How izhanruaif/lung-cancer-subtype-classification works
This is an academic lung-CT subtype-classification decision-support platform, not a diagnostic device. A clinician signs in, manages a patient, uploads a scan, requests a prediction, reviews its subtype probabilities and Grad-CAM visualization, and accesses PDF reports and history. The graph separates the web interface, API/domain handlers, inference pipeline, and persistence. README workflow statements support the broad product stages; source-index references and excerpts support the implementation links. Several route and UI implementations were not excerpted, so their internals are not expanded.
Main entry points: App.tsx Workspace and navigation · main.py FastAPI application · client.ts API client · session.py Database session
Components 25
Web application
- Workspace and navigation
frontend/src/App.tsx - API client
frontend/src/api/client.ts - Sign-in page
frontend/src/pages/LoginPage.tsx - Dashboard
frontend/src/pages/DashboardPage.tsx - Patient directory
frontend/src/pages/PatientsPage.tsx - Scan upload
frontend/src/pages/UploadPage.tsx - Prediction results
frontend/src/pages/PredictionResultPage.tsx - Heatmap viewer
frontend/src/components/GradCamViewer.tsx - Reports page
frontend/src/pages/ReportsPage.tsx
API and domain
- FastAPI application
backend/app/main.py - Authentication
backend/app/api/auth.py - Patient management
backend/app/api/patients.py - Image upload
backend/app/api/images.py - Prediction endpoint
backend/app/api/predictions.py - Report endpoint
backend/app/api/reports.py - Token security
backend/app/core/security.py - API schemas
backend/app/schemas/schemas.py
Inference and explanation
- Inference service
backend/app/services/ai_service.py - CT preprocessing
ml/preprocessing/dicom_loader.py - Attention CNN
ml/models/attention_cnn.py - Grad-CAM engine
ml/explainability/gradcam.py
Persistence and reports
- Database session
backend/app/database/session.py - Patient and prediction records
backend/app/models/models.py - PDF generation
backend/app/services/pdf_service.py
Other components
- Clinician
Connections 38
- Clinician → Workspace and navigation: uses
README.md - Workspace and navigation → Sign-in page: renders
frontend/src/App.tsx - Workspace and navigation → Dashboard: renders
frontend/src/App.tsx - Workspace and navigation → Patient directory: renders
frontend/src/App.tsx - Workspace and navigation → Scan upload: renders
frontend/src/App.tsx - Workspace and navigation → Prediction results: renders
frontend/src/App.tsx - Workspace and navigation → Reports page: renders
frontend/src/App.tsx - Sign-in page → API client: authenticates via
frontend/src/pages/LoginPage.tsx - Patient directory → API client: requests data
frontend/src/pages/PatientsPage.tsx - Scan upload → API client: uploads and predicts
frontend/src/pages/UploadPage.tsx - Prediction results → API client: requests prediction
frontend/src/pages/PredictionResultPage.tsx - Prediction results → Heatmap viewer: renders
frontend/src/pages/PredictionResultPage.tsx - Reports page → API client: loads reports
- Dashboard → API client: loads summary data
- API client → FastAPI application: calls REST API
README.md - FastAPI application → Authentication: registers
backend/app/main.py - FastAPI application → Patient management: registers
backend/app/main.py - FastAPI application → Image upload: registers
backend/app/main.py - FastAPI application → Prediction endpoint: registers
backend/app/main.py - FastAPI application → Report endpoint: registers
backend/app/main.py - FastAPI application → Database session: creates tables with
backend/app/main.py - Authentication → Token security: uses token functions
backend/app/api/auth.py - Authentication → Patient and prediction records: queries user
backend/app/api/auth.py - Authentication → Database session: gets database session
backend/app/api/auth.py - Patient management → Patient and prediction records: uses patient records
backend/app/api/patients.py - Patient management → Database session: gets database session
backend/app/api/patients.py - Image upload → Patient and prediction records: uses image records
backend/app/api/images.py - Image upload → Database session: gets database session
backend/app/api/images.py - Prediction endpoint → Inference service: requests inference
backend/app/api/predictions.py - Prediction endpoint → Patient and prediction records: uses prediction records
backend/app/api/predictions.py - Prediction endpoint → Database session: gets database session
backend/app/api/predictions.py - Report endpoint → PDF generation: generates PDF
backend/app/api/reports.py - Report endpoint → Patient and prediction records: uses report records
backend/app/api/reports.py - Report endpoint → Database session: gets database session
backend/app/api/reports.py - Inference service → CT preprocessing: prepares input
backend/app/services/ai_service.py - Inference service → Attention CNN: runs inference
backend/app/services/ai_service.py - Inference service → Grad-CAM engine: generates heatmap
backend/app/services/ai_service.py - Patient and prediction records → Database session: uses declarative base
backend/app/models/models.py