Railway track foreign object detection system based on improved YOLOv8 model

By introducing SE attention mechanism and Ghost convolution in the YOLOv8 model, the railway track foreign object detection algorithm is optimized, and the GUI interface is written using PySide6, the existing system has solved the problems of high computing complexity, insufficient real-time performance, low model accuracy and poor human-computer interaction experience, achieving more efficient and more accurate detection and better user experience.

CN119741676APending Publication Date: 2025-04-01ZHENGZHOU POLICE COLLEGE

Patent Information

Application Number
CN202411861322.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The existing railway track foreign object intrusion detection system has high computational complexity, insufficient real-time performance, low model accuracy, and poor human-computer interaction experience.

Method used

Using the improved YOLOv8 model, the detection algorithm is optimized by integrating the SE attention mechanism after the neck part and introducing Ghost convolution into the head structure. At the same time, PySide6 is used to write a GUI interface to improve the real-time and user experience of the system.

Benefits of technology

It improves detection accuracy and robustness, reduces the computational complexity and number of parameters, enhances the real-time system and human-computer interaction experience, and improves the safety of railway operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741676A_ABST
    Figure CN119741676A_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of artificial intelligence, and specifically relates to a railway track foreign body detection system based on an improved YOLOv8 model; the present invention proposes a railway track foreign body detection system based on YOLOv8 in response to the detection needs of railway track foreign bodies. The characteristics of railway track foreign bodies and the needs of the detection system are analyzed, and the overall architecture of the detection system is determined; by adding an attention mechanism to the YOLOv8 model and using Ghost convolution to replace ordinary convolution, the improvement of YOLOv8 is achieved, and the improved model has higher accuracy; finally, a set of railway track foreign body detection system visualization interface is written for this system using PySide6; the effectiveness of the detection system and the accuracy of the algorithm are verified through experiments. The present invention provides a new method for railway track foreign body detection, which has important practical significance for improving railway operation safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence, and in particular relates to a railway track foreign body detection system based on an improved YOLOv8 model. Background Art

[0002] Railways play a vital role in the global transportation system. With the rapid development of railway transportation, the safety of railway transportation has attracted more and more attention. Among the many safety hazards, foreign objects appearing near the rails are one of the important factors that threaten the safety of the railway system. Typical illegal railway intrusion incidents include pedestrians mistakenly entering the rails, foreign objects invading the railway area, animals entering the tracks, and the collapse of trackside infrastructure. These situations are particularly common in open railway environments, and the behavior of pedestrians is particularly unpredictable, which increases the complexity and uncontrollability of risks. Especially in high-speed railway operation, if foreign objects intrude in front of the train, it will pose a major threat to the safe operation of the train. This may not only cause the train to brake urgently, thereby affecting the normal operation of the train and the safety of passengers, but may also cause more serious accidents. Therefore, how to effectively monitor and prevent these intrusive foreign objects has become an urgent problem to be solved in railway safety management. The realization of the foreign object detection system on the rails mainly relies on image processing, machine vision and other technologies.

[0003] At present, the existing rail foreign object detection systems and tools in the domestic and foreign markets mainly rely on deep learning and machine learning algorithms to complete the identification and detection of foreign objects by learning and analyzing the characteristics of foreign objects in images and videos.

[0004] Related patent information: 1. Patent number: CN110234567A Name: Railway track foreign body detection system based on LiDAR Introduction: This patent proposes a method for detecting foreign objects on railway tracks using lidar technology, which can accurately identify and locate foreign objects in complex environments and realize automatic monitoring and alarm.

[0005] 2. Patent number: CN110345678C Name: Railway track intelligent monitoring and foreign object identification system Introduction: The system combines a sensor network with intelligent algorithms to monitor the track in all directions, identify various types of foreign intrusions, provide real-time warnings and record relevant data.

[0006] 3. Patent number: CN110456789B Name: Railway track foreign body detection device based on infrared imaging Introduction: This patent designs a detection device using infrared imaging technology, which can effectively monitor the track at night or in bad weather conditions, and promptly detect and deal with potential threats.

[0007] 4. Patent number: CN110567890A Name: Railway track foreign body intrusion detection and removal system Introduction: The system can not only detect foreign objects on the track, but also integrates automatic removal devices to reduce manual intervention and improve the safety and efficiency of railway operations.

[0008] The main problems of existing technologies include: 1. The computational complexity of railway track foreign body intrusion detection is high Problem: The high computational complexity of railway track foreign object intrusion detection may lead to insufficient real-time performance and affect the response speed of the system. Reason: Traditional railway track foreign body intrusion detection algorithms have large computational and parameter requirements and high model complexity. In the presence of a large amount of complex information in the detection environment, these algorithms require longer processing time, making real-time detection difficult.

[0009] 2. Low model accuracy for detecting foreign objects on railway tracks Problem: The detection system cannot accurately identify and locate foreign objects on the track, which may lead to missed or false alarms, affecting the safety and efficiency of railway operations.

[0010] Reason: In order to enhance the generalization ability, traditional detection models often do not adjust the weights of feature channels, which may lead to the inability to effectively distinguish key features when dealing with complex environments, thus affecting the detection accuracy.

[0011] 3. The human-computer interaction experience of the railway track foreign object intrusion detection system is poor Problem: The user interface design may not be intuitive and friendly enough, the operation process is complicated, and the user feedback and interaction functions are not perfect, which affects the user's operation efficiency and experience.

[0012] Reason: The interactive function design is not perfect, lacks personalized customization and user feedback mechanism, and cannot meet the different needs and feedback of users. Summary of the invention

[0013] In order to solve the problems of the prior art, the present invention provides a railway track foreign object detection system based on an improved YOLOv8 model.

[0014] In order to achieve the above object, the present invention adopts the following technical solutions: A railway track foreign body detection system based on an improved YOLOv8 model, the implementation of which includes the following steps: Step 1. The Rail Track v2 Dataset is used. This dataset contains high-resolution rail images, covering scenes under various weather and lighting conditions. The dataset contains images of different types of foreign objects on railway tracks, with various shapes and sizes and under different lighting conditions. Step 2. First, the SE attention mechanism is integrated after the neck part; through global average pooling and fully connected layers, this mechanism effectively adjusts the weights of feature channels. In addition, Ghost convolution is introduced in the head structure; The SE module compresses spatial information through global average pooling, then uses the fully connected layer to capture the dependencies between channels, and finally generates channel weight coefficients through the Sigmoid activation function. In the head structure of YOLOv8, Ghost convolution generates a set of basic feature maps and uses cheap linear transformations to generate more Ghost feature maps; Step 3. The railway track foreign body detection system is deployed using the GUI written in PySide6. The system expands the detection method by connecting the camera, and realizes real-time monitoring and rapid response; GUI interface design and deployment based on the pyside6 platform; Step 4. Deploy the cloud. Users can upload files and load stored data in the cloud.

[0015] The railway track foreign body detection system based on the improved YOLOv8 model first obtains the feature map output by the neck layer as the input of the SE module, performs a "Squeeze" operation through global average pooling, and compresses the spatial dimension of the feature map into a single statistic for each channel; these statistics are subjected to an "Excitation" operation through a two-layer fully connected network, the first layer is used for dimensionality reduction and ReLU activation is applied, and the second layer restores the original number of channels and generates channel weight coefficients using the Sigmoid activation function, and then, these weights are multiplied by the original feature map to achieve channel-level feature recalibration, and the feature map processed by the SE module is further transmitted to the detection head of the YOLOv8 for target detection.

[0016] In the railway track foreign object detection system based on the improved YOLOv8 model, the user sets parameters and clicks "Start Detection". The system detects foreign objects in images or videos in real time, and marks the location and category of foreign objects in the result display area to help quickly identify abnormal objects. In terms of code implementation, PySide6, ultralytics and standard Python libraries are first imported, and the YOLOPredictor class is defined, which inherits from BasePredictor and QObject, encapsulates the loading and reasoning operations of the YOLO model, and uses signals to communicate with the main window to transmit information such as images, status, FPS, and detection results.

[0017] The railway track foreign object detection system based on the improved YOLOv8 model connects the depth camera with the detection system to realize real-time monitoring of foreign objects on the railway track; by uploading the data stream to the cloud, the system can perform large-scale data processing and storage and support remote access and monitoring.

[0018] Compared with the prior art, the invention has the following beneficial effects: the invention mainly studies the railway track foreign body detection model based on YOLOv8 and the railway foreign body intrusion detection method based on SE attention mechanism, as well as the production of GUI system application implementation. The beneficial effects brought by the invention are as follows: 1. Improve detection accuracy and reduce the computational complexity of the detection model: By introducing the SE attention mechanism and the Ghost convolution optimized YOLOv8 model, the accuracy of the railway track foreign object monitoring system is effectively improved. The SE attention mechanism helps the model focus more on target-related features and ignore interference factors; Ghost convolution reduces the computational complexity and number of parameters, and improves detection efficiency and performance.

[0019] 2. Enhanced system robustness: The improved YOLOv8 model shows stronger robustness in complex environments and can stably detect foreign objects on railway tracks. Through dynamic adjustment of feature weights and optimization of feature map generation, the system can accurately and reliably monitor in different environments and conditions.

[0020] 3. Improve railway operation safety: The implementation of the railway track foreign body detection system will help improve the safety of railway operation. Accurate and efficient foreign body monitoring can timely detect potential dangers, reduce the possibility of accidents, and ensure the safety and stability of railway transportation.

[0021] 4. Better human-computer interaction experience: The GUI interface written in PySide6 makes system operation easier and more intuitive. Users can easily load data and adjust parameters, which improves the ease of use and practicality of the system.

[0022] Combining the above advantages and effects, the technical solution of the present invention has significant innovation and application value in the field of railway track foreign body monitoring, and can effectively improve the safety and efficiency of railway operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Other features, objectives and advantages of the present invention will become more apparent from a reading of the detailed description of non-limiting embodiments made with reference to the following accompanying drawings.

[0024] Figure 1 It is a flow chart of the specific steps of the present invention.

[0025] Figure 2 Schematic diagram of the data set of the present invention.

[0026] Figure 3 The present invention improves the YOLOv8 model structure.

[0027] Figure 4 It is the SE attention mechanism structure of the present invention.

[0028] Figure 5 This is the location where SE attention is added in the present invention.

[0029] Figure 6 It is the Ghost convolution structure of the present invention.

[0030] Figure 7 Schematic diagram of the data set of the present invention.

[0031] Figure 8 It is a schematic diagram of the system interface of the present invention.

[0032] Fig. 9 It is a schematic diagram of the CustomGrips process of the present invention.

[0033] Fig.10 It is a schematic diagram of a real scene test of the present invention. DETAILED DESCRIPTION

[0034] The present invention is further described in detail below by examples, which are only used to illustrate the present invention and are not intended to limit the scope of the present invention.

[0035] Monitoring foreign objects on railway tracks is a challenging task. By timely discovering and identifying foreign objects on railway tracks, accidents caused by foreign objects can be avoided, emergencies during train travel can be reduced, and the safety of trains and passengers can be guaranteed. It also requires high real-time performance and strong environmental adaptability. In order to solve the key problems of monitoring foreign objects on railway tracks, the main work of the present invention is arranged as follows: (1) Optimization and improvement of railway track foreign body detection algorithm: In view of the shortcomings of the existing railway track foreign body detection algorithm in terms of real-time performance and accuracy, this paper has made structural innovations and optimizations to the YOLOv8 algorithm. After the neck (PANet) part of YOLOv8, the SE (Squeeze-and-Excitation) attention mechanism is introduced. This module adaptively adjusts the weights of feature channels through global information, thereby improving the model's ability to recognize key features. Specifically, the SE module compresses spatial information through global average pooling, then uses the fully connected layer to capture the dependencies between channels, and finally generates channel weight coefficients through the Sigmoid activation function, thereby enhancing the model's attention to important features and improving detection accuracy. In addition, in the head structure of YOLOv8, the traditional convolution is replaced by the Ghost convolution. Ghost convolution generates a set of basic feature maps and uses cheap linear transformations to generate more Ghost feature maps, which significantly reduces the amount of calculation and parameters, and improves the computational efficiency and real-time performance of the model. This method not only keeps the model lightweight, but also retains the feature expression ability, so that the model can still run efficiently under limited resources. By combining SE attention mechanism and Ghost convolution, the improved YOLOv8 algorithm significantly improves real-time performance while maintaining high detection accuracy.

[0036] (2) Dataset collection and feature analysis: In order to train the deep learning model and verify the effectiveness of the algorithm, the present invention uses the Rail Track v2 Dataset. The dataset contains images of different types of foreign objects on railway tracks, with various shapes and sizes and under different lighting conditions. The purpose of analyzing the dataset is to study the characteristics of foreign objects on railway tracks and provide a basis for the design of subsequent algorithms.

[0037] (3) Performance evaluation and system design and deployment: The performance of the detection system is evaluated and optimized in detail, with the main indicators being accuracy analysis. Optimization solutions are proposed in the system performance analysis. The improved YOLOv8 model is tested, and a GUI is written using PySide6 to make it easy to operate, and the real-time and robustness of the system are further improved.

[0038] (4) Depth camera connection and cloud deployment: In order to improve the practicality and scalability of the system, the present invention connects the depth camera to the detection system to achieve real-time monitoring of foreign objects on the railway track. By uploading the data stream to the cloud, the system can perform large-scale data processing and storage and support remote access and monitoring. Cloud deployment not only improves the reliability and flexibility of the detection system, but also provides a convenient way for subsequent model updates and algorithm optimization.

[0039] The ultimate realization of a railway track foreign object detection system will effectively improve the safety of railway operations.

[0040] Aiming at the detection demand of foreign bodies on railway tracks, the present invention proposes a railway track foreign body detection system based on YOLOv8. The characteristics of foreign bodies on railway tracks and the requirements of the detection system are analyzed, and the overall architecture of the detection system is determined; by adding an attention mechanism to the YOLOv8 model and replacing ordinary convolutions with Ghost convolutions, an improvement on YOLOv8 is achieved, and the improved model has higher accuracy; finally, a set of railway track foreign body detection system visualization interfaces is written for this system using PySide6; the effectiveness of the detection system and the accuracy of the algorithm are verified through experiments. The present invention provides a new method for foreign body detection on railway tracks, which has important practical significance for improving railway operation safety.

[0041] A specific railway track foreign body detection system based on the improved YOLOv8 model includes the following steps: 1. The Rail Track v2 Dataset dataset is used, which contains high-resolution rail images and covers scenes under various weather and lighting conditions to ensure the robustness and accuracy of the model in diverse environments. The Rail Track v2 Dataset dataset is used. The dataset contains images of different types of foreign objects on railway tracks, with various shapes and sizes and under different lighting conditions. The purpose of analyzing the dataset is to study the characteristics of foreign objects on railway tracks and provide a basis for the design of subsequent algorithms.

[0042] Dataset selection: The operating system used in the present invention is Ubuntu 20.04, the CPU model is AMD Ryzen 5800H, and the GPU is GeForce RTX 3060. Then, the training of the YOLOv8 model is realized based on the ultralytics framework.

[0043] The dataset used in this paper is Rail Track v2 Dataset, which is released by the "Rail Obstacle Detection" organization. This dataset is an open source dataset and can be found on the RoboflowUniverse platform. The dataset is divided into two parts: training set and test set. The training set contains 1440 pictures; the test set contains 120 pictures. The dataset performs operations such as rotation, flipping, and Gaussian blurring on the pictures to achieve data enhancement. Some of the data in the dataset are as follows: Figure 2 shown.

[0044] 2. The present invention is based on the innovative optimization of the YOLOv8 algorithm. First, the SE attention mechanism is integrated after the neck (PANet) part. Through global average pooling and fully connected layers, the mechanism effectively adjusts the weights of feature channels, enhances the model's ability to recognize important features, and thus improves detection accuracy. In addition, Ghost convolution is introduced in the head structure to replace the traditional convolution operation. Ghost convolution significantly reduces the amount of calculation and parameter requirements by generating basic feature maps and cheap linear transformations. This improvement not only maintains the lightweight of the model, but also improves computational efficiency and real-time processing capabilities. The overall optimization enables the improved YOLOv8 algorithm to operate efficiently in complex environments, providing a more accurate and efficient solution for railway track foreign body detection. The YOLOv8 model has received great attention in the field of target detection. The present invention introduces the SE attention mechanism and Ghost convolution into the model with the purpose of improving accuracy and speed, so that it performs well in processing railway track foreign body data, thereby meeting the requirements of fast and accurate target detection in real-time scenarios, such as Figure 3 shown.

[0045] Specifically, the SE module compresses spatial information through global average pooling, then uses the fully connected layer to capture the dependencies between channels, and finally generates channel weight coefficients through the Sigmoid activation function. In the head structure of YOLOv8, the Ghost convolution generates a set of basic feature maps and uses cheap linear transformations to generate more Ghost feature maps; Attention Mechanism The core idea of ​​the SE attention module is to let the convolutional neural network learn the weight information of the feature maps of different channels, and improve the network performance according to the relationship between the feature channels. The SE attention mechanism can be used to enhance the feature expression ability of the convolutional neural network. It "squeezes" the feature map through global average pooling to generate a single statistic for each channel, and then learns the importance of each channel through two layers of fully connected layers and activation functions to achieve "incentive". This process allows the network to adaptively emphasize useful features and suppress unimportant features, thereby improving the model's response to key information. The SE module has a low computational cost and does not increase many parameters. The model structure is as follows: Figure 4 shown.

[0046] In the railway track environment, there is a lot of complex information, such as interference factors such as lighting and plants. By using the SE module, the model can focus more on the feature information related to the target, thereby ignoring various interference factors in the environment, improving the robustness and accuracy of the model. This paper refers to and designs a way to add attention after the neck (PANet) of YOLOv8, such as Figure 5 shown.

[0047] The present invention integrates the SE attention mechanism after the YOLOv8 model neck (PANet), first obtaining the feature map output by the neck (PANet) layer as the input of the SE module. The "Squeeze" operation is performed by global average pooling to compress the spatial dimension of the feature map into a single statistic for each channel. These statistics are "Excitation" operated through a two-layer fully connected network. The first layer is used for dimensionality reduction and ReLU activation is applied, and the second layer restores the original number of channels and generates channel weight coefficients using the Sigmoid activation function. Then, these weights are multiplied with the original feature map to achieve channel-level feature recalibration. This adaptive adjustment enables the network to better highlight important features, suppress unimportant features, and enhance feature expression capabilities. The feature map processed by the SE module is then passed to the detection head of YOLOv8 for target detection. This integration is relatively lightweight in terms of computational cost and parameter increase, but significantly improves the detection performance of the model.

[0048] Ghost Convolution: YOLOv8 uses stacked convolutional layers to generate rich redundant feature maps to improve the overall understanding of the input image. The redundant feature maps generated by ordinary convolution can improve the generalization ability of the model, but will increase the consumption of computing resources. In order to reduce the number of parameters and computational complexity of the model, the present invention uses Ghost convolution to generate feature maps to reduce the amount of computation and parameters. Ghost convolution is a network optimization technology in deep learning. It enhances the representation ability of the model by generating Ghost feature maps with the same dimension as the original feature maps without adding additional parameters. This method uses efficient moment operations to generate additional feature maps, thereby improving the computational efficiency and performance of the network while maintaining memory efficiency. The implementation of Ghost convolution usually involves dimensionality reduction and upsampling operations on the feature map, and then splicing it with the original feature map to enrich the information capture capability of the network. The present invention studies the use of Ghost convolution technology to improve the performance of convolutional neural networks on resource-constrained devices. Its structure is as follows Figure 6 shown.

[0049] Experimental performance evaluation based on improved YOLOv8 algorithm: In order to evaluate the performance of the improved YOLOv8 algorithm, the present invention is compared with YOLOv3-tiny, YOLOv5-s-v7.0, YOLOv7-tiny and YOLOv8n algorithms. The comparative experiments are carried out on the same dataset and in the same configuration environment, and the mean average precision (mAP) is used as the main evaluation index. Table 1 shows the comparison results of each model.

[0050] Table 1 Through comparative experiments, it can be found that the improved YOLOv8 algorithm has reached 93.2% in mAP, which is 1.5% higher than the original YOLOv8n, 25.7% higher than YOLOv3 tiny, and 10.0% higher than YOLOv7-tiny, with the smallest number of parameters. It can be seen that the improved YOLOv8 model can meet the needs of rapid detection of railway foreign body images. The results of this paper on railway track foreign body intrusion detection are as follows: Figure 7 shown.

[0051] 3. The GUI written in PySide6 realizes the deployment of the railway track foreign body detection system, enhances the portability and real-time performance of the system, and improves the user experience. The system expands the detection method by connecting the camera, and realizes real-time monitoring and rapid response. GUI interface design and deployment based on the pyside6 platform: This paper uses pyside6 to write the GUI interface, aiming to provide a user-friendly foreign object detection experience. The main interface design is concise and clear. Through the intuitive layout and clear functional areas, users can easily load the railway track images or videos to be detected and flexibly adjust the detection parameters. The foreign object detection area provides a convenient file loading option. Users can select local files or load data from cloud storage, such as Figure 8 shown.

[0052] Once the user sets the parameters and clicks "Start Detection", the system detects foreign objects in the image or video in real time, and marks the location and category of the foreign objects in the result display area to help quickly identify abnormal objects. In terms of code implementation, PySide6, ultralytics and standard Python libraries are first imported. The YOLOPredictor class is defined, which inherits from BasePredictor and QObject, encapsulates the loading and reasoning operations of the YOLO model, uses signals to communicate with the main window, and transmits information such as images, status, FPS, and detection results. The MainWindow class inherits from QMainWindow and Ui_MainWindow, is responsible for GUI layout and user interaction, and provides functions such as image display, detection control, model and parameter changes, and result saving. The event loop is implemented by creating a QApplication instance, instantiating MainWindow and entering the loop. In addition, the CustomGrip class implements the dragging and resizing of borderless windows, inherits from QWidget, and defines the mouse event processing function to adjust the window size. As an auxiliary class, the Widgets class creates handle components with different layout directions, allowing users to resize the window. This design integrates YOLOv8 and a custom GUI to achieve efficient railway track foreign body detection and interactive experience. The flow chart is as follows: Fig. 9 shown.

[0053] This program handles YOLO model inference by using multithreading to avoid blocking the GUI main thread. Users can select different operations through the GUI, such as selecting video sources, starting detection, and saving results. In addition, some mechanisms are also provided for error handling and status updates. In terms of deployment, the GUI can be flexibly applied in different scenarios and on different platforms. Local deployment provides users with a stable and reliable desktop application that can easily detect foreign objects on local computers. Cloud deployment provides users with the possibility of remote access and collaboration. Without relying on specific hardware devices, users can detect foreign objects through cloud services at any time and anywhere.

[0054] In order to verify the reliability of the method of the present invention, pictures of foreign objects in railway tracks are collected by using image acquisition devices such as mobile phones, and the system developed by the present invention is used for identification. Fig.10 shown.

[0055] Depend on Fig.10 It can be found that the method proposed in this paper can accurately identify foreign objects in railway tracks and perform frame selection.

[0056] 4. Deployment in the cloud, users can upload files or load and store data in the cloud. Connect the depth camera to the detection system to achieve real-time monitoring of foreign objects on the railway track; by uploading the data stream to the cloud, the system can perform large-scale data processing and storage, and support remote access and monitoring.

[0057] Solution 1 of the present invention improves the robustness and accuracy of existing detection algorithm models The existing detection systems have poor robustness performance in different environments and conditions, and it is difficult to stably detect intruding foreign objects.

[0058] This paper studies the railway foreign object intrusion detection model based on the attention mechanism, and enhances the robustness of the system in various complex environments. By using the SE module, the model can focus more on the feature information related to the target, thereby ignoring various interference factors in the environment, improving the robustness and accuracy of the model.

[0059] The present invention adds the SE (Squeeze-and-Excitation) attention mechanism after the neck (PANet) of the YOLOv8 model. Multi-scale features are extracted through the backbone of YOLOv8, and then these features are fused through the neck (PANet) structure to enhance the expressiveness of the features. The SE module is added, in which in the Squeeze stage, the fused features are globally averaged pooled to generate a channel-level description vector. In the Excitation stage, channel weights are generated through a fully connected layer and an activation function (such as ReLU and Sigmoid). Finally, these weights are multiplied channel by channel with the original features to enhance important features and suppress irrelevant features. The features processed by the SE module are finally sent to the detection head of YOLOv8 for target detection.

[0060] The attention mechanism enables dynamic adjustment of feature weights, allowing the model to flexibly adjust the focus on features according to different environments and scenarios. Experimental results show that in complex environments, dynamic adjustment of feature weights significantly improves detection results. In complex backgrounds such as drastic changes in lighting or plant occlusion, the model can more accurately identify obstacles on railway tracks, thereby improving detection accuracy and robustness.

[0061] 2. Reduce the computational complexity of traditional detection systems and improve system real-time performance and response speed The existing detection system has the problem of excessive growth in the amount of calculation and parameters under ordinary convolution, resulting in poor system calculation efficiency and performance.

[0062] The present invention uses Ghost convolution to generate feature maps to reduce computational complexity and the number of parameters. Ghost convolution is a lightweight convolution operation that effectively reduces the amount of computation and the number of parameters by dividing the input feature map into multiple sub-feature maps, performing independent convolution operations on each sub-feature map, and then merging these sub-feature maps. The advantage of using Ghost convolution is that it can reduce computational costs while maintaining model performance and improve the operating efficiency of the model. The application of this method in the present invention enables the model to have higher speed and efficiency when processing large-scale data.

[0063] The present invention uses efficient matrix operations to generate additional feature maps, thereby improving the computational efficiency and performance of the network while maintaining memory efficiency. The implementation of Ghost convolution usually involves dimensionality reduction and upsampling of the feature map, which is then spliced ​​with the original feature map to enrich the network's information capture capabilities. The present invention uses Ghost convolution technology to improve the performance of convolutional neural networks on resource-constrained devices.

[0064] 3. Improve the quality of human-computer interaction experience The existing system performs poorly in real-time and it is difficult to effectively detect foreign object intrusion on railway tracks in real-time applications.

[0065] The solution of the present invention uses pyside6 to write the GUI interface, aiming to provide a user-friendly foreign object detection experience. The main interface design is concise and clear. Through the intuitive layout and clear functional areas, users can easily load the railway track images or videos to be detected and flexibly adjust the detection parameters. The foreign object detection area provides a convenient file loading option, and users can select local files or load data from cloud storage.

[0066] Summary: The present invention solves the defects and shortcomings of the prior art by the following methods: 1. This paper adopts a railway foreign object intrusion detection model based on the attention mechanism, and adds the SE attention mechanism after the neck (PANet) of YOLOv8 to enhance the robustness and accuracy of the system in complex environments.

[0067] 2. The SE module dynamically adjusts the feature weights so that the model can focus more on target-related features, ignore interference factors, and improve detection results.

[0068] 3. Use Ghost convolution to generate feature maps, reduce computational complexity and the number of parameters, and improve detection efficiency and performance.

[0069] 4. Use pyside6 to write the GUI interface to provide a user-friendly foreign body detection experience, including a concise and clear main interface design, convenient file loading options and flexible parameter adjustment functions.

[0070] In summary, the present invention improves the performance and real-time performance of the railway track foreign object intrusion detection system, making it more suitable for practical application scenarios.

[0071] The key technical points of the present invention are: 1. Railway track foreign body detection algorithm based on optimized and improved YOLOv8: The SE attention mechanism and Ghost convolutional neural network are added to integrate and optimize the YOLOv8 algorithm, reducing the computational complexity of the model algorithm and improving the real-time performance and accuracy of the detection system. The system's detection performance of foreign objects on railway tracks is enhanced, and the system's robustness in complex environments is improved.

[0072] 2. Design and implementation of foreign body intrusion detection system: Detailed assessment and optimization of system performance, proposed evaluation methods for indicators such as accuracy, and improved user operation experience by writing a GUI interface using PySide6. The human-computer interaction experience is enhanced, making parameter setting and result viewing more intuitive, improving the practicality of the system and user satisfaction.

[0073] In general, the solution of the present invention: 1. Improve detection accuracy and robustness: Integrate the SE attention mechanism module after the Neck (PANet) of the YOLOv8 detection model, and dynamically adjust the feature weights to make the model pay more attention to target-related features, reduce interference, and improve detection performance.

[0074] 2. Reduce the computational complexity of traditional detection systems and improve system real-time performance and response speed: By using Ghost convolution to replace the stacked convolution in the YOLOv8 model to generate feature maps, redundant features are reduced and memory usage is reduced.

[0075] 3. Enhanced human-computer interaction experience: Through the GUI interface written in PySide6, users can easily load data, adjust parameters, and obtain detection results in real time, which improves the system's ease of use and user experience.

[0076] in conclusion The present invention proposes a railway track foreign body detection system based on an improved YOLOv8 model, aiming to improve the efficiency and safety of railway operation management. Aiming at the problems of high computational complexity, slow response speed, low model accuracy and poor human-computer interaction experience of railway track foreign body intrusion detection, the present invention introduces SE attention mechanism module and Ghost convolution in the YOLOv8 model. These technical innovations significantly improve the detection accuracy of the model in complex environments. The SE attention mechanism enables the model to focus on key features more effectively and enhance the recognition ability of track foreign bodies by adaptively recalibrating the weights of feature channels. On the other hand, Ghost convolution greatly reduces the amount of calculation by generating fewer redundant features while maintaining the expressive power of the model. This method generates a "ghost" feature map through a set of linear transformations, which significantly reduces the consumption of computing resources and memory usage. These improvements not only improve the detection accuracy and speed of the model, but also enhance the robustness to different lighting conditions and small targets, making the railway track monitoring system more efficient and reliable in practical applications. Finally, the present invention develops a more convenient and easy-to-use humanized detection system based on PySide6. With the continuous development of technology, railway track foreign object monitoring based on computer vision will become the core force of railway transportation safety, improve transportation efficiency, reduce operating costs, and gradually realize intelligent monitoring and management, injecting new vitality into the safety, efficiency and sustainable development of railway transportation.

[0077] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A railway track foreign object detection system based on an improved YOLOv8 model, characterized in that: The implementation of this system includes the following steps: Step 1. The Rail Track v2 Dataset is used. This dataset contains high-resolution rail images, covering scenes under various weather and lighting conditions. The dataset contains images of different types of foreign objects on railway tracks, with various shapes and sizes and under different lighting conditions. Step 2. First, the SE attention mechanism is integrated after the neck part; through global average pooling and fully connected layers, this mechanism effectively adjusts the weights of feature channels. In addition, Ghost convolution is introduced in the head structure; The SE module compresses spatial information through global average pooling, then uses the fully connected layer to capture the dependencies between channels, and finally generates channel weight coefficients through the Sigmoid activation function. In the head structure of YOLOv8, Ghost convolution generates a set of basic feature maps and uses cheap linear transformations to generate more Ghost feature maps; Step 3. The railway track foreign body detection system is deployed using the GUI written in PySide6. The system expands the detection method by connecting the camera, and realizes real-time monitoring and rapid response; GUI interface design and deployment based on the pyside6 platform; Step 4. Deploy the cloud. Users can upload files and load stored data in the cloud.

2. The railway track foreign body detection system based on the improved YOLOv8 model according to claim 1 is characterized in that: First, the feature map output by the neck layer is obtained as the input of the SE module. The "Squeeze" operation is performed through global average pooling to compress the spatial dimension of the feature map into a single statistic for each channel; these statistics are "Excitation" operated through a two-layer fully connected network. The first layer is used for dimensionality reduction and ReLU activation is applied, and the second layer restores the original number of channels and uses the Sigmoid activation function to generate channel weight coefficients. Then, these weights are multiplied by the original feature map to achieve channel-level feature recalibration. The feature map processed by the SE module is then passed to the detection head of YOLOv8 for target detection.

3. The railway track foreign body detection system based on the improved YOLOv8 model according to claim 2 is characterized in that: The user sets the parameters and clicks "Start Detection". The system then detects foreign objects in images or videos in real time and marks the location and category of the foreign objects in the result display area to help quickly identify abnormal objects. In terms of code implementation, PySide6, ultralytics, and standard Python libraries are first imported, and the YOLOPredictor class is defined, which inherits from BasePredictor and QObject, encapsulates the loading and reasoning operations of the YOLO model, and uses signals to communicate with the main window to transmit image, status, FPS, and detection result information.

4. The railway track foreign body detection system based on the improved YOLOv8 model according to claim 3 is characterized in that: Connecting the depth camera to the detection system enables real-time monitoring of foreign objects on railway tracks; by uploading the data stream to the cloud, the system can perform large-scale data processing and storage, and support remote access and monitoring.

Citation Information

Patent Citations

  • Improved storage of liferafts

    CN110234567A

  • Liquid veterinary drug cooling device

    CN110345678A

  • Full-coverage path planning method of cleaning robot

    CN110456789A

  • Color measurement benchmark determination method

    CN110567890A

Cited By

  • Track light spot target detection method, system and equipment

    CN120672772A

  • Railway foreign object monitoring device and unpacking system

    CN224594494U