{"id":22615522,"url":"https://github.com/sovit-123/robust_neural_networks_by_adding_noise_to_data","last_synced_at":"2026-04-24T12:07:21.048Z","repository":{"id":111787353,"uuid":"242926807","full_name":"sovit-123/Robust_Neural_Networks_by_Adding_Noise_to_Data","owner":"sovit-123","description":"PyTorch implementation of building robust deep learning neural networks by adding noise to image data before training.","archived":false,"fork":false,"pushed_at":"2020-04-01T04:22:32.000Z","size":126,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-16T19:08:52.013Z","etag":null,"topics":["computer-vision","convolutional-neural-networks","deep-learning","image-classification","image-processing","image-recognition","neural-networks","paper-implementations","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sovit-123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-02-25T06:26:03.000Z","updated_at":"2024-08-22T14:50:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"eba2d9c5-4a22-4fdc-8b69-151946b5aefe","html_url":"https://github.com/sovit-123/Robust_Neural_Networks_by_Adding_Noise_to_Data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sovit-123/Robust_Neural_Networks_by_Adding_Noise_to_Data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sovit-123%2FRobust_Neural_Networks_by_Adding_Noise_to_Data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sovit-123%2FRobust_Neural_Networks_by_Adding_Noise_to_Data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sovit-123%2FRobust_Neural_Networks_by_Adding_Noise_to_Data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sovit-123%2FRobust_Neural_Networks_by_Adding_Noise_to_Data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sovit-123","download_url":"https://codeload.github.com/sovit-123/Robust_Neural_Networks_by_Adding_Noise_to_Data/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sovit-123%2FRobust_Neural_Networks_by_Adding_Noise_to_Data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32222536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["computer-vision","convolutional-neural-networks","deep-learning","image-classification","image-processing","image-recognition","neural-networks","paper-implementations","pytorch"],"created_at":"2024-12-08T19:08:15.438Z","updated_at":"2026-04-24T12:07:21.033Z","avatar_url":"https://github.com/sovit-123.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"* # README\n\n  ![Accuracy plot](https://debuggercafe.com/wp-content/uploads/2020/02/yes_yes_acc.png)\n\n  ## 1) Research Paper Implementation\n\n  * This project is an attempt to ***Building Robust Neural Network Models by Adding Noise to Image Data.***\n  * The following are the research papers that I have tried the replicate the results and ideas from:\n    * [**An empirical study on the effects of different types of noise in image classification tasks**](https://arxiv.org/pdf/1609.02781.pdf),  Gabriel B. Paranhos da Costa, Welinton A. Contato, Tiago S. Nazare, Jo ̃ao E. S. Batista Neto, Moacir Ponti.\n    * [**Deep networks for robust visual recognition**](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.170.1765\u0026rep=rep1\u0026type=pdf), Yichuan Tang, Chris Eliasmith.\n    * [**Deep Convolutional Neural Networks and Noisy Images**](https://www.researchgate.net/publication/322915518_Deep_Convolutional_Neural_Networks_and_Noisy_Images), Tiago S. Nazar\u0013e, Gabriel B. Paranhos da Costa, Welinton A. Contato, and Moacir Ponti (2018).\n\n  \n\n  ***Note:*** *I have included plots (inside `outputs/plots`) for both training files after training for 20 epochs. Take a loot at those for gaining faster insights into the project results.*\n\n  \n\n  ## 2) What is the Project About?\n\n  * Neural networks are good at image recognition but are bad at handling noise. \n  * *So, to make them generalize better on noisy images, we can train them noisy images*.\n  * And this project is an attempt to build robust image recognition neural networks by training them noisy data.\n\n  \n\n  ## 3) What Neural Network Model are We Using?\n\n  * All of the training happens using the ResNet18 pre-trained models.\n  * We are not using ImageNet weights, but are making all the hidden layer weights learnable.\n\n  \n\n  ## 4) Python Files Included and Ways to Execute Them\n\n  * If the datasets are not present, then they will be downloaded to `inputs/data` directory. So, make sure the availability of internet connection before running any of the files.\n\n  * All the executable python (`.py`) files are inside `src/` directory. All the python files can be executed from the command line. Different argument parsers are used for easy facilitation of training the neural networks.\n\n  * There are three python files:\n\n    * `add_noise.py`:\n\n      * You can use this file to add ***gaussian, speckle, and salt \u0026 pepper noise*** to image data. *This file does not play any part in training of neural network models. Instead, the user can use this visualize how different types noise looks like.*\n\n      * Execute the file:\n\n        ```\n        # to add noise to CIFAR10 dataset\n        python src/add_noise.py --dataset=cifar10 --gauss_noise=0.5 --salt_pep=0.5 --speckle_noise=0.5\n        \n        # to add noise to MNIST dataset\n        python src/add_noise.py --dataset=mnist --gauss_noise=0.5 --salt_pep=0.5 --speckle_noise=0.5\n        \n        # to add noise to FashionMIST dataset\n        python src/add_noise.py --dataset=fashionmnist --gauss_noise=0.5 --salt_pep=0.5 --speckle_noise=0.5\n        ```\n\n        \n\n      * `--gauss_noise`, `--salt_pet`, `--speckle_noise` arguments define the amount of noise to add. They are optional arguments with default values already defined inside the python file.\n\n      * All the preprocessing inside the file is done according to the dataset provided in the command line argument.\n\n      * The resulting images will get stored inside `outputs/plots`.\n\n    * `train_rnd_noise.py`:\n\n      * You can execute this python file to train neural network model by applying ***random noise to image data***.\n\n      * Execute the file:\n\n        ```\n        # training without random noise, validating without random noise \n        python src/train_rnd_noise.py --epochs=20 --train_noise=no --test_noise=no\n        \n        # training with random noise, validating without random noise \n        python src/train_rnd_noise.py --epochs=20 --train_noise=yes --test_noise=no\n        \n        # training without random noise, validating with random noise \n        python src/train_rnd_noise.py --epochs=1 --train_noise=no --test_noise=yes\n        \n        # training with random noise, validating with random noise \n        python src/train_rnd_noise.py --epochs=1 --train_noise=yes --test_noise=yes\n        ```\n\n        \n\n    * `train_gauss_noise.py`:\n\n      * You can execute this python file to train neural network model by applying ***gaussian noise to image data***.\n\n      * Execute the file:\n\n        ```\n        # train with variance 0.5, validate with variance 0.5\t\n        python src/train_gauss_noise.py --epochs=10 --train_noise=0.5 --test_noise=0.5\n        ```\n\n        \n\n      * `--test_noise`: variance for validation images for the gaussian noise.\n\n      * `--train_noise`: variance for training images for the gaussian noise.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsovit-123%2Frobust_neural_networks_by_adding_noise_to_data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsovit-123%2Frobust_neural_networks_by_adding_noise_to_data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsovit-123%2Frobust_neural_networks_by_adding_noise_to_data/lists"}