Instructions to use nmariotto/scratch-assay-segmentation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use nmariotto/scratch-assay-segmentation with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("nmariotto/scratch-assay-segmentation", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Scratch-assay wound segmentation β YOLO11-seg
Instance-segmentation weights for the cell-free gap in brightfield scratch (wound-healing)
assay images. M_v3.pt is the current model and the one the companion web interface serves.
These weights accompany the manuscript "Deep Learning Instance Segmentation for Quantitative Analysis of Cell Migration in Wound Healing Assays" (Cytometry Part A, under revision).
Files
| File | Version | Status |
|---|---|---|
M_v3.pt |
v3.0.0 | current: trained on the well-level partition; evaluated below |
M.pt, S.pt |
v2.0.0 | superseded, kept for the record |
Why v2.0.0 was superseded. In v2.0.0 the SKOV-3 images were partitioned by acquisition field, and fields of the same well could fall in different partitions. The field labels were also wrong for most SKOV-3 images: they had been numbered from the first image of each block present in the dataset, so a missing image shifted every label after it. The labels were rederived from the acquisition order of the laboratory's original files, the dataset was partitioned at the level of the physical well, and every configuration was retrained. The weights trained on the original image-level partition stay in the earlier deposit (10.5281/zenodo.20298130), which is marked as superseded and should not be cited.
M_v3.pt
| Architecture | YOLO11m-seg, 22.4 M parameters, 45.2 MB |
| Training seed | 42 (one of five; the others are in the data archive) |
| Default confidence | 0.35, chosen on the validation images as the threshold with the smallest mean absolute error in wound area against the annotations |
| Latency | median over 40 test images at confidence 0.35, taken as the median of three runs: 270 ms on a 16-core CPU, 67 ms on an NVIDIA GeForce RTX 4060 Ti |
On the 247 held-out test images (from 25 physical units, none of them present in training):
| at conf 0.35 | at conf 0.80 | |
|---|---|---|
| mAP@50 / mAP@50β95 | 95.9% / 81.7% | (threshold-independent) |
| Instance precision / recall | 86.4% / 94.5% | 98.0% / 81.8% |
| Images with a wound in which one is detected | 99.5% | |
| Images without a wound in which one is detected | 2 of 27 |
Closure-fraction agreement with a supervised manual reference standard, at conf 0.35, over 116 paired observations from all 50 eligible acquisition series (a usable baseline in every series): concordance correlation coefficient 0.869, mean bias β0.009, 95% limits of agreement β0.272 to +0.255. In 2 of the 116 observations the model returned no wound where the reference still measured one (a false complete closure).
Training
| Architecture | YOLO11-seg (Ultralytics 8.4.102) |
| Initialisation | COCO checkpoint |
| Input | 640 Γ 640, letterbox with black padding |
| Schedule | 100 epochs, batch 4, early stopping disabled |
| Augmentation | HSV 0.015/0.7/0.4, translate 0.1, scale 0.5, fliplr 0.5, mosaic (off for the last 10 epochs) |
| Framework | PyTorch 2.6.0, CUDA 12.4 |
Training data: 903 images (213 validation, 247 held-out test) of endothelial cells (EA.hy926)
and SKOV-3 monolayers, brightfield, 5Γ objective, single laboratory, partitioned at the level
of the physical well. One class, wound.
Usage
from ultralytics import YOLO
model = YOLO("M_v3.pt")
r = model.predict("scratch.png", conf=0.35, retina_masks=True)
mask = r[0].masks # polygon and binary mask of the gap
An empty result (r[0].masks is None) means that no wound was detected. It is not evidence of
complete closure, and should be inspected rather than recorded as an area of zero.
What these weights are good for, and where they fail
A single automated measurement can differ from a careful manual one by more than twenty percentage points of closure. These weights measure wound area under conditions comparable to those of the study. They were not validated for comparing treatments: on the held-out data the slope of this model's closure on the reference's, within time point, was 0.76, so a difference between conditions measured with them would be, on average, about a quarter smaller than the manual one.
Known limits:
- Small wounds. Between 2.5% and 5% of the field the mean intersection over union with the annotation is 0.81, against 0.92 above 10%. Measurements taken while the residual gap is below roughly 5% of the field are the least reliable part of a series.
- A stricter threshold misses wounds. At conf 0.80 the model detected a wound in about half of the test images whose wound occupies 2.5β5% of the field, and missed some large baseline wounds as well; an undetected wound reads as a closed one.
- Isolated cells. The gap is quantified as the region enclosed by the segmented contour, so cells that detach and migrate individually into an otherwise continuous gap are not subtracted from it.
Acquisition envelope: one inverted microscope, brightfield, 5Γ objective, one institution. No external testing was performed. Robustness to other microscopes, magnifications or contrast modalities is unknown.
Licence
AGPL-3.0. These weights are trained with Ultralytics YOLO11, which is AGPL-3.0, and no commercial licence was obtained; the trained weights are a derivative work and carry the same licence. The image dataset is released separately under CC BY 4.0, and the statistical analysis code under MIT.
Citation
Data and code archive: https://doi.org/10.5281/zenodo.20298129 (concept DOI, always the
latest). M_v3.pt belongs to v3.0.0 of the archive, https://doi.org/10.5281/zenodo.23453791.
Code repository: https://github.com/nykemariotto/scratch-assay-segmentation
Web interface: https://huggingface.co/spaces/nmariotto/Scratch-assay-segmentation
Contact: Allan F. F. Alves β allan.alves@unesp.br β ORCID 0000-0002-0954-9919
- Downloads last month
- 135
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("nmariotto/scratch-assay-segmentation", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True)