{"id":13499060,"url":"https://github.com/titu1994/DenseNet","last_synced_at":"2025-03-29T03:32:19.529Z","repository":{"id":61950238,"uuid":"73181331","full_name":"titu1994/DenseNet","owner":"titu1994","description":"DenseNet implementation in Keras","archived":false,"fork":false,"pushed_at":"2020-06-10T08:17:17.000Z","size":20772,"stargazers_count":706,"open_issues_count":7,"forks_count":294,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-10-13T14:17:01.721Z","etag":null,"topics":["bottleneck","deep-learning","densenet","densenet-model","keras","paper"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/titu1994.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}},"created_at":"2016-11-08T11:53:02.000Z","updated_at":"2024-08-13T10:07:40.000Z","dependencies_parsed_at":"2022-10-24T02:45:22.747Z","dependency_job_id":null,"html_url":"https://github.com/titu1994/DenseNet","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titu1994%2FDenseNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titu1994%2FDenseNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titu1994%2FDenseNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titu1994%2FDenseNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/titu1994","download_url":"https://codeload.github.com/titu1994/DenseNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246135765,"owners_count":20729056,"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":["bottleneck","deep-learning","densenet","densenet-model","keras","paper"],"created_at":"2024-07-31T22:00:27.787Z","updated_at":"2025-03-29T03:32:19.506Z","avatar_url":"https://github.com/titu1994.png","language":"Python","funding_links":[],"categories":["Papers\u0026Codes"],"sub_categories":["DenseNet"],"readme":"# Dense Net in Keras\nDenseNet implementation of the paper [Densely Connected Convolutional Networks](https://arxiv.org/pdf/1608.06993v3.pdf) in Keras\n\nNow supports the more efficient DenseNet-BC (DenseNet-Bottleneck-Compressed) networks. Using the DenseNet-BC-190-40 model, \nit obtaines state of the art performance on CIFAR-10 and CIFAR-100\n\n# Architecture\nDenseNet is an extention to Wide Residual Networks. According to the paper: \u003cbr\u003e\n```\nThe lth layer has l inputs, consisting of the feature maps of all preceding convolutional blocks. \nIts own feature maps are passed on to all L − l subsequent layers. This introduces L(L+1) / 2 connections \nin an L-layer network, instead of just L, as in traditional feed-forward architectures. \nBecause of its dense connectivity pattern, we refer to our approach as Dense Convolutional Network (DenseNet).\n```\n\nIt features several improvements such as :\n\n1. Dense connectivity : Connecting any layer to any other layer.\n2. Growth Rate parameter Which dictates how fast the number of features increase as the network becomes deeper.\n3. Consecutive functions : BatchNorm - Relu - Conv which is from the Wide ResNet paper and improvement from the ResNet paper.\n\nThe Bottleneck - Compressed DenseNets offer further performance benefits, such as reduced number of parameters, with similar or better performance. \n\n- Take into consideration the DenseNet-100-12 model, with nearly 7 million parameters against with the DenseNet-BC-100-12, with just 0.8 million parameters.\nThe BC model achieves 4.51 % error in comparison to the original models' 4.10 % error\n\n- The best original model, DenseNet-100-24 (27.2 million parameters) achieves 3.74 % error, whereas the DenseNet-BC-190-40 (25.6 million parameters) achieves\n3.46 % error which is a new state of the art performance on CIFAR-10.\n\nDense Nets have an architecture which can be shown in the following image from the paper: \u003cbr\u003e\n\u003cimg src=\"https://github.com/titu1994/DenseNet/blob/master/images/dense_net.JPG?raw=true\"\u003e\n\n# Performance\nThe accuracy of DenseNet has been provided in the paper, beating all previous benchmarks in CIFAR 10, CIFAR 100 and SVHN \u003cbr\u003e\n\u003cimg src=\"https://github.com/titu1994/DenseNet/blob/master/images/accuracy_densenet.JPG?raw=true\"\u003e\n\n# Usage\n\nImport the `densenet.py` script and use the `DenseNet(...)` method to create a custom DenseNet model with a variety of parameters.\n\nExamples : \n\n```\nimport densenet\n\n# 'th' dim-ordering or 'tf' dim-ordering\nimage_dim = (3, 32, 32) or image_dim = (32, 32, 3)\n\nmodel = densenet.DenseNet(classes=10, input_shape=image_dim, depth=40, growth_rate=12, \n\t\t\t  bottleneck=True, reduction=0.5)\n```\n\nOr, Import a pre-built DenseNet model for ImageNet, with some of these models having pre-trained weights (121, 161 and 169).\n\nExample : \n```\nimport densenet\n\n# 'th' dim-ordering or 'tf' dim-ordering\nimage_dim = (3, 224, 224) or image_dim = (224, 224, 3)\n\nmodel = densenet.DenseNetImageNet121(input_shape=image_dim)\n```\n\nWeights for the DenseNetImageNet121, DenseNetImageNet161 and DenseNetImageNet169 models are provided ([in the release tab](https://github.com/titu1994/DenseNet/releases)) and will be automatically downloaded when first called. They have been trained on ImageNet. The weights were ported from the repository https://github.com/flyyufelix/DenseNet-Keras.\n\n\n\n# Requirements\n\n- Keras\n- Theano (weights not tested) / Tensorflow (tested) / CNTK (weights not tested)\n- h5Py\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftitu1994%2FDenseNet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftitu1994%2FDenseNet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftitu1994%2FDenseNet/lists"}