TCR-Net (TrackCrackRefineNet) is the YOLO11s segmentation model described in the manuscript Multi-Stage GAN-Based Synthetic Data Augmentation and Attention-Guided Feature Refinement for Track Slab Crack Segmentation under Data Scarcity and Pixel Imbalance. This repository releases the model implementation and configuration files for its three enhancement components. It is based on the official Ultralytics v8.3.9 source, the version used by the original experiments. This is an independent research project, not an official Ultralytics release.
| Component | Location | Purpose |
|---|---|---|
DWR-FR (C3k2_DWR) |
ultralytics/nn/modules/tcr.py |
Multi-scale residual feature refinement in the backbone |
| CPCA | ultralytics/nn/modules/tcr.py |
Channel-prior attention in the neck |
LQE (Segment_LQE) |
ultralytics/nn/modules/tcr.py |
Localization-quality adjustment in the segmentation head |
The complete paper model is my_project/yaml/tcr-net.yaml. Configurations for the baseline and the component ablations are in my_project/yaml/ablations. The paper's CA, CBAM, SE, and EMA attention comparisons are in my_project/yaml/attention. The original experiment directory also contains exploratory LSCD variants; they are outside the three-component TCR-Net evaluated as the final model in the manuscript and are not part of this release.
The archived DWR-FR + CPCA checkpoint uses C3k2_DWR at both P4 and P5. Its public ablation YAML restores that P4 layer, which had changed to plain C3k2 in a later copy of the experiment YAML.
| Paper configuration | YAML |
|---|---|
| YOLO11s baseline | ablations/baseline.yaml |
| DWR-FR | ablations/dwr.yaml |
| CPCA | ablations/cpca.yaml |
| LQE | ablations/lqe.yaml |
| DWR-FR + CPCA | ablations/dwr-cpca.yaml |
| DWR-FR + CPCA + LQE | tcr-net.yaml |
Install a PyTorch build suitable for your CPU or CUDA environment, then install this repository in editable mode:
git clone https://github.com/cjdfree/TCR-Net.git
cd TCR-Net
pip install -e .Use your own Ultralytics segmentation dataset and pass its local data YAML. Each model YAML sets nc: 1 for the single crack class. The dataset YAML passed through data= takes precedence if your dataset has a different class count.
yolo segment train model=my_project/yaml/tcr-net.yaml data=/path/to/your/data.yaml imgsz=1024 epochs=1200 batch=8 optimizer=AdamW pretrained=False amp=False seed=0 deterministic=True patience=0 workers=8 device=0To train an ablation, replace model= with the matching file in my_project/yaml/ablations/. To validate your own checkpoint and data:
yolo segment val model=/path/to/your/best.pt data=/path/to/your/data.yaml imgsz=1024 device=0The command above records the main settings from the archived full-model run. Unspecified settings follow Ultralytics v8.3.9 defaults; results also depend on the dataset, training environment, and software versions. This repository does not include a trained checkpoint or claim that a fresh run will reproduce the manuscript's metrics without the original data.
The track slab crack images, labels, and GAN-generated dataset used in the manuscript are not publicly released because of data-use and redistribution permission restrictions. No images, annotations, private paths, or model checkpoints are bundled in this repository. The public release covers the TCR-Net segmentation model and the listed comparison configurations; it does not include the GAN augmentation pipeline.
This repository retains Ultralytics' AGPL-3.0 license. The DWR-FR, CPCA, and LQE implementations were extracted and adapted from the authors' experiment code. The manuscript cites the originating research on DWRSeg, CPCA, and Generalized Focal Loss V2. Please acknowledge both the associated manuscript and Ultralytics when using this code.