{"id":15664296,"url":"https://github.com/deep-diver/deepmodels","last_synced_at":"2025-05-05T23:06:20.739Z","repository":{"id":82125086,"uuid":"145846118","full_name":"deep-diver/DeepModels","owner":"deep-diver","description":"TensorFlow Implementation of state-of-the-art models since 2012","archived":false,"fork":false,"pushed_at":"2022-12-13T22:20:42.000Z","size":144,"stargazers_count":37,"open_issues_count":3,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-05T23:06:15.531Z","etag":null,"topics":["cnn","convolutional-neural-networks","deep-learning","image-classification","models","tensorflow"],"latest_commit_sha":null,"homepage":"","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/deep-diver.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":"2018-08-23T11:47:03.000Z","updated_at":"2024-11-06T09:43:21.000Z","dependencies_parsed_at":"2023-03-12T08:45:57.734Z","dependency_job_id":null,"html_url":"https://github.com/deep-diver/DeepModels","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-diver%2FDeepModels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-diver%2FDeepModels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-diver%2FDeepModels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-diver%2FDeepModels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deep-diver","download_url":"https://codeload.github.com/deep-diver/DeepModels/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252590605,"owners_count":21772937,"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","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","image-classification","models","tensorflow"],"created_at":"2024-10-03T13:41:57.632Z","updated_at":"2025-05-05T23:06:20.705Z","avatar_url":"https://github.com/deep-diver.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeepModels\n\n\u003cimg width=\"300px\" src=\"./overview.png\"\u003e\n\nThis repository is mainly for implementing and testing state-of-the-art deep learning models since 2012 when AlexNet has emerged. It will provide pre-trained models on each dataset later.\n\nIn order to try with state-of-the-art deep learning models, datasets to be fed into and training methods should be also come along. This repository comes with three main parts, **Dataset**, **Model**, and **Trainer** to ease this process.\n\nDataset and model should be provided to a trainer, and then the trainer knows how to run training, resuming where the last training is left off, and transfer learning.\n\n## Dependencies\n- numpy \u003e= 1.14.5\n- scikit-image \u003e= 0.12.3\n- tensorflow \u003e= 1.6\n- tqdm \u003e= 4.11.2\n- urllib3 \u003e= 1.23\n\n```sh\n# install all the requirements.\n\npip install -r requirements.txt\n```\n\n## Testing Environment\n- macOS High Sierra (10.13.6) + eGPU encloosure (Akitio Node) + NVIDIA GTX 1080Ti\n- [floydhub](https://www.floydhub.com/) + NVIDIA TESLA K80, + NVIDIA TESLA V100\n- [GCP cloud ML engine](https://cloud.google.com/ml-engine/) + NVIDIA TESLA K80, + NVIDIA TESLA P100, + NVIDIA TESLA V100\n\n## Pre-defined Classes\n#### Datasets\n- **[MNIST](http://yann.lecun.com/exdb/mnist)**\n  - 10 classes of handwritten digits images in size of 28x28\n  - 60,000 training images, 10,000 testing images\n- **[CIFAR-10](https://www.cs.toronto.edu/~kriz/cifar.html)**\n  - 10 classes of colored images in size of 32x32\n  - 50,000 training images, 10,000 testing images\n  - 6,000 images per class\n- **[CIFAR-100](https://www.cs.toronto.edu/~kriz/cifar.html)**\n  - 100 classes of colored images in size of 32x32\n  - 600 images per class\n  - 500 training images, 100 testing images per class\n- **Things to be added**\n  - **[STL-10](https://cs.stanford.edu/~acoates/stl10/)**\n  - **[ImageNet](http://www.image-net.org/)**\n\n#### Models\n- **[AlexNet](https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf)** | 2012 | [[CODE]](./models/alexnet.py)\n- **[VGG](https://arxiv.org/pdf/1409.1556.pdf)** | 2014 | [[CODE]](./models/vgg.py)\n  - model types\n    - **A:** 11 layers, **A-LRN:** 11 layers with LRN (Local Response Normalization)\n    - **B:** 13 layers, **C:** 13 layers with additional convolutional layer whose kernel size is 1x1\n    - **D:** 16 layers (known as **VGG16**)\n    - **E:** 19 layers (known as **VGG19**)\n- **[Inception V1 (GoogLeNet)](https://arxiv.org/pdf/1409.4842.pdf)** | 2014 | [[CODE]](./models/googlenet.py)\n- **[Residual Network](https://arxiv.org/pdf/1512.03385.pdf)** | 2015 | [[CODE]](./models/resnet.py)\n  - model types (depth): 18, 34, 50, 101, 152\n- **[Inception V2](https://arxiv.org/pdf/1512.00567v3.pdf)** | 2015 | [[CODE]](./models/inception_v2.py)\n- **[Inception V3](https://arxiv.org/pdf/1512.00567v3.pdf)** | 2015 | [[CODE]](./models/inception_v3.py)\n- **[Residual Network V2](https://arxiv.org/pdf/1603.05027.pdf)** | 2016 | [[CODE]](./models/resnet_v2.py)\n  - model types (depth): 18, 34, 50, 101, 152, 200\n- **[Inception V4](https://arxiv.org/pdf/1602.07261.pdf)** | 2016 | [[CODE]](./models/inception_v4.py)\n- **[Inception+Resnet V1](https://arxiv.org/pdf/1602.07261.pdf)** | 2016 | [[CODE]](./models/inception_resnet_v1.py)\n- **[Inception+Resnet V2](https://arxiv.org/pdf/1602.07261.pdf)** | 2016 | [[CODE]](./models/inception_resnet_v2.py)\n- **[DenseNet](https://arxiv.org/pdf/1608.06993.pdf)** | 2017 | [[CODE]](./models/densenet.py)\n  - model types (depth): 121, 169, 201, 264\n- **Things to be added**\n  - **[SqueezeNet](https://arxiv.org/abs/1602.07360)** | 2016\n  - **[MobileNet](https://arxiv.org/pdf/1704.04861.pdf)** | 2017\n  - **[NASNet](https://arxiv.org/pdf/1707.07012.pdf)** | 2017\n\n#### Trainers\n- ClfTrainer: Trainer for image classification like ILSVRC\n\n## Pre-trained accuracy (coming soon)\n- AlexNet\n- VGG\n- Inception V1 (GoogLeNet)\n\n## Example Usage Code Blocks\n#### Define hyper-parameters\n```python\nlearning_rate = 0.0001\nepochs = 1\nbatch_size = 64\n```\n\n#### Train from nothing\n```python\nfrom dataset.cifar10_dataset import Cifar10\n\nfrom models.googlenet import GoogLeNet\nfrom trainers.clftrainer import ClfTrainer\n\ninceptionv1 = GoogLeNet()\ncifar10_dataset = Cifar10()\ntrainer = ClfTrainer(inceptionv1, cifar10_dataset)\ntrainer.run_training(epochs, batch_size, learning_rate,\n                     './inceptionv1-cifar10.ckpt')\n```\n\n#### Train from where left off\n```python\nfrom dataset.cifar10_dataset import Cifar10\n\nfrom models.googlenet import GoogLeNet\nfrom trainers.clftrainer import ClfTrainer\n\ninceptionv1 = GoogLeNet()\ncifar10_dataset = Cifar10()\ntrainer = ClfTrainer(inceptionv1, cifar10_dataset)\ntrainer.resume_training_from_ckpt(epochs, batch_size, learning_rate,\n                                  './inceptionv1-cifar10.ckpt-1', './new-inceptionv1-cifar10.ckpt')\n```\n\n#### Transfer Learning\n```python\nfrom dataset.cifar100_dataset import Cifar100\n\nfrom models.googlenet import GoogLeNet\nfrom trainers.clftrainer import ClfTrainer\n\ninceptionv1 = GoogLeNet()\ncifar10_dataset = Cifar100()\ntrainer = ClfTrainer(inceptionv1, cifar10_dataset)\ntrainer.run_transfer_learning(epochs, batch_size, learning_rate,\n                              './new-inceptionv1-cifar10.ckpt-1', './inceptionv1-ciafar100.ckpt')\n```\n\n#### Testing\n```python\nfrom dataset.cifar100_dataset import Cifar100\n\nfrom models.googlenet import GoogLeNet\nfrom trainers.clftrainer import ClfTrainer\n\n# prepare images to test\nimages = ...\n\ninceptionv1 = GoogLeNet()\ncifar10_dataset = Cifar100()\ntrainer = ClfTrainer(inceptionv1, cifar10_dataset)\nresults = trainer.run_testing(images, './inceptionv1-ciafar100.ckpt-1')\n```\n\n## Basic Workflow\n1. Define/Instantiate a dataset\n2. Define/Instantiate a model\n3. Define/Instantiate a trainer with the dataset and the model\n4. Begin training/resuming/transfer learning\n\n## References\n- [TensorFlow official website](https://www.tensorflow.org/)\n- [CNN Receptive Field Calculator](http://fomoro.com/tools/receptive-fields/index.html)\n- [A Simple Guide to the Versions of the Inception Network](https://towardsdatascience.com/a-simple-guide-to-the-versions-of-the-inception-network-7fc52b863202)\n- [UNDERSTANDING RESIDUAL NETWORKS](https://towardsdatascience.com/understanding-residual-networks-9add4b664b03)\n- [Improving Inception and Image Classification in TensorFlow](https://ai.googleblog.com/2016/08/improving-inception-and-image.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeep-diver%2Fdeepmodels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeep-diver%2Fdeepmodels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeep-diver%2Fdeepmodels/lists"}