Defect diagnosis, degradation prediction, and maintenance prioritization for metro-track imagery
English · 中文
CaDPR connects image diagnosis with downstream degradation prediction and maintenance ranking. The public implementation works with precomputed visual features and includes runnable synthetic examples, model definitions, training and analysis tools, and two task-head checkpoints.
The workflow has three parts:
- Defect diagnosis (T1) classifies ten track-defect categories and supplies the corrugation gate and a fixed 9D context vector.
- Degradation prediction (T2) combines DINOv2, ConvNeXt and SigLIP features with context to predict pad extrusion and clip degradation.
- Maintenance prioritization (T3) combines predicted probability, predictive variability and attributable-fraction (AF) branch weights to produce a ranked inspection queue.
Python 3.10 or 3.11 is recommended.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtOn Windows, activate the environment with .venv\Scripts\activate.
Run inference with the bundled checkpoint:
python scripts/run_demo.pyRun the complete synthetic T1→T2→T3 example:
python scripts/run_pipeline.py| Directory | Purpose |
|---|---|
models/ |
T1 classifier, T2 task heads and checkpoint loader |
cadpr/ |
Shared schemas, split logic and metric utilities |
configs/ |
Configuration reference for model dimensions and experiment defaults |
train/ |
T1 and T2 training implementation |
analysis/ |
Calibration, uncertainty aggregation, T3 ranking and deployment analysis |
scripts/ |
User-facing training, testing and demo commands |
test/ |
Unit, protocol and end-to-end tests |
demo_data/ |
Fully synthetic inputs for examples and tests |
data_analysis/ |
Directional defect-transition analysis and aggregate tables |
weights/ |
Synthetic and representative task-head checkpoints |
assets/diagrams/ |
Editable Draw.io sources and bilingual SVG exports |
Each top-level directory has a short English README.md and Chinese README_CN.md.
# Smoke training
python scripts/train.py --task t1 --epochs 4
python scripts/train.py --task t2 --model all3_cadpr --epochs 1
# Task-level evaluation
python scripts/test.py --task t2 --model all3_cadpr
python scripts/test.py --task t3 --model all3_cadpr
# Regression tests
python -B test/run_tests.pyFor repeated experiments from a compatible feature cache, use scripts/train_final.py. Use --help on any command to inspect its inputs and options.
demo_data/contains synthetic feature arrays and temporal pairs with the same interfaces used by the code.weights/cadpr_synthetic_demo.ptsupports the public demo.weights/cadpr_demo_seed42_fold0.ptis a representative trained T2 task head.data_analysis/contains the directional transition tables and the script used to generate them.
Released under the MIT License.