Downloads · 30 days
0
Camsouille/CM-UNet
CM-UNet is a machine learning model from Camsouille. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
CM-UNet is a UNet-based model designed for coronary artery segmentation in X-Ray angiography. It leverages self-supervised pretraining on unannotated datasets and transfer learning on limited annotated data, reducing…
Downloads · 30 days
0
Access
Public
Updated Aug 20, 2025
Repo size
249 MB
Likes
0
Public
Click a slice to open those files.
.pth124 MB · 100%
From the Hugging Face model README
CM-UNet is a UNet-based model designed for coronary artery segmentation in X-Ray angiography.
It leverages self-supervised pretraining on unannotated datasets and transfer learning on limited annotated data, reducing the need for large-scale manual annotations.
import torch
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
from UNET.model import UNet
# 1. Load model
model = UNet()
model.load_state_dict(torch.load("unet_weights.pth", map_location="cpu"))
model.eval()
# 2. Load an image (.npy format)
arr = np.load("example.npy") # replace with your image path
image = Image.fromarray(arr).resize((256, 256), resample=Image.BICUBIC)
x = torch.from_numpy(np.asarray(image)).unsqueeze(0).float()
# 3. Run inference
with torch.no_grad():
logits = model(x)
# 4. Postprocess → predicted mask
pred_mask = torch.argmax(logits, dim=1).squeeze(0).numpy()
# 5. Plot input and predicted mask
fig, axs = plt.subplots(1, 2, figsize=(8, 4))
axs[0].imshow(arr, cmap="gray")
axs[0].set_title("Input Image")
axs[0].axis("off")
axs[1].imshow(pred_mask, cmap="gray")
axs[1].set_title("Predicted Mask")
axs[1].axis("off")
plt.show()
If you find this work useful, please consider citing it:
@misc{challier2025cmunetselfsupervisedlearningbasedmodel,
title={CM-UNet: A Self-Supervised Learning-Based Model for Coronary Artery Segmentation in X-Ray Angiography},
author={Camille Challier and Xiaowu Sun and Thabo Mahendiran and Ortal Senouf and Bernard De Bruyne and Denise Auberson and Olivier Müller and Stephane Fournier and Pascal Frossard and Emmanuel Abbé and Dorina Thanou},
year={2025},
eprint={2507.17779},
archivePrefix={arXiv},
primaryClass={q-bio.QM},
url={https://arxiv.org/abs/2507.17779},
}