A modern tram slot-type rail turnout automatic identification method and system

By improving the YOLOv5 network, adopting PP-LCNet and a bidirectional weighted feature pyramid network, and combining the EIoU loss function, the speed and accuracy problems of modern tram slotted turnout identification were solved, achieving fast and accurate turnout identification.

CN116664906BActive Publication Date: 2025-11-11JINAN UNIVERSITY
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310352328.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-03
Publication Date
2025-11-11
Estimated Expiration
2043-04-03

AI Technical Summary

Technical Problem

Existing technologies cannot effectively identify the slotted track switches of modern trams, leading to damage to cleaning tools and the need for manual intervention. Furthermore, existing methods have low recognition rates, are slow, and are greatly affected by the environment.

Method used

An improved YOLOv5 network is adopted, replacing the backbone network with the PP-LCNet model. A bidirectional weighted feature pyramid network is used to fuse feature maps, and the EIoU loss function is employed to improve the speed and accuracy of turnout identification.

Benefits of technology

It enables rapid and accurate identification of turnouts, reduces model parameters, improves recognition rate and speed, and is suitable for low-configuration equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116664906B_ABST
    Figure CN116664906B_ABST
Patent Text Reader

Abstract

This invention discloses an automatic identification method and system for slotted track switches on modern trams. The method includes the following steps: frame-by-frame decomposition of the slotted track video stream and image preprocessing to obtain preprocessed slotted track switch images; construction and training of an image detection network based on a YOLOv5 network, the image detection network including an input terminal, a backbone network, a feature fusion part, and a regression function. The input terminal uses the image input terminal of the YOLOv5 network, the backbone network uses the PP-LCNet model, the feature fusion part uses a bidirectional weighted feature pyramid network, and the regression function uses the EIoU loss function; labeling the switch types in the images to form an image dataset; inputting newly acquired slotted track switch images into the trained image detection network to obtain switch labeling diagrams and switch types. This invention provides assisted and precise localization of the detected switch regions, improving the speed, rate, and accuracy of switch identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, specifically to an automatic identification method and system for slotted track switches on modern trams. Background Technology

[0002] Currently, most modern trams use grooved rails, unlike the I-beam rails used in existing national railways, subways, and light rail systems. Because modern tram grooved rails are embedded below the road surface, they easily accumulate debris such as leaves, pebbles, and mud. Furthermore, after rain, these debris adhere to the grooved surfaces of the rails, corroding the rails and vehicle components, and in severe cases, affecting the safety of modern tram operations. However, current track cleaning vehicles cannot automatically identify switches during the cleaning process. Passing through switches easily damages the cleaning tools, requiring manual identification of switches and control of the lifting of cleaning tools to clean them and protect the tools. Failure to lift the cleaning device at the switch in time can cause irreversible damage to the cleaning equipment on the vehicle. Simultaneously, manual operation hinders the achievement of fully automated track cleaning.

[0003] Existing technologies include computer vision and lidar detection methods for turnout identification. For example, a vision-based track turnout identification method (patent publication number CN111860137A) uses a track turnout classification network model and defect point detection method to replace ordinary manual camera recognition. However, the defect point detection method is prone to missed detections, has a relatively low recognition rate, and is slow. Another example is a lidar-based railway turnout detection method (patent publication number CN110736999A), which uses lidar to scan the ground in front of the train in real time, builds a model from point cloud data, and compares it with the dataset to identify the turnout. However, lidar is expensive and has high requirements for the working environment and mobile device configuration. Moreover, all of the above methods have a problem: they require a large number of sample datasets for pre-training and are easily affected by complex environments. Summary of the Invention

[0004] To overcome the shortcomings and deficiencies of existing technologies, this invention provides an automatic identification method and system for modern tramway slotted turnouts. This invention replaces the YOLOv5 network backbone with a PP-LCNet model, thereby reducing the number of parameters in the model. The feature fusion part adopts a bidirectional weighted feature pyramid network to facilitate the fusion of feature maps with different spatial resolutions, thus balancing the accuracy loss caused by the lightweighting of the model backbone. The regression function uses the EIoU loss function to avoid mismatch between the predicted and ground truth bounding boxes during training, improving the network convergence speed. The improved YOLOv5 network has better detection performance, providing auxiliary and accurate localization of the area of ​​the detected turnout, thereby improving the turnout identification speed, recognition rate, and accuracy.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] This invention provides an automatic identification method for slotted track switches in modern trams, comprising the following steps:

[0007] Obtain the video stream of the slotted track, decompose the video stream frame by frame, and obtain a single frame image of the slotted track;

[0008] Image preprocessing is performed on each frame of the slotted track image to obtain the preprocessed image of the slotted track turnout of a modern tram.

[0009] An image detection network is constructed based on the YOLOv5 network. The image detection network includes an input terminal, a backbone network, a feature fusion part, and a regression function. The input terminal adopts the image input terminal of the YOLOv5 network to receive images of the slotted track switches of modern trams. The backbone network adopts the PP-LCNet model. The feature fusion part adopts a bidirectional weighted feature pyramid network. The regression function adopts the EIoU loss function.

[0010] The turnout types of modern tramway slotted turnout images are labeled to form an image dataset, which is then divided into training, validation and test sets.

[0011] The image detection network is trained based on the training set. The newly acquired images of modern tramway slotted turnouts are input into the trained image detection network to obtain the turnout annotation diagram and turnout type.

[0012] As a preferred technical solution, the image preprocessing includes image processing methods such as image grayscale conversion, Gaussian filtering, and histogram equalization.

[0013] As a preferred technical solution, the PP-LCNet model includes multiple LCBlock modules, which employ depthwise separable convolution operations. Each LCBlock module includes two local connection layers and one shortcut connection layer. The local connection layers replace the globally connected convolution operations of YOLOv5 with local connections, and the shortcut connection layer adds the input feature map to the output feature map.

[0014] As a preferred technical solution, the backbone network adopts the PP-LCNet model. The YOLOv5 network backbone is replaced with the PP-LCNet model to obtain the PP-LCNet-YOLOv5 network. The PP-LCNet-YOLOv5 network includes nine modules. The first module adopts a convolutional module to extract low-level features of the input image. The second to eighth modules adopt depthwise separable convolutional modules. The second to seventh modules all add Batch Normalization and activation functions. The eighth module includes an SE module. The ninth module adopts the SPPF layer in the backbone part of the YOLOv5 network to perform pooling operations of four sizes on the input image and concatenate the pooled feature maps.

[0015] As a preferred technical solution, the feature fusion part adopts a bidirectional weighted feature pyramid network, treating each feature map as a node, and representing the relationship between feature maps through a bidirectional directed graph. Each node is connected to its context nodes, and the weights between each node are learned. The weighted fusion result for each feature node is expressed as follows:

[0016]

[0017] Where, x j This represents other feature nodes connected to the node, where n represents the number of nodes connecting to the node, and w ij This represents the weight between nodes.

[0018] As a preferred technical solution, the bidirectional weighted feature pyramid network adopts a learnable weight strategy based on an attention mechanism. Each node i is regarded as an attention head, and the weight w is calculated based on the feature map of its context node j. ij .

[0019] As a preferred technical solution, the turnout type of the slotted track turnout image of modern tram is labeled, and the turnout type includes X-type turnout and Y-type turnout.

[0020] As a preferred technical solution, the turnout type of the slotted track turnout image of modern tram is marked. If a turnout is determined to appear in the image, the turnout part is marked with a rectangle; if the turnout type appears in less than half of the image, it is not marked.

[0021] Each image is labeled to generate a corresponding information file, which includes the x and y coordinates of the center point of the rectangle corresponding to the turnout, as well as the width and height of the rectangle.

[0022] As a preferred technical solution, the method also includes image enhancement processing steps, including Mosaic data enhancement, initialization, and normalization.

[0023] The present invention also provides an automatic identification system for slotted track switches of modern trams, comprising: a slotted track image acquisition module, an image preprocessing module, an image detection network construction module, an image dataset construction module, an image dataset partitioning module, an image detection network training module, and a switch identification result output module;

[0024] The grooved track image acquisition module is used to acquire the grooved track video stream, decompose the video stream frame by frame, and acquire a single frame grooved track image.

[0025] The image preprocessing module is used to preprocess each frame of the slotted track image to obtain a preprocessed image of the slotted track turnout of a modern tram.

[0026] The image detection network construction module is used to construct an image detection network based on the YOLOv5 network. The image detection network includes an input end, a backbone network, a feature fusion part, and a regression function. The input end adopts the image input end of the YOLOv5 network to receive images of modern tram trough-type turnouts. The backbone network adopts the PP-LCNet model. The feature fusion part adopts a bidirectional weighted feature pyramid network. The regression function adopts the EIoU loss function.

[0027] The image dataset construction module is used to label the turnout type of images of modern tramway slotted turnouts to form an image dataset;

[0028] The image dataset partitioning module is used to partition the image dataset into a training set, a validation set, and a test set.

[0029] The image detection network training module is used to train the image detection network based on the training set;

[0030] The turnout recognition result output module is used to input the newly acquired image of the modern tramway slotted turnout into the trained image detection network to obtain the turnout annotation diagram and turnout type.

[0031] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0032] This invention replaces the YOLOv5 network backbone with the PP-LCNet model, thereby reducing the number of parameters in the model. The feature fusion part adopts a bidirectional weighted feature pyramid network to facilitate the fusion of feature maps with different spatial resolutions, thus balancing the accuracy loss caused by the lightweighting of the model backbone. The regression function adopts the EIoU loss function to avoid mismatch between the orientation of the predicted box and the ground truth box during training, thereby improving the network convergence speed. The improved YOLOv5 network has better detection performance and can assist in the accurate localization of the area of ​​the detected turnout, thereby improving the recognition speed, recognition rate and recognition accuracy of the turnout. Attached Figure Description

[0033] Figure 1 A flowchart illustrating the automatic identification method for slotted track switches in modern trams according to the present invention;

[0034] Figure 2 This is a schematic diagram of the network structure of the image detection network of the present invention;

[0035] Figure 3 This is a schematic diagram of the network structure of the backbone network of this invention using the PP-LCNet model;

[0036] Figure 4 This is a schematic diagram of the PP-LCNet-YOLOv5 network structure of the present invention;

[0037] Figure 5 (a) is a schematic diagram of the FPN network structure;

[0038] Figure 5 (b) is a schematic diagram of the PAN network structure;

[0039] Figure 5 (c) is a schematic diagram of the weighted bidirectional feature pyramid network structure.

[0040] Figure 6 This is a schematic diagram of the turnout image of the present invention. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0042] Example 1

[0043] like Figure 1As shown, this embodiment provides an automatic identification method for slotted track switches on modern trams. It can identify the type of slotted track switch and obtain its accurate position based on a video stream. The method boasts high detection speed, can be speed-matched with high-resolution camera arrays, and provides accurate and effective detection results. This better assists in the automatic cleaning operation of modern tram track cleaning vehicles. The specific steps include:

[0044] S1: Obtain the video stream of the slotted track, decompose the video stream frame by frame, and obtain a single frame of the slotted track image;

[0045] In this embodiment, a high-speed camera group is equipped on the modern tram trough track cleaning vehicle to acquire the trough track video stream in real time, monitor the working status of the camera in real time, and decompose the video stream frame by frame.

[0046] S2: Perform image preprocessing on each frame of the slotted track image to obtain the preprocessed image of the slotted track turnout of the modern tram.

[0047] Due to the complex railway inspection environment, noise will inevitably exist in the original image. On the other hand, in the turnout section, the camera's shooting angle causes a large difference in gray level between the two rails, which will affect the detection accuracy. In this embodiment, preprocessing operations such as grayscale conversion, Gaussian filtering, and histogram equalization are performed on each frame of the image to eliminate the influence of certain external factors on the image and improve the overall detection efficiency. Then, the image resolution is modified to obtain an image suitable for input into the image detection network, thereby improving the image quality.

[0048] In this embodiment, Gaussian filtering is specifically represented as follows:

[0049]

[0050] Where Φ (x,y) These are the pixel values ​​of the processed image. x0 and y0 represent the horizontal and vertical coordinates of the standard pixel point, respectively. x and y represent the horizontal and vertical coordinates of each pixel, respectively. λ is the amplitude, and δx and δy represent the standard deviations in the x and y directions. The size of the Gaussian filter template is 3×3.

[0051] For grayscale images, the purpose of histogram equalization is to transform the pixel values ​​in the original image into an approximately uniform distribution. In this way, the image contrast is enhanced, and the detailed information within the image is fully revealed. The transformation function of histogram equalization is specifically expressed as:

[0052]

[0053] Where H(v) is the result of histogram equalization, v is the gray level of the input pixel, and A is the maximum value of the pixel in the original image. It is the probability density function of the grayscale values ​​of the original image.

[0054] Spatial domain filtering of images is a method of Gaussian filtering based on the spatial relationship between a pixel and its surrounding neighboring pixels, achieved through convolution operations. It filters a specific neighborhood of the current pixel and is a domain operation. Gray-level transformation, on the other hand, only calculates the gray-level transformation function for the current pixel and is a point operation. Gray-level transformation has several advantages: by changing the gray values ​​of pixels, it can increase or decrease the contrast and brightness of the image, allowing more image details to be displayed; it can highlight image details of interest or suppress details that need to be masked; and it can expand or compress the image's gray-level histogram distribution, making the histogram distribution more even or dense. In this embodiment, using a pre-processed image for turnout recognition can significantly reduce the amount of data and computation, reduce processing costs, and increase the efficiency and accuracy of turnout recognition.

[0055] S3: Construct an image detection network based on the YOLOv5 network, such as Figure 2 As shown, the image detection network includes an input end, a backbone network, a feature fusion part, and a regression function. The input end uses the YOLOv5 network to receive images of modern tramway trough-type turnouts. The backbone network uses the PP-LCNet model. The feature fusion part uses a bidirectional weighted feature pyramid network. The regression function uses the EIoU loss function.

[0056] Specifically, it includes:

[0057] The image input end of the YOLOv5 network is retained to receive the original image of the slotted track switch of a modern tram acquired by the image acquisition device. The original image is an image with a size of 640×640×3.

[0058] To address the issues of gradient vanishing and reduced network accuracy caused by excessively deep network structures, this embodiment selects the PP-LCNet model as the backbone network of YOLOv5 to further improve the orbit detection accuracy of the YOLOv5 object detector. The PP-LCNet model uses the DeapthSepCov (depth-separable convolution) proposed by MobileNetV1 as its basic module, and performs several optimizations on this basis. The PP-LCNet model employs multiple LCBlock modules, each containing two local connection layers (LocalConv) and one shortcut connection layer (Shortcut). The local connection layers replace the globally connected convolutional operations with local connections, thereby reducing model parameters and computational cost; the shortcut connection layer accelerates the model's convergence speed by directly adding the input feature map to the output feature map. Figure 3As shown, in the PP-LCNet model, depthwise separable convolution is used between LCBlock modules to further reduce model parameters and computational cost, thereby improving the model's running efficiency and speed.

[0059] like Figure 4 As shown, replacing the YOLOv5 backbone with PP-LCNet results in a simpler structure and lower training difficulty compared to CSPNet. PP-LCNet also performs better in handling large-scale object detection. The optimized PP-LCNet-YOLOv5 network structure can be divided into nine parts (B1–B9). Module B1 uses 3×3 ordinary convolutions for feature extraction, primarily for extracting low-level features from the input image. Modules B2–B8 consist of depthwise separable convolutions (DepthSepConv) to reduce model parameters and computational overhead. Modules B2–B7, as well as the first convolutional layer of B7, use 3×3 kernels, while the subsequent five convolutional layers in B5 and all convolutional layers in B7 use 5×5 kernels. Furthermore, modules B2–B7 incorporate Batch Normalization and activation functions to enhance the network's non-linear mapping capabilities. Module B8 introduces a Sequential Enhancing (SE) module to strengthen salient features and suppress unimportant features. The B9 module is the SPPF layer in the backbone of the YOLOv5 network. The SPPF layer performs four pooling operations (1x1, 2x2, 3x3, and 6x6) on the input feature maps and then concatenates these pooled feature maps. Based on this, the SPPF layer can perceive target objects at different scales while preserving high-level semantic information of the feature maps. Compared to CSPNet, PP-LCNet has a simpler structure, is easier to train, and performs better in handling large-scale object detection problems.

[0060] To compensate for the accuracy loss caused by simplifying the network model, this embodiment improves the feature fusion part of the model. Large targets are usually associated with deep feature maps, while small targets are usually associated with shallow feature maps. The detection network deepens the network by downsampling and convolution layer by layer to obtain more semantic information and retain feature maps at different depths. This is because deeper feature maps generally have more semantic information; however, some small pixels are ignored and some positional information is lost, while shallow feature maps have more positional information and less semantic information, both of which are important for object detection. When an image is input into the detection network, features are extracted by the backbone, generating feature maps with different spatial resolutions at different network depths. The FPN transmits these feature information from top to bottom at different depths, retaining the relevant spatial positional information of the feature maps at different scales, supplementing the limited semantic information of the network prediction anchors, and fusing these feature information through 1×1 convolution operations. However, this top-down lateral connection pyramid structure is prone to losing shallow feature maps, resulting in low accuracy in small target detection. The original YOLOv5 network used two different feature pyramid networks, PAN and FPN (Feature Pyramid Network), to fuse feature maps of different scales. For example... Figure 5 As shown in (a), FPN fuses feature maps of different resolutions by connecting the top to the bottom of the network, allowing the high-resolution feature map at the bottom to be fused with the low-resolution feature map at the top. Specifically, FPN fuses high-level semantic information and low-level detail information through cross-layer connections, enabling the model to perform detection at different scales and improving the detection accuracy of small targets. Figure 5As shown in (b), PAN employs a bottom-up and top-down feature fusion method, which can better fuse feature maps of different resolutions. However, feature maps with different spatial resolutions have significant semantic differences due to their varying depths. Feature maps at different scales sometimes contain conflicting information about the size of target instances, which can interfere with gradient calculations during network training and reduce the effectiveness of the feature pyramid. Based on this, this embodiment introduces a weighted bidirectional feature pyramid network (BiFPN), adding BiFPN to YOLOv5 and modifying the head to more effectively fuse features of different resolutions. Unlike traditional feature pyramid networks (FPN), BiFPN primarily improves the accuracy of object detection by fusing features at different levels. This method allows for dynamic adjustment of the weights between nodes based on the relevance and information content of contextual features, resulting in more accurate and robust feature fusion results. BiFPN uses a bidirectional weighted approach to fuse feature maps. Specifically, it treats each feature map as a node and represents the relationships between them using a bidirectional directed graph. In the graph, each node is connected to its context nodes, and the weights between each node are learned. For each feature node i, the weighted fusion result can be expressed as:

[0061]

[0062] Where, x j This represents other feature nodes connected to the node, where n represents the number of nodes connecting to the node, and w ij The weights between nodes are represented by the node name. To enable efficient learning and updating of these weights, BiFPN employs a learnable weight strategy based on an attention mechanism. Specifically, each node i is treated as an attention head, and a weight w is calculated based on the feature map of its context node j. ij This is achieved through a neural network with an activation function. By using this method, the weights between nodes can be dynamically adjusted based on the relevance and information content of contextual features, thus obtaining more accurate and robust feature fusion results. For example... Figure 5 As shown in (c), the original YOLOv5 network has 5 feature layers, of which only layers 3 to 5 undergo feature fusion. The shallow semantic information in layer 2 plays a crucial role in small object detection. Therefore, this embodiment selects to retain layers 2 and 5 for feature fusion. The size of these feature maps is typically enlarged to 160x160 to improve object detection accuracy. BiFPN is then used to fuse features from layers 3 to 5. When adding the BiFPN layer, cross-scale connections are used to fuse and enhance feature maps of different scales to improve object detection performance, especially the accuracy of small object detection.

[0063] The original YOLOv5 network's built-in loss function is GIoU, which, compared to IOU, adds the minimum bounding rectangle of the predicted and ground truth boxes, essentially adding a penalty term. However, GIoU only considers the distance between the center points of the target boxes, the difference in width and height, and the area of ​​the bounding rectangle when calculating the distance value, without considering the aspect ratio of the target boxes. Furthermore, GIoU is sensitive to changes in target scale; when the target scale changes, the distance between the center points of the target boxes, the difference in width and height, and the area of ​​the bounding rectangle all change, leading to a shift in the GIoU calculation results. Therefore, this embodiment uses the EIoU loss function instead of the GIoU loss function. Compared to GIoU, EIoU can more accurately measure the matching degree between the predicted and ground truth target boxes, especially in cases with complex target overlap, where EIoU can better distinguish the quality of the predicted target boxes. In addition, CIoU is more sensitive to the aspect ratio of the target boxes when measuring the target box matching degree, and can better adapt to target boxes with different aspect ratios. Meanwhile, when calculating the loss of false detection boxes, EIoU sets the IoU index between target boxes to 0, and takes into account the losses of positional and size offsets. This allows it to better distinguish between false detections and missed detections, imposes stricter penalties on false detections, and improves the regression accuracy of bounding boxes.

[0064] S4: Label the turnout types in the images of modern tramway slotted turnouts to form an image dataset, and divide it into training set, validation set and test set;

[0065] In this embodiment, the labelImg image annotation software is used to annotate the turnout type of modern tramway slotted turnout images. Specifically, to expand the dataset, such as... Figure 6 As shown, images containing X and Y type turnouts were collected respectively;

[0066] During the image annotation process: 1) If a turnout appears in the image, the visible portion of the X and Y type turnouts in the image is circled with the smallest rectangle; 2) If less than half of the two types of turnouts appear in the image, they are not marked; In order to meet the subsequent training requirements, each image will generate a corresponding information file after annotation. The information file includes the horizontal and vertical coordinates of the center point of the rectangle corresponding to the X and Y type turnouts, as well as the width and height of the rectangle; Here, the coordinates are relative to the width and height, calculated by dividing the true coordinates by the width and height, that is, the standardized (between 0 and 1) values.

[0067] In this embodiment, the dataset is divided into a training set, a validation set, and a test set in a ratio of 8:2:1; and YOLOv5s pre-trained weights are used for training to achieve fast and accurate location of turnouts in images.

[0068] S5: Train the image detection network based on the training set, input the newly acquired images of modern tramway slotted turnouts into the trained image detection network, and obtain the turnout annotation box diagram and turnout type.

[0069] In this embodiment, the image detection network training also includes an image enhancement process, including Mosaic data enhancement, initialization, and normalization.

[0070] The YOLOv5 algorithm itself is characterized by fast recognition speed and low environmental requirements. This embodiment improves the YOLOv5 backbone network, feature fusion, and loss function by changing the YOLOv5 backbone network. As a result, the trained model has a faster recognition speed and higher recognition accuracy under the same recognition category range, and the weight file is smaller, so it can be installed on mobile devices with lower configurations.

[0071] Example 2

[0072] This embodiment provides an automatic identification system for slotted track switches in modern trams, including: a slotted track image acquisition module, an image preprocessing module, an image detection network construction module, an image dataset construction module, an image dataset partitioning module, an image detection network training module, and a switch identification result output module.

[0073] In this embodiment, the grooved track image acquisition module is used to acquire the grooved track video stream, decompose the video stream frame by frame, and acquire a single frame of grooved track image.

[0074] In this embodiment, the image preprocessing module is used to preprocess each frame of the slotted track image to obtain a preprocessed image of the slotted track turnout of a modern tram.

[0075] In this embodiment, the image detection network construction module is used to construct an image detection network based on the YOLOv5 network. The image detection network includes an input end, a backbone network, a feature fusion part, and a regression function. The input end adopts the image input end of the YOLOv5 network to receive images of the slotted track switches of modern trams. The backbone network adopts the PP-LCNet model. The feature fusion part adopts a bidirectional weighted feature pyramid network. The regression function adopts the EIoU loss function.

[0076] In this embodiment, the image dataset construction module is used to label the turnout type of images of modern tramway slotted turnouts to form an image dataset;

[0077] In this embodiment, the image dataset partitioning module is used to partition the image dataset into a training set, a validation set, and a test set;

[0078] In this embodiment, the image detection network training module is used to train the image detection network based on the training set;

[0079] In this embodiment, the turnout recognition result output module is used to input the newly acquired image of the modern tramway slotted turnout into the trained image detection network to obtain the turnout annotation diagram and the turnout type.

[0080] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A method for automatic identification of slotted track switches in modern trams, characterized in that, Includes the following steps: Obtain the video stream of the slotted track, decompose the video stream frame by frame, and obtain a single frame image of the slotted track; Image preprocessing is performed on each frame of the slotted track image to obtain the preprocessed image of the slotted track turnout of a modern tram. An image detection network is constructed based on the YOLOv5 network. The image detection network includes an input terminal, a backbone network, a feature fusion part, and a regression function. The input terminal adopts the image input terminal of the YOLOv5 network to receive images of modern tramway trough-type turnouts. The backbone network adopts the PP-LCNet model. The YOLOv5 network backbone is replaced with the PP-LCNet model to obtain the PP-LCNet-YOLOv5 network. The PP-LCNet-YOLOv5 network includes nine modules. The first module uses a convolutional module to extract low-level features of the input image. The second to eighth modules use depthwise separable convolutional modules. The second to seventh modules all add Batch Normalization and activation functions. The eighth module includes an SE module. The ninth module uses the SPPF layer in the backbone part of the YOLOv5 network to perform pooling operations of four sizes on the input image and concatenate the pooled feature maps. The feature fusion part adopts a bidirectional weighted feature pyramid network. The regression function adopts the EIoU loss function. The turnout types of modern tramway slotted turnout images are labeled to form an image dataset, which is then divided into training, validation and test sets. The image detection network is trained based on the training set. The newly acquired images of modern tramway slotted turnouts are input into the trained image detection network to obtain the turnout annotation diagram and turnout type.

2. The automatic identification method for slotted track switches of modern trams according to claim 1, characterized in that, The image preprocessing includes image grayscale conversion, Gaussian filtering, and histogram equalization.

3. The automatic identification method for slotted track switches of modern trams according to claim 1, characterized in that, The PP-LCNet model includes multiple LCBlock modules, which employ depthwise separable convolution operations. Each LCBlock module includes two local connection layers and one shortcut connection layer. The local connection layers replace the globally connected convolution operations of YOLOv5 with local connections, and the shortcut connection layer adds the input feature map to the output feature map.

4. The automatic identification method for slotted track switches of modern trams according to claim 1, characterized in that, The feature fusion part employs a bidirectional weighted feature pyramid network, treating each feature map as a node and representing the relationships between feature maps through a bidirectional directed graph. Each node is connected to its context nodes, and the weights between each node are learned. The weighted fusion result for each feature node is expressed as follows: ; in, Represents nodes Other connected feature nodes, Indicates the connection node The number of nodes, Represents a node and nodes The weights between them.

5. The automatic identification method for slotted track switches of modern trams according to claim 4, characterized in that, The bidirectional weighted feature pyramid network employs a learnable weight strategy based on an attention mechanism, with each node... All are treated as an attention head, and their attention is determined based on their context nodes. The feature map is used to calculate the weights. .

6. The automatic identification method for slotted track switches of modern trams according to claim 1, characterized in that, The turnout types in images of modern tramway trough-type turnouts are labeled, including X-type turnouts and Y-type turnouts.

7. The automatic identification method for slotted track switches of modern trams according to claim 1, characterized in that, The turnout type of the slotted track turnout image of modern tram is labeled. If the turnout is determined to appear in the image, the turnout part is labeled with a rectangle; if the turnout type appears in less than half of the image, it is not labeled. Each image is labeled to generate a corresponding information file, which includes the x and y coordinates of the center point of the rectangle corresponding to the turnout, as well as the width and height of the rectangle.

8. The automatic identification method for slotted track switches of modern trams according to claim 1, characterized in that, It also includes image enhancement processing steps, including Mosaic data enhancement, initialization, and normalization.

9. An automatic identification system for slotted track switches in modern trams, characterized in that, include: The module includes a slotted track image acquisition module, an image preprocessing module, an image detection network construction module, an image dataset construction module, an image dataset partitioning module, an image detection network training module, and a turnout recognition result output module. The grooved track image acquisition module is used to acquire the grooved track video stream, decompose the video stream frame by frame, and acquire a single frame grooved track image. The image preprocessing module is used to preprocess each frame of the slotted track image to obtain a preprocessed image of the slotted track turnout of a modern tram. The image detection network construction module is used to build an image detection network based on the YOLOv5 network. The image detection network includes an input end, a backbone network, a feature fusion part, and a regression function. The input end adopts the image input end of the YOLOv5 network to receive images of modern tram trough-type turnouts. The backbone network adopts the PP-LCNet model. The YOLOv5 network backbone is replaced with the PP-LCNet model to obtain the PP-LCNet-YOLOv5 network. The PP-LCNet-YOLOv5 network includes nine modules. The first module adopts a convolution module to extract low-level features of the input image. The second to eighth modules adopt depthwise separable convolution modules. The second to seventh modules all add BatchNormalization and activation functions. The eighth module includes an SE module. The ninth module adopts the SPPF layer in the backbone part of the YOLOv5 network to perform pooling operations of four sizes on the input image and concatenate the pooled feature maps. The feature fusion part adopts a bidirectional weighted feature pyramid network. The regression function adopts the EIoU loss function. The image dataset construction module is used to label the turnout type of images of modern tramway slotted turnouts to form an image dataset; The image dataset partitioning module is used to partition the image dataset into a training set, a validation set, and a test set. The image detection network training module is used to train the image detection network based on the training set; The turnout recognition result output module is used to input the newly acquired image of the modern tramway slotted turnout into the trained image detection network to obtain the turnout annotation diagram and turnout type.

Citation Information

Patent Citations

  • Laser radar-based railway turnout detection method

    CN110736999A

  • Vision-based track turnout identification method

    CN111860137A

  • Vehicle-mounted target detection method based on improved YOLOv5

    CN115731533A

  • Arithmetic question marking system based on mixnet-yolov3 and convolutional recurrent neural network (CRNN)

    WO2022147965A1