feat: Add body part selector to scope AI analysis by medical specialty#30
Open
ArnavPundir22 wants to merge 6 commits into
Open
feat: Add body part selector to scope AI analysis by medical specialty#30ArnavPundir22 wants to merge 6 commits into
ArnavPundir22 wants to merge 6 commits into
Conversation
Agent-Logs-Url: https://github.com/ArnavPundir22/Disease-Identifier/sessions/690996a2-043a-4e7c-add1-26605ecfa428 Co-authored-by: ArnavPundir22 <179984094+ArnavPundir22@users.noreply.github.com>
…nsistency Agent-Logs-Url: https://github.com/ArnavPundir22/Disease-Identifier/sessions/690996a2-043a-4e7c-add1-26605ecfa428 Co-authored-by: ArnavPundir22 <179984094+ArnavPundir22@users.noreply.github.com>
…rompt > Adds a body part selector (dropdown) to the UI that injects a targeted medical specialty context into the Gemini system prompt, improving diagnostic specificity. Changes in app.py: - Added BODY_PART_SPECIALTY dict mapping 7 body parts to medical specialties (Eye → Ophthalmology, Chest → Cardiology/Radiology, Skin → Dermatology, Head → Neurology, Throat → ENT, Limbs → Orthopedics, Abdomen → Gastroenterology); General maps to None - Replaced static system_prompt string with build_system_prompt(body_part) function that appends a specialty-scoped context block for non-General body parts - Added st.selectbox before the file uploader with an inline st.info banner showing the resolved specialty - Persisted body_part to metadata.json and displayed it alongside the specialty label in both live and historical analysis results
Added a flow diagram for user image upload process.
Owner
|
Please resolve conflicts |
Owner
|
Please resolve conflicts @ArnavPundir22 |
Contributor
Author
|
Hey @fizaayesha, Please check, I am done with resolving conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NSoC'26
Closes Issue #27
Add Body Part Selector to Scope AI Analysis by Medical Specialty
Summary
Adds a body part selector dropdown to the Disease Identifier UI. When a user picks a body part, the Gemini system prompt is automatically enriched with the relevant medical specialty context — making AI diagnoses more targeted and clinically accurate.
What's Changed
app.pyAdded
BODY_PART_SPECIALTYmapping for 7 body regions:Replaced static system prompt with
build_system_prompt(body_part)— injects specialty context for non-General selections.Added
st.selectboxbefore the file uploader for body part selection.Added
st.infobanner showing the resolved specialty (e.g. "🔬 Analysis will be scoped to Dermatology").Persisted
body_partinmetadata.jsonso history entries retain specialty context.Displayed body part + specialty labels in both live results and historical analysis cards.
🔍 Why
Without body part context, the AI applies a generic medical lens to every image. By injecting the relevant specialty into the system prompt, the model focuses on conditions, terminology, and patterns specific to that region — producing more clinically relevant results.
🧪 How to Test
streamlit run app.py