Models β U-Net, SegFormer and SAM 2 for Automated Fracture Detection, trained on FraXet
https://doi.org/10.5281/zenodo.17866853
Model Details
License: MIT Dataset: FraXet (zenodo) Repository: github.com/ayoubft/fractex2D.pt Demo: huggingface.co/spaces/ayoubft/fractex2D_tuto Paper: doi.org/10.5194/egusphere-2026-1097 (preprint)
These models perform pixel-wise fracture segmentation on outcrop imagery. They serve as baseline architectures in the FraXet benchmarking framework, which compares classical filters, CNNs and transformer models for geological fracture mapping.
Two input modalities are published, and this is a deliberate axis of the benchmark:
rgbdem/β 4-channel models taking paired RGB + DEM patches.rgb/β 3-channel models taking RGB only, for settings where no DEM is available.
Models
| File | Arch. | Modality | In | Backbone | Params | Tile | Preprocessing |
|---|---|---|---|---|---|---|---|
rgbdem/unet-rgbdem.onnx |
U-Net [1] | RGB + DEM | 4 | from scratch, init_features=64 |
31.03 M | 256Γ256 fixed | external |
rgbdem/segformer-rgbdem.onnx |
SegFormer [2] | RGB + DEM | 4 | smp decoder on ResNet-34 (ImageNet) |
21.87 M | 256Γ256 fixed | external |
rgb/unet-rgb.onnx |
U-Net [1] | RGB | 3 | from scratch, init_features=64 |
31.03 M | any multiple of 16 | in-graph |
rgb/sam2-rgb.onnx |
SAM 2 [3] | RGB | 3 | SAM 2.0 hiera-tiny, encoder frozen | 33.12 M total | 512Γ512 fixed | in-graph |
Every model emits a single-channel sigmoid map: per-pixel fracture probability in [0, 1].
Each .onnx file carries its own input contract as embedded metadata, so the contract
travels with the file however you obtain it:
import onnx
md = {p.key: p.value for p in onnx.load("rgb/unet-rgb.onnx").metadata_props}
# {'model.name': 'unet', 'input.channels': '3', 'input.range': '0-255',
# 'preprocessing.in_graph': 'true', 'preprocessing.normalize': 'dataset',
# 'citation.doi': '10.5194/egusphere-2026-1097', ...}
All four models expose the same 15 keys, including citation.doi, so a file separated
from this model card still says what to cite. There are no separate metadata files.
SAM 2 note. This is not SAM 2 used off the shelf. The hiera-tiny image encoder is frozen; only the mask decoder was fine-tuned on FraXet. The graph is prompt-free: it takes an image and returns a mask, with no prompt encoder in the export. The 33.12 M figure is the total exported parameter count, most of which is the frozen encoder.
Input contracts
The two modality directories do not share a preprocessing path. Getting this wrong produces plausible-looking but wrong masks rather than an error.
rgbdem/ (4-channel) |
rgb/ (3-channel) |
|
|---|---|---|
| Feed as | float32 scaled to [0, 1] |
float32 holding raw 0β255 values |
| Normalization | none applied; DEM band normalized separately | baked into the graph |
| Exported with | torch 2.7.1, TorchScript exporter | torch 2.13, dynamo exporter |
| Opset | 14β15 | 17β18 |
The rgb/ models carry their own mean/std as graph constants, so you must not
normalize before calling them β just hand over raw pixel values as float32.
The two rgb/ models use different constants, deliberately:
unet-rgbuses FraXet dataset statistics (mean0.6064, 0.5927, 0.5793, std0.1688, 0.1622, 0.1621), because it is trained from scratch on FraXet.sam2-rgbuses ImageNet statistics (mean0.485, 0.456, 0.406, std0.229, 0.224, 0.225), because its frozen encoder was pretrained under that distribution and should keep seeing it.
Since both sets are inside their graphs, this asymmetry costs the caller nothing β but it is a real difference between the two arms and is stated here rather than left to be discovered.
Usage
import numpy as np, onnxruntime as ort
from huggingface_hub import hf_hub_download
path = hf_hub_download("ayoubft/fraXteX", "rgb/unet-rgb.onnx")
sess = ort.InferenceSession(path)
# raw 0-255 RGB, NCHW, float32 β no normalization: it is in the graph
x = rgb_uint8.transpose(2, 0, 1)[None].astype(np.float32)
prob = sess.run(None, {sess.get_inputs()[0].name: x})[0] # (1, 1, H, W) in [0,1]
For rgbdem/, stack the DEM as a 4th band, scale to [0, 1], and tile into
non-overlapping 256Γ256 patches.
Uses
Direct use: predict fracture probability maps or binary masks for UAV or field imagery. Downstream use: baseline models, or assistive pre-annotation tools for geoscience datasets.
Bias, Risks, and Limitations
Predictions depend on annotation quality, illumination and lithology. Thin or poorly illuminated fractures may be missed; shadows and texture can yield false positives. Treat predictions as assistive probability maps and validate with expert interpretation.
The rgbdem/ and rgb/ arms were exported at different times with different toolchains,
so a difference in their outputs is not purely architectural.
Repository history
This repo is ONNX-only. It previously shipped PyTorch checkpoints at pytorch/unet.pt
and pytorch/segformer.pt, alongside an onnx/ + pytorch/ layout.
Those files remain available at the v1-pytorch tag:
hf_hub_download("ayoubft/fraXteX", "pytorch/unet.pt", revision="v1-pytorch")
Path changes at that boundary: onnx/unet.onnx β rgbdem/unet-rgbdem.onnx,
onnx/segformer_.onnx β rgbdem/segformer-rgbdem.onnx.
Citation
If you use these models, please cite the paper (its DOI is also embedded in every
.onnx file under the citation.doi metadata key):
Fatihi, A., Caldeira, J., Beucler, T., Thiele, S. T., and Samsu, A.: Towards robust fracture mapping: benchmarking automatic fracture mapping in 2D outcrop imagery, EGUsphere [preprint], https://doi.org/10.5194/egusphere-2026-1097, 2026.
@article{fatihi2026fraxet,
author = {Fatihi, Ayoub and Caldeira, Jefter and Beucler, Tom and Thiele, Samuel T. and Samsu, Anindita},
title = {Towards robust fracture mapping: benchmarking automatic fracture mapping in 2D outcrop imagery},
journal = {EGUsphere},
year = {2026},
doi = {10.5194/egusphere-2026-1097},
url = {https://doi.org/10.5194/egusphere-2026-1097},
note = {preprint}
}
Please also cite the archived release these models come from: https://doi.org/10.5281/zenodo.17866853
References
- Ronneberger et al. 2015 β https://doi.org/10.1007/978-3-319-24574-4_28
- Xie et al. 2021 β https://doi.org/10.48550/arXiv.2105.15203
- Ravi et al. 2024, SAM 2 β https://doi.org/10.48550/arXiv.2408.00714