CN-121982728-A - Agricultural machinery label identification method based on image
Abstract
The invention discloses an agricultural machine label identification method based on images, which relates to the technical field of label identification, and carries out image enhancement pretreatment on an original image by acquiring the original image of the agricultural machine label, and inputting the enhanced image into a text detection network based on self-adaptive Bezier curve regression, obtaining a primary text recognition result, performing verification, error correction and formatting conversion, generating a key value data packet, and uploading the key value data packet to a remote management platform. According to the invention, the illumination unevenness and the background interference are restrained through image enhancement preprocessing, the edge definition of low-contrast characters is improved, a character detection network adopting self-adaptive Bezier curve regression is adopted to accurately fit a deformed text region, the robust detection of agricultural machine labels under a complex background is realized, the Bezier characteristic alignment and light attention decoding mechanism are combined, the processing efficiency is improved while the recognition precision is ensured, the structural rule and a semantic knowledge base are utilized to carry out verification and error correction, the accuracy of text recognition is improved, and data is output.
Inventors
- JIANG LONG
- ZHANG SHUAI
- FANG HUI
- LI ZHENHUA
- SHEN HAO
Assignees
- 浙江大学湖州研究院
Dates
- Publication Date
- 20260505
- Application Date
- 20251218
Claims (8)
- 1. The agricultural machinery label identification method based on the image is characterized by comprising the following steps of: S1, acquiring an original image of an agricultural machine label; S2, performing image enhancement pretreatment on an original image to inhibit uneven illumination and background interference and sharpen low-contrast character edges; s3, inputting the enhanced image into a text detection network based on self-adaptive Bezier curve regression, and predicting Bezier curve control point coordinates of a deformed text region; S4, sampling and transforming the feature map output by the character detection network according to the coordinates of the control points by utilizing the Bessel feature alignment layer to obtain a regular text feature sequence; S5, inputting the regular text feature sequence into a light text recognition network based on an attention decoding mechanism to obtain a preliminary text recognition result; s6, checking, correcting errors and formatting the primary text recognition result based on the structural rules and the semantic knowledge base of the agricultural machinery label information to generate key value pair data; and S7, binding the key value pair data with the acquisition time and the geographic coordinate information, packaging the key value pair data into a data packet according to a preset agricultural machinery Internet of things data communication protocol, and uploading the data packet to a remote management platform.
- 2. The method for recognizing agricultural machinery label based on image according to claim 1, wherein the scene adaptive image enhancement processing in S2 comprises estimating and correcting the illumination component of the original image by multi-scale Retinex algorithm to eliminate shadows and uneven reflection, and then enhancing the contrast of the illumination corrected image by limiting contrast adaptive histogram equalization algorithm in local subareas to emphasize the blurred character features due to abrasion or stains.
- 3. The method for identifying the agricultural machinery label based on the image of claim 1, wherein the text detection network based on the self-adaptive Bezier curve regression in the step S3 takes the combination of ResNet-50 and a characteristic pyramid network as a main network, the Bezier curve is a cubic Bezier curve, the control point coordinates are generated in the following mode and serve as regression targets, each long side of the marked quadrilateral text box is trisected to obtain 4 initial points, the optimal 4 control points are obtained by utilizing least square fitting, and the total number of the two long sides is 8.
- 4. The method for recognizing an agricultural implement signage based on an image of claim 3, wherein the regression targets of the 8 control point coordinates are represented by normalized offsets relative to minimum vertex coordinates of a circumscribed quadrilateral of the text instance.
- 5. The method for recognizing an agricultural implement label based on an image according to claim 1, wherein the specific operations of the Bessel feature alignment layer in S4 include: For any target pixel point on the output feature map, calculating a parameter t according to the ratio of the horizontal position to the total width; Substituting t into Bezier curve equations describing the upper and lower boundaries of the text region to respectively obtain coordinates of an upper boundary point tp and a lower boundary point bp in the input feature diagram; According to the vertical position of the target pixel point, linear interpolation is carried out between the point tp and bp, and accurate sampling point coordinates on an input feature map are obtained; and performing bilinear interpolation on the sampling points to acquire characteristic values.
- 6. The method for recognizing agricultural machinery label based on image according to claim 1, wherein the lightweight text recognition network based on the attention decoding mechanism in S5 comprises two convolution layers, a two-way long-short-term memory network layer and a decoder based on the attention mechanism in order, wherein the decoder is used for dynamically focusing on the relevant part of the feature sequence and generating recognition results character by character.
- 7. The method for recognizing agricultural machinery label based on image according to claim 1, wherein the verifying and formatting based on the structuring rule and semantic knowledge base in S6 specifically comprises: Matching and verifying the recognized text sequence with a verification code algorithm of the vehicle recognition code, and automatically correcting characters which do not accord with a verification rule; Fuzzy matching is carried out on the text sections of the suspected model number and the serial number and a pre-constructed agricultural machinery model number and engine number database, and the text sections are corrected to be the most probable correct items; And analyzing and filling the checked and corrected information according to a field template of model number, engine number, delivery date, vehicle identification code number and the like, and outputting the structured data in JSON or XML format.
- 8. The method for recognizing the agricultural machine label based on the image of claim 1, wherein the character detection network in S3 and the character recognition network in S5 are obtained by performing end-to-end joint training by using an agricultural machine label image dataset which is specially collected and marked, and samples in the dataset comprise abrasion, stains, deformation and complex backgrounds with different degrees.
Description
Agricultural machinery label identification method based on image Technical Field The invention relates to the technical field of label identification, in particular to an agricultural machinery label identification method based on images. Background The image recognition and optical character recognition technology is widely applied to the automatic information collection and management of various labels and certificates, and in the field of agricultural machinery management, an agricultural machine label is used as a carrier for recording key asset information such as model numbers, engine numbers, vehicle identification codes and the like, and the digital recording of the information is a basic link for realizing the intelligent management of the agricultural machine. The existing label identification has the following defects: 1. Patent document CN117152764B discloses a digital signage image text recognition method based on a transducer network model, "the invention discloses a digital signage image text recognition method based on a transducer network model, based on a transducer network model and a scene text recognition STR technology, the position codes of the digital signage images are acquired by utilizing relative position codes, and the characteristic expressions of different subspaces are connected to an encoder, so that the texts in the digital signage images are accurately recognized. The invention adopts relative position coding to code the image feature map from two dimensions of horizontal and vertical, can accurately capture the position information between two-dimensional image blocks, better model the text information in the image, and can more accurately identify the text in the digital signage image, but the identification method in the file has the technical problems that rectangular frame positioning is adopted, the curved and inclined text area is difficult to be tightly attached, insufficient detection and feature extraction distortion are caused, and the common physical deformation and complex background interference of the agricultural machine signage cannot be effectively solved. Disclosure of Invention The invention aims to provide an image-based agricultural machinery label recognition method for solving the technical problems in the background technology. In order to achieve the above purpose, the invention provides the following technical scheme that the agricultural machinery label identification method based on the image comprises the following steps: S1, acquiring an original image of an agricultural machine label; S2, performing image enhancement pretreatment on an original image to inhibit uneven illumination and background interference and sharpen low-contrast character edges; s3, inputting the enhanced image into a text detection network based on self-adaptive Bezier curve regression, and predicting Bezier curve control point coordinates of a deformed text region; S4, sampling and transforming the feature map output by the character detection network according to the coordinates of the control points by utilizing the Bessel feature alignment layer to obtain a regular text feature sequence; S5, inputting the regular text feature sequence into a light text recognition network based on an attention decoding mechanism to obtain a preliminary text recognition result; s6, checking, correcting errors and formatting the primary text recognition result based on the structural rules and the semantic knowledge base of the agricultural machinery label information to generate key value pair data; and S7, binding the key value pair data with the acquisition time and the geographic coordinate information, packaging the key value pair data into a data packet according to a preset agricultural machinery Internet of things data communication protocol, and uploading the data packet to a remote management platform. Preferably, the scene adaptive image enhancement processing in S2 includes firstly performing illumination component estimation and correction on an original image by using a multi-scale Retinex algorithm to eliminate shadows and uneven reflection, and then performing contrast enhancement on the image after illumination correction by using a limited contrast adaptive histogram equalization algorithm in a local sub-area to highlight text features blurred due to abrasion or stains. Preferably, in the text detection network based on self-adaptive bezier curve regression in the step S3, a combination of ResNet-50 and a feature pyramid network is used as a main network, the bezier curve is a cubic bezier curve, control point coordinates of the bezier curve are generated in the following manner and used as regression targets, each long side of the marked quadrilateral text box is trisected to obtain 4 initial points, and the optimal 4 control points are obtained by using least square fitting, wherein the total number of the two long sides is 8. Preferably, the regression targets of