Downloads · 30 days
0
meriemkhiari/UNet-BrainMRI-Segmentation
UNet-BrainMRI-Segmentation is a machine learning model from meriemkhiari. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
U-Net with ResNet encoder for pixel-level brain tumor segmentation from MRI images. Developed as part of the NeuroAI multi-agent medical imaging platform (ESPRIT, 2024). This repository contains only the segmentation…
Downloads · 30 days
0
Access
Public
Updated May 30, 2026
Repo size
133 B
Likes
0
Public
Click a slice to open those files.
.py7.1 KB · 68%
From the Hugging Face model README
U-Net with ResNet encoder for pixel-level brain tumor segmentation from MRI images. Developed as part of the NeuroAI multi-agent medical imaging platform (ESPRIT, 2024). This repository contains only the segmentation and XAI components authored by Meriam Khiari. Full system at https://github.com/meriemkhiari/NeuroAI.git.
Research and educational purposes only. Not validated for clinical use.
Dataset: not publicly documented; see project README.
Metrics: not available in current codebase.
import torch
from segmentation_model import BrainTumorSegmentationModel
from image_processing import load_and_preprocess_image
from PIL import Image
# Load model
model = BrainTumorSegmentationModel("best_model.pth", device="cpu")
# Load and preprocess image
img_tensor, original_img = load_and_preprocess_image("path/to/image.jpg", device="cpu")
# Predict
prob_mask = model.predict(img_tensor)
binary_mask = (prob_mask.detach().cpu().numpy().squeeze() >= 0.5).astype(np.uint8)
The XAI module uses Grad-CAM to generate heatmaps highlighting the regions the model focused on when making a prediction. In the full NeuroAI system, LLaMA-3 is then used post-segmentation to generate natural-language explanations of why a region is flagged as abnormal. This repository does not include LLaMA weights or API keys; it only describes the interface.
Meriam Khiari - segmentation and XAI modules. Full project team: see https://github.com/celiamarrakchi/NeuroAI