Abstract:To enhance visibility observation capability along highways and improve the accuracy of visibility detection based on video surveillance images, this paper builds upon prior research by focusing on the ordinal relationships between visibility levels. By transforming the traditional visibility level classification task into a series of ordered binary classifiers, it imposes consistency constraints on visibility level detection results. This approach leads to a novel visibility detection method based on ordinal consistency constraints, resulting in more stable model predictions. Two datasets collected from real highways—JS-FHVI (Jing-Shi Foggy Highway Visibility Images) and DG-FHVI (Da-Guang Foggy Highway Visibility Images)—are used for experimental design and validation. Images are randomly partitioned into training (70%), validation (10%), and test (20%) sets. Visibility is categorised into six levels: ≤50 m, 50-100 m, 100-200 m, 200-500 m, 500-1000 m, and ≥1000 m. Image annotations are derived from meteorological station data nearest to the camera locations, with verification and corrections by professional meteorologists. A model based on ordinal consistency constraints (OCC) is designed, and an ordinal consistency constraint loss function is introduced, enabling the model to prioritise samples with inconsistent ordinal predictions. Further ablation studies compare four ordinal consistency measurement methods, revealing that Intersection over Union (IoU) yields optimal results and is adopted as the consistency metric. Subsequently, five scaling functions—linear, exponential, exponential square root, logarithmic, and softmax scaling—are evaluated, with exponential square root scaling achieving the highest classification accuracy. Based on these findings, two weighting strategies for hard samples are designed and tested. The strategy of increasing weights for hard samples proves more effective. To verify the performance of the proposed method, AlexNet, VGG16, ResNet-18, ResNet-50, EfficientNetB1, original ordinal regression, and the ordinal regression method with Ordinal Consistency Constraint (OCC) are employed as backbone networks to detect the visibility level of each highway image. The results demonstrate that the detection accuracy of the OCC-based method surpasses all other approaches. On the JS-FHVI test set, the method’s accuracy achieves 93.75%, and on the DG-FHVI test set, it achieves 86.94%. Its effectiveness is further validated through ablation studies. Cross-testing is conducted using models trained on JS-FHVI, DG-FHVI, and a unified model trained on merged data. Results demonstrate that models trained on specific highway data perform better locally, while the unified model exhibits superior generalisation across scenarios. Extensive experiments confirm that the proposed OCC-based method significantly enhances visibility detection accuracy. The current work focuses on discrete-level visibility detection; future efforts may extend to continuous numerical estimation to improve practical precision. Additionally, given the dynamic evolution of fog, short-term visibility forecasting or trend prediction remains a critical direction for further research.