How sdrxc/bi-level-prediction-model-for-screening-covid-19-from-chest-x-ray-images works
Step 1: Identify Project Type and Purpose
• This is a research‐driven machine‐learning pipeline implemented as Jupyter notebooks.
• Purpose: Bi‐level classification of chest X-ray images into Normal, Pneumonia, or COVID-19.
• Key stages: feature extraction with a pre‐trained CNN (VGG19) and two levels of shallow‐learner classification.
Step 2: Analyze File Structure
• Top-level consists of five Jupyter notebooks and one image (flow chart):
1. Feature Extraction_vgg19 (1).ipynb – extract deep features.
2. Test_hier.ipynb – orchestrates the two‐level (hierarchical) prediction.
3. Testing_covidxc.ipynb – level-1 test (Normal vs Infected).
4. Testing_lv2_covidxc.ipynb – level-2 test (Pneumonia vs COVID).
• No “src/” or “lib/” folders; the notebooks themselves define modules.
• No deployment scripts; it is an experimental/research pipeline.
Step 3: Extract Insights from README
• The flow chart in README shows data flowing through feature‐extractor → level-1 classifier → level-2 classifier → results.
• Frameworks: Python, Jupyter, Keras (VGG19), scikit-learn (Logistic Regression, k-NN, CART, RF, XGBoost).
• Dataset size is 3,168 labeled chest X-ray images.
Step 4: Key Components & Their Interactions
a. Components
1. Data Source: Balanced CXR image dataset (disk or drive).
2. Preprocessing Module: image resizing, normalization.
3. Feature Extraction Module: VGG19 pre-trained CNN.
4. Level-1 Classifier Module: ensemble of shallow learners (LR, k-NN, CART, RF, XGB).
5. Level-2 Classifier Module: same set of classifiers for infected cases.
6. Evaluation & Reporting Module: accuracy metrics, confusion matrices, plots.
7. Orchestration (Notebooks): coordinate end-to-end flow.
b. Relationships / Data Flow
• Data Source → Preprocessing → Feature Extraction → Level-1 Classifier.
• Level-1 output (“Infected”) branches into Level-2 Classifier; “Normal” is final.
• Both classifier outputs feed into the Evaluation & Reporting module.
c. Architectural Patterns & Principles
• Pipeline pattern: sequential stages with clear data transformations.
• Hierarchical decision tree: first filter, then refine.
• Modular design: each notebook/module handles one responsibility.
• Reproducibility emphasis via Jupyter notebooks and saved flow chart.
d. Technologies & Frameworks
• Python 3.x
• Jupyter Notebook
• Keras/TensorFlow (VGG19)
• scikit-learn (shallow learners)
• NumPy, Pandas, Matplotlib/Seaborn (data handling & visualization)
• Since this is an ML research pipeline, focus on data flow and module boundaries rather than client-server separation.
• Two-level classification hierarchy.
• How notebooks orchestrate or call into preprocessing/feature extraction/classification code.
Step 6: Diagramming Best Practices
Clear labels
• Name each component (e.g., “VGG19 Feature Extractor”).