{"id":13499015,"url":"https://github.com/raghakot/keras-resnet","last_synced_at":"2025-04-08T10:22:38.154Z","repository":{"id":43641047,"uuid":"56471626","full_name":"raghakot/keras-resnet","owner":"raghakot","description":"Residual networks implementation using Keras-1.0 functional API","archived":false,"fork":false,"pushed_at":"2021-01-12T11:01:26.000Z","size":1692,"stargazers_count":1385,"open_issues_count":24,"forks_count":612,"subscribers_count":51,"default_branch":"master","last_synced_at":"2025-04-01T08:44:11.811Z","etag":null,"topics":["deep-learning","keras","resnet"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raghakot.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-04-18T02:43:11.000Z","updated_at":"2025-02-24T17:37:06.000Z","dependencies_parsed_at":"2022-09-01T12:21:32.013Z","dependency_job_id":null,"html_url":"https://github.com/raghakot/keras-resnet","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/raghakot%2Fkeras-resnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raghakot%2Fkeras-resnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raghakot%2Fkeras-resnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raghakot%2Fkeras-resnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raghakot","download_url":"https://codeload.github.com/raghakot/keras-resnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247820080,"owners_count":21001428,"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":["deep-learning","keras","resnet"],"created_at":"2024-07-31T22:00:26.052Z","updated_at":"2025-04-08T10:22:38.106Z","avatar_url":"https://github.com/raghakot.png","language":"Python","funding_links":[],"categories":["Papers\u0026Codes"],"sub_categories":["ResNet"],"readme":"# keras-resnet\n[![Build Status](https://travis-ci.org/raghakot/keras-resnet.svg?branch=master)](https://travis-ci.org/raghakot/keras-resnet)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/raghakot/keras-resnet/blob/master/LICENSE)\n\nResidual networks implementation using Keras-1.0 functional API, that works with \nboth theano/tensorflow backend and 'th'/'tf' image dim ordering.\n\n### The original articles\n * [Deep Residual Learning for Image Recognition](http://arxiv.org/abs/1512.03385) (the 2015 ImageNet competition winner)\n * [Identity Mappings in Deep Residual Networks](http://arxiv.org/abs/1603.05027)\n\n### Residual blocks\nThe residual blocks are based on the new improved scheme proposed in [Identity Mappings in Deep Residual Networks](http://arxiv.org/abs/1603.05027) as shown in figure (b)\n\n![Residual Block Scheme](images/residual_block.png?raw=true \"Residual Block Scheme\")\n\nBoth bottleneck and basic residual blocks are supported. To switch them, simply provide the block function [here](https://github.com/raghakot/keras-resnet/blob/master/resnet.py#L109)\n\n### Code Walkthrough\nThe architecture is based on 50 layer sample (snippet from paper)\n\n![Architecture Reference](images/architecture.png?raw=true \"Architecture Reference\")\n\nThere are two key aspects to note here\n\n 1. conv2_1 has stride of (1, 1) while remaining conv layers has stride (2, 2) at the beginning of the block. This fact is expressed in the following [lines](https://github.com/raghakot/keras-resnet/blob/master/resnet.py#L63-L65).\n 2. At the end of the first skip connection of a block, there is a disconnect in num_filters, width and height at the merge layer. This is addressed in [`_shortcut`](https://github.com/raghakot/keras-resnet/blob/master/resnet.py#L41) by using `conv 1X1` with an appropriate stride.\n For remaining cases, input is directly merged with residual block as identity.\n\n### ResNetBuilder factory\n- Use ResNetBuilder [build](https://github.com/raghakot/keras-resnet/blob/master/resnet.py#L135-L153) methods to build standard ResNet architectures with your own input shape. It will auto calculate paddings and final pooling layer filters for you.\n- Use the generic [build](https://github.com/raghakot/keras-resnet/blob/master/resnet.py#L99) method to setup your own architecture.\n\n### Cifar10 Example\n\nIncludes cifar10 training example. Achieves ~86% accuracy using Resnet18 model.\n\n![cifar10_convergence](images/convergence.png?raw=true \"Convergence on cifar10\")\n\nNote that ResNet18 as implemented doesn't really seem appropriate for CIFAR-10 as the last two residual stages end up \nas all 1x1 convolutions from downsampling (stride). This is worse for deeper versions. A smaller, modified ResNet-like \narchitecture achieves ~92% accuracy (see [gist](https://gist.github.com/JefferyRPrice/c1ecc3d67068c8d9b3120475baba1d7e)). ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraghakot%2Fkeras-resnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraghakot%2Fkeras-resnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraghakot%2Fkeras-resnet/lists"}