Instructions to use Beijuka/maternal-ultrasound-funnel-segmentation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use Beijuka/maternal-ultrasound-funnel-segmentation with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("Beijuka/maternal-ultrasound-funnel-segmentation") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Funnel Region Segmentation Modal for Maternal Ultrasound Image Preprocessing
Overview
This project provides a deep learning segmentation model for detecting the funnel-like region of interest (ROI) in maternal ultrasound images. The model is designed as a preprocessing component for downstream maternal healthcare AI pipelines and ultrasound image analysis workflows.
The main objective is to automatically isolate the clinically relevant ultrasound region while suppressing irrelevant image areas and artifacts. The segmented region can then be used to generate ROI-focused ultrasound images where regions outside the detected funnel area are masked to black.
Model Architecture
The model was trained using the Ultralytics YOLO segmentation framework.
Base Model
- YOLO11n-seg
Task
- Image Segmentation
Framework
- Ultralytics YOLO
Input Resolution
- 640 × 640
Dataset
Dataset Description
The dataset consists of manually annotated maternal ultrasound images with segmentation masks outlining the funnel-shaped ultrasound viewing region.
Total Images
- 161 labeled ultrasound images
Dataset Split
The dataset was randomly shuffled and split into training, validation, and testing sets.
| Split | Percentage | Approximate Images |
|---|---|---|
| Train | 70% | 112 |
| Validation | 15% | 24 |
| Test | 15% | 25 |
Training Configuration
Training Setup
from ultralytics import YOLO
model = YOLO("yolo11n-seg.pt")
results = model.train(
data="data.yaml",
epochs=100,
imgsz=640,
batch=8,
# Conservative medical imaging augmentations
degrees=10,
scale=0.1,
fliplr=0.5,
mosaic=0.0
)
Data Augmentation Strategy
Only conservative augmentations were applied to preserve anatomical and ultrasound image realism.
| Augmentation | Value |
|---|---|
| Rotation | ±10° |
| Scaling | 0.1 |
| Horizontal Flip | 0.5 |
| Mosaic | Disabled |
Mosaic augmentation was disabled to avoid generating unrealistic ultrasound compositions.
Model Performance
Evaluation was performed on the held-out test set.
Segmentation Metrics
| Metric | Score |
|---|---|
| Mask mAP@50 | 0.995 |
| Mask mAP@50-95 | 0.995 |
| Precision | 0.998 |
| Recall | 1.000 |
Detection Metrics
| Metric | Score |
|---|---|
| Box mAP@50 | 0.995 |
| Box mAP@50-95 | 0.995 |
Inference Speed
| Stage | Time per Image |
|---|---|
| Preprocess | 5.4 ms |
| Inference | 19.0 ms |
| Postprocess | 3.5 ms |
Sample Validation Output
Class Images Instances Box(P) R mAP50 mAP50-95 Mask(P) R mAP50 mAP50-95
all 25 25 0.998 1.0 0.995 0.995 0.998 1.0 0.995 0.995
Training Metrics
The repository also includes:
results.csvcontaining epoch-level training metricsresults.pngshowing training and validation performance curves
Example logged metrics include:
| Metric | Description |
|---|---|
| train/box_loss | Bounding box loss |
| train/seg_loss | Segmentation loss |
| metrics/mAP50(M) | Segmentation mAP@50 |
| metrics/mAP50-95(M) | Segmentation mAP@50-95 |
| val/seg_loss | Validation segmentation loss |
Running Inference
Install Dependencies
pip install ultralytics
Load the Model
from ultralytics import YOLO
model = YOLO("best.pt")
Run Prediction
results = model.predict(
source="image.png",
conf=0.25
)
Repository Contents
| File | Description |
|---|---|
best.pt |
Trained segmentation model |
results.csv |
Training metrics log |
results.png |
Training curves |
data.yaml |
Dataset configuration |
README.md |
Project documentation |
Limitations
- The dataset size is relatively small (161 images)
- Performance may vary across ultrasound devices and scanning protocols
Citation
If you use this work, please cite:
@misc{maternal_ultrasound_funnel_segmentation,
title={Funnel Region Segmentation for Maternal Ultrasound Image Preprocessing},
author={Beijuka Bruno},
year={2026}
}
- Downloads last month
- -