{"id":15674920,"url":"https://github.com/philipperemy/keras-sde-net","last_synced_at":"2025-10-30T11:58:01.321Z","repository":{"id":70249809,"uuid":"291629082","full_name":"philipperemy/keras-sde-net","owner":"philipperemy","description":"Keras implementation of SDE-Net (ICML 2020).","archived":false,"fork":false,"pushed_at":"2020-09-11T00:58:12.000Z","size":193,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-06T23:35:22.740Z","etag":null,"topics":["keras","keras-tensorflow","neural-networks","sde-net","tensorflow"],"latest_commit_sha":null,"homepage":"","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/philipperemy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["philipperemy"]}},"created_at":"2020-08-31T06:04:57.000Z","updated_at":"2024-08-14T06:00:32.000Z","dependencies_parsed_at":"2023-03-02T11:15:32.118Z","dependency_job_id":null,"html_url":"https://github.com/philipperemy/keras-sde-net","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/philipperemy/keras-sde-net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fkeras-sde-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fkeras-sde-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fkeras-sde-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fkeras-sde-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philipperemy","download_url":"https://codeload.github.com/philipperemy/keras-sde-net/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipperemy%2Fkeras-sde-net/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264565981,"owners_count":23629086,"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":["keras","keras-tensorflow","neural-networks","sde-net","tensorflow"],"created_at":"2024-10-03T15:53:03.888Z","updated_at":"2025-10-30T11:57:56.286Z","avatar_url":"https://github.com/philipperemy.png","language":"Python","funding_links":["https://github.com/sponsors/philipperemy"],"categories":[],"sub_categories":[],"readme":"## SDE Net (Keras)\nThis repo contains the code for the paper:\n\nLingkai Kong, Jimeng Sun and Chao Zhang, SDE-Net: Equipping Deep Neural Network with Uncertainty Estimates, ICML2020.\n\n[[paper](https://arxiv.org/abs/2008.10546)] [[video](https://www.youtube.com/watch?v=RylZA4Ioc3M)]\n\n![SDE-Net](figure/illustration.png)\n\n### Package installation\n\nFrom PyPI\n\n```bash\npip install sdenet\n```\n\nFrom the sources\n\n```bash\ngit clone https://github.com/philipperemy/keras-sde-net.git \u0026\u0026 cd keras-sde-net\nvirtualenv -p python3 venv \u0026\u0026 source venv/bin/activate # optional but recommended.\npip install -r requirements.txt \u0026\u0026 pip install -e . # install the package.\n```\n\n### Import the models\n\n```python\nfrom sdenet import SDENet\nfrom sdenet import ResidualNet\n```\n\n### Training \u0026 Evaluation\n\nSupported datasets are: MNIST, SVHN, CIFAR10, CIFAR100. Supported models are RESNET and SDENET.\n\nLook at the bash run scripts at the root of the repository to get started for training and evaluation.\n\n\n### Comparison between official Pytorch implementation and Keras\n\nThis comparison is just the result of one run. No runs were handpicked. Overall it's very similar.\n\nExcept probably SDENET on SVHN (95% vs 94%).\n\n#### Pytorch\n\n```\nMNIST RESNET\n_________________________________\n\nFinal Accuracy: 9945/10000 (99.45%)\n\ngenerate log  from out-of-distribution data\ncalculate metrics for OOD\nOOD  Performance of Baseline detector\nTNR at TPR 95%:            88.783%\nAUROC:                     95.939%\nDetection acc:             92.169%\nAUPR In:                   86.441%\nAUPR Out:                  98.434%\n\ncalculate metrics for mis\nmis  Performance of Baseline detector\nTNR at TPR 95%:            89.791%\nAUROC:                     97.510%\nDetection acc:             93.041%\nAUPR In:                   99.985%\nAUPR Out:                  34.000%\n\n\nMNIST SDENET\n_________________________________\n\nFinal Accuracy: 9927/10000 (99.27%)\n\ngenerate log  from out-of-distribution data\ncalculate metrics for OOD\nOOD  Performance of Baseline detector\nTNR at TPR 95%:            99.372%\nAUROC:                     99.804%\nDetection acc:             98.692%\nAUPR In:                   99.483%\nAUPR Out:                  99.887%\ncalculate metrics for mis\nmis  Performance of Baseline detector\nTNR at TPR 95%:            92.544%\nAUROC:                     97.525%\nDetection acc:             94.485%\nAUPR In:                   99.979%\nAUPR Out:                  41.739%\n\n\nSVHN RESNET\n_________________________________\n\nFinal Accuracy: 24609/25856 (95.18%)\n\ngenerate log  from out-of-distribution data\ncalculate metrics for OOD\nOOD  Performance of Baseline detector\nTNR at TPR 95%:            66.552%\nAUROC:                     94.421%\nDetection acc:             90.136%\nAUPR In:                   97.639%\nAUPR Out:                  84.998%\ncalculate metrics for mis\nmis  Performance of Baseline detector\nTNR at TPR 95%:            64.376%\nAUROC:                     90.458%\nDetection acc:             85.371%\nAUPR In:                   99.301%\nAUPR Out:                  44.899%\n\n\nSVHN SDENET\n_________________________________\n\nFinal Accuracy: 24588/25856 (95.10%)\n\ngenerate log  from out-of-distribution data\ncalculate metrics for OOD\nOOD  Performance of Baseline detector\nTNR at TPR 95%:            65.215%\nAUROC:                     94.308%\nDetection acc:             89.746%\nAUPR In:                   97.694%\nAUPR Out:                  84.017%\ncalculate metrics for mis\nmis  Performance of Baseline detector\nTNR at TPR 95%:            67.831%\nAUROC:                     91.267%\nDetection acc:             86.501%\nAUPR In:                   99.270%\nAUPR Out:                  48.871%\n\n```\n\n#### Keras\n```\nMNIST RESNET\n_________________________________\n\n Final Accuracy: 9944/10000 (99.44%)\n\ngenerate log  from out-of-distribution data\ncalculate metrics for OOD\nOOD  Performance of Baseline detector\nTNR at TPR 95%:            93.162%\nAUROC:                     97.946%\nDetection acc:             94.250%\nAUPR In:                   94.842%\nAUPR Out:                  99.215%\ncalculate metrics for mis\nmis  Performance of Baseline detector\nTNR at TPR 95%:            96.997%\nAUROC:                     98.863%\nDetection acc:             96.697%\nAUPR In:                   99.994%\nAUPR Out:                  26.744%\n\nMNIST SDENET\n_________________________________\n\nFinal Accuracy: 9934/10000 (99.34%)\n\ngenerate log  from out-of-distribution data\ncalculate metrics for OOD\nOOD  Performance of Baseline detector\nTNR at TPR 95%:            98.425%\nAUROC:                     99.567%\nDetection acc:             97.804%\nAUPR In:                   98.613%\nAUPR Out:                  99.872%\ncalculate metrics for mis\nmis  Performance of Baseline detector\nTNR at TPR 95%:            95.515%\nAUROC:                     98.763%\nDetection acc:             95.825%\nAUPR In:                   99.992%\nAUPR Out:                  32.524%\n\nSVHN RESNET\n_________________________________\n\n Final Accuracy: 24487/25856 (94.71%)\n\ngenerate log  from out-of-distribution data\ncalculate metrics for OOD\nOOD  Performance of Baseline detector\nTNR at TPR 95%:            56.648%\nAUROC:                     93.602%\nDetection acc:             87.504%\nAUPR In:                   97.627%\nAUPR Out:                  81.664%\ncalculate metrics for mis\nmis  Performance of Baseline detector\nTNR at TPR 95%:            63.765%\nAUROC:                     91.843%\nDetection acc:             85.721%\nAUPR In:                   99.386%\nAUPR Out:                  46.231%\n\nSVHN SDENET\n_________________________________\n\n Final Accuracy: 24339/25856 (94.13%)\n\ngenerate log  from out-of-distribution data\ncalculate metrics for OOD\nOOD  Performance of Baseline detector\nTNR at TPR 95%:            64.491%\nAUROC:                     94.358%\nDetection acc:             88.711%\nAUPR In:                   97.776%\nAUPR Out:                  87.517%\ncalculate metrics for mis\nmis  Performance of Baseline detector\nTNR at TPR 95%:            60.160%\nAUROC:                     88.955%\nDetection acc:             85.735%\nAUPR In:                   99.165%\nAUPR Out:                  45.268%\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipperemy%2Fkeras-sde-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilipperemy%2Fkeras-sde-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipperemy%2Fkeras-sde-net/lists"}