| title | OIRseg |
|---|---|
| emoji | 🔬 |
| colorFrom | yellow |
| colorTo | red |
| sdk | streamlit |
| sdk_version | 1.55.0 |
| app_file | app.py |
| pinned | false |
Retinal image segmentation tool for Oxygen-Induced Retinopathy (OIR) research. Segments retinal flatmount images into three zones: neovascular (NV), vaso-obliterated (VO), and retinal tissue, with quantitative area measurements.
- Multi-class segmentation — U-Net with EfficientNet-B4 encoder, trained on retinal flatmounts
- Single & batch processing — upload one image or a batch for bulk analysis
- Test-time augmentation (TTA) — optional multi-transform inference for improved accuracy
- Per-class threshold tuning — adjustable confidence thresholds for NV, VO, and retina masks
- NV post-processing — vessel suppression and VO boundary zone filtering to reduce false positives
- Downloadable results — masks, overlays, and CSV metrics as a ZIP
- PubMed RAG (optional) — AI-powered interpretation of results using retrieved PubMed literature and Claude
.
├── app.py # Streamlit web interface
├── src/
│ ├── config.py # Model & training hyperparameters
│ ├── model.py # U-Net architecture (segmentation-models-pytorch)
│ └── predict.py # Inference & post-processing pipeline
├── rag.py # PubMed RAG: retrieve abstracts + Claude Q&A
├── ingest.py # Fetch & embed PubMed abstracts into ChromaDB
├── config.py # RAG configuration (API keys, search params)
├── theme.py # Streamlit UI theme
├── requirements.txt # Pinned Python dependencies
└── .env.example # Environment variable template
- Python 3.11
- Model checkpoint (
best_model.pth) — downloaded automatically from Hugging Face on first run
python -m venv venv
# Windows
.\venv\Scripts\Activate.ps1
# Linux/macOS
source venv/bin/activate
pip install -r requirements.txtstreamlit run app.pyThe app opens at http://localhost:8501. On first launch, the model checkpoint (~227 MB) is downloaded automatically from Hugging Face Hub.
Enables AI-powered interpretation of segmentation results using PubMed literature.
-
Copy
.env.exampleto.envand add your API keys:ANTHROPIC_API_KEY=sk-ant-... NCBI_EMAIL=your@email.com -
Ingest PubMed abstracts:
python ingest.py
-
Restart the app — the RAG tab will become available.
| Component | Value |
|---|---|
| Architecture | U-Net |
| Encoder | EfficientNet-B4 (ImageNet pretrained) |
| Decoder attention | scSE |
| Input size | 768 x 768 |
| Output classes | 3 (NV, VO, Retina) |
| Loss | BCE + Focal Tversky (class-weighted) |
This project was developed for academic research purposes.