Book Image

Hands-On Java Deep Learning for Computer Vision

By : Klevis Ramo
Book Image

Hands-On Java Deep Learning for Computer Vision

By: Klevis Ramo

Overview of this book

Although machine learning is an exciting world to explore, you may feel confused by all of its theoretical aspects. As a Java developer, you will be used to telling the computer exactly what to do, instead of being shown how data is generated; this causes many developers to struggle to adapt to machine learning. The goal of this book is to walk you through the process of efficiently training machine learning and deep learning models for Computer Vision using the most up-to-date techniques. The book is designed to familiarize you with neural networks, enabling you to train them efficiently, customize existing state-of-the-art architectures, build real-world Java applications, and get great results in a short space of time. You will build real-world Computer Vision applications, ranging from a simple Java handwritten digit recognition model to real-time Java autonomous car driving systems and face recognition models. By the end of this book, you will have mastered the best practices and modern techniques needed to build advanced Computer Vision Java applications and achieve production-grade accuracy.
Table of Contents (8 chapters)

Building a neural network that produces art

In this section, we are going to build a Java application for creating art. Before jumping into the code and application, let's look at the high-level description on how is it implemented. We will use transfer learning with the pre-trained VGG-16 architecture, trained on ImageNet dataset, which is a bunch of convolution layers in the following diagram:

Basically, as we go deeper, the depth of the third dimension increases, while the first two dimensions shrink in time.

At first, we are going to fit a content image as an input through a forward pass as shown in the following diagram. Then, we will gain the values of all activation layers along with the prediction. But for neural style transfer, we are not interested in the prediction, but only in the activation layers, because those layers are capturing the image features. The...