Casting mold character recognition method and system considering industrial environment

By constructing and training cast mold character detection model, combining image features and character recognition model, the problem of mold character recognition in complex industrial scenarios is solved, high-precision and high-efficiency recognition effect is achieved, and the speed advantage is achieved when deploying on mobile terminals.

CN119863800APending Publication Date: 2025-04-22JINAN MEIDE CASTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411938340.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

When the prior art faces the recognition of mold characters in complex industrial scenarios, it is difficult to effectively deal with the problems of diverse character shapes, complex backgrounds and uneven lighting, resulting in poor recognition results.

Method used

By obtaining casting mold drawing data, removing the interference factors that affect character recognition, building and training casting mold character detection model, combining image features and character recognition model, accurate recognition of characters in complex industrial scenarios is achieved.

Benefits of technology

While ensuring high detection accuracy, quickly identify characters in drawings and molds, improve production efficiency, and improve recognition efficiency when deploying on mobile terminals through model quantization methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863800A_ABST
    Figure CN119863800A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and provides a casting mold character recognition method and system considering an industrial environment, and the technical scheme is that interference factors influencing character recognition in a casting mold drawing are removed, character regions are screened based on the drawing after the interference factors influencing character recognition are removed, and a character recognition result is obtained. Performing identification to obtain initial character region image data; training the constructed casting mold character detection model based on the initial character region image data to obtain a trained casting mold character detection model; when the casting mold character detection model is trained, adjusting the training data set according to the data distribution and data synthesis of the training data set according to the actual measurement scene; detecting a to-be-detected drawing based on the trained casting mold character detection model to obtain a character region image, and extracting image features of a character region; and combining the image features of the character region with the trained character recognition model to obtain a character recognition result. And efficient and accurate recognition of the mold characters is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image processing, and in particular relates to a casting mold character recognition method and system considering industrial environment. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] In the field of industrial manufacturing, mold character recognition is a vital task. The characters on the mold drawings usually contain key production information, such as size, material, process requirements, etc. However, due to the complexity of mold drawings, the characters are often in different backgrounds, lighting conditions and morphological changes, making character recognition extremely challenging. Traditional character recognition methods, such as those based on template matching or feature extraction, often have difficulty achieving ideal recognition results when faced with complex scenes.

[0004] Existing solutions mostly use OCR and deep learning technology. OCR (Optical Character Recognition) technology is a technology that converts characters in an image into computer-editable text. With the development of computer vision technology, image recognition technology has been widely used in various fields. However, when image recognition technology is directly applied to mold character recognition, it is still necessary to solve problems such as character distortion, blur, and adhesion. In recent years, deep learning technology has made significant progress in the field of character recognition. By training deep neural networks, accurate recognition of characters in complex scenes can be achieved. However, the existing recognition methods do not take into account the differences in the number of characters in complex industrial scenes, such as diverse character shapes, complex backgrounds, and uneven lighting, and the recognition effect is often poor. Summary of the invention

[0005] In order to solve at least one of the technical problems existing in the above-mentioned background technology, the present invention provides a casting mold character recognition method and system taking into account the industrial environment, which takes into account the difference in the number of characters in complex industrial scenes, ensures high detection accuracy and quickly identifies the characters in drawings and molds, thereby improving production efficiency.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] A first aspect of the present invention provides a casting mold character recognition method considering an industrial environment, comprising the following steps:

[0008] Get casting mold drawing data;

[0009] Remove the interference factors that affect character recognition in the casting mold drawing, screen the character area based on the drawing after removing the interference factors that affect character recognition, and identify and obtain the initial character area image data;

[0010] The constructed casting mold character detection model is trained based on the initial character region image data to obtain a trained casting mold character detection model; when the casting mold character detection model is trained, the data distribution and data synthesis of the training data set are adjusted according to the actual measurement scene.

[0011] Based on the trained casting mold character detection model, the drawing to be detected is detected to obtain a character area image, and the image features of the character area are extracted;

[0012] The character recognition result is obtained by combining the image features of the character area and the trained character recognition model.

[0013] Furthermore, the removing of interference factors affecting character recognition includes removing table borders, drawing descriptions and other redundant information through opening and closing operations in image morphological operations.

[0014] Furthermore, the step of screening the character area based on the drawing after removing the interference factors affecting the character recognition and identifying and obtaining the initial character area image data includes:

[0015] Extract edge points in the image based on the drawing after removing interference factors that affect character recognition;

[0016] Combine the edge points of the image and the Hough transform search circle to screen the required character area and obtain the initial character area image data, including: for each edge point in the image, calculate the parameters of all Hough transform search circles that may pass through the edge point, and add votes to the corresponding points in the parameter space, and find the points with the most votes in the parameter space. The parameters corresponding to these points are the parameters of the circles existing in the image.

[0017] Furthermore, the drawing to be inspected is inspected to obtain a character region image, and image features of the character region are extracted, including:

[0018] A dynamic convolution layer is defined, and the mold character image data is input into the dynamic convolution layer. In the dynamic convolution layer, the convolution kernel parameters are dynamically adjusted according to the mold character image data information, and a convolution operation is performed based on the adjusted convolution kernel parameters to obtain a first feature map;

[0019] The first feature map is subjected to a convolution operation to obtain the inherent feature map of the first feature map, and the additional features of the first feature map are extracted through the GhostConvolution module. The inherent feature map and the additional features are concatenated to obtain the second feature map, and the second feature map is subjected to a convolution operation to extract the inherent feature map of the second feature map. The channel attention features are extracted through the Squeeze-and-Excitation module, and the inherent feature map of the second feature map and the channel attention features are concatenated to obtain the third feature map. The third feature map is subjected to the PFHead structure to extract the image features of the character area.

[0020] Furthermore, when the character recognition model is trained, a quantization method is used to fine-tune the character detection model to obtain an adjusted character detection model. Furthermore, the training data set is adjusted according to the actual measured scene by adjusting the data distribution and data synthesis of the training data set, specifically including:

[0021] Determine the number, length, and attribute characteristics of the text in each measured scene, and adjust the data distribution of the training data set according to the number, length, and attribute characteristics of the text in the measured scene;

[0022] Get the preset specific character data, add it to the original data set, set the ratio of the original data to the newly added data, and then synthesize the data set.

[0023] Furthermore, the character recognition model adopts the PP-OCRv4 recognition model.

[0024] A second aspect of the present invention provides a casting mold character recognition system considering an industrial environment, comprising:

[0025] A data acquisition module, which is used to acquire casting mold drawing data;

[0026] A character region extraction module is used to remove interference factors that affect character recognition in the casting mold drawing, screen the character region based on the drawing after removing the interference factors that affect character recognition, and identify and obtain initial character region image data;

[0027] A character detection module is used to train the constructed casting mold character detection model based on the initial character area image data to obtain a trained casting mold character detection model; when the casting mold character detection model is trained, the data distribution and data synthesis of the training data set are adjusted according to the actual measurement scene.

[0028] A character recognition module, which is used to detect the drawing to be detected based on the trained casting mold character detection model to obtain a character area image and extract image features of the character area;

[0029] The character recognition result is obtained by combining the image features of the character area and the trained character recognition model.

[0030] A third aspect of the present invention provides a computer-readable storage medium.

[0031] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in the casting mold character recognition method considering the industrial environment as described above.

[0032] A fourth aspect of the present invention provides a computer device.

[0033] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the casting mold character recognition method considering the industrial environment as described above are implemented.

[0034] Compared with the prior art, the present invention has the following beneficial effects:

[0035] 1. The present invention takes into account the characteristics of casting mold characters in different scenarios, adjusts the data distribution and data synthesis of the training data set according to the measured scenarios, and trains the casting mold character detection model based on the reconstructed data set to obtain accurate recognition results.

[0036] 2. The improved PP-OCRv4 network for character recognition of the present invention is an improvement on the text detection module, which is an improvement on the deep separable convolution of the backbone network LCNetV3 and the introduction of an enhanced attention mechanism; the improvement on the deep separable convolution is to replace the fixed convolution kernel with a dynamic convolution, so that the convolution operation can dynamically adjust the weight according to the input, thereby improving the expressive power of the model; the Squeeze-and-Excitation module is introduced to improve the channel attention capability, and a lighter efficient channel attention module (Efficient Channel Attention) is used to improve the feature selection capability.

[0037] 3. When the current deep learning model is deployed on the mobile terminal, a large amount of labeled data and computing resources are required. After deployment on the mobile terminal, it cannot respond quickly, which is not conducive to improving production efficiency. The present invention uses the model quantization method to fine-tune the model to improve the recognition efficiency. Without losing the accuracy of the model, the model parameters of FP32 precision are converted to Int8 precision, the size of the model parameters is reduced and the calculation is accelerated. The quantized model has a speed advantage when deployed.

[0038] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0040] Figure 1 is a flow chart of a casting mold character recognition method considering an industrial environment provided by an embodiment of the present invention;

[0041] Figure 2 is a casting mold character detection flow chart provided by an embodiment of the present invention;

[0042] Figure 3 It is a network structure flow chart of a casting mold character detection model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0043] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0044] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0045] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0046] Embodiment 1

[0047] like Figure 1 As shown, this embodiment provides a casting mold character recognition method considering an industrial environment, comprising the following steps:

[0048] Step 1: Obtain casting mold drawings and build a training data set;

[0049] In this embodiment, the location of the character area is marked on the obtained casting mold drawing, 70% of the labeled image data of the entire data set is taken as the initial training data of the model, and the remaining 20% ​​of the labeled image data is used as verification data, and 10% of the labeled image data is used as test data.

[0050] Step 2: Remove the interference factors that affect character recognition in the casting mold drawing, screen the character area based on the drawing after removing the interference factors that affect character recognition, and identify and obtain the initial character area image data;

[0051] The specific steps include:

[0052] Step 201, removing interference factors that affect character recognition;

[0053] In this embodiment, the characters are more obvious than other information features in the drawing. Through image morphological operations - opening and closing operations, redundant information such as table borders and drawing descriptions are removed. The opening operation is a process of first performing an erosion operation and then performing an expansion operation. Given an input image A and a structural element B, the opening operation can be expressed as ,in represents the corrosion operation, Represents the expansion operation. The closing operation is the process of first performing the expansion operation and then the corrosion operation. The closing operation can be expressed as .

[0054] Step 202, filtering the character area based on the drawing after removing the interference factors affecting the character recognition, and identifying and obtaining the mold character image data;

[0055] Specifically include:

[0056] Step 2021: First, use an edge detection algorithm (such as the Canny algorithm) to extract edge points in the image. These edge points are usually pixel points with large brightness changes in the image, corresponding to the edges of the object.

[0057] Step 2022: Combine the image edge points and the Hough transform search circle to filter the required character area and obtain the character information;

[0058] The relationship between the image edge points and the Hough transform search circle is:

[0059] (x) 2 +(yb) 2 =r 2 ,

[0060] Among them, (a, b) is the coordinate of the center of the circle, r is the radius of the circle, x, y are pixel points, and in the Hough transform, the circle in this two-dimensional image space is converted to the three-dimensional parameter space (a, b, r).

[0061] For each edge point in the image, calculate the parameters of all possible circles passing through the point, and add votes to the corresponding points in the parameter space; in this way, if a circle does exist in the image, its parameters will receive more votes in the parameter space, forming a peak. Find the points with the most votes in the parameter space, and the parameters corresponding to these points are the parameters of the circles in the image. Through peak detection, the position and radius of the circle in the image can be determined.

[0062] By using the above method, the characters in the drawing are extracted to the white background to obtain a drawing with only character information.

[0063] Step 3: training the constructed casting mold character detection model based on the initial character area image data to obtain a trained casting mold character detection model;

[0064] like Figure 2 The figure shows the structural flow chart of the casting mold character detection model. Specifically, the casting mold character detection model uses LCNetV3 as a more accurate backbone network, uses a parallel head branch fusion structure to process different head branches in parallel, and fuses the results. The shrink ratio is dynamically increased during training to adapt to texts of different sizes. The collaborative mutual learning (CML) strategy is used to add the KL div loss output by the Student and Teacher networks to improve the model performance.

[0065] The specific steps include:

[0066] Step 301: Adjust the training data set by adjusting the data distribution and data synthesis of the training data set according to the actual measurement scenario;

[0067] Among them, adjusting the data distribution of the training data set according to the actual measurement scenario includes:

[0068] Determine the number, length, and attribute characteristics of the text in each measured scene, and adjust the data distribution of the training data set according to the number, length, and attribute characteristics of the text in the measured scene; for example, if the measured scene contains a large number of short texts, it is recommended that the training data also contain more short texts; if the measured scene has high requirements for space recognition, it is recommended that the training data also contain more text content with spaces. By distributing data in a targeted manner for each scene, the detection effect can be further improved.

[0069] Among them, synthesis is carried out according to different actual scene data. There are differences in the shape, background complexity and lighting of mold characters in complex scenes, and there are cases where some characters are recognized incorrectly. Therefore, the preset specific character data is obtained and added to the original data set. After setting the ratio of original data to new data, such as 10:1 to 5:1, the data set is synthesized; avoid overfitting of the model due to too much data from a single scene, and try to balance the word frequency of the corpus to ensure that the frequency of occurrence of commonly used characters is not too low.

[0070] Step 302, preprocessing the mold character image data to obtain preprocessed mold character image data;

[0071] In this embodiment, the mold character image is resized to 640*640, and normalized to [0,1] after normalization preprocessing to meet the input requirements of the neural network;

[0072] Step 303: input the preprocessed mold character image data into the backbone network for feature extraction to obtain initial image features;

[0073] The backbone network uses LCNetv3 to extract features. The LCNetV3 network is a lightweight convolutional neural network that achieves efficient computing performance and low model complexity by optimizing the network structure and parameters. Its network structure usually includes components such as input layer, multiple convolutional layers, activation function layers, pooling layers, and fully connected layers. In LCNetV3, the convolutional layer adopts a lightweight design, which reduces the number of parameters and the amount of calculation while maintaining good feature extraction capabilities.

[0074] In this embodiment, the backbone network is improved by using dynamic convolution instead of fixed convolution kernels, so that the convolution operation can dynamically adjust the weight according to the input, thereby improving the expression ability of the model. The specific method is as follows:

[0075] Step 3031, defining a dynamic convolution layer, inputting the mold character image data into the dynamic convolution layer, in the dynamic convolution layer, dynamically adjusting the convolution kernel parameters according to the mold character image data information, performing a convolution operation based on the adjusted convolution kernel parameters, and obtaining a first feature map;

[0076] In this embodiment, the dynamic convolution layer mentioned is based on the existing convolution layer type torch.nn.Conv2d, creating a new dynamic convolution layer class;

[0077] When dynamically adjusting the convolution kernel parameters according to the mold character image data information, the convolution kernel parameters can be dynamically adjusted according to the input features based on the meta-learning algorithm. During the training process, the optimal parameter adjustment strategy under different tasks or data distributions can be learned, and the generated convolution kernel parameters can be normalized to have a suitable numerical range to avoid problems such as gradient explosion or disappearance.

[0078] The dynamically generated convolution kernel parameters replace the parameters of the traditional fixed convolution kernel, and the convolution operation is performed based on the adjusted convolution kernel parameters.

[0079] Step 3032: extract the first feature map through a convolution operation to obtain an intrinsic feature map of the first feature map, extract additional features of the first feature map through a Ghost Convolution module, concatenate the intrinsic feature map and the additional features to obtain a second feature map, extract the second feature map through a convolution operation to obtain an intrinsic feature map of the second feature map, extract channel attention features through a Squeeze-and-Excitation module, and concatenate the intrinsic feature map of the second feature map and the channel attention features to obtain a third feature map;

[0080] In this embodiment, Ghost convolution is used to further reduce the number of parameters and calculations by generating "redundant" feature maps; the Squeeze-and-Excitation module is introduced to improve the channel attention ability, and a lighter efficient channel attention module (Efficient Channel Attention) is used to improve the feature selection ability and output the feature map; the network structure is as follows Figure 3 As shown:

[0081] Among them, Ghost Convolution module: The input feature map is subjected to conventional convolution operations to obtain a part of the inherent feature maps. These inherent feature maps generate more ghost feature maps through a series of linear operations. These operations maintain the inherent feature maps while increasing the number and diversity of feature maps. Finally, the feature map obtained by conventional convolution and the feature map generated by Ghost are spliced ​​to obtain the final feature map output

[0082] Squeeze-and-Excitation module: Aggregate spatial information through global average pooling, compress the information of each channel into one value to form a channel descriptor. Use two fully connected layers to perform nonlinear transformation on the channel descriptor, and use the Sigmoid activation function to achieve feature recalibration, strengthen important feature maps, and weaken unimportant feature maps. Apply the obtained channel weights to the original feature map to achieve channel reweighting of the feature map.

[0083] Efficient Channel Attention module: After using one-dimensional convolution to aggregate features, the kernel size k is adaptively determined, one-dimensional convolution is performed, and then the channel attention is learned through the Sigmoid function. The channel attention weights obtained through learning are used to weight each channel of the feature map, thereby improving the feature selection capability.

[0084] Step 303: The extracted third feature map is passed through the PFHead structure to extract the image features of the character area;

[0085] The PFHead structure adopts a parallel head branch fusion structure. After the first transposed convolution, upsampling and transposed convolution are performed respectively. Then the upsampled output is convolved through 3x3 convolution to obtain the output result, which is cascaded with the result of the transposed convolution branch and passed through a 1x1 convolution layer. Finally, the result of the 1x1 convolution is added to the result of the transposed convolution to obtain the final output probability map; the probability map will be post-processed by NMS (non-maximum suppression) to obtain the final text detection box.

[0086] Step 4: Combine the image features of the character area and the trained character recognition model to obtain the character recognition result; the character recognition model in this embodiment adopts the PP-OCRv4 recognition model, which is further upgraded on the basis of PP-OCRv3. Through the Multi-Scale dynamic scale training strategy, the robustness of the recognition model when used in end-to-end series is enhanced. Use the backbone network PP-LCNetV3 with better accuracy, extract image features using the Neck structure Lite-Neck with streamlined parameters, use the GTC-NRTR strategy to guide the CTC training strategy through Attention, integrate the expression of multiple text features, and effectively improve text recognition accuracy. Use the DKD distillation strategy to supervise the training of the model, use the input of the PP-OCRv4 recognition model as the image features of the character area, and convert the output encoding into a readable character sequence;

[0087] The character recognition model is trained using a multi-scale training strategy. During the training process, the height of the input image is randomly resized to enhance the robustness of the recognition model when used in end-to-end series. During training, each iter randomly selects one of the three heights (32, 48, 64) for resizing.

[0088] Improve the training parameters of the text recognition model. Set the training epoch_num to 100, the evaluation interval to evaluate every 100 steps, eval_batch_step: [0, 100], change the learning rate decay strategy to Cosine, name: Cosine, change the fine-tune learning rate to learning_rate: 0.0001, and change the number of warmup rounds, warmup_epoch: 2.

[0089] Among them, the Cosine learning rate attenuation strategy formula is as follows:

[0090]

[0091] i is the number of runs; and Respectively represent the maximum and minimum values ​​of the learning rate, defining the range of the learning rate; T curIndicates how many epochs are currently executed; T i Indicates the number of epochs in the i-th run.

[0092] In this embodiment, when training the character recognition model, the weight quantization and activation quantization methods are used to fine-tune the character detection model to obtain an adjusted character detection model; specifically, the following steps are included:

[0093] Among them, weight quantization is to quantize the recognition model weight from FP32 to Int8, calculate the scale factor and zero point of each weight tensor, and convert the weight from FP32 to Int8.

[0094] Activation quantization is to quantize the activation value (model output) from FP32 to Int8, and perform activation quantization during inference; for the output (activation) of each layer, the appropriate scaling factor and zero point are determined through dynamic quantization or static quantization.

[0095] Adjust the quantization model. The present invention uses quantization-aware training (QAT) to further optimize the quantization model. By simulating the quantization process during training and adjusting the model weights, the performance of the quantized model is closer to the original FP32 model.

[0096] Use onxx to convert to Int8 precision model.

[0097] The deep learning technology is applied to the detection and recognition of mold characters, aiming to solve the problem of character detection and recognition by using the robustness, efficiency and accuracy of deep learning. The latest OCR algorithm is mainly used to detect the mold character area. Compared with the current traditional image processing, the present invention has higher robustness to the problem of non-prominent targets and complex background noise interference, and at the same time, it has higher performance in real time and is more suitable for the actual industrial production process. While maintaining a high detection accuracy, it can also quickly detect and identify the character area of ​​each mold image to be detected. At the same time, the recognition network is connected to the detection network, and the characters can be quickly identified after being detected.

[0098] Step 5: Integrate the model character recognition algorithm into the mobile app. The specific steps are as follows:

[0099] Step 501: The front-end and back-end of the applet are developed in JAVA language. In order to enable Java to call C++, the present invention uses JNI (Java Native Interface) to interact with C++. The specific process is as follows:

[0100] Step 5011: Declare native methods in Java code. Java uses the native keyword to mark these methods, indicating that these methods will be implemented in C++.

[0101] Step 5012: After declaring the native method in Java, a header file needs to be generated, which will contain the declaration of the native method for use by the C++ code. The generation of the JNI header file can be completed by the javac tool provided by JDK.

[0102] Step 5013: Implement the native method declared in Java in C++. The C++ code needs to include the header file generated by javac -h and implement the corresponding native method.

[0103] Step 5014: Compile the C++ code into a local shared library, and the Java code will call the C++ method through this library. The generated local library will generate different file formats according to different operating systems. The present invention uses g++ to compile the .dll library on Windows.

[0104] Step 5015: Ensure that the Java program can find the compiled native library. When running the Java program, use the -Djava.library.path parameter to specify the directory containing the shared library (.dll).

[0105] Step 502: Design an adaptation layer in the mini program, and implement functions such as image data input, preprocessing, character recognition reasoning, and result output by providing an interface to call the quantized model. Ensure that in the mini program, users can take a photo or select an image from the gallery, and process the image by calling the quantized character recognition model.

[0106] Step 503: The mold character recognition applet compares the characters in the recognized drawing with the characters of the photographed mold object and displays the results visually. The specific steps are as follows:

[0107] Visual display: visualize the character recognition results and comparison results, and display them on the front end of the mini program through a graphical interface. Specific forms of display include:

[0108] By marking the recognized character areas in drawings and physical character images, users can clearly see which characters are recognized correctly and which characters are recognized incorrectly.

[0109] Displays the comparison results, such as the percentage of character matches or similarity scores. If the recognition results are inconsistent, provides error prompts and correction suggestions.

[0110] Provides corresponding feedback information, such as recognition success, recognition failure or recognition accuracy evaluation, and supports users to manually correct recognition results.

[0111] User interaction and optimization: When using the mini program, users can choose to input drawings or physical character images in different ways, such as directly taking pictures or uploading pictures. Based on user feedback, the character recognition model is continuously optimized to improve its performance and stability in actual applications.

[0112] Embodiment 2

[0113] This embodiment provides a casting mold character recognition system considering industrial environment, including:

[0114] A data acquisition module, which is used to acquire casting mold drawing data;

[0115] A character region extraction module is used to remove interference factors that affect character recognition in the casting mold drawing, screen the character region based on the drawing after removing the interference factors that affect character recognition, and identify and obtain initial character region image data;

[0116] A character detection module is used to train the constructed casting mold character detection model based on the initial character area image data to obtain a trained casting mold character detection model; when the casting mold character detection model is trained, the data distribution and data synthesis of the training data set are adjusted according to the actual measurement scene.

[0117] A character recognition module, which is used to detect the drawing to be detected based on the trained casting mold character detection model to obtain a character area image and extract image features of the character area;

[0118] The character recognition result is obtained by combining the image features of the character area and the trained character recognition model.

[0119] Embodiment 3

[0120] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the casting mold character recognition method considering the industrial environment as described above are implemented.

[0121] Embodiment 4

[0122] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the casting mold character recognition method considering the industrial environment as described above are implemented.

[0123] Embodiment 5

[0124] This embodiment provides a program product, which is a computer program product, including a computer program. When the computer program is executed by a processor, the steps in the casting mold character recognition method considering the industrial environment as described above are implemented.

[0125] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0126] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0127] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0129] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0130] 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. A casting mold character recognition method considering an industrial environment, characterized in that: The steps include: Get casting mold drawing data; Remove the interference factors that affect character recognition in the casting mold drawing, screen the character area based on the drawing after removing the interference factors that affect character recognition, and identify and obtain the initial character area image data; The constructed casting mold character detection model is trained based on the initial character region image data to obtain a trained casting mold character detection model; when the casting mold character detection model is trained, the data distribution and data synthesis of the training data set are adjusted according to the actual measurement scene. Based on the trained casting mold character detection model, the drawing to be detected is detected to obtain a character area image, and the image features of the character area are extracted; The character recognition result is obtained by combining the image features of the character area and the trained character recognition model.

2. The casting mold character recognition method considering industrial environment as claimed in claim 1, characterized in that: The removing of interference factors affecting character recognition includes removing table borders, drawing descriptions and other redundant information through opening and closing operations in image morphological operations.

3. The casting mold character recognition method considering industrial environment as claimed in claim 1, characterized in that: The method of screening the character area based on the drawing after removing the interference factors affecting the character recognition, and identifying and obtaining the initial character area image data, comprises: Extract edge points in the image based on the drawing after removing interference factors that affect character recognition; Combine the edge points of the image and the Hough transform search circle to screen the required character area and obtain the initial character area image data, including: for each edge point in the image, calculate the parameters of all Hough transform search circles that may pass through the edge point, and add votes to the corresponding points in the parameter space, and find the points with the most votes in the parameter space. The parameters corresponding to these points are the parameters of the circles existing in the image.

4. The casting mold character recognition method considering industrial environment as claimed in claim 1, characterized in that: The drawing to be inspected is inspected to obtain the character area image, and the image features of the character area are extracted, including: A dynamic convolution layer is defined, and the mold character image data is input into the dynamic convolution layer. In the dynamic convolution layer, the convolution kernel parameters are dynamically adjusted according to the mold character image data information, and a convolution operation is performed based on the adjusted convolution kernel parameters to obtain a first feature map; The first feature map is subjected to a convolution operation to obtain the inherent feature map of the first feature map, and the additional features of the first feature map are extracted through the GhostConvolution module. The inherent feature map and the additional features are concatenated to obtain the second feature map, and the second feature map is subjected to a convolution operation to extract the inherent feature map of the second feature map. The channel attention features are extracted through the Squeeze-and-Excitation module, and the inherent feature map of the second feature map and the channel attention features are concatenated to obtain the third feature map. The third feature map is subjected to the PFHead structure to extract the image features of the character area.

5. The casting mold character recognition method considering industrial environment as claimed in claim 1, characterized in that: When training the character recognition model, a quantization method is used to fine-tune the character detection model to obtain an adjusted character detection model.

6. The casting mold character recognition method considering industrial environment as claimed in claim 1, characterized in that: The adjusting of the data distribution and data synthesis of the training data set according to the actual measured scenario specifically includes: Determine the number, length, and attribute characteristics of the text in each measured scene, and adjust the data distribution of the training data set according to the number, length, and attribute characteristics of the text in the measured scene; Get the preset specific character data, add it to the original data set, set the ratio of the original data to the newly added data, and then synthesize the data set.

7. The casting mold character recognition method considering industrial environment as claimed in claim 1, characterized in that: The character recognition model adopts the PP-OCRv4 recognition model.

8. Casting mold character recognition system considering industrial environment, characterized in that: include: A data acquisition module, which is used to acquire casting mold drawing data; A character region extraction module is used to remove interference factors that affect character recognition in the casting mold drawing, screen the character region based on the drawing after removing the interference factors that affect character recognition, and identify and obtain initial character region image data; A character detection module is used to train the constructed casting mold character detection model based on the initial character area image data to obtain a trained casting mold character detection model; when the casting mold character detection model is trained, the data distribution and data synthesis of the training data set are adjusted according to the actual measurement scene. A character recognition module, which is used to detect the drawing to be detected based on the trained casting mold character detection model to obtain a character area image and extract image features of the character area; The character recognition result is obtained by combining the image features of the character area and the trained character recognition model.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the casting mold character recognition method considering the industrial environment as described in any one of claims 1 to 7 are implemented.

10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the casting mold character recognition method considering the industrial environment as described in any one of claims 1 to 7 are implemented.