An electronic scale image text recognition method based on artificial intelligence OCR

Through the image text recognition method of electronic scales based on artificial intelligence OCR, including sample collection, cleaning, labeling, expansion and model training, the accurate recognition of image text of electronic scales is achieved using ResNet34 and CTC loss functions, and the problem of inaccurate recognition in the prior art is solved.

CN114022876BActive Publication Date: 2025-03-07ZHONGZAI YUNTU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111346871.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-15
Publication Date
2025-03-07
Estimated Expiration
2041-11-15

AI Technical Summary

Technical Problem

The prior art cannot accurately realize the image recognition of electronic scales.

Method used

The image text recognition method of electronic scales based on artificial intelligence OCR is adopted, including sample collection, cleaning, labeling, expansion, data preprocessing, feature extraction and model optimization. Image feature extraction and model training were performed using ResNet34 and CTC loss functions.

Benefits of technology

Accurate recognition of the image text of the electronic scale is realized, and the problem of inaccurate recognition in the prior art is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114022876B_ABST
    Figure CN114022876B_ABST
Patent Text Reader

Abstract

The present invention provides an electronic scale image text recognition method based on artificial intelligence OCR, the method comprising the following steps: sample collection step; sample cleaning step; sample labeling step; sample expansion step; sample preprocessing step; according to the first algorithm processing, ResNet34 extracts features, after the first neural network processing, CTC loss calculation optimizes the weights in ResNet34 and the first neural network model. The method provided by the present invention can accurately realize electronic scale image text recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to an electronic scale image text recognition method based on artificial intelligence OCR. Background Art

[0002] OCR character recognition technology, OCR refers to the process of optical equipment (scanners, digital cameras, etc.) checking characters printed on paper, determining their shapes by detecting dark and light patterns, and then using character recognition methods to translate the shapes into computer text. Its essence is to use optical equipment to capture images and recognize text, extending the ability of the human eye to the machine. OCR technology has a wide range of applications, including document recognition, license plate recognition, smart medical care, PDF document conversion to Word, photo recognition, screenshot recognition, network image recognition, unmanned driving, paperless office, manuscript editing and proofreading, logistics sorting, public opinion monitoring, document retrieval, subtitle recognition, literature retrieval, etc.

[0003] Electronic scales are automated weighing devices used to weigh goods. They measure goods through the force-electricity conversion of sensors and processing by weighing instruments.

[0004] With the development of the intelligent era, there is also a demand for remote electronic scale image recognition. Recognizing the measurement value in an image through an image is also used in remote data proofreading, unattended operation and other scenarios. Summary of the invention

[0005] The technical problem to be solved by the present invention is that the prior art cannot accurately realize electronic scale image recognition.

[0006] The present invention provides an electronic scale image text recognition method based on artificial intelligence OCR, which is characterized by comprising the following steps:

[0007] S1: Sample collection step, collecting electronic scale text image data, and extracting frames from video images to obtain corresponding images;

[0008] S2: sample cleaning step, removing duplicate electronic scale image data and removing image data without required electronic scale text;

[0009] S3: Sample annotation steps, using the 4-point annotation method to facilitate quick tilt correction after text cropping, using the PPOCR label annotation tool to annotate the text position and text content at the same time, crop and export the image data after the annotation is completed, check whether the image is inverted, and if so, manually rotate it 180 degrees to make the image upright;

[0010] S4: Sample expansion step, expanding the sample.

[0011] S5: Data preprocessing step. Before the data is sent to the model training, it needs to be processed. The input image data needs to be normalized, adjusted to the appropriate size and dimension, and the data labels need to be converted into digital sequences.

[0012] S6: using a first algorithm to process the image data, the first algorithm input is a plurality of matching point pairs of the same parts in the two images, and the first algorithm output is a coordinate mapping of the same parts in the two images;

[0013] S7: The data is processed by ResNet34 to extract features, and then the weights in the ResNet34 and first neural network models are optimized by CTC loss calculation.

[0014] The beneficial effect of the present invention is that the method provided by the present invention can accurately realize the electronic scale image and text recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 The present invention is an overall step diagram of an electronic scale image text recognition method based on artificial intelligence OCR.

[0016] Figure 2 This is a ResNet34 network structure diagram of an electronic scale image text recognition method based on artificial intelligence OCR of the present invention. DETAILED DESCRIPTION

[0017] The present invention provides an electronic scale image text recognition method based on artificial intelligence OCR, the method comprising the following steps:

[0018] S1: Sample collection, collect electronic scale text image data on the Internet, and extract frames of video images to get corresponding images.

[0019] S2: Sample cleaning, there are many types of electronic scale text image data, and it is necessary to standardize which types are needed. The collected data is relatively chaotic, often with high repetitiveness and images without text or incomplete text, etc., so it is necessary to first eliminate the repeated electronic scale image data, and then eliminate the image data without the required electronic scale text. Images with incomplete text can be retained or eliminated according to the situation.

[0020] S3: Sample annotation, OCR text image needs to annotate the text in the image and the position of the text in the image. Here, the 4-point annotation method is used to facilitate the quick tilt correction after the text is cropped. The present invention uses the PPOCR label annotation tool, which can annotate the text position and text content at the same time. After the annotation is completed, the image data is cropped and exported to check whether the image is inverted. If there is an inverted image, manually rotate it 180 degrees to make the image upright. There is no vertical or inverted display in the electronic scale text image, so the image in the present invention only needs to pay attention to the upright situation.

[0021] S4: Sample expansion, OCR text recognition itself requires a lot of data, each character label needs to be included, and the electronic scale text types are complex, with background interference, etc. The existing collected data does not meet the above conditions, so the sample is expanded.

[0022] S5: Data preprocessing: Before the data is sent to the model training, it needs to be processed, the input image data is normalized, adjusted to the appropriate size dimension, and the data label is converted into a digital sequence. The input image size is transformed into an image size of 100*32, and the image area value [0,255] space is mapped to the [-1,1] space area.

[0023] S6: The first algorithm input is a plurality of matching point pairs of the same parts in the two images, and the output is the coordinate mapping of the same parts in the two images. The first algorithm is implemented using the following formula:

[0024] φ(x)=c+a T x+w T s(x)

[0025] s(x)=(σ(x-x1),σ(x-x2),...,σ(xx n )) T

[0026]

[0027] In the formula, x represents input data, c represents scalar, and vector a∈R 2×1 , R represents a set of real numbers, weight w∈R n×1 , n represents the length of x, T represents transpose, Represents the n-normalized square of the input data x.

[0028] The S7 data is processed by the first algorithm, ResNet34 extracts features, and after processing by the first neural network, the weights in the ResNet34 and first neural network models are optimized by CTC loss calculation.

[0029] ResNet34, ResNet (Residual Neural Network) The structure of ResNet can accelerate the training of neural networks very quickly, and the accuracy of the model is also greatly improved. At the same time, ResNet is very generalizable and can even be directly used in the InceptionNet network. Traditional convolutional networks or fully connected networks will have more or less information loss and loss problems when transmitting information, and will also cause gradient disappearance or gradient explosion, making it impossible to train very deep networks. ResNet solves this problem to a certain extent by directly bypassing the input information to the output to protect the integrity of the information. The entire network only needs to learn the difference between the input and output, simplifying the learning objectives and difficulty.

[0030] ResNet34 process is as follows Figure 2 Shown:

[0031] 7*7 convolution kernel, stride 2, and 64 channels of convolution layer;

[0032] 2*2 maximum pooling layer;

[0033] 2 times of 3*3 convolution kernel, 64 channels of convolution layer, and fusion of the results before and after calculation;

[0034] Repeat the previous step 3 times;

[0035] 3*3 convolution kernel, stride 2, convolution layer with 128 channels, 3*3 convolution kernel, convolution layer with 128 channels, and fusion of the calculated results with the initial results;

[0036] 2 times of 3*3 convolution kernel, 128 channels of convolution layer, and fusion of the results before and after calculation;

[0037] Repeat the previous step 3 times;

[0038] 3*3 convolution kernel, stride 2, convolution layer with 256 channels, 3*3 convolution kernel, convolution layer with 256 channels, and fusion of the calculated result with the initial result;

[0039] 2 times of 3*3 convolution kernel, 256 channels of convolution layer, and fusion of the results before and after calculation;

[0040] Repeat the previous step 5 times;

[0041] 3*3 convolution kernel, stride 2, convolution layer with 512 channels, 3*3 convolution kernel, convolution layer with 512 channels, and fusion of the calculated result with the initial result;

[0042] 2 times of 3*3 convolution kernel, 512 channels of convolution layer, and fusion of the results before and after calculation;

[0043] Repeat the previous step 2 times;

[0044] 2*2 average pooling layer;

[0045] The first neural network is constructed using the following formula.

[0046] z t =σ(W z ·[h t-1 ,x t ])

[0047] r t =σ(W r ·[h t-1 ,x t ])

[0048]

[0049]

[0050]

[0051] W in the formula z represents the update gate z t The weights in , σ represents the activation function, h t-1 Indicates the output at the previous moment, h t Represents the output at the current moment, x t Indicates current entry and exit, W r Reset gate r t The weights in , W represents the candidate hidden state The weights in , tanh is the hyperbolic tangent function.

[0052] CTC loss, the full name of CTC is Connectionist Temporal Classification. This method is mainly used to solve the problem of misalignment between neural network labels and outputs. It is often used in tasks such as text recognition, speech, and natural language.

[0053] The beneficial effect of the present invention is that the method provided by the present invention can accurately realize the electronic scale image and text recognition.

[0054] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An electronic scale image text recognition method based on artificial intelligence OCR, characterized in that: The following steps are involved: S1: Sample collection step, collecting electronic scale text image data, and extracting frames from video images to obtain corresponding images; S2: sample cleaning step, removing duplicate electronic scale image data and removing image data without required electronic scale text; S3: Sample annotation step, using the 4-point annotation method to facilitate quick tilt correction after text cropping, annotate the text position and text content, crop and export image data after annotation, check whether the image is inverted, and manually rotate 180 degrees to make the image upright if there is an inverted image; S4: sample expansion step, expanding the sample; S5: Data preprocessing step: Before the data is sent to the model training, it needs to be processed. The input image data needs to be normalized, adjusted to a suitable size and dimension, and the data labels need to be converted into digital sequences. S6: using a first algorithm to process the image data, the first algorithm input is a plurality of matching point pairs of the same parts in the two images, and the first algorithm output is a coordinate mapping of the same parts in the two images; The first algorithm inputs multiple sets of matching point pairs of the same parts in two images, and outputs the coordinate mapping of the same parts of the two images; the first algorithm is implemented using the following formula: φ(x)=c+a T x+w T s(x) s(x)=(σ(x-x1),σ(x-x2),...,σ(xx n )) T In the formula, x represents input data, c represents scalar, and vector a∈R 2×1 , R represents a set of real numbers, weight w∈R n×1 , n represents the length of x, T represents transpose, Represents the n-normalized square of the input data x; S7: The data is processed by ResNet34 to extract features, and after being processed by the first neural network, the weights in the ResNet34 and first neural network models are optimized by CTC loss calculation; The first neural network was constructed using the following formula: z t =σ(W z ·[h t-1 ,x t ]) r t =σ(W r ·[h t-1 ,x t ]) W in the formula z represents the update gate z t The weights in , σ represents the activation function, h t-1 Indicates the output at the previous moment, h t Represents the output at the current moment, x t Indicates current entry and exit, W r Reset gate r t The weights in , W represents the candidate hidden state The weights in , tanh is the hyperbolic tangent function.

Citation Information

Patent Citations

  • Building indication mark character recognition method based on a deep learning technology

    CN111626292A

  • Image recognition method and apparatus

    WO2020000879A1