{"id":22794550,"url":"https://github.com/colintr/neural_network_session_project","last_synced_at":"2025-03-30T17:43:32.198Z","repository":{"id":91542567,"uuid":"372527689","full_name":"ColinTr/Neural_Network_Session_Project","owner":"ColinTr","description":"M. Sc. project: Comparison of 3 criterion of selection in active learning","archived":false,"fork":false,"pushed_at":"2024-08-20T09:47:25.000Z","size":2264,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T19:59:49.896Z","etag":null,"topics":["active-learning","deep-learning","python"],"latest_commit_sha":null,"homepage":"","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/ColinTr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-31T14:07:24.000Z","updated_at":"2024-08-20T09:47:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"71bf9c75-be66-4e0e-a61c-aff126f03134","html_url":"https://github.com/ColinTr/Neural_Network_Session_Project","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/ColinTr%2FNeural_Network_Session_Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinTr%2FNeural_Network_Session_Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinTr%2FNeural_Network_Session_Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinTr%2FNeural_Network_Session_Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColinTr","download_url":"https://codeload.github.com/ColinTr/Neural_Network_Session_Project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246357691,"owners_count":20764361,"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":["active-learning","deep-learning","python"],"created_at":"2024-12-12T04:09:13.689Z","updated_at":"2025-03-30T17:43:32.163Z","avatar_url":"https://github.com/ColinTr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  Neural Network Session Project\n\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \n  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\u003c/div\u003e\n\n\n## 🔍 Overview\n\nThis project was carried out during the final year of our Master in Computer Science.\nHere, we explore the implementation of active learning techniques in neural networks, specifically focusing on classification tasks.\nThe primary goal was to enhance the learning efficiency by allowing the network to select the most informative data points for labeling, thereby reducing the need for a fully labeled dataset.\n\nFor the full context, we recommend the reader to open the \u003ca href=\"https://github.com/ColinTr/Neural_Network_Session_Project/blob/master/TROISEMAINE_BOUCHARD_INACIO_Rapport_Projet_de_Session_IFT780.pdf\"\u003eproject report\u003c/a\u003e (in french).\n\n\n## 📂 Directory Structure\n\nTo use train.py and visualisation.py, you need to be in the ./src folder. \n\n    .\n    ├── .gitignore\n    ├── AUTHORS.md                          \u003c- The names of the project's authors\n    ├── README.md                           \u003c- This file\n    ├── requirements.txt                    \u003c- The required packages\n    ├── results                             \u003c- The generated results\n    └── src                                 \u003c- The source code\n        ├── models                          \u003c- Base class, base blocks and implementation of the models\n        │   ├── DNNBaseModel.py             \u003c- The base class of which our model's inherit\n        │   ├── DNNBlocks.py                \u003c- The base blocks which make up our models\n        │   ├── LeNet.py                    \u003c- The LeNet neural network\n        │   ├── ResNeXt.py                  \u003c- WIP : The ResNeXt neural network\n        │   └── VGGNet.py                   \u003c- The VGGNet neural network\n        ├── scenarii                        \u003c- Main scenario and strategies\n        │   ├── BaseScenario.py             \u003c- The base class of which our scenarios inherit\n        │   └── PoolBaseSamplingScenario.py \u003c- The implementation of the pool sampling scenario and its strategies\n        ├── scripts                         \u003c- The scripts detailed below\n        │   ├── launch_calcul_canada.sh     \u003c- Used to launch runner.py on calcul canada\n        │   ├── mean.py                     \u003c- Used to compute the mean values of all results in a folder\n        │   ├── mean-visualisation.py       \u003c- Plots the computed mean values\n        │   ├── runner.py                   \u003c- Launches sequentially train.py instances\n        │   └── visualisation.py            \u003c- Plots the various metrics of a single result file\n        ├── DataManager.py                  \u003c- The manager of the DataLoader objects\n        ├── train.py                        \u003c- The main entry point of our project\n        └── TrainTestManager.py             \u003c- The class which hosts the active learning's logic\n   \n## 🐍 Requirements\n\nThis project is meant to be used with python 3.7.\n\n\n## 💻 Usage\n\n### Training :\n\nThe main entry point script is **train.py**. It launches one full active learning loop.\nTo use it, type :\n\n\u003e cd src (important !)\n\u003e \n\u003e python3 scripts/train.py model dataset [parameters]\n\nThe parameters are :\\\n--model : The model to use (values : vggnet / lenet) (default = vggnet).\\\n--dataset : The dataset to use (values : CIFAR-10 / mnist) (default = cifar10).\\\n--strategy : The data selection criterion (values : least_confidence / entropy_sampling / margin_sampling / random_sampling) (default = least_confidence).\\\n--stopping_criterion_value : The quantity of data to add to the seed dataset (default = 100).\\\n--seed_size : The size of the initial training dataset (default = 100).\\\n--batch_szie : The batch size used when training the model (default = 20). Reduce this value if you have memory errors.\\\n--query_size : The quantity of data added to the seed dataset after one iteration of the active learning's loop (default = 20).\\\n--optimizer : The optimizer used to train the model (values : SGD or Adam) (default = Adam).\\\n--num_epochs : The number of epochs to train each model (default = 10).\\\n--validation : The share of data used for the validation dataset (default = 0.1).\\\n--lr : The learning rate (default = 0.001).\n\nTo launch multiple instances of train.py one after the other, edit **runner.py** to fit your needs and simply launch it with :\n\u003e cd src\n\u003e \n\u003e python scripts/runner.py\n\n### Visualisation :\nThere are 3 scripts useful for data visualisation.\n\n1) **visualisation.py**\n\n    The first one is visualisation.py. It displays graphs with the following metrics : training and validation losses, training and validation accuracies.\\\n    To launch it, use :\n    \u003e cd src\n    \u003e \n    \u003e python scripts/visualisation.py [any number of result files]\n\n\n2) **mean.py**\n\n    To be able to plot the mean validation accuracy curves, you first need to compute the mean values using the mean.py script.\\\n    To use it, type :\n    \u003e cd src\n    \u003e \n    \u003e python scripts/mean.py [folder path]\n\n    It will compute the mean of every result file of the given folder path and write the result inside the folder ./results/mean\n\n\n3) **mean-visualisation.py**\n    Lastly, this script will allow you to plot the mean learning curves with the variance around each curve.\n    To use it, type :\n    \u003e cd src\n    \u003e \n    \u003e python scripts/mean-visualisation.py [any number of **mean** result files]\n\n\n## ⚖️ License\n\nThis code is released under the MIT license. See the LICENSE file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolintr%2Fneural_network_session_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolintr%2Fneural_network_session_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolintr%2Fneural_network_session_project/lists"}