CrackEvo · UNet-ResNet34 crack segmentation (protocol A baseline)
Single-frame crack segmentation for laboratory fracture images: concrete and cement-mortar cubes under uniaxial compression, coal / sandstone Brazilian discs under SHPB impact. Trained on the laboratory tests of the CrackEvo team plus public crack datasets (CFD, CrackTree, DeepCrack, 40k), which are used for training only.
| file | format | input | output |
|---|---|---|---|
crackevo_unet_r34_A.onnx | ONNX opset 17, CPU-friendly | image float32 [N,3,512,512], ImageNet-normalised RGB | logit [N,1,512,512]; crack where sigmoid(logit) > 0.3 |
crackevo_unet_r34_A.pt | PyTorch state_dict for segmentation_models_pytorch.Unet("resnet34", classes=1) | same | same |
Large images are processed with 512-px sliding windows (stride 384, logits averaged). About 45 ms per tile on a desktop CPU with ONNX Runtime.
Run at the original resolution. Downscaling before inference loses thin cracks: on the mortar test sequences the boundary-tolerant F1 drops from 0.747 (original 1920 px) to 0.643 when the longest side is reduced to 1024 px. A probability threshold of 0.3 was best on the validation split; results change little between 0.1 and 0.9.
Expected accuracy (5-fold cross-validation by test specimen)
The same recipe was trained five times, each time holding out a fifth of the 45 labelled test sequences (832 frames); frames of one specimen are never split between training and test.
| metric | mean ± s.d. over folds |
|---|---|
| pixel IoU | 0.503 ± 0.078 |
| pixel F1 | 0.666 ± 0.069 |
| boundary-tolerant F1 (2 px) | 0.826 ± 0.022 |
| clDice | 0.699 ± 0.022 |
| sequence-mean IoU | 0.546 ± 0.045 |
| test family | pixel IoU | tolerant F1 |
|---|---|---|
| concrete, uniaxial compression | 0.641 | 0.882 |
| cement mortar, uniaxial compression (cracks ~1.7 px wide) | 0.438 | 0.728 |
| coal and sandstone discs, SHPB | 0.562 | 0.863 |
Exact-pixel IoU is limited by hand-drawn strokes: in the mortar family a fifth of the labelled pixels lie 1–4 px beside the visible crack. For crack evolution the model is much closer to the labels than pixel IoU suggests: on held-out tests, the predicted crack-area curves follow the hand-labelled curves with a median rank correlation of 0.97–1.00 per family.
The released file is the single-split model (protocol A: held-out test IoU 0.453, tolerant F1 0.834, clDice 0.690). Cross-material generalisation (unseen sandstone) drops to IoU 0.429; cross loading-rate generalisation is unaffected (0.456).
Usage
import numpy as np, onnxruntime as ort, cv2
sess = ort.InferenceSession("crackevo_unet_r34_A.onnx", providers=["CPUExecutionProvider"])
img = cv2.cvtColor(cv2.imread("frame.jpg"), cv2.COLOR_BGR2RGB)[:512, :512] # tile
x = (img.astype(np.float32) / 255 - [0.485, 0.456, 0.406]) / [0.229, 0.224, 0.225]
logit = sess.run(None, {"image": x.transpose(2, 0, 1)[None].astype(np.float32)})[0]
mask = 1 / (1 + np.exp(-logit[0, 0])) > 0.3
In the browser: https://dihao-crackevo.static.hf.space runs this model with ONNX Runtime Web for single images and for sequences (new-crack curves after subtracting the initial state, key frames, and the stress level of each key frame for force- or stress-controlled tests).
Research model; no guarantee for field inspection use. Part of the CrackEvo project.