Skip to content

fix: add dedicated glaucoma detection endpoint with separate model#58

Open
Siddh2024 wants to merge 3 commits into
Brijeshthummar02:masterfrom
Siddh2024:fix/glaucoma-dedicated-model
Open

fix: add dedicated glaucoma detection endpoint with separate model#58
Siddh2024 wants to merge 3 commits into
Brijeshthummar02:masterfrom
Siddh2024:fix/glaucoma-dedicated-model

Conversation

@Siddh2024

Copy link
Copy Markdown

Fixes #56

Description

Added a fully separate glaucoma detection pathway to prevent the glaucoma endpoint from loading cataract-trained or brain-tumor model weights. The glaucoma model is loaded from its own dedicated file path (glaucoma_model.h5 by default, configurable via GLAUCOMA_MODEL_PATH env var) and never shares weights with any other condition model.

Changes

  • New endpoint: POST /api/predict/glaucoma - accepts fundus images, runs glaucoma-specific preprocessing (CLAHE-enhanced LAB), and returns glaucoma/normal scores
  • New model loading: glaucoma_model global loaded independently of the brain tumor ensemble; endpoint returns 503 if model file is absent
  • New preprocessing: preprocess_fundus_image() with CLAHE and fundus-appropriate normalization
  • Config: GLAUCOMA_MODEL_PATH env var (defaults to glaucoma_model.h5), GLAUCOMA_CONFIDENCE_THRESHOLD config
  • Documentation: Updated .env.example with glaucoma model path docs
  • Stats endpoint: Reports glaucoma model availability
  • Startup logs: Shows glaucoma model status on boot

Why this fixes #56

The original issue stated the glaucoma endpoint loaded catract_model.pth - the same weights used for cataract predictions. This PR ensures the glaucoma endpoint uses a dedicated model loaded from its own file path, making predictions meaningful and condition-specific.

@Brijeshthummar02

Copy link
Copy Markdown
Owner

@Siddh2024 go through the weights available in discussion page and show me logs after tests of this addition of glaucoma model on scans.

@Brijeshthummar02

Copy link
Copy Markdown
Owner

it's confusing to me why we adding it fully separate model even we can add this into existing model in combination of resnet-50. what's POV behind separate work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Glaucoma prediction endpoint loads cataract-trained model weights

2 participants