- Solution Blueprints
- MRI Analysis
MRI Analysis
MRI analysis with a web interface and LLM-generated reports.
Overview

This Solution Blueprint provides an AI-assisted MRI analysis workflow through a web interface:
- Users upload a scan, optionally add patient context, and select the MRI type.
- The MRI is then analyzed using Computer Vision and Machine Learning tools, and a Large Language Model generates a medical report.
- Users can review visualizations and metrics alongside the report, and ask follow-up questions in an interactive chat.
AMD Solution Blueprints are packaged as Helm charts for deployment on a Kubernetes cluster. For development or further exploration, the source code is public and available in the Solution Blueprints GitHub repository.
Architecture


The blueprint provides a React web application for MRI analysis, pairing classical computer vision with a vision language model that reads the scan itself. By default, an AMD Inference Microservice (AIM) is deployed for draft medical report generation and follow-up Q&A.
| Component | Role |
|---|---|
| React UI | Web interface for uploading scans, running analysis, and reviewing results |
| FastAPI service | Serves the UI, runs the analysis on a worker thread, and talks to the AIM LLM |
| MRI analysis pipeline | Image loading, preprocessing, segmentation, anomaly detection |
| AIM vision LLM | Reads the scan and drafts the report, plus follow-up Q&A (defaults: Gemma 4 31B on AMD Instinct; Qwen 3 VL 8B on AMD Radeon) |
Key Features
- Multi-format support: DICOM (
.dcm), NIfTI (.nii,.nii.gz), and standard image formats (.png,.jpg,.jpeg) - Robust loading and normalization: DICOM decoding (pydicom), NIfTI decoding (nibabel), image fallback (OpenCV); intensity normalization to 8-bit for consistent downstream processing
- Image preprocessing: Contrast enhancement using CLAHE and noise reduction using Gaussian filtering
- Tissue segmentation: K-means clustering (scikit-learn) with per-cluster pixel distribution statistics
- Anomaly detection: Statistical thresholding over tissue pixels (mean ± 2.5×std, so both unusually bright and unusually dark regions) with connected-component region counting (SciPy); detected regions are boxed on the scan in the UI
- Quantitative measurements: Image dimensions, intensity statistics, signal-to-noise ratio, and optional physical size estimates when pixel spacing metadata is available
- Vision-LLM reporting: The scan is sent to the model alongside the measurements, so the report describes what is visible and where; follow-up Q&A can reference the image too
- Flexible LLM configuration: Deploy the bundled AIM or connect to an existing service