How lindawangg/covid-net works
Project type and purpose
• This is a research-oriented machine-learning pipeline, not a web or full-stack application.
• Its goal is to detect COVID-19 (and pneumonia) from chest X-rays and assess disease severity.
File structure
• Top-level “create_*” directories: Jupyter notebooks that assemble raw sources into training/testing datasets (COVIDx, RICORD).
• data.py: data loader / preprocessing functions.
• train_tf.py and train_risknet.py: different training scripts (TensorFlow-based model vs. RiskNet variant).
• eval*.py: evaluation scripts for overall performance and pneumonia subset.
• inference*.py: scripts to run model inference (COVID detection, pneumonia, severity).
• labels/: text files listing image IDs and ground-truth labels for train/test splits.
• assets/: published papers and PDFs, for reference.
• docs/: markdown documentation on models, datasets, training & inference procedures.
• annotations/: CSV of severity annotations.
• requirements.txt: dependency list for environment setup.
Available documentation
• Although README.md is empty, docs/ contains:
• COVIDx dataset description
• Model architectures (COVIDNet, RiskNet)
• Training, evaluation, inference workflows
• FAQs and notes on severity scoring
Main components and their interactions
a. Data ingestion & preprocessing
• Raw DICOM/PNG X-ray files and annotation CSVs → create_COVIDx notebooks → standardized dataset
• RICORD data mapping → create_ricord_dataset notebooks
• data.py exposes loader API for training/inference scripts
b. Model training
• train_tf.py and train_risknet.py invoke data.py to read processed data → train models → output saved checkpoints/artifacts
c. Evaluation
• eval.py, eval_pneumonia.py load model checkpoints → compute metrics on hold-out sets → output reports/plots
d. Inference
• inference.py, inference_pneumonia.py, inference_severity.py load a trained model → run on new images → produce predictions
e. Documentation & assets
• docs/ and assets/ contain supporting materials but do not participate in the runtime pipeline
Architectural patterns & design principles
• Modular pipeline: clear separation of data preparation, training, evaluation, inference
• Reusable data loader (data.py) for all downstream scripts
• Directory-per-responsibility: notebooks for dataset creation, scripts for compute, docs and assets isolated
• Scripts follow pull-based design: each stage pulls inputs from previous stage’s outputs
Detail without over-splitting
• Logical piece (dataset creation, loader, model training, eval, inference)
• Data flow is end-to-end from raw data to final predictions