App to detect animals in images and train custom classifiers to detect animal breeds.
Classifier was trained on https://www.kaggle.com/datasets/anandkumarsahu09/cattle-breeds-dataset.
See classify_breed python code folder for classification results.
Results were achieved for dataset also in java code (see app_data/models.json)
Classifier performs well, there are a lot of noise images in dataset and thus the mean accuracy is around 66% for multiclass classification. For most images with a clear view of the cow the classification is good (>90% in test).
Write a config.properties file with the following format:
projectPath=/path/to/project dataPath=/path/to/training/data
The classifier is trained on the cattle breed dataset:
https://kaggle.com/datasets/anandkumarsahu09/cattle-breeds-dataset/data
which can be downloaded with the script download_cattle_breed_dataset.py.
The classifier training is generic and a new classifier can be trained on any dataset with the following folder structure:
dataset
├── ...
├── class1
│ ├── image1.png
│ ├── image2.png
│ └── ...
├── class2
│ ├── image1.png
│ ├── image2.png
│ └── ...
└── ...
The dir names will be the names of the classes
In order to run the application on your machine, a ready-made shaded jar file can be found at:
measureanimals/target/measureanimals-1.0.jar
If you have java installed, the app can be run using:
java -jar ./target/measureanimals-1.0.jar
-
Upload an image from your dataset:
-
Run the coco detection:
-
Run the category classifier (for cattle breed in this case):
The classifier uses SIFT to extract keypoints, then bags the keypoints by using KMeans, and then uses GradientBoostedTrees to run the file



