Developing an image classifier using transfer learning
In the next section, we will see how to distinguish between dogs and cats based on their raw images. We will also see how to implement our first CNN model to deal with the raw and color image having three channels.
Note
This project is highly inspired (but extended significantly) by the "Java Image Cat&Dog Recognition with Deep Neural Networks" article by Klevis Ramo (http://ramok.tech/).
The code
folder has three packages with a few Java files in each. Their functionalities are outlined as follows:
com.packt.JavaDL.DogvCatClassification.Train
:TrainCatvsDogVG16.java
: It is used to train the network and the trained model is saved to a user specific location. Finally, it prints the results.PetType.java
: Contains anenum
type that specifies pet types (that is, cat, dog, and unknown).VG16CatvDogEvaluator.java
: Restores the trained model saved in a specified location by theTrainCatvsDogVG16.java
class. Then it evaluates on both test and...