{"id":27242371,"url":"https://github.com/animikhaich/alexnet-tensorflow","last_synced_at":"2025-08-16T15:08:31.750Z","repository":{"id":51013203,"uuid":"363726710","full_name":"animikhaich/AlexNet-Tensorflow","owner":"animikhaich","description":"GPU Optimized AlexNet Implementation to train on ImageNet 2012 using Tensorflow 2.x","archived":false,"fork":false,"pushed_at":"2023-03-26T05:36:26.000Z","size":19499,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T20:36:11.172Z","etag":null,"topics":["alexnet","alexnet-tensorflow","imagenet","implementation","paper","python","tensorflow","tensorflow-datasets","tensorflow2","tfdata"],"latest_commit_sha":null,"homepage":"http://animikh.me/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/animikhaich.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,"zenodo":null}},"created_at":"2021-05-02T18:52:42.000Z","updated_at":"2024-07-09T05:36:13.000Z","dependencies_parsed_at":"2025-04-10T20:19:33.851Z","dependency_job_id":"04e0f92d-991b-4702-86b2-cf27efd60444","html_url":"https://github.com/animikhaich/AlexNet-Tensorflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/animikhaich/AlexNet-Tensorflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animikhaich%2FAlexNet-Tensorflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animikhaich%2FAlexNet-Tensorflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animikhaich%2FAlexNet-Tensorflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animikhaich%2FAlexNet-Tensorflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/animikhaich","download_url":"https://codeload.github.com/animikhaich/AlexNet-Tensorflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animikhaich%2FAlexNet-Tensorflow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270728073,"owners_count":24635135,"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-16T02:00:11.002Z","response_time":91,"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":["alexnet","alexnet-tensorflow","imagenet","implementation","paper","python","tensorflow","tensorflow-datasets","tensorflow2","tfdata"],"created_at":"2025-04-10T20:19:24.214Z","updated_at":"2025-08-16T15:08:31.744Z","avatar_url":"https://github.com/animikhaich.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/logo.png\" alt=\"Logo\" width=\"250\" height=\"250\"\u003e\n\n  \u003ch2 align=\"center\"\u003eAlexNet\u003c/h2\u003e\n\n  \u003cp align=\"center\"\u003e\n    Tensorflow 2.x Implementation of the original AlexNet Paper\n    \u003cbr /\u003e\n    \u003ca href=\"https://papers.nips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf\"\u003ePaper Link\u003c/a\u003e\n    ·\n    \u003ca href=\"https://nbviewer.jupyter.org/github/animikhaich/AlexNet-Tensorflow/blob/main/AlexNet_Prototype_Model.ipynb\"\u003eArchitecture\u003c/a\u003e\n    ·\n    \u003ca href=\"https://nbviewer.jupyter.org/github/animikhaich/AlexNet-Tensorflow/blob/main/AlexNet_Data_Loader.ipynb\"\u003eData Loader\u003c/a\u003e\n    ·\n    \u003ca href=\"https://nbviewer.jupyter.org/github/animikhaich/AlexNet-Tensorflow/blob/main/AlexNet_Trainer.ipynb\"\u003eModel Trainer\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/alexnet-full.png\" alt=\"AlexNet Architecture\"\u003e\n\u003c/p\u003e\n\u003c!-- TABLE OF CONTENTS --\u003e\n\n## Table of Contents\n\n- [](#)\n  - [Features](#features)\n  - [Hardware Requirements](#hardware-requirements)\n    - [Hardware used for Development and Testing](#hardware-used-for-development-and-testing)\n    - [Minimum Hardware Requirements](#minimum-hardware-requirements)\n  - [Dataset Download \u0026 Setup](#dataset-download--setup)\n    - [Dataset Download](#dataset-download)\n    - [Raw/Source Dataset Directory Structure](#rawsource-dataset-directory-structure)\n    - [Processed/Destination Dataset Directory Structure](#processeddestination-dataset-directory-structure)\n  - [References](#references)\n  - [Contributing](#contributing)\n  - [License](#license)\n  - [Contact](#contact)\n      - [Animikh Aich](#animikh-aich)\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n\n## About The Project\n\nAlexNet is a Deep Learning Paper published in the year 2012 by Alex Krizhevsky (Hence, the name). It is one of the pioneer Deep Learning Publications which kick started the Deep Learning Research and proved its importance.\n\nThis implementation is a part of my learning where I take an attempt to implement Key Deep Learning Papers using Tensorflow or PyTorch.\n\nThe Original Literature Can be found here: [AlexNet Paper](https://papers.nips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf)\n\nPaper Explained Here: [ImageNet Classification with Deep Convolutional Neural Networks - YouTube](https://youtu.be/Nq3auVtvd9Q)\n\n## Quick Links\n\n- The Original Literature Can be found here: [AlexNet Paper](https://papers.nips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf)\n- Paper Explained Here: [ImageNet Classification with Deep Convolutional Neural Networks - YouTube](https://youtu.be/Nq3auVtvd9Q)\n- Data Loader: [GitHub](https://github.com/animikhaich/AlexNet-Tensorflow/blob/main/AlexNet_Data_Loader.ipynb) | [nbViewer](https://nbviewer.jupyter.org/github/animikhaich/AlexNet-Tensorflow/blob/main/AlexNet_Data_Loader.ipynb)\n- Model Architecture: [GitHub](https://github.com/animikhaich/AlexNet-Tensorflow/blob/main/AlexNet_Prototype_Model.ipynb) | [nbViewer](https://nbviewer.jupyter.org/github/animikhaich/AlexNet-Tensorflow/blob/main/AlexNet_Prototype_Model.ipynb)\n- Model Trainer: [GitHub](https://github.com/animikhaich/AlexNet-Tensorflow/blob/main/AlexNet_Trainer.ipynb) | [nbViewer](https://nbviewer.jupyter.org/github/animikhaich/AlexNet-Tensorflow/blob/main/AlexNet_Trainer.ipynb)\n- Trained Weights: [Epoch 35, Categorical Accuracy 0.48](https://github.com/animikhaich/AlexNet-Tensorflow/blob/main/weights/alexnet.35-0.48-2.42.h5)\n\n\n## Training/Validation Resources\n\n### Trained Weights\n\nThe final Trained Weights after automatic early stopping can be found here: [Epoch 35, Categorical Accuracy 0.48](https://github.com/animikhaich/AlexNet-Tensorflow/blob/main/weights/alexnet.35-0.48-2.42.h5)\n\n\n### Legend\n\n- Orange = Training Curves\n- Blue = Validation Curves\n### Training Curves\n![Training Curves](assets/trainin-curves.png)\n\n\n\n## Features\n\n- **Tf.Data** - Optimized Tensorflow Data Pipelining using Tf.Data and Tensorflow Datasets\n- **Vanilla Implementation** - I have taken an attempt to implement the original AlexNet Architecture as resembling the original literature as closely as possible.\n- **Fused Implementation** - Since the Original Implementation was not very efficient for a single GPU training, hence, I have also implementation a Fused Model which closely resembles the original, but is a single straight network designed to run on a single GPU.\n- **Mixed Precision Training** - The Implementation uses FP16 - Mixed Precision Training since that uses the Tensor Cores of the Nvidia GPU with Compute Capability 7.0 or higher.\n\n\n## Hardware Requirements\n\n[Nvidia GPU](https://www.nvidia.com/en-gb/graphics-cards/) for Training is recommended, However, it can work with CPUs as well (Not Recommended, ImageNet is Huge. It will probably take over a year to Train)\n\n### Hardware used for Development and Testing\n\n- **CPU:** AMD Ryzen 7 3700X - 8 Cores 16 Threads\n- **GPU:** Nvidia GeForce RTX 2080 Ti 11 GB\n- **RAM:** 32 GB DDR4 @ 3200 MHz\n- **Storage:** 1 TB NVMe SSD\n- **OS:** Ubuntu 20.04\n\n### Minimum Hardware Requirements\n\n- **CPU:** AMD/Intel 4 Core CPU (CPU will become a bottleneck here)\n- **GPU:** Nvidia GeForce GTX 1660 6 GB (You can go lower, but I would not recommend it)\n- **RAM:** 16 GB\n- **Storage:** Minimum of 500 GB SSD (HDD is Not Recommended)\n- **OS:** Any Linux Distribution\n\n## Dataset Download \u0026 Setup\n\nEnough HDD/SSD space is required for the following:\n\n- Downloading Raw Dataset - 156.8 GB\n- Convert to TFRecord and Store - 155.9 GB\n- Total Storage Required - 312.7 GB\n\nAn SSD is recommended and a Mechanical HDD should be avoided since it will slow down the data loader significantly.\n\n### Dataset Download\n\nImageNet Download Link: [Download ImageNet Dataset](https://image-net.org/download-images)\n\n- Download Train Images (Required): `ILSVRC2012_img_train.tar` - Size 137.7 GB\n- Download Val Images (Required): `ILSVRC2012_img_val.tar` - Size 6.3 GB\n- Download Train Images (Optional): `ILSVRC2012_img_test.tar` - Size 12.7 GB\n\n### Raw/Source Dataset Directory Structure\nDownload the dataset from the above link and put it in the folder like shown:\n\n```sh\nimagenet2012/\n├── ILSVRC2012_img_test.tar\n├── ILSVRC2012_img_train.tar\n└── ILSVRC2012_img_val.tar\n```\n\n### Processed/Destination Dataset Directory Structure\nCreate another folder and create the folders `data`, `download` \u0026 `extracted` like shown:\n\n```sh\nimagenet/\n├── data/\n├── downloaded/\n└── extracted/\n```\n\n## References\n\n- Source Literature: [AlexNet Paper](https://papers.nips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf)\n- Paper Explanation: [ImageNet Classification with Deep Convolutional Neural Networks - YouTube](https://youtu.be/Nq3auVtvd9Q)\n- Download the Dataset by Signing up with your Institution Email Addreess: [Download ImageNet Dataset](https://image-net.org/download-images)\n- Tensorflow Datasets ImageNet2012 Dataset: [API Docs](https://www.tensorflow.org/datasets/catalog/imagenet2012)\n- Efficient Data Pipelining using: [Tf.Data](https://www.tensorflow.org/guide/data)\n- Tf.Data Training and Testing Split: [Slice \u0026 Split Docs](https://www.tensorflow.org/datasets/splits)\n- Data Loader Template taken from my own Repository: [Zero Coding Tf Classifier](https://github.com/animikhaich/Zero-Code-TF-Classifier/blob/main/core/data_loader.py)\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nDistributed under the [GNU AGPL V3 License](https://choosealicense.com/licenses/agpl-3.0/). See [LICENSE](LICENSE) for more information.\n\n## Contact\n\n#### Animikh Aich\n\n- Website: [Animikh Aich - Website](http://www.animikh.me/)\n- LinkedIn: [animikh-aich](https://www.linkedin.com/in/animikh-aich/)\n- Email: [animikhaich@gmail.com](mailto:animikhaich@gmail.com)\n- Twitter: [@AichAnimikh](https://twitter.com/AichAnimikh)\n\n\n[contributors-shield]: https://img.shields.io/github/contributors/animikhaich/AlexNet-Tensorflow.svg?style=flat-square\n[contributors-url]: https://github.com/animikhaich/AlexNet-Tensorflow/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/animikhaich/AlexNet-Tensorflow.svg?style=flat-square\n[forks-url]: https://github.com/animikhaich/AlexNet-Tensorflow/network/members\n[stars-shield]: https://img.shields.io/github/stars/animikhaich/AlexNet-Tensorflow.svg?style=flat-square\n[stars-url]: https://github.com/animikhaich/AlexNet-Tensorflow/stargazers\n[issues-shield]: https://img.shields.io/github/issues/animikhaich/AlexNet-Tensorflow.svg?style=flat-square\n[issues-url]: https://github.com/animikhaich/AlexNet-Tensorflow/issues\n[license-shield]: https://img.shields.io/github/license/animikhaich/AlexNet-Tensorflow.svg?style=flat-square\n[license-url]: https://github.com/animikhaich/AlexNet-Tensorflow/blob/main/LICENSE\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/animikh-aich/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimikhaich%2Falexnet-tensorflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanimikhaich%2Falexnet-tensorflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimikhaich%2Falexnet-tensorflow/lists"}