This project includes training and validation scripts for the fish segmentation and classification model.
Project website: www.fishial.ai
Install the dependencies.
$ pip3 install -r requirements.txt
-
InferenceTest.ipynb Is the easiest way to start. It shows an example of using a model train Mask RCNN and classification model ResNet18. It includes code to run fish instance segmentation on your images and classification they.
-
UniformDataset.ipynb is the script cut your dataset to specific maximum and minimum count images per class to the arbitrary way.
-
EvalNoteFC.ipynb is the script validate trained FC model on specific Dataset (Plot confusion matrix, recall, precision, etc. )
-
EvalNoteEmbed.ipynb is the script validate trained Embeding Network on specific Dataset (Plot confusion matrix, recall, precision, etc. )
-
VectorCreator.ipynb the script creates a dictionary with a list of attachments corresponding to each class.
-
CopyPasteDebug.ipynb is the script shows how to implement CopyPaste debug realesed by conradry
-
UniformDataset.ipynb is the script cut your dataset to specific maximum and minimum count images per class to the arbitrary way.
-
auto_train_cross.py is the script performs training automatically with different parameters the selected model using the cross entropy loss function. The checkpoint with the best performance on the validation dataset is saved to the output folder.
-
auto_train_triplet.py is the script performs training automatically with different the selected model using the (Triplet Quadruplet) loss function. The checkpoint with the best performance on the validation dataset according k-metric is saved to the output folder.
-
auto_train_cross.py is the script cut your dataset to specific maximum and minimum count images per class to the arbitrary way.
-
train.py is the basic set up script to train segmentation model using Detectrin2 API
-
train_copy_paste.py is the basic set up script to train segmentation model using Detectrin2 API with Copy Paste Augumentation.
-
(model.py, utils.py): These files contain the main classification pipline implementation.
Model | link |
---|---|
MaskRCNN Fish Segmentation | link |
ResNet18 Fish Classification | link |
Segmentation model has validated by mAP metric.
**MaskRCNN **
AP | AP50 | AP75 | APs | APm | APl |
---|---|---|---|---|---|
75.085 | 91.120 | 85.695 | 29.064 | 54.678 | 80.310 |
Classification model
Cohen kappa: 0.83