| # Model Description | |
| This model detects dogs in images and categorizes them into small, medium, and large based on the average weight of an adult of that breed. The weight classes generally follow: less than 30lbs for small dogs, between 30 lbs and 50lbs for medium dogs, and greater than 50lbs for large dogs. | |
| Training was done by fine-tuning the YOLOv11 model. Due to the large physical differences between dog breeds, this model is intended to be used to determine counts of each type to better meet the needs of the group in the area. | |
| *** | |
| # Training Data | |
| This model is trained using the following Roboflow dataset: [Link](https://universe.roboflow.com/igor-romanica-gmail-com/stanford-dogs-0pff9). | |
| The Roboflow page is using a subset of the [Stanford Dogs Dataset](http://vision.stanford.edu/aditya86/ImageNetDogs/). The subset consists of images of 60 breeds across 9884 images, about half the breed and image count of the original dataset. | |
| Annotations included manually sorting each of the 60 breeds into a category based on weight (as detailed above). Additionally, some classes were deleted due to the large weight ranges of the breed. For example, [Xoloitzcuintles](https://en.wikipedia.org/wiki/Xoloitzcuintle) are usually broken into three sub-breeds with different sizes, but they are labeled in the dataset under one category. | |
| ### *Class Breakdown* | |
| | Metric | Large | Medium | Small | | |
| |--------|--------|----------|------ | | |
| | Percent | 39% | 37% | 24% | | |
| | Count | 4,058 | 3,860 | 2,524 | | |
| ### *Training Split* | |
| | Metric | Train | Validate | Test | | |
| |--------|--------|----------|------| | |
| | Percent| 87% | 8% | 4% | | |
| | Count | 20,731 | 1,975 | 988 | | |
| *** | |
| # Training Prcedure | |
| * Trained on Google Collab using A100 | |
| * Limited to 200 epochs and 100 patience | |
| * Ran for 73 epochs, best at 63 | |
| * 4.9 hours of training on ~24k images | |
| * 10k base | |
| * 14k augmented on exposure and blur | |
| *** | |
| # Evaluation Resuls | |
| ### *Comprehensive Metrics* | |
| | Metric | Goal | Result | | |
| |--------|--------|----------| | |
| |F1 Score | .75 < | .84 | | |
| |Recall | .75 < | .96 | | |
| |Precision | .80 < | 1.0 | | |
| ### *Detailed Per-Class Breakdown* | |
|  | |
| Less than a .04 difference between classes for each metric. | |
| ### *Examples Of Classes* | |
|  | |
| ### *Visualizations* | |
| <img alt="Confusion Matrix" src="https://huggingface.co/cvtechniques/DogTypeDetection/resolve/main/confusion_matrix_normalized.png" width="700"></img> | |
| <img alt="F1-Confidence Graph" src="https://huggingface.co/cvtechniques/DogTypeDetection/resolve/main/BoxF1_curve.png" width="700"></img> | |
| <img alt="Precsiosn-Confidence Graph" src="https://huggingface.co/cvtechniques/DogTypeDetection/resolve/main/BoxP_curve.png" width="700"></img> | |
| ### *Performance Analysis* | |
| This model had high metrics across each of the classes, meeting the success threshold in precision, recall, and F1 score. The confusion matrix shows some slight overguessing, as each of the classes had a 25% to 40% rate of being predicted when that area was actual background. The model also predicted small dogs as large dogs 10% of the time, which was right at the limit set before training. That being said, the matrix still has high values of 80%-85% along the true positive diagonal. The 100% precision peak at 100% confidence does raise some red flags. This is addressed in the *Known failure cases* section. | |
| *** | |
| # Limitations and Biases | |
| ### *Known failure cases* | |
| <img alt="Failure Cases" src="https://huggingface.co/cvtechniques/DogTypeDetection/resolve/main/Screenshot%202026-03-15%20160209.png" height="500"></img> | |
| After testing with images outside of the training set, a pattern imerged where the model would perform well but consistently made mistakes on the same breeds(seen in the image above). This is because these breeds were not in the orginal training data. | |
| ### *Poor performing classes* | |
| There was a less than 5% difference between class performance. The class imbalance, with small breeds having over 1k less images than other classes, may have contributed to the realtivly high (10%) confusion rate between large and small breeds. | |
| ### *Data biases & Environmental/contextual limitations* | |
| The images found in the dataset, varried accross different conditions as well as enviroment situations. | |
| ### *Inappropriate use cases* | |
| This model has high accruacy and precision accross the breeds found in the dataset but perfroms poorly on those not found in the set. Addtioanally this model produces a realtivly high rate of false postives. | |
| ### *Sample size limitations* |