Magnetic ring line sequence character visual detection method
By introducing deformable multi-branch YOLOX network and optimized loss function in magnetic ring line sequence character visual detection, combined with Gaussian filtering and optical mirror imaging technology, the problems of recognition accuracy and robustness in the existing technology are solved, and the magnetization is achieved Efficient and accurate detection of ring-sequence characters.
Patent Information
- Application Number
- CN202411248421.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-31
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing magnetic ring line sequence character visual detection methods are difficult to accurately identify small characters or deformed characters in complex backgrounds, and the loss function of the character classification model is not optimized for the characteristics of magnetic ring line sequence characters, which affects the recognition accuracy and robustness.
Deformable multi-branch YOLOX ship object detection method is adopted, and the deformable multi-branch gradient path module and hybrid attention mechanism are introduced to optimize the loss function to improve the detection capability of small objects. It also uses Gaussian filtering, grayscale processing and optical mirror imaging technology. Enhance detection effect.
It significantly improves character recognition capabilities in complex backgrounds, improves recognition accuracy and robustness, and achieves accurate detection of long-distance ship targets.
Smart Images

Figure CN119229455A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image recognition, and in particular to a method for visually detecting magnetic ring line sequence characters. Background Art
[0002] Visual inspection of magnetic ring line sequence characters plays a key role in multiple industries and application fields, especially in automated production lines and quality control processes. However, existing methods for visual inspection of magnetic ring line sequence characters have many defects and are difficult to meet the requirements of high-precision and high-efficiency inspection.
[0003] In terms of character classification models, the existing technologies mostly use traditional machine learning algorithms or simple deep learning networks. These models have limited character recognition capabilities in complex backgrounds and are difficult to accurately recognize small characters or deformed characters on magnetic loops. Moreover, the character classification models in the existing technologies often use a fixed loss function and are not optimized for the characteristics of magnetic loop sequence characters, which makes it difficult for the model to fully learn the subtle features of the characters during training, further affecting the accuracy and robustness of character recognition. Summary of the invention
[0004] The purpose of the present invention is to provide a method for visually detecting magnetic ring linear sequence characters to solve the problems raised in the above-mentioned background technology.
[0005] This paper proposes a deformable multi-branch YOLOX ship target detection method optimized for long-distance small ship targets. This method introduces a deformable multi-branch gradient path module with stronger feature extraction capability, adopts a hybrid attention mechanism to enhance the small target detection capability, optimizes the loss function to accelerate model convergence, and improves the detection effect of long-distance ship targets in unmanned boat navigation waters while meeting the real-time detection requirements, thus achieving accurate detection of long-distance ships.
[0006] To achieve the above object, the present invention provides the following technical solution: a method for visually detecting magnetic ring line sequence characters, the method comprising:
[0007] S1. Collecting magnetic loop image data: using a high-resolution image acquisition device to obtain the magnetic loop image data to be detected;
[0008] S2, preprocessing magnetic loop image data: preprocessing the collected magnetic loop image data, including removing image noise, image enhancement and grayscale processing;
[0009] S3. Constructing a magnetic loop linear sequence character classification model: constructing a magnetic loop linear sequence character classification model using a YOLOX network, wherein the magnetic loop linear sequence character classification model is used to identify the category of magnetic loop linear sequence characters in an image, and the model includes a deformable multi-branch gradient path module, and improves the loss function in the original YOLOX network;
[0010] S4, identifying magnetic loop line sequence characters: inputting the magnetic loop line image preprocessed in step S2 into the trained magnetic loop line sequence character classification model to identify the magnetic loop line sequence characters and obtain the category information of the magnetic loop line sequence characters.
[0011] Preferably, the implementation steps of the deformable multi-branch gradient path module include:
[0012] i) Use the CBS module to process features, and use the Split operation to directly use the features of half of the channels as sub-gradient branches to participate in parallel splicing;
[0013] ii) inputting the features of the other half of the channel into the main gradient branch composed of multiple deformable residual components for further feature extraction;
[0014] iii) In the main gradient branch, the outputs of each deformable residual component are concatenated in parallel;
[0015] iv) The result of splicing the main gradient flow and the secondary gradient flow is used to adjust the number of channels through the CBS module to achieve a high degree of fusion of multi-branch features.
[0016] Preferably, the improved loss function includes: using CIoU loss to replace the original IoU loss as the positioning loss. When calculating the overlap between the predicted box and the real box, CIoU loss additionally calculates two factors, namely, the center point distance and the aspect ratio, to accelerate the regression convergence speed of the predicted box and maintain the shape similarity between the predicted box and the real box. The specific algorithm is:
[0017]
[0018] Among them, d is the Euclidean distance between the true box and the target box, c is the diagonal length of the minimum circumscribed rectangle of the true box and the target box, is a weight function, v is used to measure the consistency of the aspect ratio between the real box and the target box.
[0019] Preferably, the improved loss function further includes: using the focus FL loss to replace the original BCE loss as the positive example judgment loss, which is used to solve the problem of imbalance between positive and negative samples in the detection task, so that the model pays more attention to the training of difficult-to-classify samples. The calculation formula of the FL loss is:
[0020] L FL =-(1-p t ) γ log(p t )
[0021]
[0022] Among them, LFL is the specific value of the focal FL loss, p t is the probability value of being a positive example, is the predicted probability value, y is the label to determine whether it is a positive example, and γ is an adjustable factor used to adjust the weights of positive and negative samples.
[0023] Preferably, the Gaussian filtering method is used to eliminate the noise in the image, and the value of each pixel in the image is replaced by the weighted average of the pixel values in its neighborhood. The calculation formula is:
[0024]
[0025] Where G(x,y) is the value of the Gaussian function at the two-dimensional coordinate (x,y) of the image, x and y are the coordinates in two-dimensional space, σ is the standard deviation of the Gaussian distribution, e is the base of the natural logarithm, and π is the circumference of a circle.
[0026] Preferably, the steps of enhancing the display of the character identification in the magnetic loop image include:
[0027] Step I: Use the Sobel detection operator to perform convolution on the image and calculate the gradient intensity and direction of each pixel;
[0028] Step II: traverse each pixel in the image, compare its gradient strength with the gradient strength of the adjacent pixels in its gradient direction, and if the current pixel is not a local maximum, set its gradient strength to zero, thereby eliminating non-marked pixels and reducing marked artifacts;
[0029] Step III, set two thresholds: a high threshold and a low threshold. Pixels with gradient strength higher than the high threshold are regarded as strong identification points, and pixels with gradient strength lower than the low threshold are regarded as non-identification points. For pixels with gradient strength between the two thresholds, if they are connected to strong identification points, they are regarded as weak identification points and retained; otherwise, they are regarded as non-identification points and removed.
[0030] Preferably, the method for grayscale processing of magnetic loop image data is:
[0031] a. Select the weighted method to convert the color image into a grayscale image, and use the formula GRAY = 0.3*R + 0.59*G + 0.11*B to calculate the grayscale value. R, G, and B in the formula represent the components of the pixel in the red, green, and blue color domains respectively;
[0032] b. Read the image data of the magnetic loop line, traverse each pixel in the image, and obtain the RGB color value corresponding to each pixel;
[0033] c. Apply the color value conversion method and call the formula in step a to convert the RGB color value of each pixel obtained in step b to obtain the corresponding grayscale value;
[0034] d. Apply the converted grayscale value to each pixel to generate a grayscale image of the magnetic loop line image.
[0035] Preferably, when collecting the magnetic loop image data, an optical reflector is used to image the left and right sides of the magnetic loop to increase the detection surface.
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] The present invention uses the YOLOX network to construct a magnetic ring line sequence character classification model, and introduces a deformable multi-branch gradient path module, which significantly improves the model's character recognition ability under complex backgrounds. At the same time, the loss function in the original YOLOX network is improved, so that the model can better learn the subtle features of the characters during the training process, improving the accuracy and robustness of character recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A step diagram of the invented magnetic ring line sequence character visual detection method;
[0039] Figure 2 Schematic diagram of the deformable multi-branch YOLOX network structure;
[0040] Figure 3 This is a schematic diagram of the magnetic loop line acquisition imaging effect;
[0041] Figure 4 Design schematic diagram for magnetic loop line image acquisition scheme;
[0042] Figure 5 This is the overall effect diagram of the magnetic ring line sequence detection equipment. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] See also Figure 1-5 The present invention provides a technical solution: a method for visually detecting magnetic ring line sequence characters, the method comprising the steps of:
[0045] Step S1: Collect magnetic loop image data
[0046] Use high-resolution image acquisition equipment to capture images of the magnetic loop to be detected and obtain high-quality magnetic loop image data. High-resolution image acquisition equipment can capture more detailed information and provide accurate data basis for subsequent character recognition.
[0047] Step S2: Preprocessing magnetic loop image data
[0048] The collected magnetic loop image data is preprocessed, including image noise removal, image enhancement and grayscale processing. First, an appropriate filtering algorithm is used to remove the noise in the image and improve the image clarity. Secondly, the image is enhanced to highlight the contrast between the characters and the background, making the characters more vivid. Finally, the image is converted into a grayscale image to reduce the computational complexity of subsequent processing.
[0049] Step S3: Constructing a magnetic ring line sequence character classification model
[0050] The YOLOX network is used to construct a magnetic loop line sequence character classification model. The YOLOX network is an advanced deep learning network with excellent object detection performance. On this basis, the present invention improves the YOLOX network and introduces a deformable multi-branch gradient path module to enhance the character recognition ability of the model under complex backgrounds. At the same time, according to the characteristics of magnetic loop line sequence characters, the loss function in the original YOLOX network is optimized, so that the model can better learn the subtle features of the characters during the training process, thereby improving the accuracy and robustness of character recognition.
[0051] Step S4: Identify magnetic ring line sequence characters
[0052] The preprocessed magnetic loop image is input into the trained magnetic loop sequence character classification model to recognize magnetic loop sequence characters. The model will automatically detect and classify the characters in the image and output the category information of the magnetic loop sequence characters. By comparing the category information output by the model with the actual character category, the recognition accuracy and performance of the model can be evaluated.
[0053] The present invention will be further described below in conjunction with Examples 1 to 3:
[0054] Embodiment 1:
[0055] This paper proposes a deformable multi-branch gradient path module, which aims to enhance the model's learning ability for complex features by combining multi-path feature extraction and fusion strategies. The following are the specific implementation steps of this module:
[0056] Feature segmentation and preliminary processing: The input feature map first passes through a CBS (Conv+BN+SiLU) module for preliminary feature processing. The CBS module contains a convolutional layer (Conv), a batch normalization layer (BN), and a SiLU activation function in sequence, which is used to adjust the number of channels of the feature map and prepare for subsequent multi-branch processing.
[0057] Through the Split operation, the processed feature map is divided into two parts along the channel dimension. The features of half of the channels (recorded as sub-gradient branches) are directly retained for subsequent parallel splicing; the features of the other half of the channels (recorded as main gradient branches) enter the next step of deep feature extraction.
[0058] Feature extraction from the main gradient branch: The features of the main gradient branch are fed into a sequence of multiple deformable residual components. Each deformable residual component is designed to perform nonlinear transformation and feature enhancement on the input features while keeping the spatial resolution of the features unchanged.
[0059] The deformable residual component may contain convolutional layers, activation layers, and optional batch normalization layers. Its specific structure and parameters can be adjusted according to actual application requirements.
[0060] The outputs of each deformable residual component are merged in parallel to form the final feature representation of the main gradient branch.
[0061] Feature splicing and fusion: The sub-gradient branch features retained in step 1 are spliced in parallel with the main gradient branch features obtained in step 2 to achieve preliminary fusion of multi-path features.
[0062] The concatenated features pass through a CBS module again to adjust the number of channels and promote a high degree of fusion between features of different branches, which helps the model learn richer and more discriminative feature representations.
[0063] Module output: After the above processing, the deformable multi-branch gradient path module outputs the fused feature map. This feature map can be used as the input of subsequent network layers for further feature extraction or classification tasks.
[0064] The following is a specific implementation example of this module:
[0065] Feature segmentation and preliminary processing: Assume that the size of the input feature map is [H, W, C], where H and W are the height and width of the feature map, respectively, and C is the number of channels.
[0066] The input feature map first undergoes preliminary feature processing through the CBS (Conv+BN+SiLU) module. Specifically, it first undergoes feature transformation through a 3x3 convolutional layer, then undergoes feature normalization through a batch normalization layer, and finally undergoes nonlinear activation through the SiLU activation function.
[0067] Through the Split operation, the processed feature map is divided into two parts along the channel dimension, and the number of channels in each part is C / 2. One part (denoted as the secondary gradient branch) is directly retained for subsequent parallel splicing; the other part (denoted as the main gradient branch) enters the next step of deep feature extraction.
[0068] Feature extraction of main gradient branch: The features of the main gradient branch are fed into a sequence of two deformable residual components. Each deformable residual component contains two 3x3 convolutional layers, two batch normalization layers, and a SiLU activation function.
[0069] The first deformable residual component performs nonlinear transformation and feature enhancement on the input features, and the size of the output feature map is [H, W, C / 2]. The second deformable residual component further extracts features from the output of the first component, and the size of the output feature map is also [H, W, C / 2].
[0070] The outputs of the two deformable residual components are merged in parallel to form the final feature representation of the main gradient branch with size [H, W, C].
[0071] Feature splicing and fusion: The sub-gradient branch features retained in step 1 are spliced in parallel with the main gradient branch features obtained in step 2. The size of the spliced feature map is [H, W, 2C].
[0072] The concatenated features are processed and fused again through a CBS module. The structure of this CBS module is the same as that of the CBS module in step 1, which is used to adjust the number of channels and promote the high fusion of different branch features.
[0073] Module output: After the above processing, the deformable multi-branch gradient path module outputs a fused feature map with a size of [H, W, C]. This feature map can be used as the input of subsequent network layers for further feature extraction or classification tasks.
[0074] Embodiment 2:
[0075] In the task of magnetic ring linear sequence character visual detection, the limitations of YOLOX's original loss function gradually emerged when faced with complex and changeable character shapes and sizes. Especially when the character target is small or at the edge of the image, small pixel deviations may cause significant fluctuations in the IoU value, thereby affecting the detection accuracy. At the same time, the IoU loss only considers the overlapping area between the predicted box and the true box, ignoring the center point distance and shape difference between them, which limits the accurate regression of the predicted box to a certain extent.
[0076] In order to overcome these problems, the present invention improves the loss function of YOLOX. Specifically, the CIoU loss is used to replace the original IoU loss as the positioning loss. When calculating the overlap between the predicted box and the real box, the CIoU loss not only considers the overlapping area, but also additionally calculates the center point distance and aspect ratio. This improvement enables the predicted box to move more accurately to the real box during the iteration process, and maintains the shape similarity between the predicted box and the real box as much as possible.
[0077] By introducing the CIoU loss, the regression convergence speed of the prediction box is effectively accelerated, and the accuracy and stability of the magnetic ring line sequence character visual detection are improved. This improvement enables the YOLOX model to show stronger robustness and detection performance when facing complex and changing character shapes and sizes. The calculation formula of CIoU is:
[0078]
[0079] Among them, d is the Euclidean distance between the true box and the target box, c is the diagonal length of the minimum circumscribed rectangle of the true box and the target box, is a weight function, v is used to measure the consistency of the aspect ratio between the real box and the target box. Parameters v and The way to obtain is:
[0080]
[0081] Among them, w gt and h gt are the width and height of the target box, w and h are the width and height of the real box, respectively.
[0082] In the scene of magnetic ring line sequence character visual detection, most pixels belong to the background, which leads to the imbalance of positive and negative samples in the detection. Based on this problem, the present invention uses the focus FL loss to replace the original BCE loss as the positive example judgment loss to solve the problem of imbalance between positive and negative samples in the detection task, so that the model pays more attention to the training of difficult-to-classify samples. The calculation formula of FL loss is:
[0083] L FL =-(1-p t ) γ log(p t )
[0084]
[0085] Among them, L FL is the specific value of the focal FL loss, p t is the probability value of being a positive example, is the predicted probability value, y is the label to determine whether it is a positive example, and γ is an adjustable factor used to adjust the weights of positive and negative samples.
[0086] Embodiment 3:
[0087] In order to eliminate noise in the image and improve the accuracy of subsequent character detection, the present invention uses Gaussian filtering to pre-process the image. Gaussian filtering is a commonly used image smoothing technology, and its principle is to replace the value of each pixel in the image with the weighted average of the pixel values in its neighborhood. Specifically, Gaussian filtering calculates the weight of each pixel neighborhood through a Gaussian function. The Gaussian function is a function with a bell-shaped distribution in a two-dimensional space, and its calculation formula is:
[0088]
[0089] Where G(x,y) is the value of the Gaussian function at the two-dimensional coordinate (x,y) of the image, x and y are the coordinates in the two-dimensional space, σ is the standard deviation of the Gaussian distribution, which controls the width of the Gaussian function, that is, the smoothness of the filter, e is the base of the natural logarithm, and π is the circumference of a circle.
[0090] In practical applications, a neighborhood of appropriate size (such as 3x3, 5x5, etc.) is selected, and the weight of each pixel in the neighborhood is calculated according to the Gaussian function. Then, these weights are multiplied by their corresponding pixel values, and the results are added to obtain the Gaussian filter value of the current pixel. Finally, this filter value is assigned to the current pixel as its new pixel value. Through Gaussian filtering, the noise in the image is effectively suppressed, and the edge information of the character is also retained.
[0091] In order to enhance the display effect of character logos in magnetic loop images, the present invention adopts a logo enhancement method based on gradient strength and direction. The specific implementation steps of the method are as follows:
[0092] Step I: Use the Sobel detection operator to perform convolution on the image and calculate the gradient strength and direction of each pixel.
[0093] The Sobel detection operator is a commonly used edge detection operator. It can calculate the gradient of each pixel in the horizontal and vertical directions by performing a convolution operation on the image. Specifically, for each pixel in the image, the following formula is used to calculate its gradient strength and direction:
[0094] Gradient Strength
[0095] Gradient direction
[0096] Among them, Gx and Gy are the gradients of the pixel in the horizontal and vertical directions respectively.
[0097] Step II: traverse each pixel in the image and compare its gradient strength with the gradient strength of the adjacent pixels in its gradient direction.
[0098] In this step, each pixel in the image is traversed, and for each pixel, the neighboring pixels are searched along its gradient direction. Then, the gradient strength of the current pixel is compared with the gradient strength of the neighboring pixels in its gradient direction. If the current pixel is not a local maximum, that is, its gradient strength is less than the gradient strength of the neighboring pixels in its gradient direction, the gradient strength of the current pixel is set to zero. This can eliminate non-marked pixels and reduce marked artifacts.
[0099] Step III: Set two thresholds: a high threshold and a low threshold, and perform threshold processing on the gradient intensity.
[0100] In this step, two thresholds are set: a high threshold and a low threshold. Pixels with gradient strengths higher than the high threshold are considered strong identification points, which are usually the main part of the character identification. Pixels with gradient strengths lower than the low threshold are considered non-identification points, which are usually background or noise. For pixels with gradient strengths between the two thresholds, it is further determined whether they are connected to the strong identification points. If they are connected, these points are considered weak identification points and retained; otherwise, they are considered non-identification points and removed.
[0101] The present invention adopts a specific grayscale processing method for magnetic loop image data, aiming to convert the original color image into a grayscale image for subsequent image processing and analysis. The specific implementation steps of the method are as follows:
[0102] Step a: Select a weighted method to perform the conversion from a color image to a grayscale image.
[0103] In this step, a weighted method is used to convert the color image into a grayscale image. Specifically, the following formula is used to calculate the grayscale value of each pixel:
[0104] GRAY=0.3R+0.59G+0.11*B
[0105] Among them, R, G, and B represent the component values of the pixel in the red, green, and blue color domains respectively. This formula takes into account the sensitivity of the human eye to different colors and can generate a more natural grayscale image.
[0106] Step b: read the magnetic loop image data and traverse each pixel in the image.
[0107] In this step, the original data of the magnetic loop image is read, and each pixel in the image is traversed. For each pixel in the image, its corresponding RGB color value is obtained for subsequent grayscale conversion.
[0108] Step c: applying a color value conversion method to convert the RGB color value of each pixel obtained in step b.
[0109] In this step, the formula given in step a is called to convert the RGB color value of each pixel obtained in step b. Specifically, the R, G, and B values of each pixel are substituted into the formula GRAY=0.3R+0.59G+0.11*B to calculate the corresponding grayscale value.
[0110] Step d: Apply the converted grayscale value to each pixel to generate a grayscale image of the magnetic loop image.
[0111] Finally, in this step, the grayscale value calculated in step c is applied to each pixel to generate a grayscale image of the magnetic loop image.
[0112] In the process of collecting magnetic loop image data, in order to increase the detection surface and improve the detection accuracy, the present invention adopts a special optical reflector device. The device can perform mirror imaging on the left and right sides of the magnetic loop, thereby achieving a more comprehensive detection of the magnetic loop. The specific implementation method is as follows:
[0113] Before collecting the magnetic loop image data, an optical reflector device is set up. The device includes two independent and oppositely placed optical reflectors, which are used to perform mirror imaging on the left and right sides of the magnetic loop respectively. The angles and positions of the two reflectors are carefully designed to ensure that they can accurately reflect the left and right images of the magnetic loop.
[0114] When the magnetic loop passes through the optical reflector device, the images on the left and right sides are reflected by two reflectors respectively and projected onto the image acquisition device. The image acquisition device can be a high-resolution camera or video camera, which can capture the image in the reflector and convert it into a digital signal for storage and processing.
[0115] In this way, the present invention successfully realizes the mirror imaging of the left and right sides of the magnetic loop, and increases the detection surface. This enables more comprehensive detection of various features and information on the magnetic loop in the subsequent image processing and analysis process, and improves the accuracy and reliability of the detection.
[0116] In addition, in order to further improve the quality and clarity of the image, the image acquisition device can be further optimized and adjusted. For example, a camera or video camera with higher resolution and greater sensitivity can be selected to ensure that the captured image has better details and clarity. At the same time, the material and surface of the reflector can be processed to reduce the scattering and reflection loss of light and improve the contrast and brightness of the image.
[0117] 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 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 a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0118] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for visually detecting magnetic ring line sequence characters, characterized in that: The method comprises: S1. Collecting magnetic loop image data: using a high-resolution image acquisition device to obtain the magnetic loop image data to be detected; S2, preprocessing magnetic loop image data: preprocessing the collected magnetic loop image data, including removing image noise, image enhancement and grayscale processing; S3. Constructing a magnetic loop linear sequence character classification model: constructing a magnetic loop linear sequence character classification model using a YOLOX network, wherein the magnetic loop linear sequence character classification model is used to identify the category of magnetic loop linear sequence characters in an image, and the model includes a deformable multi-branch gradient path module, and improves the loss function in the original YOLOX network; S4, identifying magnetic loop line sequence characters: inputting the magnetic loop line image preprocessed in step S2 into the trained magnetic loop line sequence character classification model to identify the magnetic loop line sequence characters and obtain the category information of the magnetic loop line sequence characters.
2. A magnetic ring line sequence character visual detection method according to claim 1, characterized in that: The implementation steps of the deformable multi-branch gradient path module include: i) Use the CBS module to process features, and use the Split operation to directly use the features of half of the channels as sub-gradient branches to participate in parallel splicing; ii) inputting the features of the other half of the channel into the main gradient branch composed of multiple deformable residual components for further feature extraction; iii) In the main gradient branch, the outputs of each deformable residual component are concatenated in parallel; iv) The result of splicing the main gradient flow and the secondary gradient flow is used to adjust the number of channels through the CBS module to achieve a high degree of fusion of multi-branch features.
3. A magnetic ring line sequence character visual detection method according to claim 1, characterized in that: The improved loss function includes: using CIoU loss to replace the original IoU loss as the positioning loss. When calculating the overlap between the predicted box and the real box, CIoU loss additionally calculates two factors, namely, the center point distance and the aspect ratio, to speed up the regression convergence speed of the predicted box and maintain the shape similarity between the predicted box and the real box. The specific algorithm is: Among them, d is the Euclidean distance between the true box and the target box, c is the diagonal length of the minimum circumscribed rectangle of the true box and the target box, is a weight function, v is used to measure the consistency of the aspect ratio between the real box and the target box.
4. A magnetic ring line sequence character visual detection method according to claim 5, characterized in that: The improved loss function further includes: using the focus FL loss to replace the original BCE loss as the positive example judgment loss to solve the problem of imbalance between positive and negative samples in the detection task, so that the model pays more attention to the training of difficult-to-classify samples. The calculation formula of the FL loss is: L FL =-(1-p t ) γ log(p t ) Among them, L FL is the specific value of the focal FL loss, p t is the probability value of being a positive example, is the predicted probability value, y is the label to determine whether it is a positive example, and γ is an adjustable factor used to adjust the weights of positive and negative samples.
5. A magnetic ring line sequence character visual detection method according to claim 1, characterized in that: Gaussian filtering is used to eliminate noise in the image. The value of each pixel in the image is replaced by the weighted average of the pixel values in its neighborhood. The calculation formula is: Where G(x,y) is the value of the Gaussian function at the two-dimensional coordinate (x,y) of the image, x and y are the coordinates in two-dimensional space, σ is the standard deviation of the Gaussian distribution, e is the base of the natural logarithm, and π is the circumference of a circle.
6. A magnetic ring line sequence character visual detection method according to claim 1, characterized in that: The steps for implementing enhanced display of character identification in magnetic loop line images include: Step I: Use the Sobel detection operator to perform convolution on the image and calculate the gradient intensity and direction of each pixel; Step II: traverse each pixel in the image, compare its gradient strength with the gradient strength of the adjacent pixels in its gradient direction, and if the current pixel is not a local maximum, set its gradient strength to zero, thereby eliminating non-marked pixels and reducing marked artifacts; Step III, set two thresholds: a high threshold and a low threshold. Pixels with gradient strength higher than the high threshold are regarded as strong identification points, and pixels with gradient strength lower than the low threshold are regarded as non-identification points. For pixels with gradient strength between the two thresholds, if they are connected to strong identification points, they are regarded as weak identification points and retained; otherwise, they are regarded as non-identification points and removed.
7. A magnetic ring line sequence character visual detection method according to claim 1, characterized in that: The method for grayscale processing of magnetic loop image data is: a. Select the weighted method to convert the color image into a grayscale image, and use the formula GRAY = 0.3*R + 0.59*G + 0.11*B to calculate the grayscale value. R, G, and B in the formula represent the components of the pixel in the red, green, and blue color domains respectively; b. Read the image data of the magnetic loop line, traverse each pixel in the image, and obtain the RGB color value corresponding to each pixel; c. Apply the color value conversion method, call the formula in step a to convert the RGB color value of each pixel obtained in step b to obtain the corresponding grayscale value; d. Apply the converted grayscale value to each pixel to generate a grayscale image of the magnetic loop line image.
8. A magnetic ring line sequence character visual detection method according to claim 1, characterized in that: When collecting magnetic loop image data, an optical reflector is used to image the left and right sides of the magnetic loop to increase the detection surface.
Citation Information
Patent Citations
Slab number real-time detection and identification method based on deep learning
CN115909312A
Ship detection and tracking method in bridge area monitoring scene
CN117132951A
Detection system for grate plate of chain grate machine
CN118379273A
Hough transform-based license plate tilt correction method
WO2023097931A1
Cited By
Cover beam support deformation detection method and system
CN119888452A