COVID-Net Open Source Initiative

Overview

COVID-Net Open Source Initiative

Note: The COVID-Net models provided here are intended to be used as reference models that can be built upon and enhanced as new data becomes available. They are currently at a research stage and not yet intended as production-ready models (not meant for direct clinical diagnosis), and we are working continuously to improve them as new data becomes available. Please do not use COVID-Net for self-diagnosis and seek help from your local health authorities.

Recording to webinar on How we built COVID-Net in 7 days with Gensynth

Update 04/21/2021: We released a new COVIDNet CXR-S model and COVIDxSev dataset for airspace severity grading in COVID-19 positive patient CXR images. For more information on training, testing and inference please refer to severity docs.
Update 03/20/2021: We released a new COVID-Net CXR-2 model for COVID-19 positive/negative detection which was trained on the new COVIDx8B dataset with 16,352 CXR images from a multinational cohort of 15,346 patients from at least 51 countries. The test results are based on the new COVIDx8B test set of 200 COVID-19 positive and 200 negative CXR images.
Update 03/19/2021: We released updated datasets and dataset curation scripts. The COVIDx V8A dataset and create_COVIDx.ipynb are for detection of no pneumonia/non-COVID-19 pneumonia/COVID-19 pneumonia, and COVIDx V8B dataset and create_COVIDx_binary.ipynb are for COVID-19 positive/negative detection. Both datasets contain over 16000 CXR images with over 2300 positive COVID-19 images.
Update 01/28/2021: We released updated datasets and dataset curation scripts. The COVIDx V7A dataset and create_COVIDx.ipynb are for detection of no pneumonia/non-COVID-19 pneumonia/COVID-19 pneumonia, and COVIDx V7B dataset and create_COVIDx_binary.ipynb are for COVID-19 positive/negative detection. Both datasets contain over 15600 CXR images with over 1700 positive COVID-19 images.
Update 01/05/2021: We released a new COVIDx6 dataset for binary classification (COVID-19 positive or COVID-19 negative) with over 14500 CXR images and 617 positive COVID-19 images.
Update 11/24/2020: We released CancerNet-SCa for skin cancer detection, part of the CancerNet initiatives.
Update 11/15/2020: We released COVIDNet-P inference and evaluation scripts for identifying pneumonia in CXR images using the COVIDx5 dataset. For more information please refer to this doc.
Update 10/30/2020: We released a new COVIDx5 dataset with over 14200 CXR images and 617 positive COVID-19 images.
Update 09/11/2020: We released updated COVIDNet-S models for geographic and opacity extent scoring of SARS-CoV-2 lung severity and updated the inference script for an opacity extent scoring ranging from 0-8.
Update 07/08/2020: We released COVIDNet-CT, which was trained and tested on 104,009 CT images from 1,489 patients. For more information, as well as instructions to run and download the models, refer to this repo.
Update 06/26/2020: We released 3 new models, COVIDNet-CXR4-A, COVIDNet-CXR4-B, COVIDNet-CXR4-C, which were trained on the new COVIDx4 dataset with over 14000 CXR images and 473 positive COVID-19 images for training. The test results are based on the same test dataset as COVIDNet-CXR3 models.
Update 06/01/2020: We released an inference script and the models for geographic and opacity extent scoring of SARS-CoV-2 lung severity.
Update 05/26/2020: For a detailed description of the methodology behind COVID-Net based deep neural networks for geographic extent and opacity extent scoring of chest X-rays for SARS-CoV-2 lung disease severity, see the paper here.
Update 05/13/2020: We released 3 new models, COVIDNet-CXR3-A, COVIDNet-CXR3-B, COVIDNet-CXR3-C, which were trained on a new COVIDx dataset with both PA and AP X-Rays. The results are now based on a test set containing 100 COVID-19 samples.
Update 04/16/2020: If you have questions, please check the new FAQ page first.

photo not available
COVID-Net CXR-2 for COVID-19 positive/negative detection architecture and example chest radiography images of COVID-19 cases from 2 different patients and their associated critical factors (highlighted in red) as identified by GSInquire.

The COVID-19 pandemic continues to have a devastating effect on the health and well-being of the global population. A critical step in the fight against COVID-19 is effective screening of infected patients, with one of the key screening approaches being radiology examination using chest radiography. It was found in early studies that patients present abnormalities in chest radiography images that are characteristic of those infected with COVID-19. Motivated by this and inspired by the open source efforts of the research community, in this study we introduce COVID-Net, a deep convolutional neural network design tailored for the detection of COVID-19 cases from chest X-ray (CXR) images that is open source and available to the general public. To the best of the authors' knowledge, COVID-Net is one of the first open source network designs for COVID-19 detection from CXR images at the time of initial release. We also introduce COVIDx, an open access benchmark dataset that we generated comprising of 13,975 CXR images across 13,870 patient patient cases, with the largest number of publicly available COVID-19 positive cases to the best of the authors' knowledge. Furthermore, we investigate how COVID-Net makes predictions using an explainability method in an attempt to not only gain deeper insights into critical factors associated with COVID cases, which can aid clinicians in improved screening, but also audit COVID-Net in a responsible and transparent manner to validate that it is making decisions based on relevant information from the CXR images. By no means a production-ready solution, the hope is that the open access COVID-Net, along with the description on constructing the open source COVIDx dataset, will be leveraged and build upon by both researchers and citizen data scientists alike to accelerate the development of highly accurate yet practical deep learning solutions for detecting COVID-19 cases and accelerate treatment of those who need it the most.

For a detailed description of the methodology behind COVID-Net and a full description of the COVIDx dataset, please click here.

For a detailed description of the methodology behind COVID-Net based deep neural networks for geographic extent and opacity extent scoring of chest X-rays for SARS-CoV-2 lung disease severity, please click here.

For a detailed description of the methodology behind COVIDNet-CT and the associated dataset of 104,009 CT images from 1,489 patients, please click here.

Currently, the COVID-Net team is working on COVID-RiskNet, a deep neural network tailored for COVID-19 risk stratification. Currently this is available as a work-in-progress via included train_risknet.py script, help to contribute data and we can improve this tool.

If you would like to contribute COVID-19 x-ray images, please submit to https://figure1.typeform.com/to/lLrHwv. Lets all work together to stop the spread of COVID-19!

If you are a researcher or healthcare worker and you would like access to the GSInquire tool to use to interpret COVID-Net results on your data or existing data, please reach out to [email protected] or [email protected]

Our desire is to encourage broad adoption and contribution to this project. Accordingly this project has been licensed under the GNU Affero General Public License 3.0. Please see license file for terms. If you would like to discuss alternative licensing models, please reach out to us at [email protected] and [email protected] or [email protected]

If there are any technical questions after the README, FAQ, and past/current issues have been read, please post an issue or contact:

If you find our work useful, can cite our paper using:

@Article{Wang2020,
	author={Wang, Linda and Lin, Zhong Qiu and Wong, Alexander},
	title={COVID-Net: a tailored deep convolutional neural network design for detection of COVID-19 cases from chest X-ray images},
	journal={Scientific Reports},
	year={2020},
	month={Nov},
	day={11},
	volume={10},
	number={1},
	pages={19549},
	issn={2045-2322},
	doi={10.1038/s41598-020-76550-z},
	url={https://doi.org/10.1038/s41598-020-76550-z}
}

Quick Links

  1. COVIDNet-CXR models (COVID-19 detection using chest x-rays): https://github.com/lindawangg/COVID-Net/blob/master/docs/models.md
  2. COVIDNet-CT models (COVID-19 detection using chest CT scans): https://github.com/haydengunraj/COVIDNet-CT/blob/master/docs/models.md
  3. COVIDNet-CXR-S models (COVID-19 airspace severity grading using chest x-rays): https://github.com/lindawangg/COVID-Net/blob/master/docs/models.md
  4. COVIDNet-S models (COVID-19 lung severity assessment using chest x-rays): https://github.com/lindawangg/COVID-Net/blob/master/docs/models.md
  5. COVIDx-CXR dataset: https://github.com/lindawangg/COVID-Net/blob/master/docs/COVIDx.md
  6. COVIDx-CT dataset: https://github.com/haydengunraj/COVIDNet-CT/blob/master/docs/dataset.md
  7. COVIDx-S dataset: https://github.com/lindawangg/COVID-Net/tree/master/annotations
  8. COVIDNet-P inference for pneumonia: https://github.com/lindawangg/COVID-Net/blob/master/docs/covidnet_pneumonia.md
  9. CancerNet-SCa models for skin cancer detection: https://github.com/jamesrenhoulee/CancerNet-SCa/blob/main/docs/models.md

Training, inference, and evaluation scripts for COVIDNet-CXR, COVIDNet-CT, COVIDNet-S, and CancerNet-SCa models are available at the respective repos

Core COVID-Net Team

  • DarwinAI Corp., Canada and Vision and Image Processing Research Group, University of Waterloo, Canada
  • Vision and Image Processing Research Group, University of Waterloo, Canada
    • James Lee
    • Hossein Aboutalebi
    • Alex MacLean
    • Saad Abbasi
  • Ashkan Ebadi and Pengcheng Xi (National Research Council Canada)
  • Kim-Ann Git (Selayang Hospital)
  • Abdul Al-Haimi, COVID-19 ShuffleNet Chest X-Ray Model: https://github.com/aalhaimi/covid-net-cxr-shuffle

Table of Contents

  1. Requirements to install on your system
  2. How to generate COVIDx dataset
  3. Steps for training, evaluation and inference of COVIDNet
  4. Steps for inference of COVIDNet lung severity scoring
  5. Results
  6. Links to pretrained models

Requirements

The main requirements are listed below:

  • Tested with Tensorflow 1.13 and 1.15
  • OpenCV 4.2.0
  • Python 3.6
  • Numpy
  • Scikit-Learn
  • Matplotlib

Additional requirements to generate dataset:

  • PyDicom
  • Pandas
  • Jupyter

Results

These are the final results for the COVIDNet models.

COVIDNet-CXR-2 on COVIDx8B (200 COVID-19 test)

Sensitivity (%)
Negative Positive
97.0 95.5
Positive Predictive Value (%)
Negative Positive
95.6 97.0

COVIDNet-CXR4-A on COVIDx4 (100 COVID-19 test)

Sensitivity (%)
Normal Pneumonia COVID-19
94.0 94.0 95.0
Positive Predictive Value (%)
Normal Pneumonia COVID-19
91.3 93.1 99.0

COVIDNet-CXR4-B on COVIDx4 (100 COVID-19 test)

Sensitivity (%)
Normal Pneumonia COVID-19
96.0 92.0 93.0
Positive Predictive Value (%)
Normal Pneumonia COVID-19
88.9 93.9 98.9

COVIDNet-CXR4-C on COVIDx4 (100 COVID-19 test)

Sensitivity (%)
Normal Pneumonia COVID-19
95.0 89.0 96.0
Positive Predictive Value (%)
Normal Pneumonia COVID-19
90.5 93.7 96.0

COVIDNet-CXR3-A on COVIDx3 (100 COVID-19 test)

Sensitivity (%)
Normal Pneumonia COVID-19
93.0 93.0 94.0
Positive Predictive Value (%)
Normal Pneumonia COVID-19
92.1 90.3 97.9

COVIDNet-CXR3-B on COVIDx3 (100 COVID-19 test)

Sensitivity (%)
Normal Pneumonia COVID-19
95.0 94.0 91.0
Positive Predictive Value (%)
Normal Pneumonia COVID-19
90.5 91.3 98.9

COVIDNet-CXR3-C on COVIDx3 (100 COVID-19 test)

Sensitivity (%)
Normal Pneumonia COVID-19
92.0 90.0 95.0
Positive Predictive Value (%)
Normal Pneumonia COVID-19
90.2 91.8 95.0

COVIDNet-CXR Small on COVIDx2 (31 COVID-19 test)

Sensitivity (%)
Normal Pneumonia COVID-19
97.0 90.0 87.1
Positive Predictive Value (%)
Normal Pneumonia COVID-19
89.8 94.7 96.4

COVIDNet-CXR Large on COVIDx2 (31 COVID-19 test)

Sensitivity (%)
Normal Pneumonia COVID-19
99.0 89.0 96.8
Positive Predictive Value (%)
Normal Pneumonia COVID-19
91.7 98.9 90.9
Issues
  • Covid-net model?

    Covid-net model?

    Paper mentions that code for covid-net architecture is available at repo but it is not present atm.

    enhancement 
    opened by fcakyon 23
  • Final convolutional layer tensor for activation map with Grad-CAM

    Final convolutional layer tensor for activation map with Grad-CAM

    Hello,

    Thank you for sharing your work! I am trying to make the activation map to see the important features from your two trained models (COVIDNet-CXR Small and COVIDNet-CXR Large). To do that I would like to know the name of the final convolutional layer tensor. I have checked your document train_eval_inference.md but have found that tensor name.

    I listed all tensor names in your models by this code:

    tensors = [t.name for op in tf.get_default_graph().get_operations() for t in op.values()]
    for t in tensors:
        print(t)
    

    And this is a subset of the tensor names:

    ...
    conv5_block3_preact_relu/Relu:0
    conv5_block3_1_conv/convolution:0
    conv5_block3_1_bn/FusedBatchNorm_1:0
    conv5_block3_1_bn/FusedBatchNorm_1:1
    conv5_block3_1_bn/FusedBatchNorm_1:2
    conv5_block3_1_bn/FusedBatchNorm_1:3
    conv5_block3_1_bn/FusedBatchNorm_1:4
    conv5_block3_1_relu/Relu:0
    conv5_block3_2_pad/Pad/paddings:0
    conv5_block3_2_pad/Pad:0
    conv5_block3_2_conv/convolution:0
    conv5_block3_2_bn/FusedBatchNorm_1:0
    conv5_block3_2_bn/FusedBatchNorm_1:1
    conv5_block3_2_bn/FusedBatchNorm_1:2
    conv5_block3_2_bn/FusedBatchNorm_1:3
    conv5_block3_2_bn/FusedBatchNorm_1:4
    conv5_block3_2_relu/Relu:0
    conv5_block3_3_conv/convolution:0
    conv5_block3_3_conv/BiasAdd:0
    conv5_block3_out/add:0
    post_bn/FusedBatchNorm_1:0
    post_bn/FusedBatchNorm_1:1
    post_bn/FusedBatchNorm_1:2
    post_bn/FusedBatchNorm_1:3
    post_bn/FusedBatchNorm_1:4
    post_relu/Relu:0
    flatten_1/Shape:0
    flatten_1/strided_slice/stack:0
    flatten_1/strided_slice/stack_1:0
    flatten_1/strided_slice/stack_2:0
    flatten_1/strided_slice:0
    flatten_1/Const:0
    flatten_1/Prod:0
    flatten_1/stack/0:0
    flatten_1/stack:0
    flatten_1/Reshape:0
    dense_1/MatMul:0
    dense_1/BiasAdd:0
    dense_1/Relu:0
    dense_2/MatMul:0
    dense_2/BiasAdd:0
    dense_2/Relu:0
    dense_3/MatMul:0
    dense_3/BiasAdd:0
    dense_3/Softmax:0
    loss/mul/x:0
    loss/dense_3_loss/Sum/reduction_indices:0
    loss/dense_3_loss/Sum:0
    ...
    

    Based on that, I guess the final convolutional layer tensor is conv5_block3_out/add:0 and make the activation map based on that.

    To confirm what I have done, my question: Is the final convolutional layer tensor is actually conv5_block3_out/add:0?

    Thank you for your time.

    opened by nguyenhoa93 20
  • Confusion Matrix and Results Should Be Updated Or Clarified

    Confusion Matrix and Results Should Be Updated Or Clarified

    It looks like additional training and test examples were added but the Confusion Matrix and Results have not been updated to reflect this. I recommend either updating the results, or if the results are not available yet (possibly still training the new model?) a quick note added to make sure that there isn't confusion about the Confusion Matrix, which only shows 8 ground truth COVID-19 samples still. As there are two false positives in the Confusion Matrix, it's possible to assume that the results have been miscalculated with false negatives as false positives, which would reverse the precision and recall.

    bug 
    opened by josephius 9
  • Cannot create dataset COVIDx8

    Cannot create dataset COVIDx8

    Dear all,

    I would like to reproduce the results obtained with the model COVIDNet-CXR-2 (results reported here ). To this end, I am trying to create the dataset COVIDx8. After downloading all the databases listed here, I used the script create_ricord_dataset.ipynb to adequately pre-process the ricord images. A first issue I found is that at line 28 of the script create_ricord_dataset.ipynb, I had to change that line from:

    study_dir = os.path.join(ricord_dir, 'MIDRC-RICORD-1C-{}'.format(mrn), '*-{}'.format(uid)) to

    study_dir = os.path.join(ricord_dir, 'MIDRC-RICORD-1C-{}'.format(mrn), '*{}'.format(uid))

    This was necessary to match the hierarchy of the folders automatically created by the NBIA Data Retriever that I used to download the ricord database.

    Using this modified script, 24 images are removed from the ricord dataset because they are in "in position LL". Following the message I receive from the script:

    Image from MRN-419639-001634 Date-12-27-2003 UID-16722 in position LL Image from MRN-419639-001686 Date-02-09-2004 UID-47369 in position LL Image from MRN-419639-003089 Date-03-27-2005 UID-37417 in position LL Image from MRN-419639-003089 Date-03-30-2005 UID-54764 in position LL Image from MRN-SITE2-000045 Date-12-01-2005 UID-76077 in position LL Image from MRN-SITE2-000046 Date-02-02-2002 UID-62756 in position LL Image from MRN-SITE2-000078 Date-01-21-2006 UID-37750 in position LL Image from MRN-SITE2-000101 Date-12-29-1999 UID-36965 in position LL Image from MRN-SITE2-000129 Date-12-15-2005 UID-45395 in position LL Image from MRN-SITE2-000148 Date-04-09-2000 UID-44042 in position LL Image from MRN-SITE2-000149 Date-04-29-2001 UID-71428 in position LL Image from MRN-SITE2-000176 Date-03-04-2000 UID-81030 in position LL Image from MRN-SITE2-000186 Date-06-21-2005 UID-47380 in position LL Image from MRN-SITE2-000190 Date-05-31-2008 UID-46535 in position LL Image from MRN-SITE2-000190 Date-06-01-2008 UID-19302 in position LL Image from MRN-SITE2-000199 Date-12-12-2003 UID-92778 in position LL Image from MRN-SITE2-000199 Date-12-06-2003 UID-54181 in position LL Image from MRN-SITE2-000199 Date-12-25-2003 UID-91718 in position LL Image from MRN-SITE2-000199 Date-12-08-2003 UID-55518 in position LL Image from MRN-SITE2-000210 Date-05-15-2004 UID-51719 in position LL Image from MRN-SITE2-000237 Date-03-17-2005 UID-52517 in position LL Image from MRN-SITE2-000248 Date-09-27-2005 UID-77857 in position LL Image from MRN-SITE2-000249 Date-12-17-2003 UID-49234 in position LL Image from MRN-SITE2-000267 Date-02-10-2002 UID-81231 in position LL Created 1072 files

    I used the obtained ricord images to create my final COVIDx8 dataset, using the script create_COVIDx_binary.ipynb, but I obtain the following error:

    `--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) in 74 cv2.imwrite(os.path.join(savepath, 'train', patient[1]), gray) 75 else: ---> 76 copyfile(os.path.join(ds_imgpath[patient[3]], patient[1]), os.path.join(savepath, 'train', patient[1])) 77 train.append(patient) 78 train_count[patient[2]] += 1

    ~/anaconda3/envs/covid-net_py3.6/lib/python3.6/shutil.py in copyfile(src, dst, follow_symlinks) 118 os.symlink(os.readlink(src), dst) 119 else: --> 120 with open(src, 'rb') as fsrc: 121 with open(dst, 'wb') as fdst: 122 copyfileobj(fsrc, fdst)

    FileNotFoundError: [Errno 2] No such file or directory: '/home/jessica/prin_DNN_compression/dataset_COVIDxV8B/ricord_images/MIDRC-RICORD-1C-SITE2-000101-36965-0.png'`

    It seems that one of the images removed by the script create_ricord_dataset.ipynb is actually necessary to build the dataset.

    Moreover, I suspect that one or more of these images are presented in the training set and test set labels files (train_COVIDx8B.txt and test_COVIDx8B.txt), which I need to reproduce the results obtained by the model COVIDNet-CXR-2 using the script eval.py. In particular, the image I highlighted in bold in the precedent list are actually present in the file test_COVIDx8B.txt and required to reproduce your results.

    As a final attempt, I tried to simply remove this block of code from the script create_ricord_dataset.ipynb:

    # Verify orientation if ds.ViewPosition != 'AP' and ds.ViewPosition != 'PA': print('Image from MRN-{} Date-{} UID-{} in position {}'.format(mrn, date, uid, ds.ViewPosition)) continue

    I do not know if removing the verification of images orientation is safe, but in this was i can create the COVIDx8 dataset. However, when I use the script eval.py to obtain the reported performances of the model COVIDNet-CXR-2 I obtain:

    !python eval.py \ --weightspath /home/jessica/prin_DNN_compression/COVID-Net-CXR-2 \ --metaname model.meta \ --ckptname model \ --n_classes 2 \ --testfile ./labels/test_COVIDx8B.txt \ --testfolder /home/jessica/prin_DNN_compression/dataset_COVIDxV8B/data/test \ --out_tensorname norm_dense_2/Softmax:0

    [[194. 6.] [ 10. 190.]] Sens Negative: 0.97000, Positive: 0.95000 PPV Negative: 0.95098, Positive: 0.96939

    These results are a bit different from the ones reported here .

    Can you tell me if I am missing something to reproduce you results for the model COVIDNet-CXR-2?

    Thank you in advance for your help.

    All the best, Jessica

    opened by GliozzoJ 7
  • Dataset generation is not working

    Dataset generation is not working

    Issue Template

    Before posting, have you looked at the FAQ page?

    Yes. My question is not addressed there.

    Description

    Please include a summary of the issue. The dataset generation notebooks might be out-of-date (create_COVIDx.ipynb and create_COVIDx_binary.ipynb). When I ran the notebooks, they both have failed even though I changed the directory of the dataset folders.

    Please include the steps to reproduce. I followed the steps in COVIDx.md.

    List any additional libraries that are affected. None

    Steps to Reproduce

    I followed the steps in data generation.

    Expected behavior

    The one in the notebooks

    Actual behavior

    When I remove the following line,

    imagename = patientid.split('(')[0] + ' ('+ patientid.split('(')[1] + '.' + row['FORMAT'].lower()
    

    The 4th cell of create_COVIDx_binary.ipynb passes with the following output,

    Data distribution from covid datasets:
    {'negative': 373, 'normal': 0, 'pneumonia': 57, 'COVID-19': 1770}
    

    This is okay, right? But when I get to the 6th cell, this is the output,

    Key:  negative
    Test patients:  ['ANON148', 'ANON6', 'ANON152', 'ANON93', 'ANON2', 'ANON193', 'ANON156', 'ANON28', 'ANON143', 'ANON186', 'ANON15', 'ANON65', 'ANON128', 'ANON168', 'ANON120', 'ANON194', 'ANON216', 'ANON131', 'ANON175', 'ANON141']
    Key:  pneumonia
    Test patients:  ['8', '31']
    Key:  COVID-19
    Test patients:  ['19', '20', '36', '42', '86', '94', '97', '117', '132', '138', '144', '150', '163', '169', '174', '175', '179', '190', '191COVID-00024', 'COVID-00025', 'COVID-00026', 'COVID-00027', 'COVID-00029', 'COVID-00030', 'COVID-00032', 'COVID-00033', 'COVID-00035', 'COVID-00036', 'COVID-00037', 'COVID-00038', 'ANON24', 'ANON45', 'ANON126', 'ANON106', 'ANON67', 'ANON153', 'ANON135', 'ANON44', 'ANON29', 'ANON201', 'ANON191', 'ANON234', 'ANON110', 'ANON112', 'ANON73', 'ANON220', 'ANON189', 'ANON30', 'ANON53', 'ANON46', 'ANON218', 'ANON240', 'ANON100', 'ANON237', 'ANON158', 'ANON174', 'ANON19', 'ANON195', 'COVID-19(119)', 'COVID-19(87)', 'COVID-19(70)', 'COVID-19(94)', 'COVID-19(215)', 'COVID-19(77)', 'COVID-19(213)', 'COVID-19(81)', 'COVID-19(216)', 'COVID-19(72)', 'COVID-19(106)', 'COVID-19(131)', 'COVID-19(107)', 'COVID-19(116)', 'COVID-19(95)', 'COVID-19(214)', 'COVID-19(129)']
    ---------------------------------------------------------------------------
    error                                     Traceback (most recent call last)
    <ipython-input-9-37cbccc040e2> in <module>
         67             if patient[3] == 'sirm':
         68                 image = cv2.imread(os.path.join(ds_imgpath[patient[3]], patient[1]))
    ---> 69                 gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
         70                 patient[1] = patient[1].replace(' ', '')
         71                 cv2.imwrite(os.path.join(savepath, 'train', patient[1]), gray)
    
    error: OpenCV(4.2.0) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
    

    Environment

    • Build: [e.g. 3180 - type "About" in the Command Palette]
    Python 3.7.7 (default, Jul 21 2020, 10:29:19) 
    Type 'copyright', 'credits' or 'license' for more information
    IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.
    
    • Operating system and version: Ubuntu 20.04
    • [Linux] Desktop Environment and/or Window Manager: Regolith/i3
    opened by AFAgarap 7
  • Model detects COVID-19 or Data Source?

    Model detects COVID-19 or Data Source?

    Given the datasource is different for the two classes: COVID and Pneumonia/Normal, how do you validate that the model doesn't classify the data source, but actually classifies the presence of COVID-19?

    question 
    opened by ajaymaity 6
  • PEPX Network Design Pattern

    PEPX Network Design Pattern

    Thanks for working on this project! This is very interesting and very impactful.

    COVID-Net relies on a design pattern of projection-expansion-projection-extension (PEPX) throughout the network. I have beginner-level knowledge of computer vision, and I haven't seen this design pattern before.

    1. Without loading in the model, what are the output dimensions of each layer in the PEPX module (Figure 2, top right box) for PEPX1.1? This would give me a better understanding of how dimension is changing within the module.

    2. What is the intuition around the effectiveness of this design pattern? Are there some previous papers that use this design pattern for their core results?

    question 
    opened by PLBMR 6
  • Convert the checkpoint model type to TensorFlow Lite or at least saved_model format

    Convert the checkpoint model type to TensorFlow Lite or at least saved_model format

    Hi, can someone help with conversion of the checkpoint model type to ideally, TensorFlow Lite, if not, at least saved_model type. I tried and looked for multiple sources, but kept hitting dead ends...

    opened by kapilb7 6
  • Dataset distribution

    Dataset distribution

    There seem to be some discordance between the number of training and testing samples mentioned in the RSNA pneumonia dataset versus the dataset distribution mentioned on the github page, probably because of the multiple rows corresponding to same patient ID in the RSNA dataset’s csv file as it was supposed to be a detection task, please verify.

    question 
    opened by arpit-jadon 6
  • COVIDx7A dataset issue with text file

    COVIDx7A dataset issue with text file

    I believe there might be an issue with the text files here because in the data loader script:

    for i in range(len(batch_files)): sample = batch_files[i].split()

            if self.is_training:
                folder = 'train'
            else:
                folder = 'test'
    
            x = process_image_file(os.path.join(self.datadir, folder, sample[1]),
                                   self.top_percent,
                                   self.input_shape[0])
    

    batch_files[i] is a single line of the .txt file and sample[1] takes the 1th item in the line.split()

    however, in the train_covidx7A.txt file this will not agree in the sirm dataset:

    'ANON136 DX.1.2.840.113564.1722810162.20200405112431725920.1203801020003.png COVID-19 actmed\n', 'ANON188 DX.1.2.840.113564.1722810162.20200405142816863980.1203801020003.png COVID-19 actmed\n', 'ANON68 DX.1.2.840.113564.1722810162.20200420135116095500.1203801020003.png COVID-19 actmed\n', 'COVID 1 COVID(1).png COVID-19 sirm\n', 'COVID 2 COVID(2).png COVID-19 sirm\n',

    for example there is a space between the "COVID" and "2" in the last line, so line.split()[1] will not give the file name but rather the number 2. this will likely cause errors in training.

    opened by Electro1111 5
  • Bump pillow from 7.2.0 to 9.0.0

    Bump pillow from 7.2.0 to 9.0.0

    Bumps pillow from 7.2.0 to 9.0.0.

    Release notes

    Sourced from pillow's releases.

    9.0.0

    https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html

    Changes

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    9.0.0 (2022-01-02)

    • Restrict builtins for ImageMath.eval(). CVE-2022-22817 #5923 [radarhere]

    • Ensure JpegImagePlugin stops at the end of a truncated file #5921 [radarhere]

    • Fixed ImagePath.Path array handling. CVE-2022-22815, CVE-2022-22816 #5920 [radarhere]

    • Remove consecutive duplicate tiles that only differ by their offset #5919 [radarhere]

    • Improved I;16 operations on big endian #5901 [radarhere]

    • Limit quantized palette to number of colors #5879 [radarhere]

    • Fixed palette index for zeroed color in FASTOCTREE quantize #5869 [radarhere]

    • When saving RGBA to GIF, make use of first transparent palette entry #5859 [radarhere]

    • Pass SAMPLEFORMAT to libtiff #5848 [radarhere]

    • Added rounding when converting P and PA #5824 [radarhere]

    • Improved putdata() documentation and data handling #5910 [radarhere]

    • Exclude carriage return in PDF regex to help prevent ReDoS #5912 [hugovk]

    • Fixed freeing pointer in ImageDraw.Outline.transform #5909 [radarhere]

    • Added ImageShow support for xdg-open #5897 [m-shinder, radarhere]

    • Support 16-bit grayscale ImageQt conversion #5856 [cmbruns, radarhere]

    • Convert subsequent GIF frames to RGB or RGBA #5857 [radarhere]

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump babel from 2.9.0 to 2.9.1

    Bump babel from 2.9.0 to 2.9.1

    Bumps babel from 2.9.0 to 2.9.1.

    Release notes

    Sourced from babel's releases.

    Version 2.9.1

    Bugfixes

    • The internal locale-data loading functions now validate the name of the locale file to be loaded and only allow files within Babel's data directory. Thank you to Chris Lyne of Tenable, Inc. for discovering the issue!
    Changelog

    Sourced from babel's changelog.

    Version 2.9.1

    Bugfixes

    
    * The internal locale-data loading functions now validate the name of the locale file to be loaded and only
      allow files within Babel's data directory.  Thank you to Chris Lyne of Tenable, Inc. for discovering the issue!
    
    Commits
    • a99fa24 Use 2.9.0's setup.py for 2.9.1
    • 60b33e0 Become 2.9.1
    • 412015e Merge pull request #782 from python-babel/locale-basename
    • 5caf717 Disallow special filenames on Windows
    • 3a700b5 Run locale identifiers through os.path.basename()
    • 5afe2b2 Merge pull request #754 from python-babel/github-ci
    • 58de834 Replace Travis + Appveyor with GitHub Actions (WIP)
    • d1bbc08 import_cldr: use logging; add -q option
    • 156b7fb Quiesce CLDR download progress bar if requested (or not a TTY)
    • 613dc17 Make the import warnings about unsupported number systems less verbose
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Using pre-trained model

    Using pre-trained model

    Hi all I am going to use covidnet pretrained model, could you please give me a hint to do so? How can i use these files? ovidnet

    opened by EverLookNeverSee 1
  • Only return 1 class when training COVIDNet with COVIDx4 dataset

    Only return 1 class when training COVIDNet with COVIDx4 dataset

    Description

    Only return 1 class when finetuning COVIDNet and the loss is exploded.

    Steps to Reproduce

    I downloaded the COVIDx4 Dataset and tried training COVIDNet with COVIDx4 dataset. However, when inference, the model returned only one class and the performance was poor. I reported the loss every step during the training and the loss was exploded to several thousands after 1 epoch. I try both training from scratch and fine-tuning. How can I train your model stably?

    Expected behavior

    the model is trained stably

    Actual behavior

    the model returned only one class and the performance was poor.

    Environment

    Ubuntu 18.04 tensorflowgpu 1.15 And I followed the requirements.txt

    opened by gwang-kim 3
  • Issue with Create_COVIDx for COVIDx8A

    Issue with Create_COVIDx for COVIDx8A

    these lines seem to be meant to discard certain patients in the sirm dataset from the COVIDx dataset

    discard = ['100', '101', '102', '103', '104', '105', '110', '111', '112', '113', '122', '123', '124', '125', '126', '217']

    for idx, row in sirm_csv.iterrows(): patientid = row['FILE NAME'] print(patientid) print(patientid[patientid.find('(')+1:patientid.find(')')]) if row['URL'] not in cohen and patientid[patientid.find('(')+1:patientid.find(')')] not in discard:

    but this part: patientid[patientid.find('(')+1:patientid.find(')')] not in discard:

    doesn't actually do anything because there are no parenthesis in the patient ID's in the latest version of the sirm dataset metadatafile.

    furthermore, all the patientIDs in the 'discard' list all appear in the text file for covidx8a as well so they seem to be a part of the training label sets. what is the reason for discarding this images in the first place?

    opened by Electro1111 0
  • KeyError:

    KeyError: "The name 'keras_learning_phase:0' refers to a Tensor which does not exist

    installed library version: tensorflow==1.15.0 cv==4.20 python==3.6.13

    Description

    Steps to Reproduce

    tried: python train_tf.py
    --weightspath COVID-Net/COVIDNet-CXR4-A
    --metaname model.meta
    --ckptname model-18540
    --n_classes 3
    --trainfile COVID-Net/train_split_new.txt \ #this train file is produced during data preparation --testfile COVID-Net/test_split_new.txt \ #this test file is produced during data preparation --out_tensorname norm_dense_1/Softmax:0
    --logit_tensorname norm_dense_1/MatMul:0

    Expected behavior

    KeyError: "The name 'keras_learning_phase:0' refers to a Tensor which does not exist. The operation, 'keras_learning_phase', does not exist in the graph."

    Can anyone faced it? What is the reason? How do I solve it?

    opened by Saqueeb 0
  • No training steps and how to custom input image tensor?

    No training steps and how to custom input image tensor?

    I don’t see any training steps in the train_tf.py file under the main branch. How is the network updated? What if I want to modify the size of the input tensor from (480,480) to (width, height)?

    opened by YuleZhang 0
  • How to load the pretrained weights with tf2?

    How to load the pretrained weights with tf2?

    Is there a way to load the weights in tf2?

    opened by Jogima-cyber 0
  • Updating the requirements.txt

    Updating the requirements.txt

    Pull Request Template

    Description

    Current requirements.txt contains couple of dependencies that became stale after python version 3.6. So providing new requirements that will go with current environments.

    Context of change

    Please add options that are relevant and mark any boxes that apply.

    • [ ] Software (software that runs on the PC)
    • [ ] Library (library that runs on the PC)
    • [ ] Tool (tool that assists coding development)
    • [*] Other

    Type of change

    Please mark any boxes that apply.

    • [*] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [*] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [ ] This change requires a documentation update

    How Has This Been Tested?

    • [*] python version 3.7
    • [*] python version 3.8
    • [ ] python version 3.9

    Checklist:

    Please mark any boxes that have been completed.

    • [*] I have performed a self-review of my own code.
    • [ ] I have commented my code, particularly in hard-to-understand areas.
    • [ ] I have made corresponding changes to the documentation.
    • [*] My changes generate no new warnings.
    • [ ] Any dependent changes have been merged and published in downstream modules.
    opened by saahiluppal 0
  • Update COVIDx.md

    Update COVIDx.md

    Description

    Update documentation to account for removed image 242a639e.jpg. Refer to https://github.com/lindawangg/COVID-Net/pull/169

    opened by andyzzhao 1
Owner
Linda Wang
Computer Vision 📸, Self-Driving 🚘, Medical Image Analysis ⚕️
Linda Wang
The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.

MIC-DKFZ 1.1k Jan 17, 2022
Neural networks applied in recognizing guitar chords using python, AutoML.NET with C# and .NET Core

Chord Recognition Demo application The demo application is written in C# with .NETCore. As of July 9, 2020, the only version available is for windows

Andres Mauricio Rondon Patiño 18 Jan 8, 2022
U-2-Net: U Square Net - Modified for paired image training of style transfer

U2-Net: U Square Net Modified for paired image training of style transfer This is an unofficial repo making use of the code which was made available b

Doron Adler 32 Jan 11, 2022
RGBD-Net - This repository contains a pytorch lightning implementation for the 3DV 2021 RGBD-Net paper.

[3DV 2021] We propose a new cascaded architecture for novel view synthesis, called RGBD-Net, which consists of two core components: a hierarchical depth regression network and a depth-aware generator network.

Phong Nguyen Ha 1 Jan 11, 2022
The open source code of SA-UNet: Spatial Attention U-Net for Retinal Vessel Segmentation.

SA-UNet: Spatial Attention U-Net for Retinal Vessel Segmentation(ICPR 2020) Overview This code is for the paper: Spatial Attention U-Net for Retinal V

Changlu Guo 100 Jan 4, 2022
PaddleRobotics is an open-source algorithm library for robots based on Paddle, including open-source parts such as human-robot interaction, complex motion control, environment perception, SLAM positioning, and navigation.

简体中文 | English PaddleRobotics paddleRobotics是基于paddle的机器人开源算法库集,包括人机交互、复杂运动控制、环境感知、slam定位导航等开源算法部分。 人机交互 主动多模交互技术TFVT-HRI 主动多模交互技术是通过视觉、语音、触摸传感器等输入机器人

null 135 Jan 14, 2022
Keeping it safe - AI Based COVID-19 Tracker using Deep Learning and facial recognition

Keeping it safe - AI Based COVID-19 Tracker using Deep Learning and facial recognition

Vansh Wassan 15 Jun 17, 2021
covid question answering datasets and fine tuned models

Covid-QA Fine tuned models for question answering on Covid-19 data. Hosted Inference This model has been contributed to huggingface.Click here to see

Abhijith Neil Abraham 19 Sep 9, 2021
Covid-19 Test AI (Deep Learning - NNs) Software. Accuracy is the %96.5, loss is the 0.09 :)

Covid-19 Test AI (Deep Learning - NNs) Software I developed a segmentation algorithm to understand whether Covid-19 Test Photos are positive or negati

Emirhan BULUT 28 Dec 4, 2021
Automatic detection and classification of Covid severity degree in LUS (lung ultrasound) scans

Final-Project Final project in the Technion, Biomedical faculty, by Mor Ventura, Dekel Brav & Omri Magen. Subproject 1: Automatic Detection of LUS Cha

Mor Ventura 1 Dec 18, 2021
Medical-Image-Triage-and-Classification-System-Based-on-COVID-19-CT-and-X-ray-Scan-Dataset

Medical-Image-Triage-and-Classification-System-Based-on-COVID-19-CT-and-X-ray-Sc

null 2 Dec 26, 2021
A Neural Net Training Interface on TensorFlow, with focus on speed + flexibility

Tensorpack is a neural network training interface based on TensorFlow. Features: It's Yet Another TF high-level API, with speed, and flexibility built

Tensorpack 6.1k Jan 13, 2022
CFC-Net: A Critical Feature Capturing Network for Arbitrary-Oriented Object Detection in Remote Sensing Images

CFC-Net This project hosts the official implementation for the paper: CFC-Net: A Critical Feature Capturing Network for Arbitrary-Oriented Object Dete

ming71 35 Jan 8, 2022
Code for our ICASSP 2021 paper: SA-Net: Shuffle Attention for Deep Convolutional Neural Networks

SA-Net: Shuffle Attention for Deep Convolutional Neural Networks (paper) By Qing-Long Zhang and Yu-Bin Yang [State Key Laboratory for Novel Software T

Qing-Long Zhang 146 Jan 11, 2022
A Neural Net Training Interface on TensorFlow, with focus on speed + flexibility

Tensorpack is a neural network training interface based on TensorFlow. Features: It's Yet Another TF high-level API, with speed, and flexibility built

Tensorpack 6.1k Jan 13, 2022
Code for one-stage adaptive set-based HOI detector AS-Net.

AS-Net Code for one-stage adaptive set-based HOI detector AS-Net. Mingfei Chen*, Yue Liao*, Si Liu, Zhiyuan Chen, Fei Wang, Chen Qian. "Reformulating

Mingfei Chen 39 Jan 18, 2022
Implementation of CVPR'21: RfD-Net: Point Scene Understanding by Semantic Instance Reconstruction

RfD-Net [Project Page] [Paper] [Video] RfD-Net: Point Scene Understanding by Semantic Instance Reconstruction Yinyu Nie, Ji Hou, Xiaoguang Han, Matthi

Yinyu Nie 133 Jan 5, 2022
Official implementation of ACTION-Net: Multipath Excitation for Action Recognition (CVPR'21).

ACTION-Net Official implementation of ACTION-Net: Multipath Excitation for Action Recognition (CVPR'21). Getting Started EgoGesture data folder struct

V-Sense 135 Jan 4, 2022