docs/en/datasets/segment/crack-seg.md
<a href="https://colab.research.google.com/github/ultralytics/notebooks/blob/main/notebooks/how-to-train-ultralytics-yolo-on-crack-segmentation-dataset.ipynb" target="_blank"></a>
The Ultralytics Crack Segmentation Dataset provides 4,029 annotated images of cracks on roads and walls for training instance segmentation models on a single crack class. Captured across diverse pavement and structural scenarios, it pairs directly with Ultralytics YOLO for use cases ranging from transportation safety and self-driving car perception to infrastructure maintenance and structural computer vision inspection.
<strong>Watch:</strong> How to Train a Crack Segmentation Model using Ultralytics YOLO26 | AI in Construction 🎉
</p>The Crack Segmentation Dataset splits its 4,029 images as follows:
crack class covering every annotated crack on roads and walls.Crack segmentation supports infrastructure maintenance by identifying and assessing structural damage in buildings, bridges, and roads. It also enhances road safety by letting automated systems detect pavement cracks for timely repairs.
In industrial settings, crack detection with models like Ultralytics YOLO26 helps verify building integrity in construction, prevents costly downtime in manufacturing, and makes road inspections safer. Automatically classifying cracks lets maintenance teams prioritize the most urgent repairs.
The complete Crack Segmentation Dataset can also be browsed and managed on Ultralytics Platform.
A YAML file defines the dataset configuration. It includes details about the dataset's paths, classes, and other relevant information. For the Crack Segmentation dataset, the crack-seg.yaml file is maintained at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/crack-seg.yaml.
!!! example "ultralytics/cfg/datasets/crack-seg.yaml"
```yaml
--8<-- "ultralytics/cfg/datasets/crack-seg.yaml"
```
To train the Ultralytics YOLO26n-seg model on the Crack Segmentation dataset for 100 epochs with an image size of 640, use the following Python or CLI snippets. Refer to the model Training documentation page for a comprehensive list of available arguments and configurations like hyperparameter tuning.
!!! example "Train Example"
=== "Python"
```python
from ultralytics import YOLO
# Load a model
# Using a pretrained model like yolo26n-seg.pt is recommended for faster convergence
model = YOLO("yolo26n-seg.pt")
# Train the model on the Crack Segmentation dataset
# Ensure 'crack-seg.yaml' is accessible or provide the full path
results = model.train(data="crack-seg.yaml", epochs=100, imgsz=640)
# After training, the model can be used for prediction or exported
# results = model.predict(source='path/to/your/images')
```
=== "CLI"
```bash
# Start training from a pretrained *.pt model using the Command Line Interface
# Ensure the dataset YAML file 'crack-seg.yaml' is correctly configured and accessible
yolo segment train data=crack-seg.yaml model=yolo26n-seg.pt epochs=100 imgsz=640
```
Below is an example from the Crack Segmentation Dataset with its instance segmentation masks overlaid, outlining identified cracks on road and wall surfaces:
The dataset spans varied locations, surfaces, and lighting conditions, so models trained on it see the range of real-world scenes they need to generalize across. Data augmentation can broaden that variety further — see our instance segmentation and tracking guide for related workflows.
If you use the Crack Segmentation dataset in your research or development work, please cite the source appropriately:
!!! quote ""
=== "BibTeX"
```bibtex
@misc{ crack-bphdr_dataset,
title = { crack Dataset },
type = { Open Source Dataset },
author = { University },
url = { https://universe.roboflow.com/university-bswxt/crack-bphdr },
year = { 2022 },
month = { dec },
note = { visited on 2024-01-23 },
}
```
We acknowledge the team at Roboflow for making the Crack Segmentation dataset available, providing a valuable resource for the computer vision community, particularly for projects related to road safety and infrastructure assessment. For more datasets, visit the Ultralytics Datasets collection.
The Crack Segmentation Dataset is a collection of 4,029 annotated images of cracks on roads and walls for training and evaluating instance segmentation models on a single crack class. It's built for transportation-safety and infrastructure applications like structural inspection and pavement assessment, and is used directly with Ultralytics YOLO26 via the crack-seg.yaml configuration file.
The dataset totals 4,029 images — 3,717 for training, 200 for validation, and 112 for testing — all annotated for a single crack class. The full archive downloads automatically as a ~91.6 MB .zip on first use.
Load a pretrained segmentation model (e.g., yolo26n-seg.pt) and train it with the crack-seg.yaml configuration using the Python or CLI snippets in the Usage section above. See the Training guide for the full list of available arguments.
Its diverse images of cracks across roads and walls cover many real-world scenarios, improving the robustness of models trained for crack detection. Accurate segmentation supports road safety and infrastructure-assessment systems that must identify potential hazards reliably — see the Applications section above and our model training tips for best practices.
The crack-seg.yaml file, which defines the dataset paths and the single crack class, is located in the Ultralytics GitHub repository: crack-seg.yaml.