{"id":21230485,"url":"https://github.com/iliasprc/covidnet","last_synced_at":"2025-07-10T16:33:01.698Z","repository":{"id":44619693,"uuid":"251643071","full_name":"iliasprc/COVIDNet","owner":"iliasprc","description":"PyTorch implementation of COVID-Net https://github.com/lindawangg/COVID-Net","archived":false,"fork":false,"pushed_at":"2023-05-25T12:35:08.000Z","size":51306,"stargazers_count":79,"open_issues_count":4,"forks_count":18,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-10-20T20:19:51.541Z","etag":null,"topics":["covid-19","python3","pytorch","pytorch-implementation","xray"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iliasprc.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,"governance":null}},"created_at":"2020-03-31T15:17:29.000Z","updated_at":"2023-10-21T11:52:33.824Z","dependencies_parsed_at":"2022-09-25T00:33:48.487Z","dependency_job_id":"d458a06f-dce8-488c-9d79-9fa17db42bbe","html_url":"https://github.com/iliasprc/COVIDNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliasprc%2FCOVIDNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliasprc%2FCOVIDNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliasprc%2FCOVIDNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliasprc%2FCOVIDNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iliasprc","download_url":"https://codeload.github.com/iliasprc/COVIDNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225649049,"owners_count":17502183,"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":["covid-19","python3","pytorch","pytorch-implementation","xray"],"created_at":"2024-11-20T23:38:20.115Z","updated_at":"2024-11-20T23:38:20.787Z","avatar_url":"https://github.com/iliasprc.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# COVIDNet\n\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/IliasPap/COVIDNet/blob/master/COVIDNet.ipynb#scrollTo=G9t--VlR7_F6)\nMy PyTorch implementation of COVID-Net, for the original work please see: https://github.com/lindawangg/COVID-Net\n\nThe purpose of this github is to reproduce results and not to claim state-of-the-art performance !!\n\nAlso Google Colab Notebook for plug-n-play training and evaluation here [![Open In Colab](https://colab.research.google.com/github/IliasPap/COVIDNet/blob/master/COVIDNet.ipynb#scrollTo=G9t--VlR7_F6)\n\n\n## Table of Contents\n\n* [Getting Started](#getting-started)\n  * [Installation](#installation)\n* [Usage](#usage)\n* [Results](#results)\n* [Datasets](#datasets)\n* [Contributing](#contributing)\n* [License](#license)\n* [Contact](#contact)\n* [Acknowledgements](#acknowledgements)\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\n\n\n## TODOs\n\n- [ ] Final Requirements\n- [ ] Pretrained models\n- [ ] Test all pretrained models\n- [ ] Instructions for training \n- [ ] Adding command line option for inference\n\n## Requirements\n\n### Installation \u0026 Data Preparation\n\nPlease refer to \n```python\n pip install -r requirements.txt\n```\n\n\n\n\n* Python \u003e= 3.6 (3.6 recommended)\n* PyTorch \u003e= 1.4 (1.6.0 recommended)\n* torchvision \u003e=0.6.0  \n* tqdm (Optional for `test.py`)\n* tensorboard \u003e= 1.14 \n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\n### Training\n\nThe network takes as input an image of shape (N, 224, 224, 3) and outputs the softmax probabilities as (N, C), where N is the number of batches and C number of output classes.\n\n1. To train the Network from scratch simply do `python main.py` \n Arguments for training \n```yaml\ntrainer:\n  cwd: /home/ # working directory\n  logger: CovidCLF # logger name\n  epochs: 30 # number of training epochs\n  seed: 123 # randomness seed\n  cuda: True # use nvidia gpu\n  gpu: 0,1 # id of gpu\n  save: True # save checkpoint\n  load: False # load pretrained checkpoint\n  gradient_accumulation: 1 # gradient accumulation steps\n  pretrained_cpkt: cpkt.pt\n  log_interval: 1000 # print statistics every log_interval\n  model:\n    name: mobilenet_v2 # model name  [mobilenet_v2,COVIDNet_small]\n    optimizer: # optimizer configuration\n      type: SGD # optimizer type\n      lr: 1e-2 # learning rate\n      weight_decay: 0.000001 # weight decay\n    scheduler: # learning rate scheduler\n      type: ReduceLRonPlateau # type of scheduler\n      scheduler_factor: 0.5 # learning rate change ratio\n      scheduler_patience: 0 # patience for some epochs\n      scheduler_min_lr: 1e-3 # minimum learning rate value\n      scheduler_verbose: 5e-6 # print if learning rate is changed\n  dataloader:\n    train:\n      batch_size: 4 # batch size\n      shuffle: True # shuffle samples after every epoch\n      num_workers: 2 # number of thread for dataloader1\n    val:\n      batch_size: 2\n      shuffle: False\n      num_workers: 2\n    test:\n      batch_size: 1\n      shuffle: False\n      num_workers: 2\n  dataset:\n    input_data: ./data/data\n    name: COVIDx # dataset name COVIDx or COVID_CT\n    modality: RGB # type of modality\n    dim: [224,224] # image dimension\n    train:\n      augmentation: True # do augmentation to video\n    val:\n      augmentation: False\n    test:\n      augmentation: False\n```\n\n\u003c!-- RESULTS --\u003e\n## Results \n\n\nwith my   implementation  of COVID-Net and comparison with CNNs pretrained on ImageNet dataset\n\n\n### Results in COVIDx  dataset \n\n\n|    Model        | Accuracy (%) | # Params (M) | MACs (G) |      \n|:------------:|:------------:|:--------:|:-------------------:|\n | [COVID-Net-Small] |    |   89.10      |     115.42   |   2.26   |  \n |   [COVID-Net-Large](https://drive.google.com/open?id=1-3SKFua_wFl2_aAQMIrj2FhowTX8B551) |   91.22      |     118.19   |   3.54   | \n |   [Mobilenet V2   ](https://drive.google.com/open?id=19J-1bW6wPl7Kmm0pNagehlM1zk9m37VV) |   94.0       |     -   |   -      |\n |   [ResNeXt50-32x4d](https://drive.google.com/open?id=1-BLolPNYMVWSY0Xnm8Y8wjQCapXiPnLx) |   95.0       |     -   |   -      |\n | [ResNet-18](https://drive.google.com/open?id=1wxo4gkNGyrhR-1PG8Vr1hj65MfSAHOgJ)   |   94.0       |     -   |   -       |\n\n### Results in COVID-CT  dataset \n\n\n|  Model       | Accuracy (%) | # Params (M) | MACs (G) | \n|:------------:|:------------:|:--------:|:-------------------:|\n|    [COVID-Net-Small]  |     -   |  -   |  |\n|     [COVID-Net-Large]     |     -   |   -  |  |\n\n\nConfusion Matrix on both datasets coming soon !!\n\n\n\n\n\u003c!-- Datasets --\u003e\n## Datasets\n### 1) COVID-CT-Dataset\n\nThe COVID-CT-Dataset has 288 CT images containing clinical findings of COVID-19. We are continuously adding more COVID CTs.\n\nThe images are collected from medRxiv and bioRxiv papers about COVID-19. CTs containing COVID-19 abnormalities are selected by reading the figure captions in the papers. All copyrights of the data belong to medRxiv and bioRxiv.\n\nPlease refer to the preprint for details: COVID-CT-Dataset: A CT Scan Dataset about COVID-19\n\n### 2) COVIDx  dataset \n\n\nThe current COVIDx dataset is constructed by the following open source chest radiography datasets:\n* https://github.com/ieee8023/covid-chestxray-dataset\n* https://www.kaggle.com/c/rsna-pneumonia-detection-challenge\n\nWe especially thank the Radiological Society of North America and others involved in the RSNA Pneumonia Detection Challenge, and Dr. Joseph Paul Cohen and the team at MILA involved in the COVID-19 image data collection project, for making data available to the global community.\n\n### Steps to generate the COVIDx dataset\n\nDownload the datasets listed above\n * `git clone https://github.com/ieee8023/covid-chestxray-dataset.git`\n * go to this [link](https://www.kaggle.com/c/rsna-pneumonia-detection-challenge/data) to download the RSNA pneumonia dataset\n2. Create a `data` directory and within the data directory, create a `train` and `test` directory\n3. Use [COVIDNet.ipynb](COVIDNet.ipynb) to combine the two dataset to create COVIDx. Make sure to remember to change the file paths.\n4. We provide the train and test txt files with patientId, image path and label (normal, pneumonia or COVID-19). The description for each file is explained below:\n * [train\\_COVIDx.txt](train_COVIDx.txt): This file contains the samples used for training.\n * [test\\_COVIDx.txt](test_COVIDx.txt): This file contains the samples used for testing.\n\n\n\n\n\n\n\n[contributors-shield]: https://img.shields.io/github/contributors/iliasprc/COVIDNet.svg?style=flat-square\n[contributors-url]: https://github.com/iliasprc/COVIDNet/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/iliasprc/COVIDNet.svg?style=flat-square\n[forks-url]: https://github.com/iliasprc/COVIDNet/network/members\n\n[stars-shield]: https://img.shields.io/github/stars/iliasprc/COVIDNet.svg?style=flat-square\n[stars-url]: https://github.com/iliasprc/COVIDNet/stargazers\n\n[issues-shield]: https://img.shields.io/github/issues/iliasprc/COVIDNet.svg?style=flat-square\n[issues-url]: https://github.com/iliasprc/COVIDNet/issues\n\n\n\n\n\n# Links\nCheck out this repository for more medical applications with deep-learning in PyTorch\nhttps://github.com/black0017/MedicalZooPytorch from https://github.com/black0017\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filiasprc%2Fcovidnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filiasprc%2Fcovidnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filiasprc%2Fcovidnet/lists"}