{"id":20669551,"url":"https://github.com/iitis/coarse-grained-classifiers","last_synced_at":"2026-03-07T09:32:15.486Z","repository":{"id":177225060,"uuid":"566304329","full_name":"iitis/Coarse-Grained-Classifiers","owner":"iitis","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-29T08:02:43.000Z","size":7003,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-09T11:50:49.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iitis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-11-15T11:51:02.000Z","updated_at":"2023-06-29T08:03:02.000Z","dependencies_parsed_at":"2023-07-11T10:47:23.157Z","dependency_job_id":null,"html_url":"https://github.com/iitis/Coarse-Grained-Classifiers","commit_stats":null,"previous_names":["iitis/coarse-grained-classifiers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iitis/Coarse-Grained-Classifiers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FCoarse-Grained-Classifiers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FCoarse-Grained-Classifiers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FCoarse-Grained-Classifiers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FCoarse-Grained-Classifiers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iitis","download_url":"https://codeload.github.com/iitis/Coarse-Grained-Classifiers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iitis%2FCoarse-Grained-Classifiers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30210841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-16T20:14:46.769Z","updated_at":"2026-03-07T09:32:15.467Z","avatar_url":"https://github.com/iitis.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extracting coarse-grained classifiers from large CNN models\n\n**NOTE:** This is a repository with methods, instructions and examples on how to use the components created for the purpose of paper **\"Extracting coarse-grained classifiers from large CNN models\"**. We provide implementation of the vital software components and methods used in the study. All of the methods are implemented  in such a way as to make them as flexible as possible not only for the easy reproduction of our experiments but hopefully also for other potential studies of other researchers. We made sure to add comments and guidelines on how to use our methods. Note, that we use only some tiny examplary data (compatible with the freely available dataset/images used in the study) just to show the operation od the notebooks and to make the use of our materials easy for other researchers.\n\n\nThe repository includes an example on how to create  coarse-grained classifiers from large pre-trained fine-grained CNN models from keras (https://keras.io/api/applications/) with 3 strategies. The code along with the original dataset (mentioned in the paper, and also at the end of this document) can be used to reproduce the results presented in paper **\"Extracting coarse-grained classifiers from large CNN models\"**. \n\nWe present our methods via jupyter notebooks, but we also provide an HTML version of the notebooks.\n\nWe provide 3 notebooks - for each strategy of finding the fine-grained classes (ImageNet) for the given coarse-grained classes:\n* Extraction-of-coarse-grained-classifiers-WordNet-structure-hyponyms.ipynb - in this strategy, we use ALL the available fine-grained classes for each coarse-grained class. We use WordNet hypernym-hyponym (is-a) hierarchy to find the hyponyms (sub-categories) of each coarse-grained class. This is a fully-automatic strategy.\n* Extraction-of-coarse-grained-classifiers-WordNet-semantic-similarity.ipynb - in this strategy, we use one class per each coarse-grained class for the initialization of this coarse-grained class. We increase the representativeness of each coarse-grained class by using more than 1 class. We find other suitable classes based on the similarity of initialization classes with other classes. We use semantic similarity measure - WordNet path similarity. This is a semi-automatic strategy.\n* Extraction-of-coarse-grained-classifiers-CNN-weights.ipynb - in this strategy, we use one class per each coarse-grained class for the initialization of this coarse-grained class. We increase the representativeness of each coarse-grained class by using more than 1 class. We find other suitable classes based on the similarity of initialization classes with other classes. We use learned visual similarities (learned by CNN models). This is a semi-automatic strategy. This method does not require an additional data source such as WordNet.\n\n## Technical details:\n\nIn our paper, we used three pre-trained networks krom Keras Application (https://keras.io/api/applications/):\n* InceptionV3\n* MobileNetV2\n* ResNet50V2\n\nKeras provides crafted preprocessing functions for these models, so one can use them to prepare their input data for these models. At Keras Application, one can also find the docs regarding these models (required image size etc.). We use the ImageNet weights for these models.\n\nThe following Python libraries have to be installed for the example to work correctly:\n* NumPy - version 1.24.0\n* TensorFlow (+ Keras) - version 2.11.0\n* SciKit-learn - version 1.1.3\n* nltk - version 3.8.1\n\nWe used Kaggle Dogs vs. Cats dataset (see https://www.kaggle.com/c/dogs-vs-cats) in our original experiments (results presented in the paper), but we also provide a tiny dataset of our own to test the notebook operation correctness (it can be replaced with the original Dogs vs. Cats to reproduce the results, as it has the same format).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiitis%2Fcoarse-grained-classifiers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiitis%2Fcoarse-grained-classifiers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiitis%2Fcoarse-grained-classifiers/lists"}