Journals / Demiryolu Mühendisliği / 2026 / Sayı: 24

Segmentation of Thin Linear Structures Under Extreme Class Imbalance: Accuracy Paradox and Architectural Efficiency in Railway Datasets

Aşırı Sınıf Dengesizliği Altında İnce Doğrusal Yapıların Segmentasyonu: Demiryolu Veri Setlerinde Doğruluk Paradoksu ve Mimari Verimlilik

Ahmet Akkaya(BANDIRMA ONYEDİ EYLÜL ÜNİVERSİTESİ)0000-0003-4836-2310
Pages
—
Publication Date
2026-04-15
🏛️Bibliographic metadata and full text access for this article are provided via DergiPark.
DergiPark Record ↗
✨

AI Summary & Key Takeaways

AI Insight
⚡ TL;DR(Too Long; Didn't Read)

Although numerical results indicate that both models achieve an overall accuracy of over 99.8%, pixel-based confusion matrices and micro-spatial error analyses prove that Segformer variants produce discontinuities in track lines and high rates of false positive (FP) noise due to their patch-based structure.

📌 3 Key Takeaways

🎯
Objective & Hypothesis:The safe navigation of autonomous railway systems relies on the continuous and pixel-level accurate detection of railway tracks.
📊
Key Findings & Data:However, railway datasets inherently exhibit extreme class imbalance, where track pixels occupy a minuscule fraction of the area compared to the background (~170:1).
💡
Conclusion & Impact:Although numerical results indicate that both models achieve an overall accuracy of over 99.8%, pixel-based confusion matrices and micro-spatial error analyses prove that Segformer variants produce discontinuities in track lines and high rates of false positive (FP) noise due to their patch-based structure.
🔬Design:Modeling & Simulation
📍Scope:Comprehensive Sample
⚙️Variables:Demiryolu Segmentasyonu · Doğruluk Paradoksu · Sınıf Dengesizliği

Abstract

The safe navigation of autonomous railway systems relies on the continuous and pixel-level accurate detection of railway tracks. However, railway datasets inherently exhibit extreme class imbalance, where track pixels occupy a minuscule fraction of the area compared to the background (~170:1). This phenomenon leads to the "Accuracy Paradox," causing traditional metrics to misinterpret actual model performance. In this study, the convolutional neural network-based U-Net (ResNet-34) and the vision transformer-based Segformer (B0-B5) architectures are comparatively analyzed in terms of their capability to tackle this challenging task. Although numerical results indicate that both models achieve an overall accuracy of over 99.8%, pixel-based confusion matrices and micro-spatial error analyses prove that Segformer variants produce discontinuities in track lines and high rates of false positive (FP) noise due to their patch-based structure. In contrast, U-Net (R34), with its 24.4 million parameters, exhibited a statistically similar performance (p > 0.05) to Segformer-B5, which is 3.5 times larger. Furthermore, U-Net preserved track integrity much more successfully owing to its strong spatial inductive bias. As a result of the experiments, the U-Net model outperformed the computationally much heavier Segformer models with scores of 36.70 mIoU and 40.72 HD95. The Wilcoxon Signed-Rank Test results confirm that the superiority of U-Net over lower-scale ViT models is statistically significant. Consequently, this study demonstrates that in the segmentation of thin and linear structures, architectural designs preserving spatial continuity are of critical importance rather than mere model depth, and a massive increase in parameters does not necessarily yield a performance boost in this task, highlighting the issue of "parameter redundancy.

Özet

Otonom demiryolu sistemlerinin güvenli navigasyonu, ray hattının piksel hassasiyetinde ve kesintisiz olarak tespit edilmesine dayanmaktadır. Ancak demiryolu veri setleri, ray piksellerinin arka plana oranla çok küçük bir alanı kapladığı (~170:1) aşırı sınıf dengesizliği içermekte, bu da geleneksel metriklerin performansı hatalı değerlendirmesine yol açan "Doğruluk Paradoksu"nu ortaya çıkarmaktadır. Bu çalışmada, evrişimli sinir ağı tabanlı U-Net (ResNet-34) ile görsel dönüştürücü tabanlı Segformer (B0-B5) mimarileri, bu zorlu görevin üstesinden gelme yetenekleri bakımından karşılaştırmalı olarak analiz edilmiştir. Sayısal sonuçlar, her iki modelin de %99,8’in üzerinde doğruluk elde ettiğini gösterse de piksel bazlı karmaşıklık matrisleri ve mikro-uzamsal hata analizleri, Segformer varyantlarının yama tabanlı yapısı nedeniyle ray hatlarında kopukluklar ve yüksek oranda yanlış pozitif (FP) gürültüsü ürettiğini kanıtlamıştır. Buna karşın U-Net (R34), 24,4 milyon parametre ile kendisinden 3,5 kat daha büyük olan Segformer-B5 ile istatistiksel olarak benzer (p>0,05) bir performans sergilemiş; uzamsal tümevarımsal yanlılığı sayesinde hat bütünlüğünü çok daha başarılı korumuştur. Deneyler sonucunda U-Net modeli 36,70 mIoU ve 40,72 HD95 skorlarıyla, donanımsal olarak çok daha ağır olan Segformer modellerini geride bırakmıştır. Wilcoxon İşaretli Sıralar Testi sonuçları, U-Net'in düşük ölçekli ViT modellerine karşı üstünlüğünün istatistiksel olarak anlamlı olduğunu doğrulamaktadır. Çalışma sonucunda, ince-uzun yapıların segmentasyonunda model derinliğinden ziyade uzamsal sürekliliği koruyan mimari yapıların kritik öneme sahip olduğu ve parametre artışının bu görevde her zaman performans artışı sağlamadığı gösterilmiştir.

🔖

Cite This Article

Akkaya, A. (2026). Segmentation of Thin Linear Structures Under Extreme Class Imbalance: Accuracy Paradox and Architectural Efficiency in Railway Datasets. Demiryolu Mühendisliği, Sayı: 24. https://doi.org/10.47072/demiryolu.1910383

📄 Full Text PDF Viewer

📄

PDF görüntüleyici hazırlanıyor...

References (32)

  1. Ü. Ekici ve T. Ferşadoğlu, “Demiryolu taşımacılığının diğer taşımacılık modlarıyla karşılaştırılması ve sağladığı avantajlar”, Demiryolu Mühendisliği, sy 19, ss. 121-132, Oca. 2024, doi: 10.47072/demiryolu.1385217.
  2. A. G. Seferoğlu ve F. Polat, “Kayseri’de otobüs ve tramvay hizmet kalitesi: Yolcu memnuniyetinin karşılaştırmalı bir analizi”, Journal of Innovative Engineering and Natural Science, c. 5, sy 2, ss. 884-900, Tem. 2025, doi: 10.61112/jiens.1694523.
  3. M. A. Elmuhammedcebben, İ. Aydın, ve M. Sevi, “Demiryolu ortamında nesne tespiti için derin öğrenme yöntemlerinin geliştirilmesi ve zed kamerası ile mesafe ölçümü”, Demiryolu Mühendisliği, sy 22, ss. 10-24, Tem. 2025, doi: 10.47072/demiryolu.1645019.
  4. C. Taştimur, “Efficient and real-time railway track fault classification using CNN integrated with convolutional block attention module”, Muş Alparslan Üniversitesi Fen Bilimleri Dergisi, c. 13, sy 2, ss. 351-356, Ara. 2025, doi: 10.18586/msufbd.1763332.
  5. X. Wan vd., “Environmental suitability analysis integrating carbon emission evaluation for green railway alignment optimization”, International Journal of Rail Transportation, c. 14, sy 1, ss. 45-71, Oca. 2026, doi: 10.1080/23248378.2025.2474496.
  6. C.-C. Chang, K.-H. Huang, T.-K. Lau, C.-F. Huang, ve C.-H. Wang, “Using deep learning model integration to build a smart railway traffic safety monitoring system”, Scientificit Reports, c. 15, sy 1, s. 4224, Şub. 2025, doi: 10.1038/s41598-025-88830-7.
  7. Y. Weng, H. Xiang, X. Chen, C. Zhang, L. Jia, ve F. Chen, “MFD-UNet: a complex railway track boundary segmentation algorithm for drone vision based on multi-scale fusion and deformable pyramid blocks”, Measurement Science and Technology, c. 36, sy 1, s. 016198, Ara. 2024, doi: 10.1088/1361-6501/ad9cae.
  8. T. Jiang vd., “RailSeg: Learning local–global feature aggregation with contextual ınformation for railway point cloud semantic segmentation”, IEEE Transactions on Geoscience and Remote Sensing, c. 61, ss. 1-29, 2023, doi: 10.1109/TGRS.2023.3319950.
  9. Y. Chen, J. Zhou, ve C. Chen, “An efficient foreign object detection model based on Transformer for high-speed railway catenary”, Engineering Applications of Artificial Intelligence, c. 164, s. 113313, Oca. 2026, doi: 10.1016/j.engappai.2025.113313.
  10. M. A. R. Alif, M. Hussain, G. Tucker, ve S. Iwnicki, “BoltVision: A Comparative Analysis of CNN, CCT, and ViT in Achieving High Accuracy for Missing Bolt Classification in Train Components”, Machines, c. 12, sy 2, s. 93, Şub. 2024, doi: 10.3390/machines12020093.
  11. F. Guo, J. Liu, Y. Qian, ve Q. Xie, “Rail surface defect detection using a transformer-based network”, Journal of Industrial Information Integration, c. 38, s. 100584, Mar. 2024, doi: 10.1016/j.jii.2024.100584.
  12. A. Phaphuangwittayakul, N. Harnpornchai, F. Ying, ve J. Zhang, “RailTrack-DaViT: A vision transformer-based approach for automated railway track defect detection”, Journal of Imaging, c. 10, sy 8, s. 192, Ağu. 2024, doi: 10.3390/jimaging10080192.
  13. F. J. Valverde-Albacete ve C. Peláez-Moreno, “100% Classification accuracy considered harmful: The normalized ınformation transfer factor explains the accuracy paradox”, PLOS ONE, c. 9, sy 1, s. e84217, Oca. 2014, doi: 10.1371/journal.pone.0084217.
  14. J. A. Scaringi vd., “Implementing an AI algorithm in the clinical setting: a case study for the accuracy paradox”, European Radiology, c. 35, sy 7, ss. 4347-4353, Tem. 2025, doi: 10.1007/s00330-024-11332-z.
  15. Y. Chen, D. Zhu, Y. Sun, X. Chen, W. Zhang, ve X. Shen, “The accuracy paradox in RLHF: When better reward models don’t yield better language Models”, içinde Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, Y. Al-Onaizan, M. Bansal, ve Y.-N. Chen, Ed., Miami, Florida, USA: Association for Computational Linguistics, Kas. 2024, ss. 2980-2989. doi: 10.18653/v1/2024.emnlp-main.174.
  16. O. Ronneberger, P. Fischer, ve T. Brox, “U-Net: Convolutional networks for biomedical ımage segmentation”, içinde Medical Image Computing and Computer-Assisted Intervention – MICCAI 2015, N. Navab, J. Hornegger, W. M. Wells, ve A. F. Frangi, Ed., Cham: Springer International Publishing, 2015, ss. 234-241. doi: 10.1007/978-3-319-24574-4_28.
  17. T. Tang, G. T. Jayaputera, ve R. O. Sinnott, “A Performance comparison of convolutional neural networks and transformer-based models for classification of the spread of bushfires”, içinde 2024 IEEE 20th International Conference on e-Science (e-Science), Eyl. 2024, ss. 1-9. doi: 10.1109/e-Science62913.2024.10678733.
  18. A. G. R. Salgado, M. Shen, P. Harzig, P. Mayer, ve J. M. Alvarez, “Global average feature augmentation for robust semantic segmentation with transformers”, 14 Aralık 2024, arXiv: arXiv:2412.01941. doi: 10.48550/arXiv.2412.01941.
  19. Y. Xu, C. Liu, J. Zhong, W. Mei, ve Y. Zhang, “MSPFNet: Multi-scale perceptual focusing network for scrap steel segmentation and classification”, Engineering Applications of Artificial Intelligence, c. 144, s. 110084, Mar. 2025, doi: 10.1016/j.engappai.2025.110084.
  20. B. Liu vd., “Identification and mapping of gully using machine learning and deep learning algorithms in the loess hilly and gully region in China”, International Soil and Water Conservation Research, s. 100587, Eki. 2025, doi: 10.1016/j.iswcr.2025.10.003.
  21. X. Shi. A data set for few-shot segmentation on industrial surface defect detation[DS/OL]. V1. Science Data Bank, 2022[2026-03-14]. https://cstr.cn/31253.11.sciencedb.06908.
  22. P. Jaccard, “The distribution of the Flora in the alpine zone.”, New Phytologist Foundation, c. 11, sy 2, ss. 37-50, 1912, doi: 10.1111/j.1469-8137.1912.tb05611.x.
  23. L. R. Dice, “Measures of the amount of ecologic association between species”, Ecology, c. 26, sy 3, ss. 297-302, 1945, doi: 10.2307/1932409.
  24. D. M. W. Powers, “Evaluation: from precision, recall and F-measure to ROC, informedness, markedness and correlation”, 11 Ekim 2020, arXiv: arXiv:2010.16061. doi: 10.48550/arXiv.2010.16061.
  25. M. Sokolova ve G. Lapalme, “A systematic analysis of performance measures for classification tasks, Information Processing & Management, c. 45, sy 4, ss. 427-437, Tem. 2009, doi: 10.1016/j.ipm.2009.03.002.
  26. A. A. Taha ve A. Hanbury, “Metrics for evaluating 3D medical image segmentation: analysis, selection, and tool”, BMC Med Imaging, c. 15, sy 1, s. 29, Ağu. 2015, doi: 10.1186/s12880-015-0068-x.
  27. T. Heimann vd., “Comparison and evaluation of methods for liver segmentation from CT datasets”, IEEE Transactions on Medical Imaging, c. 28, sy 8, ss. 1251-1265, Ağu. 2009, doi: 10.1109/TMI.2009.2013851.
  28. J. Cuzick, “A wilcoxon-type test for trend”, Statistics in Medicine, c. 4, sy 1, ss. 87-90, 1985, doi: 10.1002/sim.4780040112.
  29. H. Karakis, A. Karamete, ve A. Okçu, “The Effects of a computer-assisted teaching material, designed according to the ASSURE ınstructional design and the ARCS model of motivation, on students’ achievement levels in a mathematics lesson and their resulting attitudes”, European Journal of Contemporary Education, c. 15, sy 1, ss. 105-113, 2016.
  30. J. Yang, A. PP Abdul Majeed, M. Ateeq, Z. Omar, R. Jailani, R. Muazu Musa ve N. Mat Yahya, "Surface defect classification: leveraging transformer and transfer learning models for enhanced precision in industrial applications", The International Journal of Advanced Manufacturing Technology, c. 139, sy. 7, s. 4141-4152, 2025.
  31. S. T. K. Ayon, F. M. Siraj ve J. Uddin, "Steel Surface Defect Detection Using Learnable Memory Vision Transformer", Computers, Materials & Continua, c. 82, sy. 1, 2025.
  32. R. Jin, Z. Shen, S. Zeng, C. Liu ve D. Tao, "Rail-SegFormer: An Attention-Enhanced Model with Convolutional Hybridization and Salient Feature Fusion", 2025 IEEE International Conference on Consumer Electronics-Taiwan (ICCE-Taiwan), s. 599-600, 2025, doi: 10.1109/ICCE-Taiwan66881.2025.11207990.