Object-Aware Heatmap Refinement for Railway Train Foreign- Object Inspection Using Compact PatchBank Anomaly Scoring
Foreign objects attached to railway train components can threaten operational safety. Fully supervised detectors can localize such objects accurately when sufficient box-level annotations are available. However, foreign objects are sparse, diverse, and component-dependent, so training annotations rarely cover all of their appearances. Heatmap-based anomaly detection offers a way to use normal samples for industrial inspection. Yet raw anomaly heatmaps often highlight suspicious regions without capturing object extent, leading to oversized, fragmented, or background-driven boxes. This paper proposes a two-stage visual inspection method for railway train component images. First, a compact DINOv2 PatchBank estimates image-level anomaly scores and produces spatial anomaly heatmaps using a small normal reference bank. Second, an object-aware heatmap refiner, trained with foreign-object box annotations, combines the anomaly heatmap with the RGB component image to convert patch-level responses into foreground masks and bounding boxes. Experiments on a five-component railway train foreign-object inspection dataset under source-image-grouped five-fold cross-validation with internal validation show that the proposed PatchBank classifier achieves 0.9875 macro ROC AUC, 0.9867 macro PR AUC, and 0.9475 macro F1. For object-level localization, direct heatmap-to-box conversion performs poorly, whereas the proposed RGB-guided refiner reaches 0.981 AP0.5 and 0.504 AP[0.5:0.95] with a low false-positive rate on normal images; a fully supervised YOLOv8m reaches 0.994 and 0.907 and still gives tighter boxes. The input ablation shows that, compared with RGB-only input, the combined input localizes objects better at stricter IoU thresholds and gives fewer false detections on normal images. On 500 synthetic foreign objects with unfamiliar appearances, the refiner reaches 0.384 AP0.5 with a recall of 0.366, whereas YOLOv8m detects almost none of them. The results suggest that object-aware heatmap refinement is an effective bridge between anomaly scoring and practical foreign-object detection in railway train component inspection.
Authors
- Yao Li (ORCID: https://orcid.org/0000-0003-1951-7854)
- Ji Qiu (ORCID: https://orcid.org/0000-0002-7913-9042)
- Ruijie Yang
- Tianyi Chen
- Kang Wang
- Xiaodong Sun (ORCID: https://orcid.org/0009-0006-5376-0232)
- Hongmei Shi
Institutions
- Shanghai Medical College of Fudan University (CN)
- Beijing Jiaotong University (CN)
- Fudan University (CN)
- University of Malaya (MY)
- Zhejiang University (CN)
Publication Details
- Journal
- Information
- Published
- 2026-11-10
- DOI
- https://doi.org/10.3390/info17111126
- Primary Topic
- Industrial Vision Systems and Defect Detection
- Type
- article
- Field-Weighted Citation Impact
- 0.00