How minimert989/immunova works
Project Type and Purpose
• This is a full-stack machine-learning platform that bundles multiple ML pipelines (TIL image classification, GNN for drug optimization, survival analysis, multimodal treatment-response fusion) plus data preprocessing and validation, and exposes inference endpoints via a FastAPI backend with a simple static frontend.
File Structure
• Top‐level:
• api.py → FastAPI application
• model.py → shared model utilities
• requirements.txt
• deployment/ → Azure deployment configuration
• frontend/ → Static HTML/CSS/JS user interface
• ML modules (each folder is effectively its own service/component):
• preprocessing/ → WSIProcessor for whole-slide image preprocessing
• til_classification/ → TIL classifier (train.py, model.py, grad_cam.py)
• drug_optimization/ → GNN model and RL optimizer
• survival_analysis/ → Kaplan-Meier and survival transformer
• treatment_response/ → Fusion of imaging + genomics + other modalities
• validation/ → Clinical and external‐dataset validation scripts
• Data landing: /datasets/ (TIL images, graphs, CSVs, multimodal assets)
Extract Insights from the README
• Describes dataset layout per pipeline
• Commands to train each model in its own directory
• Inference example and FastAPI deployment instructions
• Technology stack: Python, PyTorch, Torch-Geometric, Lifelines, FastAPI, Uvicorn, Azure
a. Main Components:
• Data Store (datasets/ on disk or blob storage)
• Preprocessing Service (WSIProcessor)
• Training Services (six distinct pipelines)
• Validation Services (clinical & external loaders + validators)
• Model Registry / Artifact Storage (torch .pth files)
• FastAPI Inference Layer (api.py)
• Frontend UI (index.html + script.js + styles.css)
• Deployment & Infrastructure (Azure config)
• External Clients (browsers, other services)
b. Interactions & Data Flow:
1. Raw data lands in Data Store
2. Preprocessing Service reads images → outputs processed data
3. Each Training Service consumes processed data → writes model artifacts
4. Validation Services read both data & artifacts → produce reports/metrics
5. FastAPI loads latest artifacts at startup or on-demand
6. Frontend or API clients send HTTP requests → FastAPI serves inference
7. Deployment layer packages all components into Azure containers
c. Architectural Patterns & Principles:
• Modular/“micro-pipeline” decomposition: each ML task is self-contained
• Clear separation of concerns: Data → Preprocessing → Training → Validation → Inference → UI
• Thin API layer for inference, with static frontend decoupled from backend
• Infrastructure as code for reproducible deployments (azure_deploy_config.yaml)
d. Key Technologies & Libraries:
• Python + PyTorch (core ML)
• Torch-Geometric (GNN)
• Lifelines (survival analysis)
• FastAPI + Uvicorn (API server)
• Azure (cloud deployment)
• Standard web stack for frontend (HTML/CSS/JS)
Final Recommendations
• Artifact paths: show where .pth or .pt files are stored and loaded
• Don’t overcomplicate: aim for clarity—one flow from data ingestion to end-user inference
• Keep deployment separate: show Azure config and containerization as an outer boundary around backend and frontend
• Review with stakeholders: ensure data compliance/regulatory flows (e.g., clinical validation) are clearly called out