Technical requirements

Implementation of the use case discussed in this chapter can be found here: https://github.com/PacktPublishing/Java-Deep-Learning-Cookbook/tree/master/04_Building_Convolutional_Neural_Networks/sourceCode.

After cloning our GitHub repository, navigate to the following directory: Java-Deep-Learning-Cookbook/04_Building_Convolutional_Neural_Networks/sourceCode. Then, import the cookbookapp project as a Maven project by importing pom.xml.

You will also find a basic Spring project, spring-dl4j, which can be imported as a Maven project as well.

We will be using the dog breeds classification dataset from Oxford for this chapter.

The principal dataset can be downloaded from the following link:
https://www.kaggle.com/zippyz/cats-and-dogs-breeds-classification-oxford-dataset.

To run this chapter's source code, download the dataset (four labels only) from here:
https://github.com/PacktPublishing/Java-Deep-Learning-Cookbook/raw/master/04_Building%20Convolutional%20Neural%20Networks/dataset.zip (it can be found in the Java-Deep-Learning-Cookbook/04_Building Convolutional Neural Networks/ directory).

Extract the compressed dataset file. Images are kept in different directories. Each directory represents a label/category. For demonstration purposes, we have used four labels. However, you are allowed to experiment with more images from different categories in order to run our example from GitHub. 

Note that our example is optimized for four species. Experimentation with a larger number of labels requires further network configuration optimization.

To leverage the capabilities of the OpenCV library in your CNN, add the following Maven dependency:

<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv-platform</artifactId>
<version>4.0.1-1.4.4</version>
</dependency>

We will be using the Google Cloud SDK to deploy the application in the cloud. For instructions in this regard, refer to https://github.com/GoogleCloudPlatform/app-maven-plugin. For Gradle instructions, refer to https://github.com/GoogleCloudPlatform/app-gradle-plugin.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset