Character recognition method, related device and storage medium

By obtaining and utilizing corner data in the target image for text recognition, the problem of poor recognition of text with large deformations by traditional methods is solved, and the accuracy and reliability of recognition are improved.

CN117292384BActive Publication Date: 2024-10-29BEIJING REALAI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311110188.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2024-10-29
Estimated Expiration
2043-08-30

AI Technical Summary

Technical Problem

Traditional text recognition methods have poor recognition results for artistic characters and handwritten characters with large deformations, and it is difficult to accurately capture their shapes, resulting in high error rates.

Method used

By obtaining the corner data in the target image, the neural network model is used to extract image features, and recognition is performed based on the corner data. The corner information of the text is referenced to locate the deformation of the text, thereby improving the recognition effect.

Benefits of technology

It improves the accuracy and reliability of recognition of characters with large deformations, overcomes the limitations of traditional methods, and enhances the ability to recognize characters such as artistic characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117292384B_ABST
    Figure CN117292384B_ABST
Patent Text Reader

Abstract

The embodiment of the present application relates to the field of OCR technology, and provides a text recognition method, a related device, and a storage medium. The text recognition method includes: obtaining a target image; based on the target image, determining the corner point data corresponding to the text contained in the target image, the corner point data is used to characterize the positions of multiple corner points; based on the corner point data, recognizing the text contained in the target image to obtain a recognition result. The embodiment of the present application can refer to the corner point information of the text to determine the invariant features of the text contained in the target image when performing text recognition, so as to locate the deformation of the text using the corner point data, guide the text recognition process, and improve the recognition effect of text with larger deformation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of text recognition, and more specifically to a text recognition method, related devices and storage media. Background Art

[0002] Artistic words play an important role in advertising, design, typesetting and other fields. They attract people's attention with their unique style and form, adding artistry and individuality to the works.

[0003] However, artistic characters have characteristics such as deformation and distortion, which leads to poor recognition effect of traditional character recognition methods on characters with large deformation. Summary of the invention

[0004] The embodiments of the present application provide a text recognition method, related devices and storage media, which can recognize text contained in a target image to obtain a recognition result, and can use corner point data to recognize the deformation of text, thereby improving the recognition effect of text with larger deformation.

[0005] In a first aspect, an embodiment of the present application provides a text recognition method, which includes: acquiring a target image, and based on the target image, determining corner point data corresponding to the text contained in the target image, wherein the corner point data is used to characterize the positions of multiple corner points; based on the corner point data, recognizing the text contained in the target image to obtain a recognition result.

[0006] In one embodiment, based on the corner point data, the text contained in the target image is recognized to obtain a recognition result, including: using the corner point data and the weight of each corner point to extract the image features of the target image; based on the image features of the target image, the text contained in the target image is recognized to obtain a recognition result.

[0007] In one embodiment, the target image contains overlapping text, and based on the target image, the corner point data corresponding to the text contained in the target image is determined, including: processing the target image based on an image segmentation model to obtain an image area corresponding to each text; identifying the corner points in the image area corresponding to each text to obtain the corner point data corresponding to the text contained in the target image.

[0008] In one embodiment, the target image is processed based on an image segmentation model to obtain an image region corresponding to each character, including: inputting a text description corresponding to the target image and the target image into the image segmentation model to obtain an image region corresponding to each character.

[0009] In one embodiment, based on the corner point data, the text contained in the target image is recognized to obtain a recognition result, including: inputting the corner point data, the target image, the text description corresponding to the target image and the image area corresponding to each text into a text recognition model to obtain a recognition result.

[0010] In one embodiment, the extraction of image features of the target image using the corner point data and the weight of each corner point is implemented based on a neural network model.

[0011] In one embodiment, the neural network model is obtained according to the following method: obtaining a sample image set corresponding to at least one sample character, and corner point data corresponding to the sample character contained in each sample image in the sample image set, wherein the sample image set includes at least one sample image corresponding to at least one sample character; based on the sample image set corresponding to at least one sample character, and corner point data corresponding to the sample character contained in each sample image in the sample image set, training an initial neural network model to obtain a neural network model.

[0012] In one embodiment, the sample images corresponding to each sample character include positive sample images and negative sample images. Based on a sample image set corresponding to at least one sample character and corner point data corresponding to the sample character contained in each sample image in the sample image set, an initial neural network model is trained to obtain a neural network model, including: for each sample character, based on the sample image set and the corner point data corresponding to the sample character, extracting image invariant features corresponding to the positive sample image of the sample character and image variation features corresponding to the negative sample image of the sample character; determining a character loss value of the sample character based on the image invariant features and the image variation features; if the character loss value does not meet a preset convergence condition, adjusting a weight parameter of the initial neural network model based on the character loss value; iteratively training the adjusted initial neural network model based on the sample character until the obtained character loss value meets the preset convergence condition, thereby obtaining a neural network model.

[0013] In a second aspect, an embodiment of the present application provides a text recognition device having a function of implementing the text recognition method provided in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, and the modules can be software and / or hardware.

[0014] In one embodiment, a text recognition device includes: an acquisition module configured to acquire a target image; a corner point recognition module configured to determine, based on the target image, corner point data corresponding to text contained in the target image, wherein the corner point data is used to characterize the positions of multiple corner points; and a text recognition module configured to recognize text contained in the target image based on the corner point data to obtain a recognition result.

[0015] In a third aspect, an embodiment of the present application provides a computing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method mentioned in the first aspect when executing the computer program.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes instructions, which, when executed on a computer, enables the computer to execute the method as mentioned in the first aspect.

[0017] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect.

[0018] In a sixth aspect, an embodiment of the present application provides a chip, which includes a processor coupled to a transceiver of a terminal device, and is used to execute the technical solution mentioned in the first aspect of the embodiment of the present application.

[0019] In the seventh aspect, an embodiment of the present application provides a chip system, which includes a processor for supporting a terminal device to implement the functions involved in the above-mentioned first aspect, for example, generating or processing the information involved in the method provided in the above-mentioned first aspect.

[0020] In a possible design, the chip system further includes a memory, which is used to store program instructions and data required by the terminal. The chip system can be composed of a chip, or can include a chip and other discrete devices.

[0021] Compared with the traditional text recognition method, the text recognition method provided by the embodiment of the present application first determines the corner point data corresponding to the text contained in the target image, and then recognizes the text contained in the target image based on the corner point data to obtain the recognition result, instead of the traditional text recognition method that only recognizes the text based on the target image. Therefore, the text recognition method provided by the embodiment of the present application can refer to the corner point information of the text to determine the invariant features of the text contained in the target image when performing text recognition, so as to locate the deformation of the text using the corner point data, guide the text recognition process, and improve the recognition effect of text with large deformation. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] By reading the detailed description of the embodiments of the present application with reference to the accompanying drawings, the objects, features and advantages of the embodiments of the present application will become easily understood.

[0023] Figure 1 A schematic diagram of a text recognition system of the text recognition method in an embodiment of the present application.

[0024] Figure 2A flowchart of a text recognition method according to an embodiment of the present application is shown.

[0025] Figure 3 A target image is provided for application embodiment.

[0026] Figure 4 A corner point image provided for an embodiment of the application.

[0027] Figure 5 A flowchart of a text recognition method provided in another embodiment of the present application.

[0028] Figure 6 A schematic diagram of a feature extraction process provided in another embodiment of the present application.

[0029] Figure 7 A flowchart of a training process of a neural network model provided in one embodiment of the present application.

[0030] Figure 8 A structural schematic diagram of a text recognition device provided in one embodiment of the present application.

[0031] Fig. 9 A schematic diagram of the structure of a training device for a neural network model provided in one embodiment of the present application.

[0032] Fig.10 A schematic diagram of the structure of a computing device according to an embodiment of the present application.

[0033] Fig.11 A schematic diagram of the structure of a mobile phone in an embodiment of the present application.

[0034] Fig.12 A schematic diagram of the structure of a server in an embodiment of the present application.

[0035] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0036] The terms "first", "second", etc. in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects (for example, the first xx and the second xx are respectively expressed as different xx, and the others are similar), and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described here can be implemented in an order other than the content illustrated or described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device including a series of steps or modules is not necessarily limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices. The division of the modules that appear in the embodiments of the present application is only a logical division. There may be other division methods when implemented in practical applications, such as multiple modules can be combined or integrated in another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling between modules, and the communication connection can be electrical or other similar forms, which are not limited in the embodiments of the present application. Furthermore, the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed in multiple circuit modules, and some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment of the present application.

[0037] The embodiment of the present application provides a text recognition method, device and storage medium, which can be applied to a text recognition system in a scenario where text recognition is required. The text recognition system may include a corner point recognition device and a text recognition device. The corner point recognition device and the text recognition device may be deployed in an integrated manner or separately. The corner point recognition device is used to determine the corner point data corresponding to the text contained in the target image based on a target image. The text recognition device is at least used to recognize the text contained in the target image based on the corner point data to obtain a recognition result. Among them, the corner point recognition device can be an application that determines the corner point data corresponding to the text contained in the target image based on the target image, or a server or terminal device installed with an application that determines the corner point data corresponding to the text contained in the target image based on the target image; the text recognition device can be a text recognition program that recognizes the text contained in the target image based on the corner point data and the target image to obtain a recognition result. The text recognition program is, for example, a text recognition model. The text recognition device can also be a terminal device deployed with a text recognition model.

[0038] The solution provided in the embodiments of the present application involves technologies such as artificial intelligence (AI), natural language processing (NLP), and machine learning (ML), which are specifically described by the following embodiments:

[0039] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0040] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0041] Natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.

[0042] Machine Learning (ML) is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0043] In today's digital age, word art plays an important role in advertising, design, typesetting and other fields. Word art attracts people's attention with its unique style and form, adding artistry and individuality to the work. Word art usually has free deformation, distortion and non-linear forms, so that their shapes no longer follow the rules of traditional fonts. The deformation of word art mainly comes from hand-drawing, digital design or the addition of artistic effects. During the printing or typesetting process, the shape of word art may change more due to factors such as distortion of the medium (such as printing equipment), angle tilt or local correction.

[0044] The traditional text recognition method is to directly recognize the text in the image through the Optical Character Recognition (OCR) model. Due to the deformation, distortion and deformation of artistic characters, traditional text recognition technology often finds it difficult to accurately capture the form of artistic characters, resulting in a high error rate in artistic character recognition. In other words, traditional text recognition methods are usually based on regular fonts and regular layouts, which mainly rely on the unified form and arrangement of characters. This method performs well in normal text and standard fonts, but the recognition effect is poor for artistic characters, handwritten characters and other characters with large deformations and large spatial scale spans.

[0045] Compared with traditional text recognition methods, the text recognition method provided in the embodiment of the present application first determines the corner point data corresponding to the text contained in the target image, and then recognizes the text contained in the target image based on the corner point data to obtain a recognition result. Therefore, when performing text recognition, the corner point information of the text can be referred to, and then the corner point data can be used to identify the deformation of the text, thereby improving the recognition effect of text with larger deformation.

[0046] In some embodiments, the corner point recognition device and the text recognition device are deployed separately, referring to Figure 1 The text recognition method provided in the embodiment of the present application can be based on Figure 1 A text recognition system implementation is shown. The text recognition system may include a server 01 and a terminal device 02.

[0047] The server 01 may be a corner point recognition device, in which a corner point recognition program may be deployed.

[0048] The terminal device 02 may be a text recognition device, in which a text recognition program (eg, a neural network model) may be deployed, such as a neural network model trained based on a machine learning method.

[0049] The terminal device 02 may forward the received target image to the server 01. The server 01 may determine the corner point data corresponding to the text contained in the target image based on the target image, and then send it to the terminal device 02. The terminal device 02 may recognize the text contained in the target image based on the corner point data to obtain a recognition result.

[0050] It should be noted that the server involved in the embodiments of the present application can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.

[0051] The terminal device involved in the embodiments of the present application may be a device that provides data connectivity to a user, a handheld device with a wireless connection function, or other processing devices connected to a wireless modem. For example, a computer with a mobile terminal, for example, a portable, pocket-sized, handheld, computer-built-in or vehicle-mounted mobile device, which exchanges data with a wireless access network. For example, a wireless local loop (Wireless Local Loop, English abbreviation: WLL) station, a personal digital assistant (English full name: Personal Digital Assistant, English abbreviation: PDA) and other devices.

[0052] Reference Figure 2 , Figure 2 A flowchart of a text recognition method provided in an embodiment of the present application. The method can be executed by a text recognition device and can be applied to text recognition scenarios where text recognition is required. First, based on a target image, the corner point data corresponding to the text contained in the target image is determined, and then based on the corner point data, the text contained in the target image is recognized to obtain a recognition result. The text recognition method includes steps 101, 102 and 103.

[0053] Step 101, obtaining a target image.

[0054] Step 102: Based on the target image, determine the corner point data corresponding to the text contained in the target image.

[0055] The target image is an image to be recognized that contains text. The text contained in the target image may be text with a large deformation. In some implementations, the text contained in the target image may be artistic text, handwritten text with a large deformation, etc. Figure 3 , Figure 3 A target image is provided for application embodiment. Figure 3 The target image shown contains the text "KERALA".

[0056] Corner point data is used to represent the positions of multiple corner points. The corner point data corresponding to the text contained in the target image can be represented by a set of corner point position data or by a corner point image. Figure 4 , Figure 4 A corner point image is provided for an embodiment of the application. The corner point image contains the corner point data corresponding to the text contained in the target image. The corner point image can be used as a robust representation of the target image, and can retain the features of words with large deformations such as artistic words. The corner point image can be an image of the same size as the target image. In the corner point image, the pixel values ​​at the corner point positions are higher, and the pixel values ​​at the non-corner point positions are lower, so that the morphological features of the artistic words can be better preserved.

[0057] In some implementations, the corner point data corresponding to the text may be the corner point data of the upper left corner, lower left corner, upper right corner, and lower right corner of the text. By capturing the four corner points of the text, the deformation of text such as artistic characters can be accurately identified, thereby overcoming the limitations of traditional methods and improving the accuracy and reliability of text recognition.

[0058] In some implementations, based on the target image, determining the corner point data corresponding to the text contained in the target image can be performed by: using a pre-trained corner point detection model to perform corner point detection on the target image to obtain the corner point data corresponding to the text contained in the target image. The pre-trained corner point detection model can be a Harris corner point detection model or a Scale Invariant Feature Transform (SIFT) feature point detection model.

[0059] In some implementations, the target image may be preprocessed first, and then based on the preprocessed target image, the corner point data corresponding to the text contained in the target image may be determined. The preprocessing may be image denoising, image resizing, and image enhancement, etc., to improve the accuracy and robustness of subsequent processing.

[0060] Step 103: Recognize the text contained in the target image based on the corner point data to obtain a recognition result.

[0061] Based on the corner point data, the text contained in the target image is recognized to obtain the recognition result. The recognition result can be obtained by using a pre-trained text recognition model and based on the corner point data, the text contained in the target image is recognized to obtain the recognition result.

[0062] The recognition result may be the text contained in the target image. For example, Figure 3 The recognition result of the target image shown may be "KERALA".

[0063] The text recognition method provided in the embodiment of the present application first obtains the target image, determines the corner point data corresponding to the text contained in the target image, and then recognizes the text contained in the target image based on the corner point data to obtain a recognition result, rather than the traditional text recognition method that only recognizes text based on the target image. Therefore, the text recognition method provided in the embodiment of the present application can refer to the corner point information of the text to determine the invariant features of the text contained in the target image when performing text recognition, thereby using the corner point data to locate the deformation of the text, guide the text recognition process, and improve the recognition effect of text with larger deformation.

[0064] Reference Figure 5 , Figure 5 A flowchart of a text recognition method provided by another embodiment of the present application. Figure 2 Based on the embodiment shown, Figure 5 The embodiment shown is described below in detail. Figure 5 The embodiment shown and Figure 2 The differences between the embodiments shown are shown, and the similarities are not repeated. Figure 5 As shown, step 103 includes steps 501 and 502 .

[0065] Step 501: extract image features of the target image using corner point data and the weight of each corner point.

[0066] The image features of the target image are extracted using the corner point data and the weights of each corner point. This can be performed as follows: the corner point data and the target image are input into a feature extraction model, and the feature extraction model can extract the image features of the target image based on the corner point data and the weights of each corner point.

[0067] The image feature extraction weight of the image area corresponding to the corner point is greater than the image feature extraction weights of other image areas, so that the feature extraction model can focus on the image area corresponding to the corner point of the text.

[0068] In some embodiments, the feature extraction model is a contrastive learning model, and the loss function used to train the feature extraction model includes a character contrast loss function. The character contrast loss function is used to determine the character loss value for each sample character based on the image invariant features corresponding to the positive sample image of the sample character and the image change features corresponding to the negative sample image of the sample character. The image invariant features corresponding to the positive sample image can be the invariant features between the positive sample images. The image change features corresponding to the negative sample image can be the change features between the negative sample images. The character loss value can be the difference between the image invariant features corresponding to the positive sample image and the image change features corresponding to the negative sample image.

[0069] The character contrast loss function maps different instances of the same character to adjacent feature spaces, so that the features are tightly clustered in the feature space, increasing the distance between character classes and reducing the distance within the same character class of different forms of the same character, thereby enhancing the ability to distinguish characters. Therefore, the feature extraction model trained using the character contrast loss function has a strong ability to distinguish characters and can well recognize characters with large deformations.

[0070] Step 502: Based on the image features of the target image, the text contained in the target image is recognized to obtain a recognition result.

[0071] Based on the image features of the target image, the text contained in the target image is recognized to obtain the recognition result. This can be performed by: using OCR to recognize the text contained in the target image to obtain the recognition result. It can also be performed by using a pre-trained text recognition model to recognize the text contained in the target image to obtain the recognition result.

[0072] By using the feature extraction model to process the corner point data and the target image, the image features of the target image are obtained, and then based on the image features of the target image, the text contained in the target image is recognized to obtain the recognition result. This allows the feature extraction model to focus on the image area corresponding to the corner points of the text, thereby extracting more image features at the corner point positions, and then providing corner point references for subsequent text recognition, thereby improving the accuracy of text recognition. In addition, the corner point data can play a good guiding role in the edges of the text, greatly improving the feature extraction model's ability to understand the convex parts of artistic characters, etc. The image features extracted by the model can better represent the characteristics of the entire artistic character.

[0073] In addition, the traditional method of directly using network models to recognize text is good at characterizing target features with clear edges, but lacks guidance for learning target images with large text deformation. Artistic characters have diverse forms and styles, and traditional network models are easily overfitted to specific art samples, and have poor generalization capabilities for new samples. The feature extraction model of this application is based on corner point data and target images for feature extraction, and can refer to corner point data for feature extraction. It does not rely on specific art samples and has strong generalization capabilities.

[0074] Reference Figure 6 , Figure 6 A schematic diagram of a feature extraction process provided by another embodiment of the present application. Figure 5 Based on the embodiment shown, Figure 6 The embodiment shown is described below in detail. Figure 6 The embodiment shown and Figure 5 The differences and similarities of the illustrated embodiments are not described in detail.

[0075] In some embodiments, the target image contains overlapping text. Figure 6 As shown, based on the target image, the corner point data corresponding to the text contained in the target image is determined. The target image can be first processed based on an image segmentation model to obtain the image area corresponding to each text, and then the corner points in the image area corresponding to each text are identified to obtain the corner point data corresponding to the text contained in the target image.

[0076] The image segmentation model can be a base model dedicated to image segmentation (SegmentAnything Model, SAM). SAM is a prompt-based model that has been trained on more than 1 billion masks on 11 million images, achieving strong zero-shot generalization. SAM is able to automatically identify and generate masks for all objects present in the target image. After pre-computing the image embedding, SAM can immediately provide segmentation masks for any prompt, enabling real-time interaction with the model.

[0077] First, the image segmentation model is used to obtain the image area corresponding to the text, and then the corner point recognition is performed on the image area corresponding to the text. This can narrow the scope of corner point recognition, improve the accuracy of corner point recognition, and provide an accurate data basis for subsequent text recognition.

[0078] In some embodiments, the target image is processed based on an image segmentation model to obtain an image region corresponding to each character. This may be by inputting a text description corresponding to the target image and the target image into the image segmentation model to obtain an image region corresponding to the character.

[0079] The text description can be used to describe the style of the text in the target image, the content of the target image, etc., and can be used as a hint for the image segmentation model. Figure 3 For the target image shown, the text description can be: the words in the image are all letters.

[0080] By adding text description to the image segmentation model, the image segmentation model can refer to the style of the text in the target image, the content involved, and other information when performing image segmentation, thereby improving the accuracy of image segmentation.

[0081] In some embodiments, based on the corner point data, the text contained in the target image is recognized to obtain a recognition result. The corner point data, the target image, the text description corresponding to the target image and the image area corresponding to the text are input into a text recognition model to obtain a recognition result.

[0082] The text recognition model may be a multimodal recognition model, and specifically, may be a pre-trained network model obtained by performing multimodal recognition training on a network model.

[0083] By integrating multimodal data (for example, corner point data, target image, text description corresponding to the target image, and image area corresponding to the text) into a text recognition model, the text recognition model can recognize the information of the text in the target image from multiple aspects, thereby improving the recognition accuracy.

[0084] In some embodiments, the feature extraction model includes a corner query module and a cross-attention mechanism module. The corner query module and the cross-attention mechanism module can both be convolutional neural network modules.

[0085] The feature extraction model is used to process the corner point data and the target image to obtain the image features of the target image, including: based on the corner point data, using the corner point query module to determine the corner point position features; based on the corner point position features and the target image, using the cross attention mechanism module to determine the image features of the target image.

[0086] Specifically, the corner point data is first input into the corner point query module, and the corner point query module can output the corner point position features. Then the corner point position features and the target image are input into the cross-attention mechanism module, and the cross-attention mechanism module can output the image features of the target image.

[0087] The corner query module is used to extract the feature representation of corner points (i.e., corner position features) from the corner point data, and the cross-attention mechanism module is used to calculate the attention weight between the text image and the feature representation of the corner points to obtain a more accurate attention distribution.

[0088] In some embodiments, the extraction of image features of the target image using the corner point data and the weights of each corner point is implemented based on a neural network model, which may be a deep learning network model.

[0089] Reference Figure 7 , Figure 7 A flowchart of a training process of a neural network model provided in one embodiment of the present application. The method can be executed by a training device for a neural network model, and a neural network model is obtained through model training. The neural network model is obtained according to the following method.

[0090] like Figure 7 As shown, first, a sample image set corresponding to at least one sample character and corner point data corresponding to the sample character contained in each sample image in the sample image set are obtained. The sample image set includes at least one sample image corresponding to each of the at least one sample characters. Then, based on the sample image set corresponding to at least one sample character and corner point data corresponding to the sample character contained in each sample image in the sample image set, an initial neural network model is trained to obtain a neural network model.

[0091] The sample image set includes at least one sample image corresponding to each of the at least one sample characters. For example, the sample image can be Figure 3 The sample image may be an image obtained by performing enhancement operations such as rotation, distortion, and translation on the sample character. The at least one sample image corresponding to at least one sample character may be at least one sample image of the same sample character in different fonts and different forms.

[0092] In some embodiments, the sample images corresponding to each sample character include a positive sample image and a negative sample image. The positive sample image is at least one sample image corresponding to a sample character, that is, an image obtained by performing enhancement operations such as rotation, distortion, and translation on a sample character. The negative sample image may be at least one sample image corresponding to a sample character different from the sample character. Exemplarily, the positive sample image is an image obtained by performing enhancement operations such as rotation, distortion, and translation on the sample character "A", and the negative sample image may be an image obtained by performing enhancement operations such as rotation, distortion, and translation on the sample character "B".

[0093] The corner point data corresponding to the sample characters contained in each sample image in the sample image set can be obtained by the following method: using a pre-trained corner point detection model to perform corner point detection on the sample image to obtain the corner point data corresponding to the sample characters contained in the sample image. The pre-trained corner point detection model can be a Harris corner point detection model or a Scale Invariant Feature Transform (SIFT) feature point detection model.

[0094] Based on a sample image set corresponding to at least one sample character and corner point data corresponding to the sample character contained in each sample image in the sample image set, an initial neural network model is trained to obtain a neural network model, which can be achieved by the following steps.

[0095] like Figure 7 As shown, first, for each sample character, based on the sample image set and corner point data corresponding to the sample character, the image invariant features corresponding to the positive sample image of the sample character and the image change features corresponding to the negative sample image of the sample character are extracted. Then, based on the image invariant features and the image change features, the character loss value of the sample character is determined. Then, it is judged whether the character loss value meets the preset convergence condition. If the character loss value does not meet the preset convergence condition, the weight parameters of the initial neural network model are adjusted based on the character loss value; and the adjusted initial neural network model is iteratively trained based on the sample character until the obtained character loss value meets the preset convergence condition, thereby obtaining the neural network model.

[0096] In some embodiments, the character loss value of the sample character is determined based on the image invariant features and the image variation features, and is determined using a loss function. The loss function includes a character contrast loss function, and the character contrast loss function is used to determine the character loss value for each sample character based on the image invariant features corresponding to the positive sample image of the sample character and the image variation features corresponding to the negative sample image of the sample character.

[0097] Exemplarily, based on a sample image set corresponding to at least one sample character and corner point data corresponding to the sample character contained in each sample image in the sample image set, an initial neural network model is trained to obtain a neural network model which can be executed as follows: determining at least one group of positive sample images and negative sample images; determining corner point data corresponding to the sample characters contained in at least one group of positive sample images and negative sample images based on at least one group of positive sample images and negative sample images; performing at least one round of training on the neural network model based on at least one group of positive sample images and negative sample images and corner point data corresponding to the sample characters contained in at least one group of positive sample images and negative sample images, and determining the trained neural network model as the neural network model. The neural network model can be a feature extraction model for extracting features from a target image. After extracting image features, the image features can be input into a text recognition model to obtain recognition results.

[0098] For each round of at least one round of training, a group of positive sample images and negative sample images are selected from at least one group of positive sample images and negative sample images; the group of positive sample images and negative sample images and the corner point data corresponding to the sample characters contained in the group of positive sample images and negative sample images are input into a neural network model to obtain image invariant features corresponding to the positive sample images and image variation features corresponding to the negative sample images; a character loss value is determined based on the image invariant features corresponding to the positive sample images and the image variation features corresponding to the negative sample images using a character contrast loss function; if the character loss value is less than or equal to a preset threshold, the deep learning model after the round of training is determined as a feature extraction model.

[0099] Exemplarily, the character contrast loss function may be as follows: Formula (1).

[0100] L(a,p,n)=max(0,d(a,p)-d(a,n)+α)(1)

[0101] Among them, d(a,p) represents the image invariant feature corresponding to the positive sample image, d(a,n) represents the image change feature corresponding to the negative sample image, α is the boundary parameter, a represents the corner point position feature, p represents the partial image feature of the positive sample image, and n represents the partial image feature of the negative sample image.

[0102] α can be set according to actual needs to control the distance interval between the image invariant features corresponding to the positive sample image and the image change features corresponding to the negative sample image.

[0103] The character contrast loss function enables the neural network model to learn the invariant features of characters by mapping different instances of the same text into adjacent feature spaces, so that the features are tightly clustered in the feature space, thereby enhancing the ability to distinguish characters with large deformations.

[0104] The above describes a text recognition method and a model training process in an embodiment of the present application. The following introduces a text recognition device (such as a server) that executes the above text recognition method.

[0105] See also Figure 8 , Figure 8 This is a structural diagram of a text recognition device provided in an embodiment of the present application, which can be applied to a server in a scenario where text recognition is required, obtains a target image, and based on the target image, determines the corner point data corresponding to the text contained in the target image; based on the corner point data, recognizes the text contained in the target image to obtain a recognition result. The text recognition device in the embodiment of the present application can achieve the above Figure 2The steps of the text recognition method executed in the corresponding embodiment. The functions implemented by the text recognition device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, and the modules can be software and / or hardware. The text recognition device 80 may include an acquisition module 801, a corner point recognition module 802 and a text recognition module 803, wherein the functions of the corner point recognition module 802 and the text recognition module 803 can be referred to Figure 2 The operations performed in the corresponding embodiments are not described in detail here.

[0106] The acquisition module 801 is configured to acquire a target image.

[0107] The corner point recognition module 802 is configured to determine the corner point data corresponding to the text contained in the target image based on the target image;

[0108] The text recognition module 803 is configured to recognize the text contained in the target image based on the corner point data to obtain a recognition result.

[0109] In some embodiments, the text recognition module 803 is further configured to extract image features of the target image using the corner point data and the weight of each corner point; based on the image features of the target image, recognize the text contained in the target image to obtain a recognition result. In some embodiments, extracting the image features of the target image using the corner point data and the weight of each corner point is implemented based on a neural network model.

[0110] In some embodiments, the target image contains overlapping text, and the corner point recognition module 802 is further configured to process the target image based on the image segmentation model to obtain the image area corresponding to each text; identify the corner points in the image area corresponding to each text, and obtain the corner point data corresponding to the text contained in the target image.

[0111] In some implementations, the corner recognition module 802 is further configured to input the text description corresponding to the target image and the target image into an image segmentation model to obtain an image region corresponding to the text.

[0112] In some implementations, the text recognition module 803 is further configured to input the corner point data, the target image, the text description corresponding to the target image, and the image area corresponding to the text into a text recognition model to obtain a recognition result.

[0113] See also Fig. 9 , Fig. 9A schematic diagram of a training device for a neural network model provided in an embodiment of the present application, which can be applied to a server in a scenario where model training is required. The training device for the neural network model in the embodiment of the present application can achieve the above Figure 7 The steps of the model training process performed in the corresponding embodiment. The functions implemented by the training device of the neural network model can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, and the modules can be software and / or hardware. The training device 90 of the neural network model may include a sample determination module 901 and a model determination module 902. The functional implementation of the sample determination module 901 and the model determination module 902 can refer to Figure 7 The operations performed in the corresponding embodiments are not described in detail here.

[0114] The sample determination module 901 is configured to obtain a sample image set corresponding to at least one sample character, and corner point data corresponding to the sample character contained in each sample image in the sample image set, wherein the sample image set includes at least one sample image corresponding to at least one sample character.

[0115] The model determination module 902 is configured to train an initial neural network model based on a sample image set corresponding to at least one sample character and corner point data corresponding to the sample character contained in each sample image in the sample image set to obtain a neural network model.

[0116] In some embodiments, the sample image corresponding to each sample character includes a positive sample image and a negative sample image. The model determination module 902 is further configured to extract, for each sample character, the image invariant features corresponding to the positive sample image of the sample character and the image change features corresponding to the negative sample image of the sample character based on the sample image set and corner point data corresponding to the sample character; determine the character loss value of the sample character based on the image invariant features and the image change features; if the character loss value does not meet the preset convergence condition, adjust the weight parameters of the initial neural network model based on the character loss value; iteratively train the adjusted initial neural network model based on the sample character until the obtained character loss value meets the preset convergence condition, thereby obtaining the neural network model.

[0117] In an embodiment of the present application, the model determination module 902 is configured to train an initial neural network model based on the sample images included in the sample image set and the corner point data corresponding to the sample characters included in each sample image to obtain a neural network model, so that the neural network model can learn the corner point data of the sample characters, extract the features of the sample images in combination with the corner point data and the sample images, and make the image feature extraction weights of the image areas corresponding to the corner points greater than the image feature extraction weights of other image areas, thereby increasing the attention of the neural network model to the image areas corresponding to the corner points and providing more accurate image features for subsequent text recognition.

[0118] The above describes the text recognition device 80 and the training device 90 of the neural network model in the embodiment of the present application from the perspective of modular functional entities. The following describes the text recognition device and the training device of the neural network model in the embodiment of the present application from the perspective of hardware processing.

[0119] It should be noted that Figure 8 The physical devices corresponding to the acquisition module 801, the corner point recognition module 802 and the text recognition module 803 shown in the figure can all be processors. Fig. 9 The physical devices corresponding to the sample determination module 901 and the model determination module 902 shown may also be processors.

[0120] Figure 8 and Fig. 9 The devices shown can all have Fig.10 The structure shown, when Figure 8 and Fig. 9 The text recognition device 80 and the neural network model training device 90 shown in FIG. Fig.10 When the structure shown is Fig.10 The processor in the device can implement the same or similar functions as the acquisition module 801, the corner point recognition module 802 and the text recognition module 803 provided in the device embodiment corresponding to the device, as well as the sample determination module 901 and the model determination module 902. Fig.10 The memory in the storage device stores a computer program that needs to be called when the processor executes the above-mentioned text recognition method.

[0121] The present application also provides a terminal device, such as Fig.11 For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The terminal device can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), a car computer, etc., taking the mobile phone as an example:

[0122] Fig.11 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Fig.11 The mobile phone includes: a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090. Those skilled in the art will understand that Fig.11 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0123] Combine the following Fig.11 A detailed introduction to the various components of the mobile phone:

[0124] The RF circuit 1010 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 1080 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 1010 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 1010 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.

[0125] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1020. The memory 1020 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1020 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0126] The input unit 1030 can be used to receive input digital or character information, and to generate key signal inputs related to the user settings and function control of the mobile phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1031 or near the touch panel 1031 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 1031 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1080, and can receive and execute commands sent by the processor 1080. In addition, the touch panel 1031 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 1031, the input unit 1030 may further include other input devices 1032. Specifically, the other input devices 1032 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0127] The display unit 1040 may be used to display the target image or the recognition result, etc. The display unit 1040 may include a display panel 1041. Optionally, the display panel 1041 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 1031 may cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near it, it is transmitted to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides a corresponding visual output on the display panel 1041 according to the type of touch event. Although in Fig.12 In the embodiment, the touch panel 1031 and the display panel 1041 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.

[0128] The mobile phone may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1041 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0129] The audio circuit 1060, the speaker 1061, and the microphone 1062 can provide an audio interface between the user and the mobile phone. The audio circuit 1060 can transmit the received audio data to the speaker 1061 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1060 and converted into audio data, and then the audio data is output to the processor 1080 for processing, and then sent to another mobile phone through the RF circuit 1010, or the audio data is output to the memory 1020 for further processing.

[0130] Wi-Fi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages, and access streaming media through the Wi-Fi module 1070. It provides users with wireless broadband Internet access. Fig.12 A Wi-Fi module 1070 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.

[0131] The processor 1080 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 1020, and calling data stored in the memory 1020, so as to monitor the mobile phone as a whole. Optionally, the processor 1080 may include one or more processing units; optionally, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1080.

[0132] The mobile phone also includes a power supply 1090 (such as a battery) for supplying power to various components. Optionally, the power supply can be logically connected to the processor 1080 through a power management system, thereby managing functions such as charging, discharging, and power consumption management through the power management system.

[0133] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0134] In the embodiment of the present application, the processor 1080 included in the mobile phone also has the function of controlling the execution of the above text recognition method process performed by the text recognition device.

[0135] The present application also provides a server. Fig.12 , Fig.12 1 is a schematic diagram of a server structure provided in an embodiment of the present application. The server 1100 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (full name in English: central processing units, abbreviated in English: CPU) 1122 (for example, one or more processors) and a memory 1132, and one or more storage media 1130 (for example, one or more mass storage devices) storing application programs 1142 or data 1144. Among them, the memory 1132 and the storage medium 1130 can be short-term storage or permanent storage. The program stored in the storage medium 1130 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1122 can be configured to communicate with the storage medium 1130 to execute a series of instruction operations in the storage medium 1130 on the server 1100.

[0136] The server 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1158, and / or one or more operating systems 1141, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.

[0137] The steps performed by the server in the above embodiment can be based on the Fig.12 For example, the steps performed by the text recognition device 80 or the neural network model training device 90 in the above-mentioned embodiment can be based on the Fig.12 For example, the central processor 1122 performs the following operations by calling the instructions in the memory 1132:

[0138] The acquisition module 801 acquires the target image; the corner point recognition module 802 determines the corner point data corresponding to the text contained in the target image based on the target image; the text recognition module 803 recognizes the text contained in the target image based on the corner point data to obtain a recognition result.

[0139] The sample determination module 901 can also be used to obtain a sample image set corresponding to at least one sample character and corner point data corresponding to the sample character contained in each sample image in the sample image set, wherein the sample image set includes at least one sample image corresponding to at least one sample character; and the model determination module 902 can be used to train an initial neural network model based on the sample image set corresponding to at least one sample character and corner point data corresponding to the sample character contained in each sample image in the sample image set to obtain a neural network model.

[0140] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0141] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0142] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0143] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0144] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0145] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0146] The computer program product includes one or more computer instructions. When a computer program is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0147] The technical solutions provided in the embodiments of the present application are introduced in detail above. The principles and implementation methods of the embodiments of the present application are explained by using specific examples in the embodiments of the present application. The description of the above embodiments is only used to help understand the methods and core ideas of the embodiments of the present application. At the same time, for those skilled in the art, according to the ideas of the embodiments of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the embodiments of the present application.

Claims

1. A method for character recognition, characterized in that: include: Get the target image; Based on the target image, determining corner point data corresponding to the text contained in the target image, the corner point data is used to represent the positions of multiple corner points, and the corner point data corresponding to the text includes corner point data of four corner points: the upper left corner, the lower left corner, the upper right corner, and the lower right corner of the text; Based on the corner point data, the text contained in the target image is recognized to obtain a recognition result; The step of recognizing the text contained in the target image based on the corner point data to obtain a recognition result includes: The image features of the target image are extracted using the corner point data and the weight of each corner point, wherein the image feature extraction weight of the image area corresponding to the corner point is greater than the image feature extraction weight of other image areas; Based on the image features of the target image, the text contained in the target image is recognized to obtain the recognition result; The target image contains overlapping characters, and determining, based on the target image, corner point data corresponding to the characters contained in the target image includes: Inputting the text description corresponding to the target image and the target image into an image segmentation model to obtain an image region corresponding to each of the characters, wherein the text description includes the character style in the target image; Identify the corner points in the image area corresponding to each of the characters to obtain the corner point data corresponding to the characters contained in the target image; The step of recognizing the text contained in the target image based on the corner point data to obtain a recognition result includes: The corner point data, the target image, the text description corresponding to the target image and the image area corresponding to each character are input into a character recognition model to obtain the recognition result.

2. The text recognition method according to claim 1, characterized in that: The method of extracting the image features of the target image by utilizing the corner point data and the weight of each corner point is implemented based on a neural network model.

3. The text recognition method according to claim 2, characterized in that: The neural network model is obtained according to the following method: Acquire a sample image set corresponding to at least one sample character, and corner point data corresponding to the sample character contained in each sample image in the sample image set, wherein the sample image set includes at least one sample image corresponding to each of the at least one sample characters; Based on the sample image set corresponding to the at least one sample character and the corner point data corresponding to the sample character contained in each sample image in the sample image set, an initial neural network model is trained to obtain the neural network model.

4. The text recognition method according to claim 3, characterized in that: The sample images corresponding to each sample word include a positive sample image and a negative sample image. The method of training an initial neural network model based on a sample image set corresponding to the at least one sample character and corner point data corresponding to the sample character contained in each sample image in the sample image set to obtain the neural network model comprises: For each of the sample characters, based on the sample image set and corner point data corresponding to the sample character, extract the image invariant features corresponding to the positive sample image of the sample character and the image change features corresponding to the negative sample image of the sample character; Determining a character loss value of the sample character based on the image invariant feature and the image change feature; If the character loss value does not meet the preset convergence condition, adjusting the weight parameters of the initial neural network model based on the character loss value; The adjusted initial neural network model is iteratively trained based on the sample characters until the obtained character loss value meets the preset convergence condition, thereby obtaining the neural network model.

5. A text recognition device, characterized in that: include: An acquisition module, configured to acquire a target image; A corner point recognition module is configured to determine, based on the target image, corner point data corresponding to the text contained in the target image, the corner point data being used to characterize the positions of a plurality of corner points, and the corner point data corresponding to the text includes corner point data of four corner points, namely, the upper left corner, the lower left corner, the upper right corner, and the lower right corner of the text; A text recognition module is configured to recognize the text contained in the target image based on the corner point data to obtain a recognition result; The step of recognizing the text contained in the target image based on the corner point data to obtain a recognition result includes: The image features of the target image are extracted using the corner point data and the weight of each corner point, wherein the image feature extraction weight of the image area corresponding to the corner point is greater than the image feature extraction weight of other image areas; Based on the image features of the target image, the text contained in the target image is recognized to obtain the recognition result; The target image contains overlapping characters, and determining, based on the target image, corner point data corresponding to the characters contained in the target image includes: Inputting the text description corresponding to the target image and the target image into an image segmentation model to obtain an image region corresponding to each of the characters, wherein the text description includes the character style in the target image; Identify the corner points in the image area corresponding to each of the characters to obtain the corner point data corresponding to the characters contained in the target image; The step of recognizing the text contained in the target image based on the corner point data to obtain a recognition result includes: The corner point data, the target image, the text description corresponding to the target image and the image area corresponding to each character are input into a character recognition model to obtain the recognition result.

6. A computing device, characterized in that It comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that: The method comprises instructions which, when executed on a computer, cause the computer to perform the method according to any one of claims 1 to 4.

8. A computer program product comprising instructions, the computer program product comprising program instructions, when the program instructions are run on a computer or a processor, the computer or the processor executes the method according to any one of claims 1 to 4.

9. A chip system, characterized in that: The chip system includes: A communication interface for inputting and / or outputting information; A processor, configured to execute a computer executable program so that a device equipped with the chip system executes the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and readable storage medium

    CN115223020A

  • Method and device for text recognition, equipment and medium

    CN116189208A