๐Ÿ” How to use this app

You have two ways to query the system:

๐Ÿ–ผ๏ธ Option A โ€” Upload an X-ray image: Drag and drop or click the image upload area on the left to provide a chest X-ray. The app will encode your image and find visually similar studies.

๐Ÿ“ Option B โ€” Describe a finding in English: Type a clinical description in the text box (e.g. "right lower lobe pneumonia", "pneumothorax", "clear lungs"). The app uses CLIP's text encoder so words map to the same vector space as the images.

Then click Find Similar X-rays. The app returns the 3 closest matches, plus up to 2 extra results (5 total) when the scores are tightly clustered โ€” giving you "second opinions" when the model is uncertain.

๐Ÿ“ฅ Your query

๐Ÿ’ก Click an example to try it

๐Ÿ“ค Recommended X-rays

๐Ÿ“‹ Radiology reports for the matches

๐Ÿ”ฌ Under the hood

  • Model: openai/clip-vit-base-patch32 (CLIP ViT-B/32, 512-dim embeddings)
  • Catalog: 2,000 X-rays from MLforHealthcare/mimic-cxr
  • Similarity: Cosine similarity (via dot product of L2-normalized vectors)
  • Adaptive top-K: 3 baseline matches, expands to 5 if score gaps โ‰ค 0.02