Track light spot target detection method, system and equipment

By enhancing image feature points and improving the YOLOv8 model, the problems of track spot target detection accuracy and terminal device inference speed in low signal-to-noise ratio environments were solved, and efficient and accurate track spot target detection was achieved.

CN120672772APending Publication Date: 2025-09-19SHANDONG ZHIYANG HUITONG DIGITAL TECH CO LTD

Patent Information

Application Number
CN202510663582.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing technologies have difficulty in efficiently distinguishing track spot targets in low signal-to-noise ratio environments, and terminal devices have slow inference speeds and insufficient generalization capabilities, requiring frequent manual intervention.

Method used

Image feature point enhancement technology and improved YOLOv8 model are used to enhance image contrast through threshold segmentation and attention mechanism modules, negative sample training data is added, and L1 regularization is introduced to crop the BN layer weights.

Benefits of technology

It improves the accuracy of track spot target detection and the inference speed of terminal devices, enhances the generalization ability of the model, and reduces dependence on hardware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120672772A_ABST
    Figure CN120672772A_ABST
Patent Text Reader

Abstract

The invention provides a track light spot target detection method, system and device. The method comprises the steps that the contrast ratio of each track light spot original image is enhanced; obtaining a binary image of a light spot image area through threshold segmentation, and mapping the binary image to a track light spot original image to realize image enhancement; constructing a data set of light spot target detection by using the enhanced image; establishing an improved yolov8 model, adding an attention mechanism behind the last layer c2f of a backbone network of the model, and regularizing the c2f of the backbone network, the c2f of a head network and a bn layer in conv; training the improved model by using the data set; and inputting a to-be-detected track light spot image into the trained model, and outputting a track light spot target detection result. Based on the method, the invention further provides a track light spot target detection system and equipment. The image enhancement technology is introduced, so that the target point contrast is more obvious, feature points are easier to learn during network model training, and the detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of track light spot detection, and in particular relates to a track light spot target detection method, system and device. Background Art

[0002] Light spot detection technology uses high-precision sensors and complex algorithms to accurately measure and analyze light spots (i.e., light spots) formed in space. Chinese patent CN119741676A discloses a railway track foreign object detection system based on an improved Yolov8 model. This system integrates the SE attention mechanism behind the Yolov8 model's neck (PANet) to enhance the model's recognition capabilities. However, this patent focuses on the model's inherent recognition capabilities. If environmental changes obscure the characteristics of the object it identifies, false positives and false negatives can be significantly increased. Chinese patent CN119313663A discloses a Yolov8-based method for detecting rail bolt defects. This method utilizes K-Means++ clustering to optimize the acquisition of the highest priority bounding box, and improves bolt detection accuracy by calculating the loss of the optimal bounding box. While this method significantly improves the speed of selecting the priori bounding box during the model's post-processing stage, the inference speed of the terminal device remains unchanged.

[0003] Therefore, the existing technology for detecting track spot targets cannot effectively distinguish targets in low signal-to-noise ratio environments, that is, when pixel values ​​are uneven and there are many noise points. Complex environments require frequent human intervention, which wastes a lot of manpower and resources. Secondly, the high dependence on terminal hardware devices can significantly reduce the inference speed on recognition devices with low computing power, and may even cause the device to crash and become unable to infer. Moreover, the generalization ability of target recognition, for example, whether there will be false detections of objects other than track spot, requires special attention. Summary of the Invention

[0004] To address the aforementioned technical issues, the present invention proposes a method, system, and device for detecting track spot targets. By incorporating image feature point enhancement technology, the method enhances the contrast of target points, making them easier to learn during network model training and improving detection accuracy.

[0005] To achieve the above object, the present invention adopts the following technical solutions: A method for detecting a track spot target comprises the following steps: Acquire track spot images and enhance the image contrast of each acquired track spot original image; then obtain a binary image of the spot image area through threshold segmentation; map the binary image to the track spot original image to achieve track spot image enhancement; use the enhanced image to construct a dataset for spot target detection; An improved YOLOv8 model for track spot target detection was established. The improved YOLOv8 model added an attention mechanism module after the last C2F module in the backbone network, and performed L1 regularization on the BN layer in the C2F module of the backbone network, the C2F module of the head network, and the Conv module. The improved yolov8 model is trained using the data set to obtain the trained yolov8 model; the track spot image to be detected is input into the trained yolov8 model, and the result of track spot target detection is output.

[0006] The embodiment of the present invention also proposes a track spot target detection system, comprising: an image preprocessing module, a model building module and a detection output module; The image preprocessing module is used to obtain track spot images and enhance the image contrast of each acquired track spot original image; then, a binary image of the spot image area is obtained by threshold segmentation; the binary image is mapped to the track spot original image to achieve track spot image enhancement; and the enhanced image is used to construct a data set for spot target detection; The model building module is used to build an improved YOLOv8 model for track spot target detection. The improved YOLOv8 model adds an attention mechanism module after the last layer C2F module of the backbone network, and performs L1 regularization on the BN layer in the C2F module of the backbone network, the C2F module of the head network, and the Conv module; The detection output module is used to train the improved YOLOv8 model using the data set to obtain a trained YOLOv8 model; input the track spot image to be detected into the trained YOLOv8 model, and output the result of track spot target detection.

[0007] The embodiment of the present invention further provides a track spot target detection device, comprising: memory for storing computer programs; A processor is configured to implement the method steps described when executing the computer program. The effects provided in the summary of the invention are only the effects of the embodiments, not all the effects of the invention. One of the above technical solutions has the following advantages or beneficial effects: The present invention proposes a method, system, and device for detecting track light spot targets. The method includes the following steps: acquiring a track light spot image and enhancing the image contrast of each acquired original track light spot image; then obtaining a binary image of the light spot image region by threshold segmentation; mapping the binary image to the original track light spot image to achieve track light spot image enhancement; using the enhanced image to construct a data set for light spot target detection; establishing an improved Yolov8 model for track light spot target detection, wherein an attention mechanism module is added after the last C2F module in the backbone network of the improved Yolov8 model, and L1 regularization is performed on the BN layer in the C2F module of the backbone network, the C2F module of the head network, and the Conv module; training the improved Yolov8 model using the data set to obtain a trained Yolov8 model; inputting the track light spot image to be detected into the trained Yolov8 model, and outputting the result of track light spot target detection. Based on a method for detecting track light spot targets, a system and device for detecting track light spot targets are also proposed. The present invention introduces image feature point enhancement technology, which can make the contrast of target points more obvious, make its feature points easier to learn during network model training, and improve detection accuracy.

[0008] In the present invention, negative samples, i.e., untargeted training data, are added during the training process of the YOLOv8 model to improve its generalization ability through semi-supervised learning. A self-attention mechanism module is introduced to focus on the feature points of the image itself, strengthen feature information, and make its learning direction clearer. L1 regularization is introduced in each BN layer of the model and the low weight value of the BN layer is clipped to accelerate the inference of the terminal device. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 This is a flow chart of a track spot target detection method proposed in Example 1 of the present invention; Figure 2 This is a flowchart of image feature point enhancement proposed in Example 1 of the present invention; Figure 3 This is a schematic diagram of an image before enhancement proposed in Example 1 of the present invention; Figure 4 This is a schematic diagram of an image after enhancement according to Embodiment 1 of the present invention; Figure 5 This is a structural diagram of the improved yolov8 network model proposed in Example 1 of the present invention; Figure 6 This is a schematic diagram of a track spot target detection system proposed in Example 2 of the present invention; Figure 7 This is a schematic diagram of a track spot target detection device proposed in Example 2 of the present invention. DETAILED DESCRIPTION

[0010] In order to clearly illustrate the technical features of this solution, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings. The disclosure below provides many different embodiments or examples for realizing different structures of the present invention. In order to simplify the disclosure of the present invention, the components and settings of specific examples are described below. In addition, the present invention may repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplicity and clarity and does not itself indicate the relationship between the various embodiments and / or settings discussed. It should be noted that the components illustrated in the accompanying drawings are not necessarily drawn to scale. The present invention omits descriptions of well-known components and processing technologies and processes to avoid unnecessary limitations on the present invention.

[0011] Example 1 Embodiment 1 of the present invention proposes a track spot target detection method, which is used to solve the technical problems existing in track spot target detection in the prior art. Figure 1 This is a flow chart of a track spot target detection method proposed in Example 1 of the present invention.

[0012] In step S100, a track spot image is acquired. In this application, a high-definition image acquisition device is used to acquire the track spot image.

[0013] In step S110, a track spot image is acquired, and the image contrast of each acquired track spot original image is enhanced; then, a binary image of the spot image region is obtained by threshold segmentation; the binary image is mapped to the track spot original image to achieve track spot image enhancement; and a dataset for spot target detection is constructed using the enhanced image. Figure 2 This is a flowchart of image feature point enhancement proposed in Example 1 of the present invention; If the original image of the track spot is represented by: Gaussian filtering is performed on the original image of the track spot to obtain a smoothed image ; Subtract the original image of the track spot from the smoothed image to obtain the feature data; the feature data is: ; The enhanced image is obtained by multiplying the feature data by the enhancement coefficient and then adding it to the original image of the track spot. The enhanced image is: ; is the final output result, that is, the result after image contrast enhancement; is the enhancement coefficient, when The larger the value, the more obvious the contrast. is the pixel of the original image of the track spot axis coordinates; is the pixel of the original image of the track spot Axis coordinates.

[0014] Since the enhanced image has obvious pixel contrast, it can be segmented by threshold value. The pixel values ​​in the image are distributed in the range of 0-30 for extraction. To reduce noise, further erosion and then expansion operations are required to ensure that the interference points are reduced, and finally the track surface area is obtained.

[0015] Since the reflection points are concentrated on the track surface, it is necessary to locate the track surface and then perform light spot positioning. The extracted track surface image data is set as ,Compared with the global threshold segmentation, this threshold segmentation algorithm is more ,flexible by comparing it with the averaged image.

[0016] Compare the track surface image data with the track surface image after pixel averaging. If the pixel value is higher than the track surface image after pixel averaging, it is set to 255, otherwise it is set to 0, and the binary image is output; that is: ; ; in, The image of the orbital surface is the averaged image; is the binary image after dynamic threshold segmentation; is the orbital surface image data; is a constant.

[0017] Figure 3 This is a schematic diagram of an image before enhancement proposed in Example 1 of the present invention; Figure 4 This is a schematic diagram of the image after enhancement proposed in Example 1 of the present invention; in this application, a background image, i.e., no target data, is added to the light spot data to enhance its generalization ability, and the image contrast is enhanced by taking the difference between the Gaussian filter and the original image and adding it to the original image pixel value. Since the pixel contrast of the enhanced image is obvious, the segmentation threshold can be determined in combination with the image pixel value to extract the track surface light spot area, that is, it is easier to obtain the light spot area by narrowing the range, and further image corrosion and expansion operations are performed to reduce noise, and then the image is compared with the averaged image to output a binary image, and the light spot area is extracted and highlighted, thereby realizing the image enhancement algorithm module to enhance the light spot characteristics.

[0018] In step S120, an improved YOLOv8 model for track spot target detection is established, wherein an attention mechanism module is added after the last C2F module of the backbone network layer of the improved YOLOv8 model, and L1 regularization is performed on the BN layer in the C2F module of the backbone network, the C2F module of the head network model, and the Conv module; Figure 5 This is a structural diagram of the improved yolov8 network model proposed in Example 1 of the present invention; This application adds an attention mechanism module after the last layer c2f module of the backbone network layer of the yolov8 model. The module includes two major model structures, namely the channel attention mechanism and the spatial attention mechanism model. The implementation principle of the channel attention mechanism is to first perform an adaptive average pooling operation on the input image, and average pool each channel of the input data, that is, the spatial dimension Compress it to (1,1), complete the convolution and sigmoid activation operations, and obtain the attention weight value.

[0019] The first feature map output by the track spot image to be detected after passing through the channel attention mechanism module is: ; in, For the batch index , channel index , spatial location The first feature map of the output of For the batch index , channel index , spatial location The tensor of the track spot image to be detected; is the weight parameter; is the bias parameter; σ is the activation function, and the data range is defined in [0,1]; is the width of the track spot image to be detected; is the height of the track spot image to be detected.

[0020] The output feature map of the input image after the channel attention mechanism is defined as , where the spatial attention mechanism processes the input feature map in two directions, integrating the feature map of the channel attention mechanism As the input features, the average and maximization operations are performed in two directions respectively, the above processing results are spliced, and the output channel is 2 feature map data. The next step is to perform convolution operation, and then the number of channels is compressed to 1 to obtain the spatial attention weight, which is finally weighted to the input feature map , get the data weighted by the spatial attention mechanism: ; in, It is the second feature map after weighting by the spatial attention mechanism; Representative channel index.

[0021] After integrating the attention mechanism, the yolov8 model begins further sparse training operations. L1 regularization is performed on the BN layer in the C2F module of the backbone network, the C2F module of the head network model, and the conv module, that is, sparse processing. During the back propagation process, regularization is performed on the learnable parameters in the BN layer, so that the weight value is small and close to 0, which is more conducive to subsequent cropping. It is worth noting that when cropping each layer, the input dimension parameters of the next input module need to be modified to avoid inconsistency between the output and input channel numbers.

[0022] ; ; ; in, is the first learnable weight parameter of the BN layer; is the second weight parameter that can be learned by the BN layer; is the learning rate; is the regularization coefficient; It is a piecewise function, that is, if the input value is greater than 0, the output is 1, if it is equal to 0, the output is 0, and if it is less than 0, the output is -1, which is used to implement L1 regularization; The value of each position of each channel; is the output of the BN layer; is the total loss function parameter gradient; is the original loss function parameter gradient; is the total loss function parameter gradient; is the original loss function parameter gradient.

[0023] The BN layer after L1 regularization is integrated and yolov8 is used as the pre-training model for transfer learning and sparse training.

[0024] The pre-trained model is cropped according to a pre-set ratio. In this paper, 20% of the BN layers are cropped. All weight parameters are obtained and the BN layers corresponding to the BN layers below the threshold and the conv layers corresponding to the BN layers are removed. When removing them, the input dimension parameters of the next input module need to be modified.

[0025] At this point, the entire model is pruned. However, after pruning the low-coefficient BN layers and the corresponding conv layers, the model accuracy will be significantly reduced due to parameter changes. Therefore, further fine-tuning training is required to ensure accuracy. The focus of the entire pruning operation is L1 regularization of the BN layers and eliminating layers that are not required for training. The main purpose is to reduce model parameters, making it lightweight and accelerating inference on devices with lower computing power.

[0026] In step S130, the improved yolov8 model is trained using the data set to obtain a trained yolov8 model; The datasets before and after feature point addition are divided, and negative samples, i.e., data without track spots, are added to enhance their generalization ability. After being divided into training and validation sets in an 8:2 ratio, the dataset annotation is completed, and finally the training and validation datasets are obtained.

[0027] In step S140, the track spot image to be detected is input into the trained yolov8 model, and the result of track spot target detection is output.

[0028] Embodiment 1 of the present invention proposes a track spot target detection method, which introduces image feature point enhancement technology, which can make the contrast of target points more obvious, make its feature points easier to learn during network model training, and improve detection accuracy.

[0029] Example 1 of the present invention proposes a method for detecting track spot targets. Negative samples, or training data without targets, are added to the YOLOv8 model training process to improve its generalization capability through semi-supervised learning. A self-attention mechanism module is introduced into the YOLOv8 model to focus on the image's feature points, enhance feature information, and clarify its learning direction. L1 regularization is introduced in each BN layer of the YOLOv8 model, and low BN layer weights are trimmed to accelerate inference on terminal devices.

[0030] Example 2 Based on the first embodiment of the present invention, a track spot target detection method is proposed. The second embodiment of the present invention further proposes a track spot target detection system. Figure 6 This is a schematic diagram of a track spot target detection system proposed in Example 2 of the present invention; the system includes: an image preprocessing module, a model building module, and a detection output module; The image preprocessing module is used to obtain track spot images and enhance the image contrast of each acquired track spot original image. Then, a binary image of the spot image area is obtained through threshold segmentation. The binary image is mapped to the track spot original image to achieve track spot image enhancement. The enhanced image is used to construct a dataset for spot target detection. The model building module is used to build an improved YOLOv8 model for track spot target detection. The attention mechanism module is added after the last layer C2F module of the backbone network layer of the improved YOLOv8 model, and L1 regularization is performed on the BN layer in the C2F module of the backbone network, the C2F module of the head network model, and the Conv module; The detection output module is used to train the improved yolov8 model using the data set to obtain the trained yolov8 model; the track spot image to be detected is input into the trained yolov8 model, and the result of track spot target detection is output.

[0031] During the execution of the image preprocessing module: the process of image enhancement processing for each acquired track spot image includes: If the original image of the track spot is represented as ; Gaussian filtering is performed on the original image of the track spot to obtain a smoothed image ; Subtract the original image of the track spot from the smoothed image to obtain feature data; multiply the feature data by the enhancement coefficient and then add it to the original image of the track spot to obtain the enhanced image; the feature data is: ; The enhanced image is: ; is the enhancement coefficient; is the pixel of the original image of the track spot Axis coordinates; where is the pixel of the original image of the track spot Axis coordinates.

[0032] The process of obtaining a track surface binary image by threshold segmentation of the enhanced image includes: comparing the track surface image data with the track surface image pixel averaged image; if the pixel value is higher than the track surface image pixel averaged image, it is set to 255; otherwise, it is set to 0, and the binary image is output; that is: ; ; in, The image of the orbital surface is the averaged image; is the binary image after dynamic threshold segmentation; is the orbital surface image data; is a constant.

[0033] The method for realizing the image enhancement of the track spot by using the binary image is as follows: Mapped to the original image of the track spot In the figure, the corresponding area pixels are highlighted to achieve image enhancement of the track spot.

[0034] During the execution of the model building module: the first feature map output by the track spot image to be detected after passing through the channel attention mechanism module is: ; in, For batch index , channel index , spatial location The first feature map of the output of For batch index , channel index , spatial location The tensor of the track spot image to be detected; is the weight parameter; is the bias parameter; σ is the activation function; is the width of the track spot image to be detected; is the height of the track spot image to be detected.

[0035] The second feature map after the first feature map is weighted by the spatial attention mechanism is: ; in, It is the second feature map after weighting by the spatial attention mechanism; Representative channel index.

[0036] The process of updating the weight parameters of the second feature map output by the spatial attention mechanism after regularization by the BN layer includes: ; ; ; in, is the first learnable weight parameter of the BN layer; is the second weight parameter that can be learned by the BN layer; is the learning rate; is the total loss function parameter gradient; is the original loss function parameter gradient; is the total loss function parameter gradient; is the original loss function parameter gradient; is the regularization coefficient; is a piecewise function; The value of each position of each channel; is the output of the BN layer.

[0037] The improved yolov8 model is also used to compare the updated weight parameters with the weight parameter threshold, and remove the BN layer below the weight parameter threshold and the conv layer corresponding to the BN layer.

[0038] During the execution of the detection output module: The datasets before and after feature point addition are divided, and negative samples, i.e., data without track spots, are added to enhance their generalization ability. After being divided into training and validation sets in an 8:2 ratio, the dataset annotation is completed, and finally the training and validation datasets are obtained.

[0039] The track spot image to be detected is input into the trained yolov8 model, and the result of track spot target detection is output.

[0040] Embodiment 2 of the present invention proposes a track spot target detection system, which introduces image feature point enhancement technology to make the contrast of target points more obvious, making its feature points easier to learn during network model training and improving detection accuracy.

[0041] Example 2 of the present invention proposes a track spot target detection system. During the training process of the YOLOv8 model, negative samples (i.e., training data without targets) are added to improve its generalization ability through semi-supervised learning. A self-attention mechanism module is introduced into the YOLOv8 model to focus on the feature points of the image itself, strengthen feature information, and make its learning direction more clear. L1 regularization is introduced in each BN layer of the YOLOv8 model, and low BN layer weights are trimmed to accelerate inference on terminal devices.

[0042] Example 3 The present invention also proposes a device, Figure 7 This is a schematic diagram of a track spot target detection device proposed in Example 2 of the present invention, comprising: memory for storing computer programs; The processor is used to implement the following method steps when executing the computer program: In step S100 , a track spot image is acquired.

[0043] In step S110, the image contrast of each acquired track light spot original image is enhanced; then, a binary image of the light spot image region is obtained by threshold segmentation; the binary image is mapped to the track light spot original image to achieve track light spot image enhancement; and the enhanced image is used to construct a data set for light spot target detection; In step S120, an improved YOLOv8 model for track spot target detection is established, wherein an attention mechanism module is added after the last C2F module of the backbone network layer of the improved YOLOv8 model, and L1 regularization is performed on the BN layer in the C2F module of the backbone network, the C2F module of the head network model, and the Conv module; In step S130, the improved yolov8 model is trained using the data set to obtain a trained yolov8 model; In step S140, the track spot image to be detected is input into the trained yolov8 model, and the result of track spot target detection is output.

[0044] Embodiment 3 of the present invention proposes a track spot target detection device, which introduces image feature point enhancement technology, which can make the contrast of target points more obvious, make its feature points easier to learn during network model training, and improve detection accuracy.

[0045] Example 3 of the present invention proposes a track spot target detection device. During the training process of the YOLOv8 model, negative samples (i.e., training data without targets) are added to improve its generalization ability through semi-supervised learning. A self-attention mechanism module is introduced into the YOLOv8 model to focus on the feature points of the image itself, strengthen feature information, and make its learning direction more clear. L1 regularization is introduced in each BN layer of the YOLOv8 model, and low BN layer weights are trimmed to accelerate inference on the terminal device.

[0046] It should be noted that the technical solution of the present invention also provides an electronic device, including: a communication interface capable of exchanging information with other devices such as network devices; a processor connected to the communication interface to realize information exchange with other devices, and used to execute a track spot target detection method provided by one or more of the above technical solutions when running a computer program, and the computer program is stored on a memory. Of course, in actual application, the various components in the electronic device are coupled together through a bus system. It can be understood that the bus system is used to realize connection and communication between these components. In addition to the data bus, the bus system also includes a power bus, a control bus and a status signal bus. The memory in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of these data include: any computer program for operating on the electronic device. It can be understood that the memory can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface storage, optical disk, or compact disc read-only memory (CD-ROM); magnetic surface storage can be magnetic disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache.By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronized dynamic random access memory (SLDRAM), direct RAM bus random access memory (DRRAM). The memory described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memory. The method disclosed in the above embodiments of the present application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above-described method can be completed by hardware integrated logic circuits or software instructions within a processor. The processor can be a general-purpose processor, a DSP (Digital Signal Processing), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The processor can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules within the decoding processor. The software module can be located in a storage medium located in memory. The processor reads the program from the memory and, in conjunction with its hardware, completes the steps of the aforementioned method. When the processor executes the program, the corresponding processes of the various methods in the embodiments of this application are implemented. For the sake of brevity, these steps are not further described here.

[0047] The description of the relevant parts of a track light spot target detection device provided in Example 3 of the present application can be found in the detailed description of the corresponding parts of a track light spot target detection method provided in Example 1 of the present application, and will not be repeated here.

[0048] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements are inherent to the elements. In the absence of further restrictions, the elements limited by the statement "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device comprising the elements. In addition, the above-mentioned technical solutions provided in the embodiments of the present application are not described in detail in accordance with the corresponding technical solutions in the prior art to achieve the same principle, so as to avoid excessive elaboration.

[0049] Although the above description is of specific embodiments of the present invention in conjunction with the accompanying drawings, it does not limit the scope of protection of the present invention. For those skilled in the art, other different forms of modifications or variations can be made based on the above description. It is not necessary and impossible to list all embodiments here. Based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without expending creative effort are still within the scope of protection of the present invention.

Claims

1. A track spot target detection method, characterized in that: The following steps are involved: Acquire the track spot image and enhance the image contrast of each acquired track spot original image; then obtain a binary image of the spot image area by threshold segmentation; map the binary image to the track spot original image to achieve track spot image enhancement; The enhanced images are used to construct a dataset for spot target detection; An improved YOLOv8 model for track spot target detection was established. The improved YOLOv8 model added an attention mechanism module after the last C2F module in the backbone network, and performed L1 regularization on the BN layer in the C2F module of the backbone network, the C2F module of the head network, and the Conv module. The improved yolov8 model is trained using the data set to obtain the trained yolov8 model; the track spot image to be detected is input into the trained yolov8 model, and the result of track spot target detection is output.

2. A track spot target detection method according to claim 1, characterized in that: The process of enhancing the image contrast of each acquired track spot raw image includes: If the original image of the track spot is represented as ; Gaussian filtering is performed on the original image of the track spot to obtain a smoothed image ; Subtract the original image of the track spot from the smoothed image to obtain feature data; multiply the feature data by the enhancement coefficient and then add it to the original image of the track spot to obtain the enhanced image; the feature data is: ; The enhanced image is: ; is the enhancement coefficient; is the pixel of the original image of the track spot Axis coordinates; where is the pixel of the original image of the track spot Axis coordinates.

3. A track spot target detection method according to claim 2, characterized in that: Then, the process of obtaining a binary image of the light spot image area by threshold segmentation includes: comparing the track surface image data with the track surface image pixel averaged image; if the pixel value is higher than the track surface image pixel averaged image, it is set to 255; otherwise, it is set to 0, and the binary image is output; that is: ; ; in, The image of the orbital surface is the averaged image; is the binary image after dynamic threshold segmentation; is the orbital surface image data; is a constant.

4. A track spot target detection method according to claim 3, characterized in that: The process of mapping the binary image to the original image of the track spot to realize the image enhancement of the track spot is as follows: Mapped to the original image of the track spot In the figure, the corresponding area pixels are highlighted to achieve image enhancement of the track spot.

5. The method for detecting a track spot target according to claim 1, wherein: The first feature map output by the track spot image to be detected after passing through the channel attention mechanism module is: ; in, For batch index , channel index , spatial location The first feature map of the output of For batch index , channel index , spatial location The tensor of the track spot image to be detected; is the weight parameter; is the bias parameter; σ is the activation function; is the width of the track spot image to be detected; is the height of the track spot image to be detected.

6. A track spot target detection method according to claim 5, characterized in that: The second feature map after the first feature map is weighted by the spatial attention mechanism is: ; in, It is the second feature map after weighting by the spatial attention mechanism; Representative channel index.

7. A track spot target detection method according to claim 6, characterized in that: The process of updating the weight parameters of the second feature map output by the spatial attention mechanism after regularization by the BN layer includes: ; ; ; in, is the first learnable weight parameter of the BN layer; is the second weight parameter that can be learned by the BN layer; is the learning rate; is the total loss function parameter gradient; is the original loss function parameter gradient; is the total loss function parameter gradient; is the original loss function parameter gradient; is the regularization coefficient; is a piecewise function; The value of each position of each channel; is the output of the BN layer.

8. A track spot target detection method according to claim 7, characterized in that: The improved yolov8 model is also used to compare the updated weight parameter with the weight parameter threshold, and remove the BN layer below the weight parameter threshold and the conv layer corresponding to the BN layer.

9. A track spot target detection system, characterized in that: include: Image preprocessing module, model building module and detection output module; The image preprocessing module is used to obtain track spot images and enhance the image contrast of each acquired track spot original image; then, a binary image of the spot image area is obtained by threshold segmentation; the binary image is mapped to the track spot original image to achieve track spot image enhancement; and the enhanced image is used to construct a data set for spot target detection; The model building module is used to build an improved YOLOv8 model for track spot target detection. The improved YOLOv8 model adds an attention mechanism module after the last layer C2F module of the backbone network, and performs L1 regularization on the BN layer in the C2F module of the backbone network, the C2F module of the head network, and the Conv module; The detection output module is used to train the improved YOLOv8 model using the data set to obtain a trained YOLOv8 model; input the track spot image to be detected into the trained YOLOv8 model, and output the result of track spot target detection.

10. A track spot target detection device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the method steps according to any one of claims 1 to 8 when executing the computer program.

Citation Information

Patent Citations

  • Lightweight track surface defect real-time detection method and device

    CN119313663A

  • Railway track foreign object detection system based on improved YOLOv8 model

    CN119741676A

Cited By

  • Structured light spot local elimination system

    CN121661075A