How krishnaharesh/glaucoma-vit works
Glaucoma-ViT is a research screening application combining retinal-image classification and a web interface. The principal workflow is a user uploading a fundus image in Analyze, the backend invoking model inference and returning a classification with visual explanation, and the application storing prediction history for signed-in users. The repository also supports model training, evaluation and comparison. Connections between components are included where excerpts, the source index or README document them; some frontend-to-backend links are documented at the API level rather than shown as direct source calls.
Main entry points: App.jsx Routes and shell · model.py Model definitions · dataset.py Dataset loading · axios.js API client
Components 26
Web application
- Routes and shell
frontend/src/App.jsx - Image analysis
frontend/src/pages/AnalyzePage.jsx - Session context
frontend/src/context/AuthContext.jsx - API client
frontend/src/api/axios.js - Dashboard
frontend/src/pages/DashboardPage.jsx - Scan history
frontend/src/pages/HistoryPage.jsx - Landing page
frontend/src/pages/LandingPage.jsx - Research overview
frontend/src/pages/AboutPage.jsx - Navigation
frontend/src/components/Navbar.jsx
API and persistence
- FastAPI routes
backend/main.py - JWT authentication
backend/auth.py - User and predictions
backend/models.py - Database access
backend/database.py
Image inference
- Single-image predictor
src/predict.py - Image preprocessing
src/preprocessing.py - Visual explanations
src/gradcam.py
Model research
- Model definitions
src/model.py - Multi-scale CNN
src/multiscale_cnn.py - Feature fusion
src/feature_fusion.py - Vision Transformer
src/vit_model.py - Dataset loading
src/dataset.py - Training augmentation
src/augmentation.py - Model configuration
src/config.py - Model training
src/train.py - Evaluation and comparison
src/evaluate.py
Other components
- User
Connections 32
- User → Routes and shell: opens
README.md - Routes and shell → Image analysis: routes to
frontend/src/App.jsx - Routes and shell → Session context: provides session
frontend/src/App.jsx - Routes and shell → Dashboard: routes to
frontend/src/App.jsx - Routes and shell → Scan history: routes to
frontend/src/App.jsx - Routes and shell → Landing page: routes to
frontend/src/App.jsx - Routes and shell → Research overview: routes to
frontend/src/App.jsx - Routes and shell → Navigation: renders
frontend/src/App.jsx - Session context → API client: requests through
frontend/src/context/AuthContext.jsx - Image analysis → API client: requests through
frontend/src/pages/AnalyzePage.jsx - Dashboard → API client: requests through
frontend/src/pages/DashboardPage.jsx - Scan history → API client: requests through
frontend/src/pages/HistoryPage.jsx - API client → FastAPI routes: calls API
README.md - FastAPI routes → JWT authentication: authenticates
backend/main.py - JWT authentication → User and predictions: queries users
backend/auth.py - FastAPI routes → User and predictions: stores predictions
backend/main.py - User and predictions → Database access: uses database base
backend/models.py - FastAPI routes → Single-image predictor: runs inference
backend/main.py - Single-image predictor → Image preprocessing: preprocesses image
src/predict.py - Single-image predictor → Model definitions: classifies image
src/predict.py - Single-image predictor → Visual explanations: uses explanation
src/predict.py - Model definitions → Multi-scale CNN: extracts features
src/model.py - Model definitions → Feature fusion: fuses features
src/model.py - Model definitions → Vision Transformer: classifies fused map
src/model.py - Dataset loading → Image preprocessing: preprocesses samples
src/dataset.py - Dataset loading → Training augmentation: transforms samples
src/dataset.py - Model training → Dataset loading: loads batches
src/train.py - Model training → Model definitions: trains model
src/train.py - Evaluation and comparison → Dataset loading: loads test data
src/evaluate.py - Evaluation and comparison → Model definitions: evaluates models
src/evaluate.py - Dataset loading → Model configuration: uses settings
src/dataset.py - Image preprocessing → Model configuration: uses settings
src/preprocessing.py