python, medical imaging,

Medical Imaging

Pritesh Kamde Pritesh Kamde Follow May 05, 2025 · 1 min read
Medical Imaging
Share this

X-ray Body Part Classifier – Quick Demo using AI

🧩 Problem Statement

In hospitals, thousands of X-ray images are generated daily but many are:

  • Unlabeled or misfiled
  • Mixed in storage without body-part tags

This makes it hard for doctors and AI systems to automatically route or diagnose these images efficiently.


❓ Why Are We Solving This?

Automatically identifying which body part an X-ray image belongs to can:

  • Help organize and sort large medical datasets
  • Serve as a preprocessing step for disease detection models
  • Reduce human effort in data labeling
  • Allow smart routing of images to relevant specialists

Approach

We are building a lightweight AI model that:

  1. Takes any X-ray image as input
  2. Predicts the body part shown (e.g., wrist, shoulder, humerus)
  3. Displays the prediction in a simple UI

Dataset

For this demo, we used a subset of the MURA dataset (Stanford):

  • 7 body part classes: elbow, finger, forearm, hand, humerus, shoulder, wrist
  • 200 images per class to keep training fast

Structure:

data/ └── train/ ├── elbow/ ├── hand/ ├── shoulder/ └── …

Public datasets:


Tech Stack

Component Tool
Deep Learning Framework PyTorch
Model Pretrained ResNet18
Frontend UI Streamlit
Image Processing Pillow, TorchVision
Deployment Local browser via streamlit run

Working

  1. Training a ResNet18 on your labeled X-ray images
  2. Saving the model and class labels
  3. Using Streamlit to create a web app:
    • Upload an X-ray image
    • View predicted body part and confidence scores

Output

  • xray_bodypart_model.pth – the trained model
  • Live web app to classify uploaded X-rays by body part

X-ray Classifier Demo

Join Newsletter
Get the latest news right in your inbox. We never spam!
Pritesh Kamde
Written by Pritesh Kamde Follow
I’m Pritesh Kamde, a Full Stack Software Engineer with a Master’s in Information Systems from the University of Arizona (Eller College) and 3 years of experience building scalable fintech systems at Barclays. My background spans Java, Spring Boot, React, Python, Node.js, and cloud platforms like AWS and GCP. At Barclays, I designed enterprise-grade APIs and real-time dashboards for retail banking and credit systems. I’ve also worked across the MERN stack to consolidate internal tools for workforce planning. With a foundation in both backend engineering and front-end architecture, I enjoy building secure, high-performance systems that solve real business problems. Outside of work, I’ve served as a Graduate Assistant and certified tutor, mentoring students in business and tech courses. I’m passionate about creating software that drives impact—whether through data-driven platforms, seamless user experiences, or automating workflows. Currently open to full-time opportunities where I can contribute to high-growth teams driving innovation in finance, AI, or cloud-native platforms.