How mdzaheerjk/chest-disease-identification works
Chest-Disease-Identification is a CNN-based CT-scan classifier with a web interface and an offline training/evaluation lifecycle. Users submit an image through the web app, which invokes the prediction pipeline and returns a Normal or Adenocarcinoma Cancer label. Training is initiated through the app or main entry point and is organized into ingestion, model preparation, training, and evaluation stages. Source excerpts show ingestion, training, evaluation, configuration, and prediction details; preparation-stage internals and some stage wiring are represented only where supported by the tree or documented workflow.
Main entry points: main.py Training entry point · model_evaluation_mlflow.py Model evaluation · app.py Flask routes · prediction.py Prediction pipeline
Components 24
Web application
- Flask routes
app.py - Web page
templates/index.html
Inference
- Prediction pipeline
src/cnnClassifier/pipeline/prediction.py - Trained model
artifacts/training/model.h5 - Fallback model
model/model.h5 - Class label
Training lifecycle
- Training entry point
main.py - Data ingestion stage
src/cnnClassifier/pipeline/stage_01_data_ingestion.py - Download and extract
src/cnnClassifier/components/data_ingestion.py - Extracted CT scans
artifacts/data_ingestion/Chest-CT-Scan-data - Base model stage
src/cnnClassifier/pipeline/stage_02_prepare_base_model.py - Base model preparation
src/cnnClassifier/components/prepare_base_model.py - Prepared base model
artifacts/prepare_base_model/base_model_updated.h5 - Training stage
src/cnnClassifier/pipeline/stage_03_model_trainer.py - Model trainer
src/cnnClassifier/components/model_trainer.py - Evaluation stage
src/cnnClassifier/pipeline/stage_04_model_evaluation.py - Model evaluation
src/cnnClassifier/components/model_evaluation_mlflow.py - Evaluation scores
scores.json
Configuration and tracking
- Configuration manager
src/cnnClassifier/config/configuration.py - YAML configuration
config/config.yaml - Model parameters
params.yaml - MLflow tracking
Other components
- User
- Dataset source
Connections 28
- User → Flask routes: submits scan
- Flask routes → Web page: renders
- Flask routes → Prediction pipeline: calls
- Prediction pipeline → Trained model: loads first
- Prediction pipeline → Fallback model: loads if missing
- Prediction pipeline → Class label: returns class
- User → Flask routes: requests training
- Flask routes → Training entry point: runs
- Training entry point → Data ingestion stage: calls
- Training entry point → Base model stage: calls
- Training entry point → Training stage: calls
- Training entry point → Evaluation stage: calls
- Data ingestion stage → Configuration manager: gets settings
- Data ingestion stage → Download and extract: calls
- Download and extract → Dataset source: downloads from
- Download and extract → Extracted CT scans: extracts to
- Base model stage → Base model preparation
- Training stage → Model trainer
- Model trainer → Extracted CT scans: reads scans
- Model trainer → Prepared base model: loads
- Model trainer → Trained model: saves
- Evaluation stage → Model evaluation
- Model evaluation → Trained model: loads
- Model evaluation → Extracted CT scans: evaluates scans
- Model evaluation → Evaluation scores: writes
- Model evaluation → MLflow tracking: logs run
- Configuration manager → YAML configuration: reads
- Configuration manager → Model parameters: reads