{"id":13578646,"url":"https://github.com/qubvel/efficientnet","last_synced_at":"2025-05-14T07:08:14.013Z","repository":{"id":40523680,"uuid":"189477120","full_name":"qubvel/efficientnet","owner":"qubvel","description":"Implementation of EfficientNet model. Keras and TensorFlow Keras.","archived":false,"fork":false,"pushed_at":"2024-01-24T14:27:34.000Z","size":835,"stargazers_count":2082,"open_issues_count":65,"forks_count":469,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-04-11T01:41:53.734Z","etag":null,"topics":["classification","deep-learning","efficient","efficientnet","image-classification","imagenet","mobilenet","nasnetmobile","pretrained-models"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/1905.11946","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qubvel.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":"2019-05-30T20:21:09.000Z","updated_at":"2025-04-08T21:19:04.000Z","dependencies_parsed_at":"2024-06-18T12:25:10.138Z","dependency_job_id":"97f28754-2105-42ca-a3ed-c525461e6ea3","html_url":"https://github.com/qubvel/efficientnet","commit_stats":{"total_commits":66,"total_committers":10,"mean_commits":6.6,"dds":0.1515151515151515,"last_synced_commit":"f7f3e736c113b872caf53dae9fbbda996a8eb87d"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qubvel%2Fefficientnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qubvel%2Fefficientnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qubvel%2Fefficientnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qubvel%2Fefficientnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qubvel","download_url":"https://codeload.github.com/qubvel/efficientnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092656,"owners_count":22013290,"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":["classification","deep-learning","efficient","efficientnet","image-classification","imagenet","mobilenet","nasnetmobile","pretrained-models"],"created_at":"2024-08-01T15:01:32.524Z","updated_at":"2025-05-14T07:08:13.978Z","avatar_url":"https://github.com/qubvel.png","language":"Python","funding_links":[],"categories":["Python","\u003e 1k ★","Tensorflow实用程序","Model 💛💛💛💛💛\u003ca name=\"Model\" /\u003e"],"sub_categories":["Classification 分类"],"readme":"# EfficientNet Keras (and TensorFlow Keras)\n\n[![PyPI version](https://badge.fury.io/py/efficientnet.svg)](https://badge.fury.io/py/efficientnet) [![Downloads](https://pepy.tech/badge/efficientnet/month)](https://pepy.tech/project/efficientnet/month)\n\nThis repository contains a Keras (and TensorFlow Keras) reimplementation of **EfficientNet**, a lightweight convolutional neural network architecture achieving the [state-of-the-art accuracy with an order of magnitude fewer parameters and FLOPS](https://arxiv.org/abs/1905.11946), on both ImageNet and\nfive other commonly used transfer learning datasets.\n\nThe codebase is heavily inspired by the [TensorFlow implementation](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet).\n\n## Important!\nThere was a huge library update on **24th of July 2019**. Now efficientnet works with both frameworks: `keras` and `tensorflow.keras`.\nIf you have models trained before that date, please use efficientnet of version 0.0.4 to load them. You can roll back using `pip install -U efficientnet==0.0.4` or `pip install -U git+https://github.com/qubvel/efficientnet/tree/v0.0.4`.\n\n## Table of Contents\n\n 1. [About EfficientNet Models](#about-efficientnet-models)\n 2. [Examples](#examples)\n 3. [Models](#models)\n 4. [Installation](#installation)\n 5. [Frequently Asked Questions](#frequently-asked-questions)\n 6. [Acknowledgements](#acknowledgements)\n\n## About EfficientNet Models\n\nEfficientNets rely on AutoML and compound scaling to achieve superior performance without compromising resource efficiency. The [AutoML Mobile framework](https://ai.googleblog.com/2018/08/mnasnet-towards-automating-design-of.html) has helped develop a mobile-size baseline network, **EfficientNet-B0**, which is then improved by the compound scaling method  to obtain EfficientNet-B1 to B7.\n\n\u003ctable border=\"0\"\u003e\n\u003ctr\u003e\n    \u003ctd\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/tensorflow/tpu/master/models/official/efficientnet/g3doc/params.png\" width=\"100%\" /\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/tensorflow/tpu/master/models/official/efficientnet/g3doc/flops.png\", width=\"90%\" /\u003e\n    \u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\nEfficientNets achieve state-of-the-art accuracy on ImageNet with an order of magnitude better efficiency:\n\n* In high-accuracy regime, EfficientNet-B7 achieves the state-of-the-art 84.4% top-1 / 97.1% top-5 accuracy on ImageNet with 66M parameters and 37B FLOPS. At the same time, the model is 8.4x smaller and 6.1x faster on CPU inference than the former leader, [Gpipe](https://arxiv.org/abs/1811.06965).\n\n* In middle-accuracy regime, EfficientNet-B1 is 7.6x smaller and 5.7x faster on CPU inference than [ResNet-152](https://arxiv.org/abs/1512.03385), with similar ImageNet accuracy.\n\n* Compared to the widely used [ResNet-50](https://arxiv.org/abs/1512.03385), EfficientNet-B4 improves the top-1 accuracy from 76.3% of ResNet-50 to 82.6% (+6.3%), under similar FLOPS constraints.\n\n## Examples\n\n* *Initializing the model*:\n\n```python\n# models can be build with Keras or Tensorflow frameworks\n# use keras and tfkeras modules respectively\n# efficientnet.keras / efficientnet.tfkeras\nimport efficientnet.keras as efn \n\nmodel = efn.EfficientNetB0(weights='imagenet')  # or weights='noisy-student'\n\n```\n\n* *Loading the pre-trained weights*:\n\n```python\n# model use some custom objects, so before loading saved model\n# import module your network was build with\n# e.g. import efficientnet.keras / import efficientnet.tfkeras\nimport efficientnet.tfkeras\nfrom tensorflow.keras.models import load_model\n\nmodel = load_model('path/to/model.h5')\n```\n\nSee the complete example of loading the model and making an inference in the Jupyter notebook [here](https://github.com/qubvel/efficientnet/blob/master/examples/inference_example.ipynb).\n\n## Models\n\nThe performance of each model variant using the pre-trained weights converted from checkpoints provided by the authors is as follows:\n\n| Architecture   | @top1* Imagenet| @top1* Noisy-Student| \n| -------------- | :----: |:---:|\n| EfficientNetB0 | 0.772  |0.788|\n| EfficientNetB1 | 0.791  |0.815|\n| EfficientNetB2 | 0.802  |0.824|\n| EfficientNetB3 | 0.816  |0.841|\n| EfficientNetB4 | 0.830  |0.853|\n| EfficientNetB5 | 0.837  |0.861|\n| EfficientNetB6 | 0.841  |0.864|\n| EfficientNetB7 | 0.844  |0.869|\n\n**\\*** - topK accuracy score for converted models (imagenet `val` set)\n\n## Installation\n\n### Requirements\n\n* `Keras \u003e= 2.2.0` / `TensorFlow \u003e= 1.12.0`\n* `keras_applications \u003e= 1.0.7`\n* `scikit-image`\n\n### Installing from the source\n\n```bash\n$ pip install -U git+https://github.com/qubvel/efficientnet\n```\n\n### Installing from PyPI\n\nPyPI stable release\n\n```bash\n$ pip install -U efficientnet\n```\n\nPyPI latest release (with keras and tf.keras support)\n\n```bash\n$ pip install -U --pre efficientnet\n```\n\n## Frequently Asked Questions\n\n* **How can I convert the original TensorFlow checkpoints to Keras HDF5?**\n\nPick the target directory (like `dist`) and run the [converter script](./scripts) from the repo directory as follows:\n\n```bash\n$ ./scripts/convert_efficientnet.sh --target_dir dist\n```\n\nYou can also optionally create the virtual environment with all the dependencies installed by adding `--make_venv=true` and operate in a self-destructing temporary location instead of the target directory by setting `--tmp_working_dir=true`.\n\n## Acknowledgements\nI would like to thanks community members who actively contribute to this repository:\n\n1) Sasha Illarionov ([@sdll](https://github.com/sdll)) for preparing automated script for weights conversion\n2) Björn Barz ([@Callidior](https://github.com/Callidior)) for model code adaptation for keras and tensorflow.keras frameworks \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqubvel%2Fefficientnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqubvel%2Fefficientnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqubvel%2Fefficientnet/lists"}