Steel coil end face character recognition method and system based on lightweight feature extraction network
Patent Information
- Application Number
- CN202310205677.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-06
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-03-06
AI Technical Summary
成品钢卷堆放时端面字符方向随机不便于读取,成像背景环境复杂且人工长期查看监控视频难免出错,前往现场直接查看过程繁琐
[0063] In this invention, the steel coil image is extracted using video surveillance footage from the factory. No additional hardware is required, effectively eliminating interference from non-steel coil areas and obtaining sub-pixel level precision of the steel coil edge area. This allows for the precise extraction of the center coordinates and radius of the ring using accurate edge information, reducing pixel loss caused by flattening the end-face characters. An improved deep learning algorithm for end-face character recognition is employed, with a lightweight feature extraction network that retains more shallow feature information, ensuring the accuracy of end-face character detection while effectively improving detection speed.
Smart Images

Figure CN116311203B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of steel coil production automation technology, and in particular to a method and system for recognizing characters on the end face of steel coils based on a lightweight feature extraction network. Background Technology
[0002] During the strip steel production process, to facilitate subsequent steel transportation, the strip steel is coiled in the final step of production. Each coil is assigned a unique number containing information such as the production batch, type, and model, which is crucial for product quality tracking and full-process production traceability. Currently, most steel mills in China obtain coil numbers and other character information by manually reviewing monitoring videos or visiting the site directly. However, the random orientation of characters on the end faces of stacked finished steel coils makes reading difficult, the complex imaging background environment and the inherent error rate of manual video review over extended periods, and the cumbersome process of on-site inspection. Some steel mills currently use traditional machine vision methods for identification, which heavily rely on hardware equipment. This results in high equipment maintenance costs, poor algorithm accuracy, and slow recognition speed. Simply flattening the characters on the curved end faces leads to significant pixel loss, greatly affecting recognition accuracy.
[0003] Steel coil end face character recognition is a type of end face character recognition in industrial scenarios. It is often subject to image defects caused by complex imaging environments, cluttered backgrounds, bent and deformed end face characters, and uneven printing surfaces. Summary of the Invention
[0004] To address the aforementioned problems, this invention proposes a method and system for directly capturing images of steel coils from on-site monitoring, accurately restoring pixel information after flattening, and recognizing end-face characters of the steel coil markings. This method is based on a lightweight feature extraction network and achieves high reliability and recognition rate for end-face character recognition of steel coils. Furthermore, this invention features precise extraction of steel coil position information, minimal pixel loss during flattening, and a high-precision, fast, and highly generalizable end-face character recognition algorithm, significantly improving detection accuracy while reducing labor and equipment maintenance costs.
[0005] According to a first aspect of the technical solution of the present invention, a method for recognizing characters on the end face of steel coils based on a lightweight feature extraction network is provided, the recognition method comprising the following steps:
[0006] S1: Obtain the precise edge region of each steel coil in the image, and segment the steel coil image to obtain a sub-pixel level steel coil image;
[0007] S2: For sub-pixel level steel coil images, calculate the coordinates of the steel coil's center position and the radius value of the ring boundary to determine the steel coil's ring region;
[0008] S3: Flatten the circular area of the steel coil into a rectangular area and determine the pixel value of the rectangular area to obtain the rectangular image of the steel coil after the circular area of the steel coil is unfolded.
[0009] S4: A lightweight feature extraction network model is used to recognize characters on the end face of the steel coil within a rectangular image of the steel coil.
[0010] Furthermore, S1 specifically includes:
[0011] S11: Obtain an image of the steel coil stack;
[0012] S12: Use dynamic threshold segmentation to segment the steel coil from the background, extract all steel coil edges, and obtain the original steel coil image;
[0013] S13: For the original steel coil image, a subpixel edge detection algorithm is combined with an improved filtering operator for coarse edge point localization, and cubic spline interpolation is used to perform interpolation operations and edge thinning on the image to obtain a subpixel level steel coil image.
[0014] Further, S2 specifically includes: for the subpixel level steel coil image, using Hough transform to extract the complete ring in the subpixel level steel coil image, and obtaining the center position coordinates of the complete ring and the radius information of the largest and smallest circles corresponding to the ring boundary, to determine the steel coil ring region.
[0015] Furthermore, S2 specifically includes:
[0016] S21: For subpixel level steel coil images, Hough transform is used to extract complete rings from the subpixel level steel coil images;
[0017] S22: Calculate the gradient information of all points based on the sub-pixel edge detection points, draw the edge gradient line along the gradient direction, and accumulate all normals through the accumulator. The point with the larger sum value is determined as the center position coordinate (x0, y0).
[0018] S23: Calculate the distance from all edge points to the center of the circle, and determine the distance value with the highest frequency as the radius. At the same time, discard the incomplete circle area by setting the integrity threshold of the circle to be tested. Obtain the maximum and minimum circle radii corresponding to the ring boundary, and denot them as R2 and R1 respectively, and then determine the steel coil ring area.
[0019] Furthermore, S3 specifically includes:
[0020] S31: Flatten the steel coil annular region into a rectangular region;
[0021] S32: Take any point A within the rectangular area, with coordinates (x, y), and the corresponding point A′ within the circular area of the steel coil. Calculate the angle and length values of point A′ in polar coordinates, and then obtain the floating-point coordinates of the circular area through the polar coordinate transformation formula.
[0022] S33: Calculate the pixel value of point A′ using a bilinear interpolation algorithm;
[0023] S34: Based on the correspondence between the pixels in the circular region and the rectangular region of the steel coil in terms of spatial position and pixel value, the pixel value of point A in the rectangular region is calculated; by traversing each point in the rectangular region, all pixel values of the rectangular region are obtained, and finally, the rectangular image of the steel coil after the circular region of the steel coil is unfolded is obtained.
[0024] Furthermore, in step S31, the correspondence between the flattened rectangular region and the original steel coil annular region is as follows:
[0025] In terms of length, the width of the rectangle is equal to the outer arc length of the annulus. in This is the radius of the left side of the circular arc between the starting line and the radius of the arc. R2 is the radius between the right side radius of the circular arc and the starting line, and R2 is the maximum radius corresponding to the boundary of the circular arc; the height is the difference between the maximum and minimum radii of the circular arc corresponding to the boundary of the circular arc, R2-R1.
[0026] Furthermore, S32 specifically includes:
[0027] Let the angle corresponding to each unit pixel length be... in Let Ra be the radian value corresponding to a unit pixel, R2 be the radius of the largest circle corresponding to the boundary of the annulus, and y be the ordinate value of the unit pixel within the rectangular region. Then, the angle value of A′ in polar coordinates within the annulus region is... for:
[0028]
[0029] The length R of point A′ in polar coordinates A for:
[0030] R A =R²-y (2)
[0031] By using polar coordinate transformation, the floating-point coordinates (x′, y′) of the annular region A' are obtained.
[0032]
[0033]
[0034] Furthermore, S33 specifically includes:
[0035] Using the pixel values of the 4-neighborhood of point A′, the pixel value f(x′, y′) of A′ is obtained by performing calculations using the bilinear interpolation formula in two-dimensional space;
[0036] Let x′=i+u, (5)
[0037] y′=j+v (6)
[0038] Where u, v∈(0,1) represent the non-integer part of the coordinates, and i, j represent the integer part of the coordinates;
[0039] Then we can get:
[0040]
[0041] Furthermore, S4 specifically includes:
[0042] S41: Extract end face character features from the rectangular image of the steel coil using the CSPDarknet53 network in YOLOv4, and output a low-level global feature map.
[0043] S42: The low-level global feature map is subjected to character region enhancement feature extraction by the spatial pyramid pooling (SPP) structure and PANet structure in the feature pyramid to obtain the character prediction output feature map;
[0044] S43: The extracted enhanced features are converted into character recognition prediction results using YOLOHead.
[0045] Furthermore, in step S41, the CSPDarknet53 network is modified from the stacked residual unit (Resblock_body) structure to a cross-stage partial network (CSPNet) structure. The original residual block network stack is split into two parts: one part retains the stacking form, and the other part serves as residual edges, which are then connected after passing through convolutional layers. This improved structure effectively simplifies the computational complexity, thereby improving the detection efficiency of steel roll rectangle images. The activation function of the convolutional block DarknetConv2D is changed from LeakyReLU to Mish, avoiding saturation caused by the capping of the activation function itself, resulting in a more stable network gradient flow. The Mish function is a smooth activation function, which allows image information to penetrate the network structure, thereby improving the accuracy and generalization ability of character recognition in images.
[0046] Furthermore, S41 specifically includes:
[0047] S411: After normalizing the size of the rectangular image of the steel coil, a three-channel image is obtained and input into the CSPDarknet53 network;
[0048] S412: Perform Darknet convolution, followed by five Resblock_body operations (essentially large convolutional blocks composed of a series of residual networks) to output a low-level global feature map.
[0049] Furthermore, S42 specifically includes:
[0050] S421: The low-level global feature map is connected to the SPP structure, and significant contextual features are separated by max pooling kernels of different sizes. The pooling results are stacked to perform multi-scale feature fusion.
[0051] S422: The PANet structure is used to add a top-down pyramid to enhance the extraction of semantic information and low-level strong localization information. The parameters of the feature maps at three different scales are aggregated from the three enhanced feature layers to output character prediction output feature maps at three different scales.
[0052] Furthermore, S43 specifically includes:
[0053] S431: The character prediction output feature maps of three different scales are processed separately. For each feature point of each feature layer, three prior boxes are set to extract accurate single character regions. The prior boxes are decoded according to the prior boxes and the prediction output feature maps. Then, the characters in the boxes are decoded with confidence using the sigmoid function. After decoding, the confidence value range is in [0, 1].
[0054] S432: Perform character category decoding to obtain the corresponding character category and confidence level for each box; set a confidence level threshold to filter out boxes below the threshold, and then perform non-maximum suppression to output the character recognition prediction results of the entire network.
[0055] According to a second aspect of the technical solution of the present invention, a steel coil end face character recognition device based on a lightweight feature extraction network is provided, the recognition device comprising:
[0056] The subpixel-level steel coil image acquisition unit is used to acquire the precise edge regions of each steel coil in the image and to segment the steel coil image to obtain a subpixel-level steel coil image.
[0057] The steel coil annular region determination unit is used to calculate the coordinates of the center position of the steel coil and the radius value of the annular boundary for sub-pixel level steel coil images, and to determine the annular region of the steel coil.
[0058] The steel coil rectangular image acquisition unit is used to flatten the circular area of the steel coil into a rectangular area and determine the pixel value of the rectangular area to obtain the steel coil rectangular image after the circular area of the steel coil is flattened.
[0059] The steel coil rectangular image recognition unit is used to recognize characters on the end face of the steel coil within a rectangular image of the steel coil using a lightweight feature extraction network model.
[0060] According to a third aspect of the present invention, a steel coil end face character recognition system based on a lightweight feature extraction network is provided, the system comprising: a processor and a memory for storing executable instructions; wherein the processor is configured to execute the executable instructions to perform the steel coil end face character recognition method based on a lightweight feature extraction network as described in any of the preceding aspects.
[0061] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, characterized in that a computer program is stored thereon, which, when executed by a processor, implements the steel coil end face character recognition method based on a lightweight feature extraction network as described in any of the preceding aspects.
[0062] The beneficial effects of the above-described technical solution of the present invention are as follows:
[0063] In this invention, the steel coil image is extracted using video surveillance footage from the factory. No additional hardware is required, effectively eliminating interference from non-steel coil areas and obtaining sub-pixel level precision of the steel coil edge area. This allows for the precise extraction of the center coordinates and radius of the ring using accurate edge information, reducing pixel loss caused by flattening the end-face characters. An improved deep learning algorithm for end-face character recognition is employed, with a lightweight feature extraction network that retains more shallow feature information, ensuring the accuracy of end-face character detection while effectively improving detection speed.
[0064] This invention aligns with the characteristics of automated and digitalized production sites, eliminating the need for additional image acquisition equipment, thus saving on inspection costs. It accurately and quickly identifies characters on the end face of steel coil markings with varying fonts, sizes, and image clarity, reducing manual inspection errors and saving time in acquiring marking information. This contributes to achieving full-process traceability of steel production information, reducing losses caused by unavailable or incorrectly retrieved steel production information. Attached Figure Description
[0065] Figure 1A This is a step diagram of the steel coil end face character recognition processing method of the present invention; Figure 1B This is a flowchart of the steel coil end face character recognition processing technology of the present invention;
[0066] Figure 2A This is a schematic diagram of the annular region transformed from polar coordinates; Figure 2B This is a schematic diagram of the rectangular region after polar coordinate transformation;
[0067] Figure 3 This is a schematic diagram of the SPP structure.
[0068] Figure 4 The diagram shows the improved YOLOv4 network structure (where Conv: convolutional layer, Upsampling: upsampling, downsampling: downsampling, concat: concatenation). Detailed Implementation
[0069] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0070] The terms "first," "second," etc., used in this disclosure are for distinguishing similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented, for example, in orders other than those illustrated or described herein.
[0071] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.
[0072] Multiple, including two or more.
[0073] And / or, it should be understood that, for the purposes of this disclosure, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.
[0074] This invention provides a highly reliable and accurate method for recognizing characters on the end face of steel coils based on a lightweight feature extraction network. Figure 1A and Figure 1B As shown, the steps are as follows:
[0075] S1: Obtain the precise edge regions of each steel coil in the image and segment the steel coil image.
[0076] For images of stacked steel coils in a steel coil warehouse, a dynamic threshold segmentation method is used to separate the background and steel coils, extract all steel coil edges in the image, and obtain complete steel coil image information. Combined with a subpixel edge detection algorithm, an improved filtering operator is used to coarsely locate edge points, and cubic spline interpolation is used to perform interpolation operations and edge refinement on the image to obtain subpixel level images of all steel coil edges.
[0077] S2: Calculate the coordinates of the center of the steel coil and the radius of the annulus using the Hough transform.
[0078] Draw edge gradient lines along the gradient direction to determine the center position. Calculate the distances from all edge points to the center, and determine the radius R based on the distance with the highest frequency. Simultaneously, discard incomplete circle regions by setting an integrity threshold for the circle under test. This yields the center coordinates (x0, y0) of the complete circular ring of the steel coil. The maximum and minimum radii corresponding to the ring boundary are denoted as R2 and R1, respectively.
[0079] S3: Perform polar coordinate transformation on the obtained center coordinates and radius values to flatten the annular region into a rectangular region. At the same time, use bilinear interpolation to determine the pixel values of the rectangular region to obtain the rectangular image after the annular region is flattened.
[0080] S4: A lightweight feature extraction network model is used to recognize characters within the flattened rectangular image.
[0081] The specific steps in S3 are as follows:
[0082] S31: Based on the correspondence between the transformed rectangular region and the original annular region, the region where the detected annular region is located is segmented out, and its center coordinates and radius are obtained;
[0083] In terms of length, the width of the rectangle is equal to the outer arc length of the annulus. in This is the radius of the left side of the circular arc between the starting line and the radius of the arc. R1 represents the radius between the right side radius of the annular arc and the starting line, R2 represents the maximum radius corresponding to the annular boundary, and the height is the difference between the maximum and minimum radii of the annular boundary, R2-R1. The detected annular region (ROI) is segmented using the Hough transform method of S2, and its center coordinates (x0, y0) and radius R are obtained. For a point A within the expanded region, its coordinates are (x, y), and the corresponding point within the annular region is A′.
[0084] S32: Calculate the angle and length values of the corresponding points in the annular region in polar coordinates, and then obtain the floating-point coordinates of the annular region through the polar coordinate transformation formula;
[0085] Let the angle corresponding to each unit pixel length be... in Let Ra be the radian value corresponding to a unit pixel, R2 be the radius of the largest circle corresponding to the boundary of the annulus, and y be the ordinate value of the unit pixel within the rectangular region. Then, the angle value of A′ in polar coordinates within the annulus region is... for:
[0086]
[0087] The length R of point A′ in polar coordinates A for:
[0088] R A =R²-y (2)
[0089] At this point, the floating-point coordinates (x′, y′) of the annular region A' can be obtained through polar coordinate transformation.
[0090]
[0091]
[0092] S33: Calculate the pixel value of A′ using a bilinear interpolation algorithm.
[0093] The coordinates (x′, y′) of point A′ are usually non-integer values, so the pixel value of A′ cannot be obtained directly. The pixel value f(x′, y′) of A′ is obtained by using its 4-neighbor pixel values and the bilinear interpolation formula in two-dimensional space.
[0094] Let x′=i+u, (5)
[0095] y′=j+v (6)
[0096] Where u, v∈(0,1) represent the non-integer part of the coordinates, and i, j represent the integer part of the coordinates;
[0097] Then we can get:
[0098]
[0099] S34: Based on the correspondence between the pixels in the annular region and the rectangular region in terms of spatial position and pixel value, the pixel value of that point in the rectangular region is calculated. By traversing each point in the rectangular region, all pixel values of the output rectangular region can be obtained, ultimately yielding the rectangular image of the unfolded annular region of the steel coil, i.e., the character image of the steel coil end face.
[0100] The specific steps of S4 are as follows:
[0101] S41: End-face character feature extraction is performed using the CSPDarknet53 network.
[0102] The flattened steel coil end face character image is normalized to obtain a 416×416 three-channel image. First, Darknet convolution is performed, and then five Resblock_body operations (essentially large convolutional blocks composed of a series of residual networks) are performed to compress the height and width of the feature layer and expand the number of channels to retain higher character semantic information, outputting a 13×13×1024 low-level global feature map.
[0103] S42: Character region enhancement feature extraction is performed on the low-level global feature map using the spatial pyramid pooling (SPP) structure in the feature pyramid and the PANet structure.
[0104] The 13×13×1024 feature map is fed into the SPP structure. Significant contextual features are separated using max-pooling kernels of different sizes. The pooling results are stacked for multi-scale feature fusion. A top-down pyramid is added to the PANet structure to enhance the extraction of semantic information and low-level strong localization information. Parameter aggregation is performed on the feature maps at three different scales from three enhanced feature layers, outputting character prediction feature maps at three different scales.
[0105] S43: The extracted enhanced features are transformed into prediction results using YOLOHead.
[0106] The three enhanced feature layers obtained in the previous step are processed separately. For each feature point of each feature layer, three types of prior boxes are set to extract accurate single character regions. The prior boxes are decoded based on the prior boxes and the predicted output feature map. Then, the characters in the boxes are decoded with confidence using the sigmoid function. After decoding, the confidence values are in the range [0, 1]. Finally, character category decoding is performed to obtain the corresponding category and confidence of the character in each box. A confidence threshold is set to filter out boxes below the threshold. After non-maximum suppression, the character recognition prediction results of the entire network are output.
[0107] The specific improvements to the network structure in step S41 are as follows:
[0108] The YOLOv4 CSPDarknet53 was improved in two aspects: 1. The Resblock_body structure was changed to a cross-stage partial network (CSPNet) structure. The original residual block network stacking was split into two parts. One part maintained the stacking form, and the other part was used as residual edges, which were then connected after passing through convolutional layers; 2. The activation function of the convolutional block DarknetConv2D was changed from Leaky ReLU to Mish. By splitting the network structure, the number of residual block stackings was reduced, thereby avoiding unnecessary feature parameter calculations, thus improving the accuracy and speed of feature extraction and reducing memory consumption; the unbounded Mish activation function avoids saturation caused by the upper limit, and the function curve is smooth, extracting depth information.
[0109] The specific steps of step S42 are as follows:
[0110] An SPP structure is added between two DS convolutional structures (composed of cubic convolution, normalization, and activation functions) to allow the input image size to be unrestricted. Internally, depthwise separable convolutions replace continuous convolutional structures, reducing the number of parameters. Four max-pooling layers of different scales (11×11, 9×9, 5×5, 1×1) are used for processing to increase the receptive field and separate the most significant contextual features while maintaining computational speed. PANet is used for repeated feature extraction, employing a bottom-up pyramid to pass strong localization features from the lower levels of characters upwards, fusing multi-layer semantic and localization information to improve the detection performance of multi-scale character targets.
[0111] Thus, the character recognition of the end face of steel coil based on a lightweight feature extraction network is completed.
[0112] Example
[0113] This embodiment includes the following steps:
[0114] S1: Obtain the precise edge regions of each steel coil in the image and segment the steel coil image;
[0115] S2: Calculate the coordinates of the center of the steel coil and the maximum and minimum radii of the corresponding circles at the boundary of the annulus using the Hough transform;
[0116] S3: Perform polar coordinate transformation on the obtained center coordinates and radius values to flatten the annular region into a rectangular region. At the same time, use bilinear interpolation to determine the pixel values of the rectangular region to obtain the rectangular image after the annular region is flattened.
[0117] S4: A lightweight feature extraction network model is used to identify the characters on the end face of the steel coil within the flattened rectangular image of the rectangular region generated in S3.
[0118] The following examples illustrate specific implementations. Figure 2A and Figure 2B The following is an explanation.
[0119] In one specific embodiment, the S1 process is as follows: The steel coil storage area is selected from the user interface by the monitoring camera installed in the steel coil warehouse to capture the steel coil image. Since the steel coil image is affected by the shooting environment and the background is uneven, the dynamic threshold segmentation algorithm is combined with the binomial filter to determine the appropriate threshold for the segmentation of the background and the steel coil. At the same time, the subpixel edge detection algorithm is combined with the improved mathematical morphology gradient filter to perform coarse localization of edge points and the cubic spline interpolation method to perform interpolation operation and edge refinement on the image, and extract the subpixel level edge images of all steel coils.
[0120] In a specific embodiment, the S2 process is as follows: The Hough transform is used to extract the complete ring in the image, and the coordinates of the ring's center and its radius are obtained. The specific calculation process is as follows:
[0121] The gradient information of all points is calculated based on the sub-pixel edge detection points in S1. The edge gradient line, which is the normal of the circle, is drawn along the gradient direction. All normals are accumulated by an accumulator. The larger the sum, the more times the normals intersect at that point, and the closer it is to the center of the circle. Finally, the position of the center of the circle is determined by setting the sum threshold. The distance from all edge points to the center of the circle is calculated, and the distance with the highest frequency is determined as the radius. At the same time, the incomplete circle area is discarded by setting the integrity threshold of the circle to be tested.
[0122] In a specific embodiment, since the printing process of characters on the end face of the steel coil is affected by the flatness of the end face after the steel coil is rolled, the characters on the end face of the steel coil may be missing. Directly recognizing characters from the rolled image has a high error rate and is not convenient for subsequent steel coil quality tracking. Therefore, the annulus is flattened according to the center coordinates and radius obtained in S2. The specific process of S3 is as follows:
[0123] S31: To transform the characters on the inner end face of the annulus into a horizontal arrangement, the annulus region needs to be flattened into a rectangular region. The transformed rectangular region corresponds to the original annulus region, as shown in Figures 2(a) and (b): the rectangle's width is equal to the outer arc length of the annulus. in This is the radius of the left side of the circular arc between the starting line and the radius of the arc. R1 is the radius between the right side radius of the circular arc and the starting line, R2 is the maximum radius corresponding to the boundary of the circular arc, and the height is the difference between the maximum and minimum radii of the circular arc corresponding to the boundary of the circular arc, R2-R1.
[0124] Calculations show that: R2 = 9.5, R1 = 7. Therefore, π can be taken as 3.14.
[0125] For a point A within the expanded region, its coordinates are (x, y) = (6, 8), and the corresponding point within the annular region is A′, with coordinates (x′, y′).
[0126] S32: Calculate the angle and length values of the corresponding points in the annular region in polar coordinates, and then obtain the floating-point coordinates of the annular region through the polar coordinate transformation formula;
[0127] Let the angle corresponding to each unit pixel length be... in Let Ra be the radian value corresponding to a unit pixel, R2 be the radius of the largest circle corresponding to the boundary of the annulus, and y be the ordinate value of the unit pixel within the rectangular region. Then, the angle value of A′ in polar coordinates within the annulus region is... for:
[0128]
[0129] Calculations show that:
[0130]
[0131] The length R of point A′ in polar coordinates A for:
[0132] R A =R²-y (2)
[0133] Calculations show that:
[0134] R A =9.5 × 3.14 - 8 = 21.83
[0135] At this point, the floating-point coordinates (x′, y′) of the annular region A′ can be obtained by polar coordinate transformation, where x0 and y0 are (0, 0).
[0136]
[0137]
[0138] Calculations show that:
[0139] x′=0+21.83·cos3.843
[0140] =21.78
[0141] y′=0+21.83·sin3.843
[0142] =1.46
[0143] S33: Calculate the pixel value of A′ using a bilinear interpolation algorithm.
[0144] The coordinates (x′, y′) of point A′ are usually non-integer values, so the pixel value of A′ cannot be obtained directly. The pixel value of A′ is obtained by using its 4-neighbor pixel values and the bilinear interpolation formula in two-dimensional space, f(x′, y′) = f(21.78, 1.46).
[0145] Let x′=i+u, (5)
[0146] y′=j+v (6)
[0147] By substituting, we can obtain:
[0148] x′=21+0.78
[0149] y′=1+0.46
[0150] Where u, v∈(0,1) represents the non-integer part of the coordinates, and i, j represents the integer part of the coordinates;
[0151] Then we can get:
[0152]
[0153] Calculations show that:
[0154] f(21.78,1.46)=f(21+0.78,1+0.46)
[0155] = (1-0.78)×(1-0.46)×f(21,1)+(1-0.78)×0.46×f(21,2)
[0156] +0.78(1-0.46)f(22,1)+0.78×0.46×f(22,2)
[0157] =0.12×f(21,1)+0.10×f(21,2)
[0158] +0.42f(22,1)+0.36×f(22,2)
[0159] S34: Based on the correspondence between the pixels in the annular region and the rectangular region in terms of spatial position and pixel value, the calculated f(x′, y′) is the pixel value of point A in the rectangular region. By traversing every point in the rectangular region, all pixel values of the output rectangular region can be obtained, ultimately yielding the rectangular image of the unfolded annular region of the steel coil, i.e., the character image on the end face of the steel coil.
[0160] In a specific implementation example, the S4 process is as follows:
[0161] S41: The end face character features are extracted by the CSPDarknet53 network. The flattened end face character image of the steel coil is normalized to obtain a three-channel image of size 416×416. First, Darknet convolution is performed, and then five Resblock_body (which is essentially a large convolutional block composed of a series of residual networks) are performed to compress the height and width of the feature layer and expand the number of channels. Finally, the feature layers of the last three shapes are used for subsequent operations to retain higher character semantic information.
[0162] S42: Enhanced feature extraction is achieved using the spatial pyramid pooling (SPP) structure within the feature pyramid and the PANet structure. Three convolutional operations are performed on the 13×13×1024 feature layer, followed by the SPP structure (SPP has four branches, using max-pooling kernels of different sizes to perform max-pooling on the input feature layer; the pooling results are then stacked, such as...). Figure 3 (As shown), then perform three more convolutions;
[0163] S43: The extracted features are transformed into prediction results using YOLOHead; the feature layers after three convolutions are upsampled by a factor of 2 to obtain deeper features. The upsampled 26×26 feature layer is stacked with the 26×26×512 feature layer obtained from the backbone network, and then upsampled again and stacked with a 52×52×256 feature layer to complete the feature pyramid structure. Simultaneously, a top-down pyramid is added using the PANet structure to enhance the extraction of semantic information and low-level strong localization information. Convolution and downsampling reduce image size and extract shallow information. Predictions are made on feature maps of different scales. Finally, the prediction results are decoded and post-processed. The character category is obtained through 1×1 convolution to obtain the final recognition result.
[0164] The improvement to the network structure in step S41 is specifically as follows:
[0165] YOLOv4 (e.g.) Figure 4 The CSPDarknet53 shown improves upon the previous version in two aspects: 1. It replaces the Resblock_body structure with a cross-stage partial network (CSPNet) structure. The original residual block network stack is split into two parts, one part retains the stacking form, and the other part serves as residual edges, which are then connected after passing through convolutional layers; 2. The activation function of the convolutional block DarknetConv2D is changed by Leaky.
[0166] ReLU was replaced with Mish. By splitting the network structure, the number of residual block stackings is reduced, thereby avoiding unnecessary feature parameter calculations, which improves the accuracy and speed of feature extraction and reduces memory consumption. An unbounded Mish activation function is used to avoid saturation caused by an upper limit, and the function curve is smooth, which is beneficial for the extraction of deep information.
[0167] The specific process of step S42 is as follows:
[0168] An SPP structure is added between two cubic convolutions, normalization, and activation functions to allow for unlimited input image size. Internally, depthwise separable convolutions replace continuous convolutions, reducing the number of parameters. Four max-pooling layers of different scales (11×11, 9×9, 5×5, 1×1) are used to increase the receptive field and separate the most significant contextual features while maintaining computational speed. PANet is used for repeated feature extraction, employing a bottom-up pyramid structure to pass strong localization features from lower layers upwards, fusing multi-layer semantic and localization information to improve the detection performance of multi-scale targets.
[0169] The improved lightweight network structure effectively balances the accuracy and speed of the algorithm to meet the requirements of industrial environments. It adopts a method that reduces the number and depth of residual block stacking, replacing continuous convolutional structures with separable convolutions to reduce the number of parameters and improve computational speed. Simultaneously, it avoids the loss of feature information due to excessively deep convolutional layers. The PANet structure is used to repeatedly extract features, better utilizing shallow feature information and effectively fusing features from different levels. Multi-frame image fusion improves recognition accuracy. By cropping and recognizing multiple frames, and voting on the recognition results, the impact of camera shake during strip steel production on the recognition results is effectively reduced.
[0170] In summary, this invention provides a method for recognizing characters on the end face of steel coils based on a lightweight feature extraction network, belonging to the field of steel coil production automation technology. The character numbers on the end face of steel coils correspond to production-related information and are crucial for tracing the production process and measuring quality. This method utilizes stacked images of steel coils obtained from the steel coil warehouse. First, it employs a combination of sub-pixel edge detection algorithms and dynamic threshold segmentation to identify complete steel coil rings and incomplete steel coil arcs in the image. Next, it calculates the gradient of the complete steel coil ring image using Hough transform to obtain the center coordinates and radius of the coil. Then, based on the center coordinates, the ring is flattened so that the end face characters are horizontally arranged. The pixel values of the rectangular area are determined by the correspondence between pixels and positions. A deep learning neural network model is used to locate and recognize the flattened labeled end face characters. This method accurately extracts the outline edge features of the steel coils in the image and flattens the annular area while maximizing the restoration of the pixel-position correspondence. Simultaneously, it uses a lightweight feature extraction network model to recognize the characters on the end face of the steel coils, exhibiting high recognition rate and strong reliability.
[0171] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0172] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0173] Through the above description of the embodiments, those skilled in the art can clearly understand that the above implementation methods can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0174] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A method for recognizing characters on the end face of steel coils based on a lightweight feature extraction network, characterized in that, The identification method includes the following steps: S1: Obtain the image of the stacked steel coils; use dynamic threshold segmentation to segment the steel coils from the background, extract all steel coil edges, and obtain the original steel coil image; for the original steel coil image, combine the sub-pixel edge detection algorithm and use the improved filtering operator to perform coarse localization of edge points, and use cubic spline interpolation to perform interpolation operations and edge thinning on the image to obtain the sub-pixel level steel coil image. S2: For the subpixel level steel coil image, Hough transform is used to extract the complete ring in the subpixel level steel coil image, and the coordinates of the center position of the complete ring and the radius information of the largest and smallest circles corresponding to the ring boundary are obtained to determine the steel coil ring region. S3: Perform polar coordinate transformation on the obtained center coordinates and radius values to flatten the annular region into a rectangular region. At the same time, use bilinear interpolation to determine the pixel values of the rectangular region to obtain the rectangular image after the annular region is flattened. S4: Extract end face character features from the rectangular image of the steel coil using the CSPDarknet53 network in YOLOv4, and output a low-level global feature map. Character region enhancement features are extracted from the low-level global feature map using the spatial pyramid pooling structure and PANet structure in the feature pyramid, resulting in a character prediction output feature map. The extracted enhanced features are then converted into character recognition prediction results using YOLOHead. The CSPDarknet53 network modifies the Resblock_body structure to use a cross-stage local area network structure, splitting the original residual block network stack into two parts. One part retains the stacking form, while the other part serves as a residual edge, which is then connected after passing through a convolutional layer. The activation function of the convolutional block DarknetConv2D is Mish.
2. The method for recognizing characters on the end face of a steel coil according to claim 1, characterized in that, S2 specifically includes: S21: For subpixel level steel coil images, Hough transform is used to extract complete rings from the subpixel level steel coil images; S22: Calculate the gradient information of all points based on the sub-pixel edge detection points, draw the edge gradient line along the gradient direction, and accumulate all normals through an accumulator. The point with the larger sum value is determined as the center position coordinate. ; S23: Calculate the distances from all edge points to the center of the circle, and determine the distance with the highest frequency as the radius. Simultaneously, discard incomplete circle regions by setting a completeness threshold for the circle under test; obtain the maximum and minimum radii corresponding to the annular boundary, denoted as [missing information]. This allows us to determine the annular region of the steel coil.
3. The method for recognizing characters on the end face of a steel coil according to claim 1, characterized in that, S3 specifically includes: S31: Flatten the steel coil annular region into a rectangular region; S32: Select any point within the rectangular area. The coordinates are The corresponding point within the annular region of the steel coil is Calculation points The angle and length values in polar coordinates are used to obtain the floating-point coordinates of the annular region through polar coordinate transformation formulas; S33: Calculate the points using the bilinear interpolation algorithm. Pixel values; S34: Based on the correspondence between the pixels in the circular region and the rectangular region of the steel coil in terms of spatial position and pixel value, obtain the points within the rectangular region. The pixel values are determined; each point in the rectangular region is traversed to obtain all pixel values of the output rectangular region, and finally, the rectangular image of the steel coil after the circular region of the steel coil is unfolded is obtained.
4. The method for recognizing characters on the end face of a steel coil according to claim 3, characterized in that, In step S31, the correspondence between the flattened rectangular region and the original steel coil annular region is as follows: In terms of length, the width of the rectangle is equal to the outer arc length of the annulus. ,in This is the radius of the left side of the circular arc between the starting line and the radius of the arc. This is the radius of the right side of the circular arc between the starting line and the radius of the right side of the arc. The radius is the maximum radius corresponding to the boundary of the torus; the height is the difference between the maximum and minimum radii of the circle corresponding to the boundary of the torus. .
5. A steel coil end face character recognition device based on a lightweight feature extraction network, characterized in that, The steel coil end-face character recognition device processes the steel coil end-face character recognition method based on a lightweight feature extraction network according to any one of claims 1 to 4, and the steel coil end-face character recognition device includes: The subpixel-level steel coil image acquisition unit is used to acquire the precise edge regions of each steel coil in the image and to segment the steel coil image to obtain a subpixel-level steel coil image. The steel coil annular region determination unit is used to calculate the coordinates of the center position of the steel coil and the radius value of the annular boundary for sub-pixel level steel coil images, and to determine the annular region of the steel coil. The steel coil rectangular image acquisition unit is used to flatten the circular area of the steel coil into a rectangular area and determine the pixel value of the rectangular area to obtain the steel coil rectangular image after the circular area of the steel coil is flattened. The steel coil rectangular image recognition unit is used to recognize characters on the end face of the steel coil within a rectangular image of the steel coil using a lightweight feature extraction network model.
6. A character recognition system for the end face of steel coils based on a lightweight feature extraction network, the system comprising: A processor and a memory for storing executable instructions; wherein the processor is configured to execute the executable instructions to perform the steel coil end face character recognition method based on a lightweight feature extraction network according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements the steel coil end face character recognition method based on a lightweight feature extraction network according to any one of claims 1 to 4.
Citation Information
Patent Citations
Universal detection method for steel coil code spraying identification
CN112818970A