Image text recognition methods, devices, computer-readable media and electronic devices

By converting the image to a grayscale layer and performing image erosion and feature layer overlay, the low accuracy of existing text recognition methods is solved, achieving higher recognition accuracy.

CN116092094BActive Publication Date: 2026-11-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111307156.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-05
Publication Date
2026-11-17
Estimated Expiration
2041-11-05

AI Technical Summary

Technical Problem

Existing text recognition methods are greatly affected by subjective factors and have poor universality, resulting in low recognition accuracy when the scene changes.

Method used

The image to be processed is converted into a grayscale image, segmented into grayscale layers corresponding to each layer range, and then the text region is obtained through image erosion and feature layer overlay, and finally text recognition is performed.

Benefits of technology

It improves the accuracy of text recognition, avoids the omission and misidentification of connected regions, and achieves accurate recognition of the images to be processed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116092094B_ABST
    Figure CN116092094B_ABST
Patent Text Reader

Abstract

This application belongs to the field of computer technology, specifically relating to an image text recognition method, apparatus, computer-readable medium, and electronic device. The method includes: converting the image to be processed into a grayscale image; segmenting the grayscale image into grayscale layers corresponding to each layer interval based on the layer interval to which the grayscale values ​​of each pixel belong; performing image erosion on each grayscale layer to obtain a feature layer corresponding to each grayscale layer, the feature layer including multiple connected regions; superimposing the feature layers to obtain a superimposed feature layer, the superimposed feature layer including multiple connected regions; expanding each connected region on the superimposed feature layer according to a preset direction to obtain text regions; and recognizing the text in each text region on the superimposed feature layer to obtain the recognized text corresponding to the image to be processed. This improves the recognition accuracy of connected regions in each layer, thereby enabling accurate recognition of the text in the image to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and specifically relates to an image text recognition method, apparatus, computer-readable medium, and electronic device. Background Technology

[0002] With the development of computer science and technology, the ability and level of automated information processing have also been significantly improved. The digitization of image documents, as an essential step in document digitization, has always been valued by researchers in related technologies.

[0003] Text recognition methods in related technologies rely on manually set features and rules based on changes in the scene of the image document. This makes them highly susceptible to subjective factors and lacks versatility, often performing well only for the scene for which the designed features and rules are applied. Once the scene changes, the originally designed features and rules often become inapplicable, resulting in low accuracy in text recognition.

[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide an image text recognition method, apparatus, computer-readable medium, and electronic device, which at least to some extent overcomes the technical problem of how to improve the accuracy of text recognition in related technologies.

[0006] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.

[0007] According to one aspect of the embodiments of this application, an image text recognition method is provided, the image text recognition method comprising: The image to be processed is converted into a grayscale image, and the grayscale image is divided into grayscale layers corresponding to each of the layer intervals according to the layer interval to which the grayscale value of each pixel in the grayscale image belongs. The layer interval is used to represent the range of grayscale values ​​of the pixels in the corresponding grayscale layer. Image erosion is performed on each of the grayscale layers to obtain a feature layer corresponding to each grayscale layer. The feature layer includes multiple connected regions, which are regions that include multiple pixels with connected relationships. The various feature layers are superimposed to obtain a superimposed feature layer, which includes multiple connected regions. The text region is obtained by expanding each connected region on the superimposed feature layer in a preset direction. The text in each of the text regions on the superimposed feature layer is recognized to obtain the recognized text corresponding to the image to be processed.

[0008] According to one aspect of the embodiments of this application, an image text recognition device is provided, the image text recognition device comprising: The layer segmentation module is configured to convert the image to be processed into a grayscale image, and to segment the grayscale image into grayscale layers corresponding to each layer interval according to the layer interval to which the grayscale value of each pixel in the grayscale image belongs. The layer interval is used to represent the range of grayscale values ​​of the pixels in the corresponding grayscale layer. The erosion module is configured to perform image erosion on each of the grayscale layers to obtain a feature layer corresponding to each grayscale layer. The feature layer includes multiple connected regions, and each connected region is a region that includes multiple pixels with connected relationships. The feature overlay module is configured to overlay the various feature layers to obtain an overlay feature layer, wherein the overlay feature layer includes a plurality of the connected regions; The expansion module is configured to expand each connected region on the superimposed feature layer in a preset direction to obtain a text region. The text recognition module is configured to recognize the text in each of the text regions on the superimposed feature layer to obtain the recognized text corresponding to the image to be processed.

[0009] In some embodiments of this application, based on the above technical solutions, the image text recognition device further includes: The minimum value determination unit is configured to determine one or more minimum values ​​among the distribution frequencies of each gray value in the gray-scale image based on the gray value of each pixel in the gray-scale image. The full value range determination unit is configured to determine the minimum value of the full value range based on the minimum gray value of the grayscale image; and to determine the maximum value of the full value range based on the maximum gray value of the grayscale image. The layer interval acquisition unit is configured to divide the full value range into multiple layer intervals based on the grayscale values ​​corresponding to each of the minimum values.

[0010] In some embodiments of this application, based on the above technical solutions, the layer interval acquisition unit includes: The sorting subunit is configured to sort the minimum value of the full value range, the minimum value of the full value range, and the gray values ​​corresponding to each of the minimum values ​​in ascending or descending order. The layer interval segmentation subunit is configured to use two adjacent gray values ​​as the two interval endpoints corresponding to the layer interval to segment the full value range, thereby obtaining multiple layer intervals that are connected end to end and do not overlap.

[0011] In some embodiments of this application, based on the above technical solutions, the minimum value determination unit includes: The frequency distribution determination subunit is configured to calculate the frequency distribution of each gray value based on the gray value of each pixel in the grayscale image. The distribution function acquisition sub-unit is configured to obtain the corresponding distribution function based on the distribution frequency of each gray value in the grayscale image; The smoothing curve acquisition sub-unit is configured to perform function smoothing on the distribution function to obtain the smoothing curve corresponding to the distribution function; The minimum value acquisition subunit is configured to identify each trough of the smooth curve and take the value of the point corresponding to each trough as the minimum value in the distribution frequency of each gray value in the grayscale image.

[0012] In some embodiments of this application, based on the above technical solutions, the corrosion module includes: The binary layer acquisition unit is configured to determine a target threshold in the grayscale value range of the grayscale layer, and to assign grayscale values ​​in the grayscale layer that are greater than or equal to the target threshold to a first value, and to assign grayscale values ​​in the grayscale layer that are less than the target threshold to a second value, thereby forming a binary layer corresponding to the grayscale layer. The marked connected region acquisition unit is configured to perform image erosion on the binary image to obtain a marked connected region composed of multiple pixels with gray values ​​of the first value; The erosion unit is configured to retain pixel values ​​in the grayscale layer located at the position of the marked connected region corresponding to the binary layer, and discard pixel values ​​in the grayscale layer located outside the position of the marked connected region corresponding to the binary layer.

[0013] In some embodiments of this application, based on the above technical solutions, the preset direction is a horizontal or vertical direction, and the expansion module includes: The circumscribed rectangle acquisition unit is configured to acquire the circumscribed rectangle of the connected region, expand the connected region to fill the circumscribed rectangle, wherein the circumscribed rectangle is a rectangle that is externally tangent to the connected region in a preset direction; The nearest connected region acquisition unit is configured to acquire the nearest connected region of the connected region, wherein the nearest connected region is the connected region with the shortest interval distance to the connected region; The text region acquisition unit is configured to expand the connected region toward the nearest connected region when the direction of the nearest connected region relative to the connected region is a preset direction, so as to obtain the text region.

[0014] In some embodiments of this application, based on the above technical solutions, the text recognition module includes: The text segmentation unit is configured to segment the text region to obtain one or more single-character regions. The character recognition unit is configured to recognize the characters in each of the single-character regions to obtain the character information corresponding to each of the single-character regions; The text information acquisition unit is configured to combine the character information corresponding to each of the single character regions according to the arrangement position of each of the single character regions in the text region to obtain the text information corresponding to the text region; The text recognition acquisition unit is configured to acquire the recognition text of the image to be processed based on the text information corresponding to the multiple text regions.

[0015] In some embodiments of this application, based on the above technical solutions, the text segmentation unit includes: The length-to-height ratio calculation subunit is configured to calculate the length-to-height ratio of the text region, wherein the length-to-height ratio is the ratio of the length of the text region to the height of the text region; A character estimation subunit is configured to calculate the estimated number of characters in the text region based on the aspect ratio; The single-character region acquisition subunit is configured to uniformly cut the text region along the length direction according to the expected number, thereby obtaining the expected number of single-character regions.

[0016] In some embodiments of this application, based on the above technical solutions, the single-word region acquisition subunit includes: A pre-cut quantity acquisition subunit is configured to acquire a pre-cut quantity based on the expected quantity, wherein the pre-cut quantity is greater than or equal to the expected quantity; The uniformly arranged cutting line subunit is configured to uniformly arrange candidate cutting lines in the length direction on the text region according to the pre-cutting number, the candidate cutting lines being able to uniformly cut the text region in the length direction to obtain the pre-cutting number of candidate regions; The target cutting line acquisition sub-unit is configured to take candidate cutting lines with adjacent cutting lines on both sides as target cutting lines; The distance summation calculation subunit is configured to detect the sum of distances between the target cutting line and the adjacent candidate cutting lines on both sides; The target cutting line retention subunit is configured to retain the target cutting line when the ratio of the sum of the distances to the height of the text region is greater than or equal to a preset ratio. The target cutting line discard subunit is configured to discard the target cutting line when the ratio of the sum of the distances to the height of the text region is less than a preset ratio.

[0017] In some embodiments of this application, based on the above technical solutions, the feature overlay module includes: The superimposed feature layer acquisition unit is configured to superimpose the various feature layers to obtain a superimposed feature layer; The merged connected region acquisition unit is configured to merge connected regions on the superimposed feature layer with a spacing distance less than a preset distance into a merged connected region; The area percentage calculation unit is configured to calculate the area of ​​the connected regions from each feature layer in the merged connected region, and to calculate the area percentage corresponding to each feature layer, wherein the area percentage is the ratio of the area of ​​the connected region at the corresponding position of the feature layer to the area of ​​the merged connected region. The connected region replacement unit is configured to replace the merged connected region with the connected region at the corresponding position of the feature layer with the largest area proportion.

[0018] In some embodiments of this application, based on the above technical solutions, the method is applied to the automated processing of complaint forms, wherein the image to be processed includes the image in the complaint form; the image text recognition device further includes: The label classification unit is configured to input the recognition text corresponding to the image to be processed into a pre-trained neural network model to obtain the complaint effectiveness label and complaint risk label corresponding to the complaint form where the image to be processed is located; The complaint form database storage unit is configured to store the complaint validity tag and complaint risk tag corresponding to the complaint form, and the subject corresponding to the complaint form into the complaint form database.

[0019] In some embodiments of this application, based on the above technical solutions, the image text recognition device further includes: The transaction data acquisition unit is configured to acquire information flow data and fund flow data of transaction orders, wherein the transaction orders correspond to the target entity; The tag search unit is configured to search the complaint form database based on the target subject to obtain the target complaint form corresponding to the target subject, as well as the complaint validity tag and complaint risk tag corresponding to the target complaint form; The risk strategy suggestion acquisition unit is configured to input the information flow data and fund flow data of the transaction order, as well as the complaint validity label and complaint risk label corresponding to the target entity, into a pre-trained decision tree model to obtain risk strategy suggestions corresponding to the target entity. The risk strategy suggestions include one or more of the following: trusting the transaction order, limiting the transaction order amount, penalizing the transaction order, intercepting the transaction order, and reminding the transaction of risks.

[0020] According to one aspect of the embodiments of this application, a computer-readable medium is provided, on which a computer program is stored, which, when executed by a processor, implements the image text recognition method as described above.

[0021] According to one aspect of the embodiments of this application, an electronic device is provided, the electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the image text recognition method as described above by executing the executable instructions.

[0022] According to one aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the image-text recognition method as described above.

[0023] In the technical solution provided in this application embodiment, the grayscale image is segmented into grayscale layers corresponding to each layer interval based on the layer interval to which the grayscale value of each pixel belongs; image erosion is performed on each grayscale layer; the feature layers are superimposed to obtain a superimposed feature layer; each connected region on the superimposed feature layer is expanded in a preset direction to obtain a text region; the text in each text region on the superimposed feature layer is recognized to obtain the recognized text corresponding to the image to be processed. Therefore, by segmenting the grayscale image into grayscale layers corresponding to each layer interval and performing image erosion on each grayscale layer, the erosion processing of each grayscale layer in the image to be processed is achieved separately, improving the erosion effect on each layer, avoiding omissions and misidentifications of connected regions, and improving the accuracy of connected region recognition, thereby enabling accurate recognition of the text in the image to be processed.

[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0026] Figure 1 An exemplary system architecture block diagram illustrating the application of the technical solution of this application is shown schematically.

[0027] Figure 2 A flowchart illustrating the steps of an image text recognition method according to certain embodiments of this application is shown schematically.

[0028] Figure 3 The flowchart illustrates the steps before dividing a grayscale image into grayscale layers corresponding to each layer interval based on the layer interval to which the grayscale value of each pixel of the grayscale image belongs, according to a certain embodiment of this application.

[0029] Figure 4 This diagram illustrates the correspondence between grayscale values ​​and distribution frequencies of a grayscale image in certain embodiments of this application.

[0030] Figure 5 The flowchart illustrates the steps of dividing the full value range into multiple layer intervals based on the grayscale values ​​corresponding to each minimum value in a certain embodiment of this application.

[0031] Figure 6 The flowchart illustrates, in a certain embodiment of this application, the steps of determining one or more minimum values ​​among the distribution frequencies of each gray value in a grayscale image based on the gray values ​​of each pixel.

[0032] Figure 7 The flowchart illustrates the steps of performing image erosion on each grayscale layer in a certain embodiment of this application to obtain the feature layer corresponding to each grayscale layer, wherein the feature layer includes multiple connected regions.

[0033] Figure 8 The flowchart illustrating the steps of stacking various feature layers to obtain a stacked feature layer is shown in a certain embodiment of this application.

[0034] Figure 9 The flowchart illustrates the steps in a certain embodiment of this application to expand each connected region on the superimposed feature layer in a preset direction to obtain a text region.

[0035] Figure 10The flowchart illustrates the steps of recognizing text in various text regions on an overlay feature layer to obtain the recognized text corresponding to the image to be processed in a certain embodiment of this application.

[0036] Figure 11 The flowchart illustrating the steps of cutting a text region into one or more single-character regions in a certain embodiment of this application is shown in the illustration.

[0037] Figure 12 The flowchart illustrates the steps of uniformly cutting a text region along its length direction according to a predetermined number to obtain a predetermined number of single-character regions in a certain embodiment of this application.

[0038] Figure 13 The flowchart illustrates the steps in a certain embodiment of this application to identify the text in each text region on the overlay feature layer and obtain the identified text corresponding to the image to be processed.

[0039] Figure 14 The diagram illustrates the internal structure of a first sub-neural network model according to an embodiment of this application.

[0040] Figure 15 The diagram illustrates the internal structure of a second sub-neural network model according to a certain embodiment of this application.

[0041] Figure 16 The flowchart illustrates the steps in a certain embodiment of this application after storing the complaint validity label and complaint risk label corresponding to the complaint form, and the subject corresponding to the complaint form into the complaint form database.

[0042] Figure 17 This illustration schematically shows how, in a certain embodiment of this application, information flow data and fund flow data of transaction orders, as well as complaint validity labels and complaint risk labels corresponding to the target entity, are input into a pre-trained decision tree model to obtain risk strategy suggestions corresponding to the target entity.

[0043] Figure 18 A schematic block diagram of the image text recognition device provided in the embodiments of this application is shown.

[0044] Figure 19 A schematic block diagram of a computer system architecture for implementing an electronic device according to embodiments of the present application is shown. Detailed Implementation

[0045] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.

[0046] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0047] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0048] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0049] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0050] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0051] Computer vision (CV) is a science that studies how to enable machines to "see." More specifically, it refers to machine vision, which uses cameras and computers to replace human eyes in tasks such as target recognition, tracking, and measurement, and further performs image processing to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition), video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), and common biometric recognition technologies such as facial recognition and fingerprint recognition.

[0052] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can 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 endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0053] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, and smart customer service. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.

[0054] Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying platform, a platform product and service layer, and an application service layer.

[0055] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operations management. The user management module is responsible for managing the identity information of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the correspondence between user real identities and blockchain addresses (access management). Furthermore, under authorization, it monitors and audits transactions of certain real identities and provides risk control rule configuration (risk control audit). The basic services module is deployed on all blockchain node devices to verify the validity of business requests. After consensus is reached on valid requests, they are recorded in storage. For a new business request, the basic services first perform interface adaptation parsing and authentication (interface adaptation), and then encrypt the business information using a consensus algorithm (consensus management). After encryption, the data is transmitted completely and consistently to the shared ledger (network communication) and recorded and stored. The smart contract module is responsible for contract registration, issuance, triggering, and execution. Developers can define contract logic using a programming language and publish it to the blockchain (contract registration). According to the contract terms, the key or other events are invoked to trigger execution and complete the contract logic. It also provides functions for contract upgrades and cancellations. The operations management module is mainly responsible for deployment, configuration modification, contract settings, cloud adaptation, and real-time status visualization during product launch, such as alarms, network status management, and node device health status management.

[0056] The platform's product service layer provides the basic capabilities and implementation frameworks for typical applications. Developers can leverage these basic capabilities, along with the specific characteristics of their business needs, to implement blockchain-based business logic. The application service layer provides blockchain-based application services to business stakeholders.

[0057] The solutions provided in this application involve artificial intelligence technologies such as computer vision and machine learning, which are specifically described in the embodiments below.

[0058] Figure 1 An exemplary system architecture block diagram illustrating the application of the technical solution of this application is shown schematically.

[0059] like Figure 1 As shown, the system architecture 100 may include terminal device 110, network 120, and server 130. Terminal device 110 may include various electronic devices such as smartphones, tablets, laptops, and desktop computers. Server 130 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Network 120 may be a communication medium of various connection types capable of providing a communication link between terminal device 110 and server 130, such as a wired communication link or a wireless communication link.

[0060] Depending on the implementation requirements, the system architecture in this application embodiment can have any number of terminal devices, networks, and servers. For example, server 130 can be a server group composed of multiple server devices. In addition, the technical solutions provided in this application embodiment can be applied to terminal device 110, or to server 130, or can be implemented jointly by terminal device 110 and server 130. This application does not impose any special limitations on this.

[0061] For example, the image text recognition method of this application can be mounted on server 130, and the user interacts with server 130 through a client on terminal device 110. Thus, based on the layer range to which the grayscale values ​​of each pixel in the grayscale image belong, the grayscale image is segmented into grayscale layers corresponding to each layer range; image erosion is performed on each grayscale layer; the feature layers are superimposed to obtain a superimposed feature layer; each connected region on the superimposed feature layer is expanded in a preset direction to obtain a text region; the text in each text region on the superimposed feature layer is recognized to obtain the recognized text corresponding to the image to be processed. Therefore, by segmenting the grayscale image into grayscale layers corresponding to each layer range and performing image erosion on each grayscale layer, the erosion processing of each grayscale layer in the image to be processed is performed separately, improving the erosion effect on each layer, avoiding omissions and misidentifications of connected regions, and improving the accuracy of connected region recognition, thereby achieving accurate recognition of the text in the image to be processed.

[0062] Alternatively, for example, the server 130 may be equipped with the image text recognition method of the present application, which is applied to the automated processing of complaint forms. The user uploads the complaint form to the server 130 through the client on the terminal device 110. After the server performs text recognition on the complaint form using the image text recognition method of a certain embodiment of the present application, it inputs the recognized text corresponding to each text region into a pre-trained neural network model to obtain the complaint validity label and complaint risk label corresponding to the complaint form. The complaint validity label and complaint risk label corresponding to the complaint form, as well as the subject corresponding to the complaint form, are stored in the complaint form database. Thus, the automated processing of complaint forms is realized, which can save manpower and improve the processing efficiency of complaint forms.

[0063] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, smart voice interaction device, smart home appliance, in-vehicle terminal, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0064] In related technologies, text detection in images can be achieved by extracting text through edge detection. However, edge detection in images with complex backgrounds may result in excessive background edges (i.e., increased noise), while the edge information of the text itself is easily overlooked, leading to poor performance. If erosion or dilation is applied in this situation, the background and text areas will merge, further deteriorating the results. In some scenarios, such as complaint orders where images may be chat screenshots or product page screenshots, the complex backgrounds make text recognition in these images less effective.

[0065] In some embodiments of this application, a grayscale image is divided into grayscale layers corresponding to each layer range, and image erosion is performed on each grayscale layer. This achieves separate erosion processing of each grayscale layer in the image to be processed, improves the erosion effect on each layer, avoids omissions and misidentifications of connected regions, and improves the accuracy of connected region identification, thereby enabling accurate recognition of text in the image to be processed.

[0066] The image text recognition method provided in this application will be described in detail below with reference to specific embodiments.

[0067] Figure 2 A flowchart illustrating the steps of an image text recognition method according to certain embodiments of this application is shown schematically. The entity executing this image text recognition method can be a terminal device, a server, etc., and this application does not impose any limitations on this. Figure 2 As shown, the image text recognition method mainly includes the following steps S210 to S250.

[0068] S210. Convert the image to be processed into a grayscale image, and divide the grayscale image into grayscale layers corresponding to each layer interval according to the layer interval to which the grayscale value of each pixel in the grayscale image belongs. The layer interval is used to represent the range of grayscale values ​​of the pixels in the corresponding grayscale layer.

[0069] Specifically, the images to be processed can be transaction order interfaces, documents, advertisement screenshots, etc. The value range of each layer interval can be a preset value range that does not overlap with each other.

[0070] Therefore, grayscale images can be segmented into grayscale layers corresponding to each layer range, and pixels with similar grayscale values ​​can be grouped into the same layer. This allows subsequent steps to perform image erosion and connected region identification on each layer, improving the erosion effect on each layer and avoiding omissions and misidentifications of connected regions.

[0071] Figure 3 This schematically illustrates a flowchart of the steps preceding the segmentation of a grayscale image into grayscale layers corresponding to each layer interval based on the layer interval to which the grayscale values ​​of each pixel belong, according to a certain embodiment of this application. Figure 3 As shown, based on the above embodiments, before dividing the grayscale image into grayscale layers corresponding to each layer interval according to the layer interval to which the grayscale value of each pixel of the grayscale image belongs in step S210, the following steps S310 to S330 may be further included.

[0072] S310. Based on the gray values ​​of each pixel in the grayscale image, determine one or more minimum values ​​among the distribution frequencies of each gray value in the grayscale image.

[0073] S320. Determine the minimum value of the full value range based on the minimum gray value of the grayscale image; determine the maximum value of the full value range based on the maximum gray value of the grayscale image.

[0074] S330. Divide the range of full values ​​into multiple layer intervals based on the grayscale values ​​corresponding to each minimum value.

[0075] Figure 4 This diagram schematically illustrates the correspondence between grayscale values ​​and distribution frequencies of a grayscale image in certain embodiments of this application. For example, please refer to... Figure 4Based on the diagram showing the correspondence between grayscale values ​​and their distribution frequencies in the grayscale image, the minimum values ​​corresponding to the six minimum points in the distribution frequency of each grayscale value in the grayscale image can be determined: the minimum value 0 corresponding to the minimum point (48,0), the minimum value 8 corresponding to the minimum point (72,8), the minimum value 150 corresponding to the minimum point (100,150), the minimum value 95 corresponding to the minimum point (120,95), the minimum value 14 corresponding to the minimum point (141,14), and the minimum value 0 corresponding to the minimum point (218,0). Then, based on the minimum grayscale value 49 of the grayscale image, the minimum value of the full range is determined to be grayscale value 49. Alternatively, any grayscale value less than the minimum grayscale value 49, such as grayscale values ​​0, 1, 5, etc., can be used as the minimum value of the full range. Next, based on the maximum gray value of 217 in the grayscale image, the maximum value of the full range is determined to be the gray value 217. Alternatively, any gray value greater than the maximum gray value 217, such as gray values ​​250, 254, 255, etc., can be taken as the maximum value of the full range.

[0076] For example, the minimum value of the full value range is determined to be gray value 49 based on the minimum gray value of the grayscale image (49), and the maximum value of the full value range is determined to be gray value 217 based on the maximum gray value of the grayscale image (217). Then, based on the gray values ​​corresponding to each minimum value, the full value range is divided into multiple layer intervals [49,72], (72,100], (100,120], (120,141], (141,217).

[0077] For example, based on the minimum gray value 49 of the grayscale image, the minimum value of the full range is determined to be 0, which is less than the minimum gray value 49. Based on the maximum gray value 217 of the grayscale image, the maximum value of the full range is determined to be 255, which is greater than the maximum gray value 217. Then, after removing the minimum gray value 48 and the maximum gray value 218 from the gray values ​​corresponding to the minimum values, the full range is divided into multiple layer intervals [0,72], (72,100], (100,120], (120,141], (141,255) according to the gray values ​​corresponding to each minimum value.

[0078] In some implementations, the correspondence between the gray values ​​of the gray image and the probability of occurrence of each gray value can be generated based on the gray values ​​of each pixel in the gray image. Then, one or more minimum values ​​among the probability of occurrence of each gray value in the gray image can be determined. Then, based on the gray values ​​corresponding to each minimum value, the range of the full value is divided into multiple layer intervals. The specific scheme is similar to steps S310 to S330, and will not be described in detail here.

[0079] Therefore, dividing the full value range into multiple layer intervals is beneficial for subsequently dividing the grayscale image into grayscale layers corresponding to each layer interval, which in turn facilitates the erosion of each layer separately. Furthermore, since the grayscale values ​​of each layer are similar, it can improve the erosion effect on the image.

[0080] In some implementations, before dividing the full value range into multiple layer intervals based on the grayscale values ​​corresponding to each minimum value in step S330, one or more maxima in the distribution frequency of each grayscale value in the grayscale image can be determined first based on the grayscale values ​​of each pixel in the grayscale image. Then, based on the number of maxima, the number of layer intervals into which the full value range is divided is determined, wherein the value range of each layer interval includes one corresponding maximum value. For details, please refer to [link to relevant documentation]. Figure 4 Before dividing the full value range into multiple layer intervals based on the grayscale values ​​corresponding to each minimum value in step S330, one or more maxima in the distribution frequency of each grayscale value in the grayscale image are determined based on the grayscale values ​​of each pixel: the maximum value 254 corresponding to the maximum value point (60, 254), the maximum value 610 corresponding to the maximum value point (94, 610), the maximum value 270 corresponding to the maximum value point (106, 270), the maximum value 305 corresponding to the maximum value point (130, 305), and the maximum value 202 corresponding to the maximum value point (156, 202). Then, based on the number of maxima (5), the number of layer intervals into which the full value range is divided is also determined to be 5. Each layer interval includes its corresponding maximum value. Then, as described in the above embodiment, the range of full values ​​is divided into 5 layer intervals [49,72], (72,100], (100,120], (120,141], (141,217]) based on the gray values ​​corresponding to each minimum value.

[0081] Figure 5 This schematically illustrates a flowchart of the steps in a certain embodiment of this application to divide the full value range into multiple layer intervals based on the grayscale values ​​corresponding to each minimum value. For example... Figure 5 As shown, based on the above embodiments, step S330, which divides the full value range into multiple layer intervals according to the grayscale values ​​corresponding to each minimum value, may further include the following steps S510 to S520.

[0082] S510. Sort the minimum value, the maximum value, and the gray values ​​corresponding to each minimum value in ascending or descending order. S520. Using two adjacent gray values ​​as the endpoints of the corresponding layer intervals, the full value range is divided to obtain multiple layer intervals that are connected end to end and do not overlap.

[0083] For example, such as Figure 4 In this embodiment, the gray value 0, which is less than the minimum gray value 49, is taken as the minimum value of the full value range, and the gray value 255, which is greater than the maximum gray value 217, is taken as the maximum value of the full value range. Then, the gray values ​​after removing the minimum gray value 48 and the maximum gray value 218 from the minimum value 0, the maximum value 255, and the gray values ​​48, 72, 100, 120, 141, and 218 corresponding to each minimum value are sorted in ascending or descending order to obtain: 0, 72, 100, 120, 141, and 255. Then, the two adjacent gray values ​​are used as the two endpoints of the corresponding layer intervals to divide the full value range, resulting in multiple layer intervals that are connected end to end and do not overlap: [0, 72], (72, 100], (100, 120], (120, 141], (141, 255).

[0084] Figure 6 This schematically illustrates a flowchart of the steps in a certain embodiment of the present application for determining one or more minimum values ​​among the distribution frequencies of each grayscale value in a grayscale image based on the grayscale values ​​of each pixel. Figure 6 As shown, based on the above embodiments, step S310, which determines one or more minimum values ​​in the distribution frequency of each gray value in the grayscale image according to the grayscale value of each pixel, may further include the following steps S610 to S640.

[0085] S610. Calculate the distribution frequency of each gray value based on the gray value of each pixel in the grayscale image; S620. Obtain the corresponding distribution function based on the distribution frequency of each gray value in the grayscale image; S630. Perform function smoothing on the distribution function to obtain the smoothed curve corresponding to the distribution function; S640. Identify each trough of the smooth curve and take the value of the point corresponding to each trough as the minimum value in the distribution frequency of each gray value in the grayscale image.

[0086] Specifically, smoothing the distribution function can be achieved by performing kernel density estimation, making the distribution function smooth and continuous, thus obtaining clear troughs. This helps to obtain more accurate minimum values ​​from a statistical perspective, allowing for the division of layer intervals based on the clustering trend of grayscale values ​​in the grayscale image. This makes the division of layer intervals more accurate, grouping pixels of the same type with similar grayscale values ​​into the same layer, which helps to improve the accuracy of identifying connected regions, and thus improves the accuracy of text recognition in the image being processed.

[0087] In some implementations, in addition to using kernel density estimation to smooth the distribution function, filtering or other methods can also be used to smooth the distribution function. This application does not limit this.

[0088] In some implementations, after step S630, each peak of the smooth curve can be identified, and the value of the point corresponding to each peak can be taken as the maximum value in the distribution frequency of each gray value in the gray image. Then, based on the number of maximum values, the number of layer intervals into which the full value range is divided can be determined, wherein the value range of each layer interval includes the corresponding maximum value.

[0089] S220. Perform image erosion on each grayscale layer to obtain the feature layer corresponding to each grayscale layer. The feature layer includes multiple connected regions, which are regions containing multiple pixels with connected relationships.

[0090] Specifically, the image erosion method can be to use a convolution kernel to scan and erode each pixel one by one, and this application does not limit this.

[0091] A connected region is a region comprising multiple pixels that are connected. Within a region of connected pixels, each pixel is adjacent to at least one pixel in that region. Adjacency relationships can include 4-adjacency, 8-adjacency, etc.

[0092] Figure 7 The flowchart illustrates, in a certain embodiment of this application, the steps of performing image erosion on each grayscale layer to obtain a feature layer corresponding to each grayscale layer, wherein the feature layer includes multiple connected regions. Figure 7 As shown, based on the above embodiments, step S220, which involves performing image erosion on each grayscale layer to obtain a feature layer corresponding to each grayscale layer, and the feature layer includes multiple connected regions, may further include the following steps S710 to S730.

[0093] S710. Determine the target threshold within the grayscale value range of the grayscale layer, and assign the grayscale values ​​in the grayscale layer that are greater than or equal to the target threshold to the first value, and assign the grayscale values ​​in the grayscale layer that are less than the target threshold to the second value, thereby forming a binary layer corresponding to the grayscale layer. S720. Perform image erosion on the binary image to obtain a labeled connected region composed of multiple pixels with gray values ​​of the first value; S730. Retain the pixel values ​​in the grayscale layer that are located at the positions of the marked connected regions in the corresponding binary layer, and discard the pixel values ​​in the grayscale layer that are located outside the positions of the marked connected regions in the corresponding binary layer.

[0094] Therefore, after determining the binary layer corresponding to the grayscale layer, image erosion is performed on the binary image to obtain a marked connected region composed of multiple pixels with grayscale values ​​of the first value. Then, the pixel values ​​in the grayscale layer located at the marked connected region of the corresponding binary layer are retained, while the pixel values ​​in the grayscale layer located outside the marked connected region of the corresponding binary layer are discarded. This allows for the erosion of the grayscale layer without losing the multi-level grayscale values ​​of the pixels in the grayscale layer, and enables the identification of connected regions in the layer while preserving the layer color level accuracy of the image.

[0095] S230. Stack the various feature layers to obtain a stacked feature layer, which includes multiple connected regions.

[0096] Figure 8 The flowchart illustrating the steps of stacking various feature layers to obtain a stacked feature layer is shown in a certain embodiment of this application. Figure 8 As shown, based on the above embodiments, the step S230 of superimposing the various feature layers to obtain the superimposed feature layer may further include the following steps S810 to S840.

[0097] S810. Stack the various feature layers to obtain a stacked feature layer; S820. Merge connected regions on the superimposed feature layer with a spacing less than a preset distance into a merged connected region; S830. Calculate the area of ​​the connected regions from each feature layer in the merged connected region, and calculate the area ratio of each feature layer. The area ratio is the ratio of the area of ​​the connected region at the corresponding position of the feature layer to the area of ​​the merged connected region. S840. Replace the merged connected regions with the connected regions at the corresponding positions of the feature layers with the largest area proportions.

[0098] Therefore, by superimposing the various feature layers to obtain a superimposed feature layer, connected regions on the superimposed feature layer with a spacing smaller than a preset distance are merged into a merged connected region. This merges previously adjacent or merged connected regions between layers, creating a correlation and enhancing the correlation between layers, thereby improving the recognition accuracy of the layer being processed. Then, the merged connected region is replaced with the connected region at the corresponding position of the feature layer with the largest area proportion. This ensures that only the connected regions at the corresponding positions of the feature layers with the largest area proportion in the merged connected region are retained. In other words, only the connected regions at the corresponding positions of the feature layers that contribute the most are retained. This allows the recognition of merged connected regions to focus more on the feature layers that contribute the most, thereby improving the recognition accuracy of connected regions and ultimately improving the text recognition accuracy of the image being processed.

[0099] S240. Performing dilation on each connected region on the superimposed feature layer according to a preset direction to obtain a text region.

[0100] Specifically, the preset direction is a horizontal direction, a vertical direction, a 30° oblique direction, a 45° oblique direction, a 60° oblique direction, a curved direction with a certain curvature, etc., and different preset directions can be adopted according to the actual application scenario.

[0101] Figure 9 schematically shows a flowchart of the step of performing dilation on each connected region on the superimposed feature layer according to a preset direction to obtain a text region in an embodiment of the present application. As Figure 9 shown, on the basis of the above embodiments, the preset direction is the horizontal direction or the vertical direction, and the step of performing dilation on each connected region on the superimposed feature layer according to the preset direction to obtain a text region in step S240 may further include the following steps S910 to S930.

[0102] S910. Acquiring an circumscribed rectangle of the connected region, and dilating the connected region to fill the circumscribed rectangle, wherein the circumscribed rectangle is a rectangle circumscribed to the connected region in the preset direction; S920. Acquiring the nearest connected region of the connected region, wherein the nearest connected region is a connected region with the shortest separation distance from the connected region; S930. When the direction of the nearest connected region relative to the connected region is the preset direction, dilating the connected region toward the direction of the nearest connected region to obtain a text region.

[0103] Accordingly, dilation in the preset direction between the connected region and the nearest connected region can be realized, and the text region can be obtained. It can be understood that Chinese characters such as "small", "dan", "eight" and "yuan" are not completely internally connected, but are formed by separated incomplete parts of the characters, so they are not recognized as one connected region in the feature map, but are recognized as a plurality of connected regions. In the present application, dilation in the preset direction between the connected region and the nearest connected region is realized to obtain the text region, so that the connected regions containing incomplete characters or single characters can all be dilated and connected into a text region, and the text region may include a plurality of characters. In the dilation process, the incomplete characters are also wrapped in the dilation region, which can avoid missing recognition of characters or separate recognition of incomplete characters, and further improve the text recognition capability for the image to be processed.

[0104] In some embodiments, when the direction of the nearest connected region relative to the connected region is the preset direction, the connected region is dilated toward the direction of the nearest connected region, wherein the preset direction is the horizontal direction. Accordingly, in combination with people's reading habits, the texts in most images are arranged horizontally, which can improve the text recognition accuracy for most images to be processed.

[0105] In some implementations, when the direction of the nearest connected region relative to the connected region is a preset direction, the connected region is triggered to expand in the opposite direction to the nearest connected region to obtain the text region. This allows the connected regions and the nearest connected region to expand in opposite directions, resulting in a more uniform expansion and a more accurate text region.

[0106] In some implementations, when the direction of the nearest connected region relative to the connected region is a preset direction, and the distance between the nearest connected region and the connected region is less than a first preset distance, the connected region is expanded towards the direction of the nearest connected region to obtain the text region. This avoids expansion between the nearest connected regions even when the distance between them is too large, thus preventing the expansion of unrelated connected regions to form a text region and improving the accuracy of text region recognition.

[0107] S250. Recognize the text in each text region on the superimposed feature layer to obtain the recognized text corresponding to the image to be processed.

[0108] Specifically, the text regions on the superimposed feature layer can be input into a pre-trained machine learning model to obtain the recognized text corresponding to the image to be processed. The pre-trained machine learning model can be based on CNN (Convolutional Neural Network), CNN+LSTM (Long Short-Term Memory) models, Faster RCNN, etc. Training data can be constructed first, using 48×48 grayscale images to create sample images. Each sample image can include a single character, serving as training data for the machine learning model. To ensure the sufficiency of the training data, 45 different font styles can be collected, such as Song, Hei, Kai, and irregular handwriting, thus comprehensively covering various printed fonts and improving the machine learning model's ability to recognize characters.

[0109] In some implementations, different font styles can each include multiple images of different font sizes, with multiple images for each font size, thereby improving the diversity and comprehensiveness of the training data.

[0110] In some implementations, each sample image can be added with a preset proportion of random artificial noise, such as 5%, 6%, 7%, 8%, 9%, or 10%, thereby enhancing the generalization ability of the machine learning model.

[0111] Figure 10This schematically illustrates a flowchart of the steps in a certain embodiment of this application to recognize the text in each text region on an overlay feature layer to obtain the recognized text corresponding to the image to be processed. For example... Figure 10 As shown, based on the above embodiments, the step S250 of recognizing the text in each text region on the superimposed feature layer to obtain the recognized text corresponding to the image to be processed may further include the following steps S1010 to S1040.

[0112] S1010. Perform text segmentation on the text region to obtain one or more single-character regions; S1020. Recognize the characters in each single-character region to obtain the character information corresponding to each single-character region; S1030. Combine the character information corresponding to each single character area according to the arrangement position of each single character area in the text area to obtain the text information corresponding to the text area; S1040. Obtain the recognized text of the image to be processed based on the text information corresponding to multiple text regions.

[0113] Specifically, the recognition text of the image to be processed can be obtained based on the text information corresponding to multiple text regions. This can be done by determining the positions of the multiple text regions in the image to be processed. For example, text regions that are close in position and distributed line by line can be spliced ​​together line by line to obtain the recognition text of the image to be processed.

[0114] Therefore, after segmenting the text region into individual character regions, the characters in each individual character region are recognized. Since the objects of recognition are all individual character regions, compared with directly recognizing the entire text region, the recognition method can be simplified and the recognition accuracy can be improved. For example, compared with the construction and training of recognizing the entire text region, recognizing individual character regions is easier to construct and train the recognition model, and can achieve better training results with a smaller amount of training data.

[0115] Figure 11 This schematically illustrates a flowchart of the steps involved in segmenting a text region to obtain one or more single-character regions, according to a certain embodiment of this application. Figure 11 As shown, based on the above embodiments, the text segmentation of the text region in step S1010 to obtain one or more single-character regions may further include the following steps S1110 to S1130.

[0116] S1110. Calculate the length-to-height ratio of the text region, which is the ratio of the length of the text region to the height of the text region; S1120. Calculate the estimated number of characters in the text region based on the aspect ratio; S1130. The text region is uniformly divided along its length according to the expected number to obtain the expected number of single-character regions.

[0117] It is understandable that characters in the same language generally have a relatively fixed length-to-height ratio. Therefore, based on the length-to-height ratio of a text region, the estimated number of characters in the text region can be approximately estimated, facilitating precise segmentation of the text region and enabling more accurate recognition of individual character regions.

[0118] Figure 12 This schematically illustrates a flowchart of the steps in a certain embodiment of this application to uniformly divide a text region along its length direction according to a predetermined number, thereby obtaining a predetermined number of single-character regions. For example... Figure 12 As shown, based on the above embodiments, step S1130, which involves uniformly cutting the text region along the length direction according to the expected number to obtain the expected number of single-character regions, may further include the following steps S1210 to S1260.

[0119] S1210. Obtain the pre-cut quantity based on the expected quantity, where the pre-cut quantity is greater than or equal to the expected quantity; S1220. Arrange candidate cutting lines evenly along the length direction on the text region according to the pre-cutting number, and the candidate cutting lines can evenly cut the text region along the length direction to obtain the pre-cutting number of candidate regions; S1230. Select candidate cutting lines with adjacent cutting lines on both sides as target cutting lines; S1240. Detect the sum of the distances between the target cutting line and the adjacent candidate cutting lines on both sides; S1250. When the ratio of the total distance to the height of the text area is greater than or equal to a preset ratio, the target cutting line is retained; S1260. When the ratio of the total distance to the height of the text area is less than a preset ratio, the target cutting line is discarded.

[0120] Therefore, considering that the interval between two characters generally has a minimum interval, the empirical value of the ratio between the minimum interval between two characters and the height of the text line composed of the characters is used as a preset ratio. By executing the method from steps S1210 to S1260, the candidate cutting lines can be screened, thereby improving the accuracy of cutting single character regions and thus improving the character recognition accuracy.

[0121] Figure 13 This schematically illustrates a flowchart of the steps involved in recognizing text in various text regions on an overlay feature layer, as described in a certain embodiment of this application, to obtain the recognized text corresponding to the image to be processed. For example... Figure 13As shown, based on the above embodiments, the method is applied to the automated processing of complaint forms, and the image to be processed includes the image in the complaint form; after step S250 identifies the text in each text region on the superimposed feature layer and obtains the identified text corresponding to the image to be processed, it may further include the following steps S1310 to S1320.

[0122] S1310. Input the recognition text corresponding to the image to be processed into the pre-trained neural network model to obtain the complaint validity label and complaint risk label corresponding to the complaint form containing the image to be processed; S1320. Store the complaint validity label and complaint risk label corresponding to the complaint form, as well as the subject corresponding to the complaint form, in the complaint form database.

[0123] Complaint validity labels can include valid complaint labels and invalid complaint labels. Complaint risk labels can include empty category labels, dating scam risk labels, gambling risk labels, pornography risk labels, transaction dispute risk labels, etc.

[0124] The neural network model can include a first sub-neural network model and a second sub-neural network model. The first sub-neural network model can be a pre-trained model such as BERT (Bidirectional Encoder Representation from Transformers), capable of semantic understanding and text classification of the recognized text corresponding to the image to be processed, obtaining a complaint effectiveness label corresponding to the recognized text. The second sub-neural network model can be a classification model such as CRF (Conditional Random Fields), capable of semantic understanding, information extraction, and text classification of the recognized text corresponding to the image to be processed, obtaining a complaint risk label corresponding to the recognized text.

[0125] In some implementations, the text corresponding to the image to be processed can be cleaned and denoised before being input into a pre-trained neural network model. Specifically, data cleaning may include removing illegal characters, stop words, emoticons, etc., from the text corresponding to the image to be processed, and then correcting typos and cleaning symbols in the text.

[0126] In some implementations, the pre-trained neural network model can be deployed on a near real-time platform to output the complaint effectiveness label and complaint risk label corresponding to the complaint form at the hourly level, and the complaint effectiveness label and complaint risk label corresponding to the complaint form, as well as the subject corresponding to the complaint form, can be stored in the complaint form database.

[0127] Figure 14Schematically illustrates the internal structure diagram of the first sub-neural network model according to an embodiment of the present application. Specifically, the recognized text corresponding to the image to be processed is subjected to word segmentation processing and then input into the first sub-neural network model. For example, if the recognized text corresponding to the image to be processed is: "Hello, my name is Zhang San.", after performing word segmentation processing on the recognized text "Hello, my name is Zhang San." corresponding to the image to be processed, "[CLS] / Hello / , / my / name / is / Zhang San / . / [SEP]" is obtained. Then let X1="Hello", X2=",", X3="my", X4="name", X5="Zhang San", X6=".", XN="[SEP]", and input them into the Figure 14 first sub-neural network model shown in the figure. X[CLS] is embedded and encoded to obtain the code E[CLS] of X[CLS], X1 is embedded and encoded to obtain the code E1 of X1, ... XN is embedded and encoded to obtain the code EN of XN, and so on. Then E[CLS], E1...EN are input into the transformer neural network to obtain the corresponding text features C, T1...TN, and then the complaint validity label of the recognized text "Hello, my name is Zhang San." corresponding to the image to be processed is obtained according to the text features C, T1...TN.

[0128] Figure 15 Schematically illustrates the internal structure diagram of the second sub-neural network model according to an embodiment of the present application. For example, if the recognized text corresponding to the image to be processed is: "I am from City A.", after performing word segmentation processing on the recognized text "I am from City A." corresponding to the image to be processed, "I / am from / City A / ." is obtained. Then let X1="I", X2="am from", X3="City A", X4=".", and input them into the Figure 15 first sub-neural network model shown in the figure. X1 is embedded and encoded to obtain the code E1 of X1, X2 is embedded and encoded to obtain the code E2 of X2, ... XN is embedded and encoded to obtain the code EN of XN, and so on. Then E1, E2...EN are input into the transformer neural network to obtain the corresponding text features T1, T2...TN, and then the text features T1, T2...TN are input into the neural network composed of multiple LSTMs to obtain the corresponding type features C1, C2...CN. Finally, the complaint risk label of the recognized text "I am from City A." corresponding to the image to be processed is obtained according to the type features C1, C2...CN. The complaint risk labels may include a null classification label, a dating fraud risk label, a gambling risk label, an pornography risk label, a transaction dispute risk label, and the like.

[0129] Therefore, by performing text recognition on the images in the complaint form and inputting the recognized text corresponding to the image to be processed into a pre-trained neural network model, the complaint validity label and complaint risk label of the recognized text corresponding to the image to be processed can be obtained, thereby realizing the automated processing of complaint forms. This can save the labor cost of manual review of complaint forms and improve the processing efficiency of complaint forms through automation, so as to stop the loss of high-risk complaint orders in a timely manner.

[0130] It is understandable that the text contained in the complaint form may be transaction content information or pre-transaction communication content. Therefore, the embodiments of this application can effectively identify the merchant's malice and the merchant's transaction category, and obtain the complaint validity label and complaint risk label of the identified text corresponding to the image to be processed, so as to realize the automated processing of complaint forms.

[0131] Furthermore, this application can achieve accurate recognition of text in the image to be processed, thus reducing the loss of effective information in complaint images and improving the accuracy and rationality of automated processing of complaint forms.

[0132] In one application scenario, online payment fraud involving pornography, gambling, and drugs persists. Identifying and combating these fraudulent merchants using effective information is a significant challenge. When users notice irregularities during transactions, they typically file complaints. These complaints often contain images with substantial textual information. Therefore, this application aims to effectively identify a merchant's malicious intent and transaction category, deriving complaint validity and risk labels corresponding to the identified text in the image. This automated processing of complaints facilitates precise, timely, and comprehensive action against these fraudulent activities.

[0133] Figure 16 This schematically illustrates a flowchart of the steps involved in storing the complaint validity label and complaint risk label corresponding to the complaint form, as well as the subject corresponding to the complaint form, into the complaint form database in a certain embodiment of this application. Figure 16 As shown, based on the above embodiments, after storing the complaint validity label and complaint risk label corresponding to the complaint form and the subject corresponding to the complaint form into the complaint form database in step S1320, the following steps S1610 to S1630 may be further included.

[0134] S1610. Obtain the information flow data and fund flow data of the transaction orders, where each transaction order corresponds to a target entity; S1620. Search the complaint database based on the target subject to obtain the target complaint corresponding to the target subject, as well as the complaint validity label and complaint risk label of the target complaint; S1630. Input the information flow data and fund flow data of the transaction order, as well as the complaint validity label and complaint risk label corresponding to the target entity, into the pre-trained decision tree model to obtain risk strategy suggestions corresponding to the target entity. The risk strategy suggestions include one or more of the following: trusting the transaction order, limiting the transaction order amount, punishing the transaction order, intercepting the transaction order, and reminding the transaction risk.

[0135] Figure 17 This illustration schematically demonstrates how, in a certain embodiment of this application, information flow data and fund flow data of transaction orders, as well as complaint validity labels and complaint risk labels corresponding to the target entity, are input into a pre-trained decision tree model to obtain risk strategy suggestions corresponding to the target entity. For example... Figure 17 As shown, after obtaining a complaint form and performing text recognition on the image within it, the recognized text corresponding to the image to be processed is input into the first sub-neural network model to obtain a complaint effectiveness label for the recognized text corresponding to the image to be processed. The recognized text corresponding to the image to be processed is then input into the second sub-neural network model to obtain a complaint risk label for the recognized text corresponding to the image to be processed. Then, the complaint effectiveness label and complaint risk label corresponding to the complaint form, along with the subject of the complaint form, are stored in the complaint form database. The real-time strategy engine can acquire transaction order information flow data and fund flow data in real time, and search the complaint form database based on the target subject corresponding to the transaction order to obtain the target complaint form corresponding to the target subject, as well as the corresponding complaint effectiveness label and complaint risk label. Finally, the transaction order information flow data, fund flow data, and the complaint effectiveness label and complaint risk label corresponding to the target subject are input into the pre-trained decision tree model or scoring card model included in the real-time strategy engine to obtain risk strategy suggestions corresponding to the target subject. These risk strategy suggestions include one or more of the following: trusting the transaction order, limiting the transaction order amount, penalizing the transaction order, intercepting the transaction order, and alerting the user to transaction risks.

[0136] Specifically, different levels of automatic penalties can be applied based on the different risk tags of the target entities corresponding to the transaction orders. Merchants with more valid complaint tags can be subject to more severe penalties such as closing payment permissions and imposing fines, while merchants with fewer valid complaint tags can be subject to more lenient penalties such as limiting credit limits or intercepting and alerting abnormal orders. This achieves risk control for real-time transactions.

[0137] Therefore, the complaint validity label and complaint risk label corresponding to the complaint form, as well as the subject corresponding to the complaint form, are stored in the complaint form database. This allows for searching the complaint form database based on the target subject to obtain the target complaint form corresponding to the target subject, as well as the complaint validity label and complaint risk label associated with the target complaint form. Then, the information flow data and fund flow data of the transaction order, along with the complaint validity label and complaint risk label corresponding to the target subject, are input into a pre-trained decision tree model to obtain risk strategy suggestions corresponding to the target subject. This model can generate automatic processing strategies based on multiple types of risk labels, whether the complaint is valid, and other transaction information of the merchant. This is beneficial for establishing a tiered penalty system for abnormal merchants and realizing the automated processing of abnormal transaction orders.

[0138] It should be noted that although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0139] The following describes an apparatus embodiment of this application, which can be used to perform the image text recognition method described in the above embodiments of this application. Figure 18 A schematic block diagram of the image text recognition device provided in an embodiment of this application is shown. Figure 18 As shown, the image text recognition device 1800 includes: The layer segmentation module 1810 is configured to convert the image to be processed into a grayscale image, and to segment the grayscale image into grayscale layers corresponding to each layer interval according to the layer interval to which the grayscale value of each pixel in the grayscale image belongs. The layer interval is used to represent the range of grayscale values ​​of the pixels in the corresponding grayscale layer. The erosion module 1820 is configured to perform image erosion on each grayscale layer to obtain the feature layer corresponding to each grayscale layer. The feature layer includes multiple connected regions, which are regions containing multiple pixels with connected relationships. The feature overlay module 1830 is configured to overlay various feature layers to obtain an overlay feature layer, which includes multiple connected regions. The expansion module 1840 is configured to expand each connected region on the superimposed feature layer in a preset direction to obtain a text region. The text recognition module 1850 is configured to recognize the text in each text region on the overlay feature layer to obtain the recognized text corresponding to the image to be processed.

[0140] In some embodiments of this application, based on the above embodiments, the image text recognition device further includes: The minimum value determination unit is configured to determine one or more minimum values ​​among the distribution frequencies of each gray value in the gray-scale image based on the gray value of each pixel in the gray-scale image. The full value range determination unit is configured to determine the minimum value of the full value range based on the minimum gray value of the grayscale image; and to determine the maximum value of the full value range based on the maximum gray value of the grayscale image. The layer range acquisition unit is configured to divide the full value range into multiple layer ranges based on the grayscale values ​​corresponding to each minimum value.

[0141] In some embodiments of this application, based on the above embodiments, the layer interval acquisition unit includes: The sorting sub-unit is configured to sort the minimum value of the full value range, the minimum value of the full value range, and the gray values ​​corresponding to each minimum value in ascending or descending order; The layer interval segmentation sub-unit is configured to use two adjacent sorted gray values ​​as the two interval endpoints corresponding to the layer interval, and to divide the full value range to obtain multiple layer intervals that are connected end to end and do not overlap.

[0142] In some embodiments of this application, based on the above embodiments, the minimum value determination unit includes: The frequency distribution determination subunit is configured to calculate the frequency distribution of each gray value based on the gray value of each pixel in the grayscale image. The distribution function acquisition sub-unit is configured to obtain the corresponding distribution function based on the distribution frequency of each gray value in the grayscale image; The smooth curve acquisition sub-unit is configured to perform function smoothing on the distribution function to obtain the smooth curve corresponding to the distribution function; The minimum value acquisition subunit is configured to identify each trough of the smooth curve and take the value of the point corresponding to each trough as the minimum value in the distribution frequency of each gray value in the grayscale image.

[0143] In some embodiments of this application, based on the above embodiments, the corrosion module includes: The binary layer acquisition unit is configured to determine a target threshold in the gray value range of the gray layer, and to correspond gray values ​​in the gray layer that are greater than or equal to the target threshold to a first value, and to correspond gray values ​​in the gray layer that are less than the target threshold to a second value, thereby forming a binary layer corresponding to the gray layer. The labeled connected region acquisition unit is configured to perform image erosion on the binary image to obtain a labeled connected region composed of multiple pixels with gray values ​​of the first value; The erosion unit is configured to retain pixel values ​​in the grayscale layer that are located at the marked connected regions of the corresponding binary layer, and discard pixel values ​​in the grayscale layer that are located outside the marked connected regions of the corresponding binary layer.

[0144] In some embodiments of this application, based on the above embodiments, the preset direction is horizontal or vertical, and the expansion module includes: The circumscribed rectangle acquisition unit is configured to acquire the circumscribed rectangle of the connected region, expand the connected region to fill the circumscribed rectangle, and the circumscribed rectangle is a rectangle that is circumscribed to the connected region in a preset direction; The nearest connected component acquisition unit is configured to acquire the nearest connected component of the connected component, where the nearest connected component is the connected component with the shortest distance from the connected component. The text region acquisition unit is configured to expand the connected region toward the direction of the nearest connected region when the direction of the nearest connected region relative to the connected region is a preset direction, so as to obtain the text region.

[0145] In some embodiments of this application, based on the above embodiments, the text recognition module includes: The text segmentation unit is configured to segment a text region to obtain one or more single-word regions. The character recognition unit is configured to recognize the characters in each single-character region and obtain the character information corresponding to each single-character region; The text information acquisition unit is configured to combine the character information corresponding to each single character region according to the arrangement position of each single character region in the text region to obtain the text information corresponding to the text region. The text recognition acquisition unit is configured to acquire the recognition text of the image to be processed based on the text information corresponding to multiple text regions.

[0146] In some embodiments of this application, based on the above embodiments, the text segmentation unit includes: The length-to-height ratio calculation subunit is configured to calculate the length-to-height ratio of the text region, which is the ratio of the length of the text region to the height of the text region. The character estimation subunit is configured to calculate the estimated number of characters in the text region based on the aspect ratio; The single-character region acquisition sub-unit is configured to uniformly cut the text region along the length direction according to the expected number, thereby obtaining the expected number of single-character regions.

[0147] In some embodiments of this application, based on the above embodiments, the single-word region acquisition subunit includes: The pre-cut quantity acquisition subunit is configured to acquire the pre-cut quantity based on the expected quantity, where the pre-cut quantity is greater than or equal to the expected quantity. The cutting lines are evenly arranged sub-units and are configured to evenly arrange candidate cutting lines in the length direction on the text region according to the pre-cut number. The candidate cutting lines can evenly cut the text region in the length direction to obtain the pre-cut number of candidate regions. The target cutting line acquisition sub-unit is configured to take candidate cutting lines with adjacent cutting lines on both sides as target cutting lines; The distance summation calculation subunit is configured to detect the sum of distances between the target cutting line and the adjacent candidate cutting lines on both sides; The target cutting line retention sub-unit is configured to retain the target cutting line when the ratio of the sum of distances to the height of the text area is greater than or equal to a preset ratio; The target cutting line discard sub-unit is configured to discard the target cutting line when the ratio of the total distance to the height of the text area is less than a preset ratio.

[0148] In some embodiments of this application, based on the above embodiments, the feature overlay module includes: The superimposed feature layer acquisition unit is configured to superimpose various feature layers to obtain a superimposed feature layer. The merged connected region acquisition unit is configured to merge connected regions on the superimposed feature layer with a spacing distance smaller than a preset distance into a merged connected region. The area percentage calculation unit is configured to calculate the area of ​​the connected regions from each feature layer in the merged connected region, and to calculate the area percentage corresponding to each feature layer. The area percentage is the ratio of the area of ​​the connected region at the corresponding position of the feature layer to the area of ​​the merged connected region. The connected region replacement unit is configured to replace the merged connected region with the connected region at the corresponding position of the feature layer with the largest area ratio.

[0149] In some embodiments of this application, based on the above embodiments, the method is applied to the automated processing of complaint forms, and the image to be processed includes the image in the complaint form; the image text recognition device further includes: The label classification unit is configured to input the recognition text corresponding to the image to be processed into a pre-trained neural network model to obtain the complaint validity label and complaint risk label corresponding to the complaint form containing the image to be processed; The complaint form database storage unit is configured to store the complaint validity label and complaint risk label corresponding to the complaint form, as well as the subject corresponding to the complaint form, into the complaint form database.

[0150] In some embodiments of this application, based on the above embodiments, the image text recognition device further includes: The transaction data acquisition unit is configured to acquire information flow data and fund flow data of transaction orders, where each transaction order corresponds to a target entity. The tag search unit is configured to search the complaint form database based on the target subject to obtain the target complaint form corresponding to the target subject, as well as the complaint validity tag and complaint risk tag of the target complaint form; The risk strategy suggestion acquisition unit is configured to input the information flow data and fund flow data of the transaction order, as well as the complaint validity label and complaint risk label corresponding to the target entity, into a pre-trained decision tree model to obtain risk strategy suggestions corresponding to the target entity. The risk strategy suggestions include one or more of the following: trusting the transaction order, limiting the transaction order amount, penalizing the transaction order, intercepting the transaction order, and reminding the transaction risk.

[0151] The specific details of the image text recognition devices provided in the various embodiments of this application have been described in detail in the corresponding method embodiments, and will not be repeated here.

[0152] Figure 19 A schematic block diagram of a computer system architecture for implementing an electronic device according to embodiments of the present application is shown.

[0153] It should be noted that, Figure 19 The computer system 1900 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0154] like Figure 19 As shown, the computer system 1900 includes a central processing unit (CPU) 1901, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1902 or programs loaded from storage section 1908 into random access memory (RAM) 1903. The RAM 1903 also stores various programs and data required for system operation. The CPU 1901, ROM 1902, and RAM 1903 are interconnected via a bus 1904. An input / output interface 1905 (I / O interface) is also connected to the bus 1904.

[0155] The following components are connected to the input / output interface 1905: an input section 1906 including a keyboard, mouse, etc.; an output section 1907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1908 including a hard disk, etc.; and a communication section 1909 including a network interface card such as a local area network card, modem, etc. The communication section 1909 performs communication processing via a network such as the Internet. A drive 1910 is also connected to the input / output interface 1905 as needed. Removable media 1911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on the drive 1910 as needed so that computer programs read from them can be installed into the storage section 1908 as needed.

[0156] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1909, and / or installed from removable medium 1911. When the computer program is executed by central processing unit 1901, it performs various functions defined in the system of this application.

[0157] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0158] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0159] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0160] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.

[0161] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.

[0162] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. An image text recognition method, characterized by, include: The image to be processed is converted into a grayscale image, and the grayscale image is divided into grayscale layers corresponding to each of the layer intervals according to the layer interval to which the grayscale value of each pixel in the grayscale image belongs. The layer interval is used to represent the range of grayscale values ​​of the pixels in the corresponding grayscale layer. A target threshold is determined within the grayscale value range of the grayscale layer, and grayscale values ​​in the grayscale layer that are greater than or equal to the target threshold are assigned to a first value, while grayscale values ​​in the grayscale layer that are less than the target threshold are assigned to a second value, thus forming a binary layer corresponding to the grayscale layer. Image erosion is performed on the binary image to obtain a marked connected region composed of multiple pixels with gray values ​​of the first value; The pixel values ​​in the grayscale layer located at the position of the marked connected region corresponding to the binary layer are retained, and the pixel values ​​in the grayscale layer located outside the position of the marked connected region corresponding to the binary layer are discarded, thereby obtaining the feature layer corresponding to each grayscale layer. The feature layer includes multiple connected regions, and the connected region is a region including multiple pixels with connected relationships. The various feature layers are superimposed to obtain a superimposed feature layer, which includes multiple connected regions. Connected regions on the superimposed feature layer with a spacing less than a preset distance are merged into a merged connected region; Calculate the area of ​​the connected regions from each feature layer in the merged connected region, and calculate the area ratio corresponding to each feature layer. The area ratio is the ratio of the area of ​​the connected region at the corresponding position of the feature layer to the area of ​​the merged connected region. Replace the merged connected region with the connected region at the corresponding position of the feature layer with the largest area ratio; The text region is obtained by expanding each connected region on the superimposed feature layer in a preset direction. The text in each of the text regions on the superimposed feature layer is recognized to obtain the recognized text corresponding to the image to be processed.

2. The method according to claim 1, characterized in that, Before segmenting the grayscale image into grayscale layers corresponding to each of the layer intervals based on the grayscale values ​​of each pixel, the method further includes: Based on the grayscale value of each pixel in the grayscale image, determine one or more minimum values ​​among the distribution frequencies of each grayscale value in the grayscale image; The minimum value of the full value range is determined based on the minimum gray value of the grayscale image; the maximum value of the full value range is determined based on the maximum gray value of the grayscale image. Based on the grayscale value corresponding to each of the minimum values, the range of the full value is divided into multiple layer intervals.

3. The method according to claim 2, characterized in that, The step of dividing the full value range into multiple layer intervals based on the grayscale values ​​corresponding to each of the minimum values ​​includes: Sort the minimum value of the full value range, the maximum value of the full value range, and the gray values ​​corresponding to each minimum value in ascending or descending order; By using two adjacent grayscale values ​​as the endpoints of the corresponding layer intervals, the full value range is divided to obtain multiple layer intervals that are connected end to end and do not overlap.

4. The method according to claim 2, characterized in that, The step of determining one or more minimum values ​​among the distribution frequencies of each grayscale value in the grayscale image based on the grayscale values ​​of each pixel includes: Calculate the distribution frequency of each gray value based on the gray value of each pixel in the grayscale image; The distribution function is obtained based on the frequency of each gray value in the grayscale image. Smooth the distribution function to obtain the smoothed curve corresponding to the distribution function; Each trough of the smooth curve is identified, and the value of the point corresponding to each trough is taken as the minimum value in the distribution frequency of each gray value in the grayscale image.

5. The method according to claim 1, characterized in that, The preset direction is either horizontal or vertical. Expanding each connected region on the superimposed feature layer according to the preset direction to obtain the text region includes: Obtain the circumscribed rectangle of the connected region, and expand the connected region to fill the circumscribed rectangle, wherein the circumscribed rectangle is a rectangle that is externally tangent to the connected region in a preset direction; Obtain the nearest neighboring connected region of the connected region, wherein the nearest neighboring connected region is the connected region with the shortest interval distance to the connected region; When the direction of the nearest connected region relative to the connected region is a preset direction, the connected region is expanded in the direction of the nearest connected region to obtain the text region.

6. The method according to claim 1, characterized in that, The step of recognizing the text in each of the text regions on the superimposed feature layer to obtain the recognized text corresponding to the image to be processed includes: The text region is segmented to obtain one or more single-character regions; The characters in each of the single-character regions are identified to obtain the character information corresponding to each of the single-character regions; The character information corresponding to each of the single character regions is combined according to the arrangement position of each of the single character regions in the text region to obtain the text information corresponding to the text region; Based on the text information corresponding to the multiple text regions, the recognition text of the image to be processed is obtained.

7. The method according to claim 6, characterized in that, The step of segmenting the text region to obtain one or more single-character regions includes: Calculate the length-to-height ratio of the text region, where the length-to-height ratio is the ratio of the length of the text region to the height of the text region; Calculate the estimated number of characters in the text region based on the aspect ratio; The text region is uniformly divided along its length according to the expected number to obtain the expected number of single-character regions.

8. The method according to claim 7, characterized in that, The step of uniformly dividing the text region along its length direction according to the estimated number to obtain the estimated number of single-character regions includes: The pre-cut quantity is obtained based on the expected quantity, and the pre-cut quantity is greater than or equal to the expected quantity; Candidate cutting lines are evenly arranged along the length of the text region according to the pre-cutting number, and the candidate cutting lines can evenly cut the text region along the length to obtain the pre-cutting number of candidate regions. Select candidate cutting lines with adjacent cutting lines on both sides as target cutting lines; Detect the sum of the distances between the target cutting line and the adjacent candidate cutting lines on both sides; When the ratio of the sum of the distances to the height of the text region is greater than or equal to a preset ratio, the target cutting line is retained; When the ratio of the sum of the distances to the height of the text region is less than a preset ratio, the target cutting line is discarded.

9. The method according to any one of claims 1-8, characterized in that, The method is applied to the automated processing of complaint forms, where the image to be processed includes the image in the complaint form; after recognizing the text in each text region on the overlay feature layer to obtain the recognized text corresponding to the image to be processed, the method further includes: The recognition text corresponding to the image to be processed is input into a pre-trained neural network model to obtain the complaint validity label and complaint risk label corresponding to the complaint form containing the image to be processed; The complaint validity label and complaint risk label corresponding to the complaint form, as well as the subject corresponding to the complaint form, are stored in the complaint form database.

10. The method according to claim 9, characterized in that, After storing the complaint validity label and complaint risk label corresponding to the complaint form, and the entity corresponding to the complaint form, in the complaint form database, the method further includes: Acquire information flow data and fund flow data of transaction orders, wherein the transaction orders correspond to the target entity; Search the complaint database based on the target subject to obtain the target complaint corresponding to the target subject, as well as the complaint validity label and complaint risk label of the target complaint. The information flow data and fund flow data of the transaction order, as well as the complaint validity label and complaint risk label corresponding to the target entity, are input into a pre-trained decision tree model to obtain risk strategy suggestions corresponding to the target entity. The risk strategy suggestions include one or more of the following: trusting the transaction order, limiting the transaction order amount, penalizing the transaction order, intercepting the transaction order, and reminding the transaction risk.

11. An image text recognition device, characterized in that, include: The layer segmentation module is configured to convert the image to be processed into a grayscale image, and to segment the grayscale image into grayscale layers corresponding to each layer interval according to the layer interval to which the grayscale value of each pixel in the grayscale image belongs. The layer interval is used to represent the range of grayscale values ​​of the pixels in the corresponding grayscale layer. The erosion module is configured to determine a target threshold within the grayscale value range of the grayscale layer, and to assign grayscale values ​​in the grayscale layer greater than or equal to the target threshold to a first value, and grayscale values ​​in the grayscale layer less than the target threshold to a second value, thereby forming a binary layer corresponding to the grayscale layer; to perform image erosion on the binary image to obtain a marked connected region composed of multiple pixels with grayscale values ​​of the first value; to retain the pixel values ​​in the grayscale layer located at the positions of the marked connected regions corresponding to the binary layer, and to discard the pixel values ​​in the grayscale layer located outside the positions of the marked connected regions corresponding to the binary layer, thereby obtaining a feature layer corresponding to each grayscale layer, wherein the feature layer includes multiple connected regions, and each connected region is a region comprising multiple pixels with connected relationships; A feature overlay module is configured to overlay the various feature layers to obtain an overlay feature layer, the overlay feature layer including multiple connected regions; merge connected regions on the overlay feature layer with a spacing of less than a preset distance into a merged connected region; calculate the area of ​​the connected regions from each feature layer in the merged connected region, and calculate the area percentage corresponding to each feature layer, the area percentage being the ratio of the area of ​​the connected region at the corresponding position of the feature layer to the area of ​​the merged connected region; replace the merged connected region with the connected region at the corresponding position of the feature layer with the largest area percentage; The expansion module is configured to expand each connected region on the superimposed feature layer in a preset direction to obtain a text region. The text recognition module is configured to recognize the text in each of the text regions on the superimposed feature layer to obtain the recognized text corresponding to the image to be processed.

12. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the image text recognition method according to any one of claims 1 to 10.

13. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the image text recognition method according to any one of claims 1 to 10 by executing the executable instructions.

14. A computer program product, characterized in that, Includes computer instructions, which are stored in a computer-readable storage medium; The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the image text recognition method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Handwritten Chinese character image recognition method and device, computer device and storage medium

    CN109002756A

  • Chinese model train, Chinese image recognition method, device, equipment and medium

    CN109102037A

  • Image processing method and device, electronic device and computer readable medium

    CN110222694A

  • Financial risk verification processing method and apparatus, computer device, and storage medium

    WO2020000688A1