Training scripts for the AIAQUAMI project
- Training process relies on TensorFlow 2.9.3.
- To be able to use TensorFlow 2.9.3 on GPU you must first install CUDA 11.2 and cuDNN 11.2.
- After setting up CUDA and cuDNN, install project requirements listed in
requirements.txt
file.
- Create root folder for the dataset and place images into
data/data_original
subfolder. Images for each class should be placed in a separate folder. Name of these folders should correspond to class names. - In
settings.py
change value forroot_folder
variable to appropriate value. - Reset
experiment_no
to 1 and check other parameters available insettings.py
. - Run
prepare_data.py
script to resize images and divide them into train, validation, and test subsets. - Run
train.py
to train the model, generate confusion matrices and Grad-CAM heatmaps. Results will be saved totmp
dataset subfolder. - In case training crushes due to lack of memory, reduce
batch_size
or choose smaller model and repeat training. - Once training is finished, you may find results in
tmp
folder, under the current experiment subfolder.
Pretrained models are available for download in the repository release section:
https://github.com/a-milosavljevic/aiaquami-training/releases
This research was supported by the Science Fund of the Republic of Serbia, #7751676, Application of deep learning in bioassessment of aquatic ecosystems: toward the construction of automatic identifier of aquatic macroinvertebrates - AIAQUAMI.