Dog age assessment project led by CyfroVet, an initiative for veterinary medicine created by ACC Cyfronet AGH in Cracow.
The main goal of this work is to utilize machine learning models to improve the wellbeing of dogs. The system shows improvement beyond state-of-the-art, but the results are still not satisfying. CyfroVet is working on improving this along with approaching the problem with examination of videos showing the dogs. This repository contains the following files:
- train.py - pipeline and model that can be trained to classify dogs into three age groups.
- ga_dataset_assesment.py - a tool based on GA to exclude the least informative images from the dataset
- cnn_dog_breeds.py - a script with pipeline and model for dog breed classification task based on stanford dogs dataset
- tfrecords_writer.py - a script for saving image dataset in form of TFRecord files
- function_library.py - base of functions developed for some repeating tasks in this project. WARNING Some of them may not be compatibile with current scripts as they were developed in the early stages of the project
USAGE GUIDE
- Install packages from requirements.txt (requirements file to be introduced soon)
- train.py
- Arguments are described in the script. Provide necessary ones and start training.
- Configure
wand.init
call if using Weights and Biases to track your experiments (if no tracking is usedwandb.init
call andWandbCallback
infit
method call can be removed). - Run the script.
- cnn_dog_breeds.py
- Open file in the editor.
- Create CNN model using
create_cnn_network
function or create CNN + ViT model usingcreate_cnn_vit_network
function. - Dataset is automatically loaded from Tensorflow Datasets . If different data loading is needed please refer to the documentation under the link above.
- Configure
wand.init
call if using Weights and Biases to track your experiments (if no tracking is usedwandb.init
call andWandbCallback
infit
method call can be removed). - Run the script.
- tfrecords_writer.py
- Arguments are described in the script. Provide necessary ones and start training.
- ga_dataset_assesment (This algorithm is currently being tested on CIFAR dataset)
- Open file in the editor.
- Insert paths to:
- Images - into
np.load
function creatingdata_inputs_cifar
variable - Labels - into
np.load
function creatinglabels_cifar
variable - Invalid images - into
np.load
function creatingdata_inputs_noise
variable - Invalid labels - into
np.load
function creatinglabels_noise
variable - Initial data order (indexes of images after shuffling) - into
solutions_dir
variable
- Images - into
- If needed, configure the algorithm parameters specified with constants in the beginning of the file.
- Configure
wand.init
call if using Weights and Biases to track your experiments (if no tracking is usedwandb.init
call andWandbCallback
infit
method call can be removed). - Run the script.
- function_library.py
- Import the file to your script and call the methods as needed.
- Be sure to use correct paths for
DETECTOR
andPREDICTOR
- use files provided in utils folder.
DATASETS Currently published datasets are avaliable: https://tinyurl.com/dog-age-datasets For more information about this project please contact the owner via email: s.mazurek@cyfronet.pl