🫁 U-Net β€” COVID-19 Lung CT Semantic Segmentation

U-Net based semantic segmentation of COVID-19 infected regions in lung CT scans.

⚠️ For research and educational purposes only β€” not a medical device.


πŸ“Œ Model Summary

Property Details
πŸ—οΈ Architecture U-Net
🎯 Task Semantic Segmentation
πŸ–ΌοΈ Input Lung CT scan slices (grayscale)
🎭 Output Binary mask β€” infected vs. healthy tissue
πŸ“ Input size 256 Γ— 256 px
βš™οΈ Framework PyTorch
πŸ“œ License MIT

🧠 What This Model Does

This U-Net model segments COVID-19 infected regions in lung CT scan slices, producing a binary mask that highlights infected tissue in red overlay.

It was developed as part of a deep learning research project exploring medical image analysis β€” combining classical encoder-decoder architecture with modern training techniques for robust segmentation performance.


πŸ“ˆ Performance

Metric Score
Dice Coefficient > 0.85
Task Binary segmentation (infected / healthy)

πŸš€ How to Use

import torch
from torchvision import transforms
from PIL import Image
import numpy as np

# Load model
model = torch.jit.load("unet_model.pt", map_location="cpu")
model.eval()

# Preprocessing
transform = transforms.Compose([
    transforms.Resize((256, 256)),
    transforms.Grayscale(),
    transforms.ToTensor(),
    transforms.Normalize([0.5], [0.5]),
])

# Inference
image = Image.open("ct_scan_slice.png")
tensor = transform(image).unsqueeze(0)

with torch.no_grad():
    output = model(tensor)
    mask = torch.sigmoid(output).squeeze().numpy()

# Binary mask
binary_mask = (mask > 0.5).astype(np.uint8) * 255

# Percentage of infected area
infected_pct = binary_mask.mean() / 255 * 100
print(f"Infected area: {infected_pct:.1f}%")

πŸ—‚οΈ Training Data

  • Dataset: COVID-19 CT scan dataset (public research datasets)
  • Input format: 256Γ—256 greyscale CT slices
  • Labels: Binary masks β€” infected lung regions vs. healthy tissue

⚠️ Limitations & Disclaimer

  • Not a medical device β€” do not use for clinical diagnosis or treatment decisions
  • Validated on research datasets only β€” not on clinical production data
  • Performance may vary across different CT scanner manufacturers and imaging protocols
  • Always consult qualified medical professionals for clinical interpretation

πŸ”— Related Resources


πŸ‘€ Author

Martin Badrous β€” Computer Vision & Deep Learning Engineer

LinkedIn GitHub HuggingFace

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support