Skip to content

VioletEqz/Catto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Catto

Just a smol model to detect kawaii catto <3

This repository contains mostly the hyperparameters and configurations which was tinkered to train a Catto model on YoloV5. We also included an modified version of detect.py to implements image segmentation before detection.

Showcase

The model can be deployed on Flask, here we have deployed it on Heroku for showcasing purpose:

You can try it out through one of the 2 following links:

Catto deployed on Flask through ONNX platform

Catto running parallelly with Cat face detection on Flask through ONNX platform

Methodology

Data source

Most of the data was crawled using petfinder API, which are grouped then by IDs. We filtered only cats with more than 2 images and labelled them by hand.

ID 52332561 52419810 51939580
Example 52332561 52419810 51939580

We also crawled data from the COCO 2017 Dataset using their provided API, filtering only cat images. But since the label was in a different format, we had converted them back to Yolo format.

Example 1 Example 2 Example 3
Example1 Example2 Example3

A total of 4114 cat images were extracted from COCO 2017 Dataset for training process.

YoloV5 architecture

The model's architecture details can be found here: Doc

(Note: as YoloV5 are still in-development, there might be some changes in the future involving the architecture. The document is only accurate as of the publish date)

Future improvement

From what we observed, here are some factors that can be improved for better results:

  • Data: More data is always good for training the model, but we must also take note that the data used is of good quality and accurate.

  • Model: For our case, we chose YoloV5s as our base model to train on because speed and movability are of greater priority. Should one want better accuracy, deeper model is recommended.

  • Hyperparameters: While we have found a rather good hyperparameters on YoloV5s, there are still rooms for improvement, especially on future model or bigger model.

Usage

Training

A detailed guide on training can be found here:

Guide

Inference

To perform inference, it is recommended to use detect.py included in the YoloV5 repository. However, if that does not suite you, Pytorch Hub is a good alternative.

Guide

Result

Running detection on validation set returned very promising results after training Catto model for 200 epochs: Val1 Val2 With more data, the result can definitely improve even further. One can further expand the dataset simply by crawling from the ever-expanding Petfinder source, or extract from other datasets like VOC,...

Pretrained models

Model mAPval
0.5:0.95
mAPval
0.5
mAPtest
0.5:0.95
mAPtest
0.5
Download
Catto 0.704 0.953 0.703 0.954 Link
CocoCat 0.677 0.922 0.674 0.931 Link

References

YoloV5