{"id":21831588,"url":"https://github.com/vladfsociety/animal_classification","last_synced_at":"2026-05-03T09:39:05.691Z","repository":{"id":251246403,"uuid":"835310662","full_name":"Vladfsociety/animal_classification","owner":"Vladfsociety","description":"This repository contains implementations of various Convolutional Neural Networks for animal classification using PyTorch and TensorFlow","archived":false,"fork":false,"pushed_at":"2024-10-03T11:54:07.000Z","size":3520,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T18:03:58.046Z","etag":null,"topics":["cnn","convolutional-neural-networks","deep-learning","pytorch","tensorflow"],"latest_commit_sha":null,"homepage":"https://simpleanimalclassification.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vladfsociety.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-29T15:16:06.000Z","updated_at":"2024-10-03T11:54:11.000Z","dependencies_parsed_at":"2024-08-06T23:32:08.771Z","dependency_job_id":null,"html_url":"https://github.com/Vladfsociety/animal_classification","commit_stats":null,"previous_names":["vladfsociety/animal_classification"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Vladfsociety/animal_classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladfsociety%2Fanimal_classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladfsociety%2Fanimal_classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladfsociety%2Fanimal_classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladfsociety%2Fanimal_classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vladfsociety","download_url":"https://codeload.github.com/Vladfsociety/animal_classification/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vladfsociety%2Fanimal_classification/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269794094,"owners_count":24476739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","convolutional-neural-networks","deep-learning","pytorch","tensorflow"],"created_at":"2024-11-27T19:11:59.615Z","updated_at":"2026-05-03T09:39:05.665Z","avatar_url":"https://github.com/Vladfsociety.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Animal Classification with PyTorch and TensorFlow\nThis repository contains implementations of several Convolutional Neural Network (CNN) models for animal classification using PyTorch and TensorFlow. The goal is to compare the performance of different architectures and frameworks on this task.\nA simple Streamlit demo (https://simpleanimalclassification.streamlit.app/) has been created where the user can upload an image and test the performance of the best model (VGG16 pretrained PyTorch model).\n## Dataset\nThe dataset consists of 10 animal classes, with a total of about 25,000 images. You can view the dataset via this [link](https://www.kaggle.com/datasets/alessiocorrado99/animals10).\nAvailable animal classes:\n+ Butterfly\n+ Cat\n+ Chicken\n+ Cow\n+ Dog\n+ Elephant\n+ Horse\n+ Sheep\n+ Spider\n+ Squirrel\n## Models\nThree different architectures were used, each of which was created in both PyTorch and TensorFlow, resulting in six models. \n+ Simple CNN architecture\n```\nInput (3 channels) -\u003e [224x224x3]\nv\nConv2d(3 -\u003e 16, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [112x112x16]\nv\nConv2d(16 -\u003e 32, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [56x56x32]\nv\nConv2d(32 -\u003e 64, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [28x28x64]\nv\nConv2d(64 -\u003e 128, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [14x14x128]\nv\nConv2d(128 -\u003e 256, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [7x7x256]\nv\nFlatten -\u003e [12544]\nv\nLinear(12544 -\u003e 512) -\u003e [512]\nv\nDropout(0.2)\nv\nLinear(512 -\u003e 10) -\u003e [10]\n```\n+ VGG11 architecture implemented from scratch\n```\nInput (3 channels) -\u003e [224x224x3]\nv\nConv2d(3 -\u003e 64, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [112x112x64]\nv\nConv2d(64 -\u003e 128, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [56x56x128]\nv\nConv2d(128 -\u003e 256, 3x3) -\u003e ReLU -\u003e Conv2d(256 -\u003e 256, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [28x28x256]\nv\nConv2d(256 -\u003e 512, 3x3) -\u003e ReLU -\u003e Conv2d(512 -\u003e 512, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [14x14x512]\nv\nConv2d(512 -\u003e 512, 3x3) -\u003e ReLU -\u003e Conv2d(512 -\u003e 512, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [7x7x512]\nv\nFlatten -\u003e [25088]\nv\nLinear(25088 -\u003e 4096) -\u003e [4096]\nv\nDropout(0.5)\nv\nLinear(4096 -\u003e 4096) -\u003e [4096]\nv\nDropout(0.5)\nv\nLinear(4096 -\u003e 10) -\u003e [10]\n```\n+ VGG16 with pretrained on imagenet dataset weights\n```\nInput (3 channels) -\u003e [224x224x3]\nv\nConv2d(3 -\u003e 64, 3x3) -\u003e ReLU -\u003e Conv2d(64 -\u003e 64, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [112x112x64]\nv\nConv2d(64 -\u003e 128, 3x3) -\u003e ReLU -\u003e Conv2d(128 -\u003e 128, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [56x56x128]\nv\nConv2d(128 -\u003e 256, 3x3) -\u003e ReLU -\u003e Conv2d(256 -\u003e 256, 3x3) -\u003e ReLU -\u003e Conv2d(256 -\u003e 256, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [28x28x256]\nv\nConv2d(256 -\u003e 512, 3x3) -\u003e ReLU -\u003e Conv2d(512 -\u003e 512, 3x3) -\u003e ReLU -\u003e Conv2d(512 -\u003e 512, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [14x14x512]\nv\nConv2d(512 -\u003e 512, 3x3) -\u003e ReLU -\u003e Conv2d(512 -\u003e 512, 3x3) -\u003e ReLU -\u003e Conv2d(512 -\u003e 512, 3x3) -\u003e ReLU -\u003e MaxPool(2x2) -\u003e [7x7x512]\nv\nFlatten -\u003e [25088]\nv\nLinear(25088 -\u003e 4096) -\u003e [4096]\nv\nDropout(0.5)\nv\nLinear(4096 -\u003e 4096) -\u003e [4096]\nv\nDropout(0.5)\nv\nLinear(4096 -\u003e 10) -\u003e [10]\n```\n## Results\nEach model was trained on the animal classification dataset, with the following results tracked:\n+ Accuracy: Monitored for both training and validation datasets\n+ Loss: Recorded for training and validation datasets\n\nThe results include:\n+ Accuracy and loss graphs for all models (*accuracy.jpg*, *loss.jpg* files in **reports/pytorch/{model}**, **reports/tensorflow/{model}** folders)\n+ Tests on 20 test images with actual vs predicted class (*test_result.txt* files in **reports/pytorch/{model}**, **reports/tensorflow/{model}** folders)\n\nThe table below presents the rounded accuracy and loss results for the training and validation datasets for all models:\n\n| Model                         | Final train accuracy | Final train loss | Final validation accuracy | Final validation loss |\n|-------------------------------|----------------------|------------------|---------------------------|-----------------------|\n| Simple CNN (PyTorch)          | 80%                  | 0.6              | 77%                       | 0.7                   |\n| Simple CNN (TensorFlow)       | 88%                  | 0.37             | 79%                       | 0.83                  |\n| VGG11 (PyTorch)               | 92.5%                | 0.2              | 81%                       | 0.77                  |\n| VGG11 (TensorFlow)            | 93%                  | 0.2              | 82%                       | 0.75                  |\n| VGG16 pretrained (PyTorch)    | 98.2%                | 0.06             | 95%                       | 0.17                  |\n| VGG16 pretrained (TensorFlow) | 96.5%                | 0.12             | 93.5%                     | 0.24                  |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladfsociety%2Fanimal_classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvladfsociety%2Fanimal_classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladfsociety%2Fanimal_classification/lists"}