Table image processing method and equipment

By segmenting and encoding table images, and utilizing the multi-modal recognition capabilities of large models, intelligent table recognition that does not rely on OCR is realized, which solves the problem of limited table recognition accuracy in the existing technology and improves the accuracy of table recognition. accuracy and stability.

CN118658171APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410271409.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-08
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In the existing technology, the accuracy of table recognition of table images is limited by the accuracy of OCR recognition technology. Complex table images are difficult to accurately recognize in OCR recognition, resulting in low table recognition accuracy.

Method used

By segmenting and resizing the table image, a sub-table image and a target table image with the target size are generated and encoded. The table recognition model is used for table recognition. Combined with the multi-modal recognition capabilities of the large model, various Smart form recognition relying on OCR.

Benefits of technology

It improves the table recognition accuracy of table images, avoids the influence of OCR recognition errors, retains the image features of table images, and enhances the ability to identify local and overall feature relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118658171A
    Figure CN118658171A
Patent Text Reader

Abstract

The invention provides a table image processing method and equipment, and the method comprises the steps: segmenting a table image, obtaining M sub-table images with a target size, M being an integer greater than 1, and the target size being an image input size corresponding to a table recognition model; adjusting the size of the table image to obtain a target table image with the target size; encoding the M sub-table images to obtain M sub-table image features, and encoding the target table image to obtain target table image features; performing table recognition on the target table image features and the M sub-table image features through the table recognition model to obtain a table recognition result of the table image; according to the invention, the table recognition accuracy of the table image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular to a method and device for processing table images. Background Art

[0002] Tables are the most common and intuitive form of information organization in documents. They contain a lot of structured information of users. Obtaining this structured information helps to build a huge database for data storage and management. Optical Character Recognition (OCR) is used to perform OCR recognition on table images, and the table content can be recognized based on the OCR recognition results. Summary of the invention

[0003] The embodiments of the present application provide a method, device, electronic device, computer-readable storage medium and computer program product for processing a table image, which can improve the table recognition accuracy of the table image.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application embodiment provides a method for processing a table image, including:

[0006] Segment the table image to obtain M sub-table images with target sizes, where M is an integer greater than 1, and the target size is the image input size corresponding to the table recognition model;

[0007] resizing the table image to obtain a target table image having the target size;

[0008] Encoding the M sub-table images to obtain M sub-table image features, and encoding the target table image to obtain target table image features;

[0009] The table recognition model is used to perform table recognition on the target table image features and the M sub-table image features to obtain a table recognition result of the table image.

[0010] The present application also provides a table image processing device, including:

[0011] A segmentation module, used for segmenting the table image to obtain M sub-table images with a target size, where M is an integer greater than 1, and the target size is the image input size corresponding to the table recognition model;

[0012] An adjustment module, used for adjusting the size of the table image to obtain a target table image with the target size;

[0013] An encoding module, used for encoding the M sub-table images to obtain M sub-table image features, and encoding the target table image to obtain target table image features;

[0014] The table recognition module is used to perform table recognition on the target table image features and the M sub-table image features through the table recognition model to obtain a table recognition result of the table image.

[0015] The present application also provides an electronic device, including:

[0016] A memory for storing computer executable instructions;

[0017] The processor is used to implement the table image processing method provided in the embodiment of the present application when executing the computer executable instructions stored in the memory.

[0018] An embodiment of the present application also provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the method for processing the table image provided in the embodiment of the present application is implemented.

[0019] An embodiment of the present application also provides a computer program product, including computer executable instructions or a computer program. When the computer executable instructions or the computer program are executed by a processor, the table image processing method provided in the embodiment of the present application is implemented.

[0020] The embodiments of the present application have the following beneficial effects:

[0021] Using the embodiment of the present application, the table image is first segmented to obtain M sub-table images with a target size, and the table image is resized to obtain a target table image with a target size, where the target size is a model input size corresponding to a table recognition model; the M sub-table images are then encoded to obtain M sub-table image features, and the target table image is encoded to obtain target table image features; finally, table recognition is performed on the target table image features and the M sub-table image features through the table recognition model to obtain a table recognition result of the table image.

[0022] Here, (1) a table recognition model is used to realize table recognition of table images, without relying on OCR recognition technology, thus avoiding the influence of OCR recognition error on table recognition; (2) the table image is segmented using the image input size of the table recognition model so that the sub-table image has a target size and can adapt to the input size of the table recognition model, thus avoiding the compression deformation caused by compressing the table image to the target size in order to enable the table recognition model to process the image features of the table image, thereby ensuring that the image features of the table image can be better preserved; (3) the table recognition model is used to perform table recognition on the target table image features and M sub-table image features, so that the table recognition model can pay attention to the relationship between the local features of the table image (i.e., each sub-table image feature) and the overall features of the table image (i.e., the target table image feature). In this way, the accuracy of table recognition of table images can be improved through the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a schematic diagram of the architecture of a table image processing system provided in an embodiment of the present application;

[0024] Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0025] Figure 3 It is a flowchart of a method for processing a table image provided in an embodiment of the present application;

[0026] Figure 4 is a schematic diagram of a table image provided in an embodiment of the present application;

[0027] Figure 5 It is a flowchart of a method for processing a table image provided in an embodiment of the present application;

[0028] Figure 6 It is a flowchart of a method for processing a table image provided in an embodiment of the present application;

[0029] Figure 7 It is a flowchart of a method for processing a table image provided in an embodiment of the present application;

[0030] Figure 8 It is a flowchart of a method for processing a table image provided in an embodiment of the present application;

[0031] Fig. 9 It is a flowchart of a method for processing a table image provided in an embodiment of the present application;

[0032] Fig.10 It is a schematic diagram of image segmentation provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0034] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0035] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0036] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0037] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0038] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0039] 1) Client: Also known as the user end, it refers to the program that provides local services to users corresponding to the server. Except for some applications that can only run locally, it is generally installed on an ordinary client and needs to cooperate with the server to run. That is, there must be corresponding servers and service programs in the network to provide corresponding services. In this way, specific communication connections need to be established on the client and server sides to ensure the normal operation of the application.

[0040] 2) Artificial Intelligence (AI): It is a comprehensive technology in computer science. By studying the design principles and implementation methods of various intelligent machines, machines are given the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline, generally including sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, the pre-trained model can be a large model or a basic model, which can be widely used in downstream tasks in various directions of artificial intelligence after fine-tuning. Large models include multimodal large language models (LLM), which are language models characterized by their huge scale, capable of containing billions of parameters and building complex artificial neural networks. These networks are driven by AI algorithms that use deep learning technology and use huge data sets to evaluate, standardize and generate relevant content, as well as make accurate predictions.

[0041] 3) OCR recognition: refers to the process in which an electronic device (such as a scanner or digital camera) examines characters printed on paper, determines their shapes by detecting dark and light patterns, and then uses character recognition methods to translate the shapes into computer text; that is, for printed characters, an optical method is used to convert the text in a paper document into a black and white dot matrix image file, and the recognition software is used to convert the text in the image into a text format for further editing and processing by word processing software.

[0042] 4) Table image: refers to an image that includes a table, that is, a table in image form.

[0043] 5) Table recognition (also known as table understanding): artificial intelligence technology is used to recognize tables in table images (including table area detection, table content recognition, and table structure recognition), so that electronic devices (such as laptops, smart phones, etc.) can understand the content and meaning of the table in the table image. For example, it may include: the structural information of the table (including rows, columns, cells, hierarchical structures, etc.), the content in the cells (including text, images, etc.), the entities in the table and the attributes of the entities, the relationship between the entities, etc.

[0044] 6) Large models: Large models refer to machine learning models with large-scale parameters and complex computational structures. These models are usually built with deep neural networks and have billions or even hundreds of billions of parameters. Large models are designed to improve the expressiveness and predictive performance of the model and to handle more complex tasks and data. Large models are widely used in various fields, including natural language processing, computer vision, speech recognition, and recommendation systems. Large models learn complex patterns and features by training massive amounts of data, have stronger generalization capabilities, and can make accurate predictions on unseen data.

[0045] Small models: Small models usually refer to models with fewer parameters and shallower layers. They are lightweight, efficient, and easy to deploy. They are suitable for scenarios with small data volumes and limited computing resources, such as mobile applications, embedded devices, and the Internet of Things. When the training data and parameters of the model continue to expand until a certain critical scale is reached, it exhibits some unpredictable and more complex capabilities and characteristics. The model can automatically learn from the original training data and discover new, higher-level features and patterns. This ability is called "emergence capability." Machine learning models with emergence capabilities are considered to be large models in an independent sense, which is the biggest difference between them and small models. Compared with small models, large models usually have more parameters and deeper layers, and have stronger expressive power and higher accuracy, but they also require more computing resources and time for training and reasoning. They are suitable for scenarios with large data volumes and sufficient computing resources, such as cloud computing, high-performance computing, and artificial intelligence.

[0046] Tables are the most common and intuitive form of information organization in documents. They contain a lot of structured information about users. Obtaining this structured information helps build a huge database to store and manage data. In some scenarios, what can be obtained is usually a table document in the form of an image. So how to make the computer understand the table document in the form of an image is an urgent problem to be solved. In the related technology, OCR recognition is performed on the table image through OCR recognition technology, and then the table image content is recognized based on the OCR recognition result. Since table recognition depends on OCR recognition, the upper limit of the table recognition accuracy is the upper limit of the OCR recognition accuracy, resulting in low table recognition accuracy for table images.

[0047] Based on this, the embodiment of the present application provides a method for processing a table image to at least solve the above-mentioned problems. Based on the above description of the nouns and terms involved in the embodiment of the present application, the embodiment of the present application is described in detail below. The embodiment of the present application provides a method, device, electronic device, computer-readable storage medium and computer program product for processing a table image, which can improve the table recognition accuracy of the table image.

[0048] It should be noted that the collection and processing of relevant data in this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained, and subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.

[0049] The following describes a table image processing system provided by an embodiment of the present application. Figure 1 , Figure 1 1 is a schematic diagram of the architecture of the table image processing system provided in the embodiment of the present application. To support an exemplary application, the table image processing system 100 includes: a server 200, a network 300, and a terminal 400. The terminal 400 is connected to the server 200 via the network 300, and the network 300 can be a wide area network or a local area network, or a combination of the two, and a wireless or wired link is used to realize data transmission.

[0050] Here, the terminal 400 (for example, running a client) responds to a table recognition instruction for a table image (for example, triggered by a user) and sends a table recognition request for the table image to the server 200; the server 200 receives the table recognition request sent by the terminal 400; in response to the table recognition request, the table image is segmented to obtain M sub-table images with a target size, where M is an integer greater than 1, and the target size is the image input size corresponding to the table recognition model; the table image is resized to obtain a target table image with a target size; the M sub-table images are encoded to obtain M sub-table image features, and the target table image is encoded to obtain a target table image feature; table recognition is performed on the target table image features and the M sub-table image features through the table recognition model to obtain a table recognition result of the table image; the table recognition result of the table image is returned to the terminal 400; the terminal 400 receives the table recognition result of the table image returned by the server 200; and the table recognition result of the table image is displayed.

[0051] In some embodiments, the method for processing table images provided in the embodiments of the present application is implemented by an electronic device, for example, it can be implemented by a terminal alone, it can also be implemented by a server alone, or it can be implemented by a terminal and a server in collaboration. In some embodiments, the electronic device for implementing the method for processing table images provided in the embodiments of the present application can be various types of terminals or servers. Among them, the server (such as server 200) can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers. The terminal (such as terminal 400) can be a laptop, a tablet computer, a desktop computer, a smart phone, an intelligent voice interaction device (such as a smart speaker), a smart home appliance (such as a smart TV), a smart watch, a vehicle-mounted terminal, a wearable device, a virtual reality (Virtual Reality, VR) device, an aircraft, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and the embodiments of the present application are not limited to this.

[0052] In some embodiments, the processing method of the table image provided in the embodiment of the present application can be implemented with the aid of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model application, which can form a resource pool, which is used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing resources and storage resources. As an example, a server (such as server 200) can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0053] In some embodiments, the terminal or server can implement the processing method of the table image provided in the embodiment of the present application by running various computer executable instructions or computer programs. For example, the computer executable instructions can be commands, machine instructions or software instructions at the microprogram level. The computer program can be a native program or software module in the operating system; it can be a native (Native) application (Application, APP), that is, a program that needs to be installed in the operating system to run; it can also be a small program that can be embedded in any APP, that is, a program that can be run only by downloading it to the browser environment. In short, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.

[0054] The following describes an electronic device for implementing a table image processing method provided by an embodiment of the present application. Figure 2 , Figure 2 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. The electronic device 500 provided in the embodiment of the present application can be a terminal or a server. Figure 2 As shown, the electronic device 500 includes: at least one processor 510, a memory 550, at least one network interface 520 and a user interface 530. The various components in the electronic device 500 are coupled together through a bus system 540. It can be understood that the bus system 540 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 540 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 540 is not used in the following examples. Figure 2 Various buses are labeled as bus system 540 .

[0055] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0056] The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0057] The memory 550 may be removable, non-removable, or a combination thereof. The memory 550 may include one or more storage devices physically located away from the processor 510. The memory 550 includes a volatile memory or a non-volatile memory, and may also include both a volatile memory and a non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.

[0058] In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0059] Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0060] A network communication module 552, used to reach other electronic devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;

[0061] a presentation module 553 for enabling presentation of information via one or more output devices 531 (e.g., display screen, speaker, etc.) associated with the user interface 530 (e.g., a user interface for operating peripherals and displaying content and information);

[0062] The input processing module 554 is used to detect one or more user inputs or interactions from one of the one or more input devices 532 and translate the detected inputs or interactions.

[0063] In some embodiments, the table image processing device provided in the embodiments of the present application can be implemented in a software manner. Figure 2 A processing device 555 for a table image stored in a memory 550 is shown, which may be software in the form of a program or plug-in, including the following software modules: a segmentation module 5551, an adjustment module 5552, an encoding module 5553, and a table recognition module 5554. These modules are logical, and therefore may be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.

[0064] The following describes the processing method of the table image provided by the embodiment of the present application. As mentioned above, the processing method of the table image provided by the embodiment of the present application is implemented by an electronic device, for example, it can be implemented by a server or a terminal alone, or by a server and a terminal in collaboration. Therefore, the execution subject of each step will not be repeatedly described below. Figure 3 , Figure 3 : is a flow chart of a method for processing a table image provided in an embodiment of the present application. The method for processing a table image provided in an embodiment of the present application includes:

[0065] Step 101: Segment the table image to obtain M sub-table images with target sizes.

[0066] Wherein, M is an integer greater than 1, and the target size is the image input size corresponding to the table recognition model.

[0067] In practical applications, if it is necessary to perform table recognition on a table image, the user can trigger a table recognition instruction for the table image on the electronic device, and the electronic device responds to the table recognition instruction and performs table recognition processing on the table image. When performing table recognition processing on a table image, first in step 101, the table image is segmented to obtain M sub-table images with target sizes. It should be noted that the table image includes a table, and the table may include table content, such as text, images, etc. As an example, see Figure 4 , Figure 4 It is a schematic diagram of a table image provided in an embodiment of the present application. Here, the table image includes a table for recording transaction information, which includes transaction date, transaction amount, transaction location and so on.

[0068] In step 101, when the table image is segmented, the image input size corresponding to the table recognition model used for table recognition is first obtained, and then the table image is segmented according to the image input size, so as to obtain M sub-table images with a target size, and the target size is the image input size. It should be noted that the image size of the table image is larger than the target size. For example, if the image input size is 10*10 and the image size of the table image is 100*100, then (100 / 10)*(100 / 10)=100 sub-table images can be obtained by segmentation, that is, M=100. In this way, the table image is segmented using the image input size so that each sub-table image has a target size, which can not only adapt to the input resolution of the table recognition model, but also avoid the severe compression deformation caused by forcibly adjusting the table image to a specified size, thereby ensuring that the image features of the table image can be better retained, thereby improving the table recognition accuracy of the table recognition model.

[0069] In some embodiments, the table recognition model is constructed based on a large model, for example, the large model may be a multimodal large language model (LLM). Thus, by performing table recognition using a table recognition model constructed based on a large model, the table recognition accuracy of the table recognition model can be improved by leveraging the model processing capability of the large model.

[0070] In some embodiments, before segmenting a table image to obtain M sub-table images with a target size, the table image can be obtained by executing the following steps: step 201, obtaining an initial table image to be processed; step 202, performing target detection on the initial table image to determine a target area where the table in the initial table image is located; step 203, segmenting the target area from the initial table image to obtain a table image.

[0071] Here, in step 201, the initial table image to be processed is obtained. In practical applications, since the obtained initial table image may often include some areas that are irrelevant or similar to the table, in step 202, it is necessary to perform target detection on the initial table image to determine the target area where the table is located in the initial table image. Therefore, in step 203, the target area is segmented from the initial table image to obtain the table image. In this way, the influence of irrelevant content in the table image on table recognition can be reduced, the difficulty of table recognition is reduced, and the accuracy of table recognition is improved. In step 202, target detection can be achieved through a machine learning model for target detection, such as a region proposal network model (RPN), a Faster R-CNN model, and the like.

[0072] In some embodiments, see Figure 5 , step 202 can be implemented by executing the following steps 2021-2024: step 2021, extracting features from the initial table image to obtain an initial table image feature map, the initial table image feature map includes P feature points, P is an integer greater than 1; step 2022, for each feature point, determining Q candidate area boxes centered on the feature point, Q is an integer greater than 1; step 2023, from the P*Q candidate area boxes of the P feature points, determining R target candidate area boxes including the table, and performing regression processing on the R target candidate area boxes to obtain a target area box including the table; step 2024, taking the area surrounded by the target area box as the target area where the table is located in the initial table image.

[0073] Here, in step 2021, feature extraction is performed on the initial table image (for example, feature extraction is performed using a pre-trained feature extraction model, such as a high-resolution network model (High-Resolution Net, HRNet)) to obtain an initial table image feature map, which includes P feature points (i.e., P pixels in the image feature map); in actual applications, when performing feature extraction, feature map extraction of multiple feature sizes can be performed on the initial table image to obtain multiple first intermediate feature maps with different feature sizes, and then the multiple first intermediate feature maps are respectively converted into second intermediate feature maps of a target feature size (for example, the maximum feature size among the multiple feature sizes), thereby splicing the multiple second intermediate feature maps to obtain the initial table image feature map.

[0074] In step 2022, the following operations may be performed for each feature point: Q candidate area frames centered on the feature point are determined, and the sizes of the Q candidate area frames are different. In step 2023, R target candidate area frames including the table are determined from the P*Q candidate area frames of the P feature points. In practical applications, each candidate area frame may be classified and predicted by a pre-trained regional candidate network model (for example, an RPN network model), so as to determine which candidate area frames include the table and which candidate area frames do not include the table based on the classification prediction result of the classification prediction (used to indicate whether the candidate area frame includes the table), and then the candidate area frame including the table is used as the target candidate area frame. Then, the R target candidate area frames are regressed to obtain a target area frame including the table, which is the target candidate area frame that is most likely to include the table among the R target candidate area frames. Thus, in step 2024, the area surrounded by the target area frame is used as the target area where the table is located in the initial table image.

[0075] In some embodiments, the table image can be segmented by executing the following steps to obtain M sub-table images with a target size: identify the table border line in the table image to obtain a first pixel point of the table border line; determine a second pixel point within a preset range of the first pixel point, the second pixel point being a pixel point that is not a table border line point; replace the pixel value of the first pixel point with the pixel value of the second pixel point to obtain a target table image; segment the target table image according to the target size to obtain M sub-table images with a target size.

[0076] Here, when the table image is segmented, the table border line (including the horizontal border line and the vertical border line of the table) of the table in the table image is first identified to obtain the first pixel point on the table border line, thereby erasing the table border line in the table image, preventing excessive attention to the table border line during the table recognition process, reducing the interference of the table border line on the table recognition, and improving the accuracy of the table recognition. When erasing the table border line in the table image, for each first pixel point included in the table line, a second pixel point within a preset range of the first pixel point can be determined, the second pixel point is a pixel point of a non-table border line, the preset range can be a pixel neighborhood of the first pixel point, and the number of the second pixel points can be set as needed, such as 2, 4, 8, 10, etc. Then the pixel value of the first pixel point is replaced by the pixel value of the second pixel point to obtain the target table image. Specifically, when the number of the second pixel points is at least one, the pixel value of each second pixel point can be obtained, and the pixel average value of the pixel value of the second pixel point is determined, and then the pixel value of the first pixel point is replaced by the pixel average value to achieve the effect of erasing the table border line. In this way, since the pixel value of the first pixel is replaced by the pixel value of the second pixel, the original area occupied by the table border line in the target table image can be kept consistent with the color of the table image to the greatest extent, thereby reducing the difficulty of table recognition in the table image and improving the accuracy of table recognition.

[0077] Step 102: resize the table image to obtain a target table image with a target size.

[0078] Since each sub-table image of the table image is only obtained, each sub-table image can only be used for partial understanding of the table image. In order to understand the relationship between the local part of the table image and the whole table image, the table image can also be resized in step 102 to obtain a target table image with a target size. In this way, it can help to obtain the relationship between the local part of the table image and the whole table image during table recognition, thereby further improving the accuracy of table recognition. When resizing, it can be achieved by size compression. For example, if the image size of the table image is 100*100 and the target size is 10*10, the table image can be compressed to obtain a 10*10 target table image.

[0079] Step 103: Encode the M sub-table images to obtain M sub-table image features, and encode the target table image to obtain the target table image features.

[0080] In step 103, each sub-table image obtained by segmentation is encoded separately to obtain the sub-table image features of each sub-table image; at the same time, the target table image obtained by size adjustment is encoded to obtain the target table image features of the target table image.

[0081] In some embodiments, see Figure 6 , M sub-table images can be encoded by executing the following steps for each sub-table image to obtain M sub-table image features: Step 1031, visual feature extraction is performed on the sub-table image according to N feature sizes to obtain N first visual features of the sub-table image, where N is an integer greater than 1; Step 1032, the feature sizes of the N first visual features of the sub-table image are converted into target feature sizes to obtain N target first visual features, and the N target first visual features are spliced ​​to obtain sub-table image features of the sub-table image; Correspondingly, the target table image can be encoded by executing the following steps to obtain target table image features: Step 1033, visual feature extraction is performed on the target table image according to N feature sizes to obtain N second visual features; Step 1034, the feature sizes of the N second visual features are converted into target feature sizes to obtain N target second visual features, and the N target second visual features are spliced ​​to obtain target table image features.

[0082] Here, in step 1031, visual feature extraction is performed on the sub-table image according to N feature sizes to obtain N first visual features of the sub-table image. The N feature sizes can be pre-set as needed, such as 3*3, 2*2, 4*4, 8*8, etc. By performing visual feature extraction with N different feature sizes, visual features can be extracted from different focus areas, thereby increasing the diversity and integrity of the extracted visual features, so as to improve the feature expression capability of the visual features for the sub-table image. In step 1032, the feature sizes of the N first visual features of the sub-table image are respectively converted into target feature sizes to obtain N target first visual features, and the N target first visual features are spliced ​​to obtain the sub-table image features of the sub-table image. For example, the target feature size can be the maximum feature size among the N feature sizes, so that the first visual features of various feature sizes are converted into features of the maximum feature size, which can avoid the feature compression affecting the accuracy of the extracted features; then the N target first visual features are spliced ​​to obtain the sub-table image features of the sub-table image, thereby improving the feature expression capability of the sub-table image features of the sub-table image.

[0083] In step 1033, visual features of the target table image are extracted according to N feature sizes to obtain N second visual features of the target table image. Similar to the sub-table image, visual features can be extracted from different focus areas by using N feature sizes, thereby increasing the diversity and completeness of the extracted visual features to improve the feature expression capability of the visual features for the target table image. In step 1034, the feature sizes of the N second visual features are respectively converted into target feature sizes to obtain N target second visual features, and the N target second visual features are spliced ​​to obtain target table image features. For example, the target feature size can also be the maximum feature size among the N feature sizes, so that the second visual features of various feature sizes are converted into features of the maximum feature size, which can avoid feature compression affecting the accuracy of the extracted features; then the N target second visual features are spliced ​​to obtain the target table image features, thereby improving the feature expression capability of the target table image features of the target table image.

[0084] Combining the above steps 1031 to 1034, the feature expression capabilities of the sub-table image features of each sub-table image and the target table image features can be improved, thereby further improving the accuracy of table recognition based on each sub-table image feature and the target table image feature.

[0085] In some embodiments, see Figure 7 , the M sub-table images can also be encoded by executing the following steps to obtain M sub-table image features: step 301, visual feature extraction is performed on the M sub-table images to obtain M third visual features, and semantic feature extraction is performed on the M sub-table images to obtain M first semantic features; step 302, for each sub-table image, the third visual feature and the first semantic feature of the sub-table image are merged to obtain the sub-table image feature of the sub-table image; correspondingly, the target table image can be encoded by executing the steps to obtain the target table image feature: step 303, visual feature extraction is performed on the target table image to obtain the fourth visual feature, and semantic feature extraction is performed on the target table image to obtain the second semantic feature; step 304, the third visual feature and the second semantic feature are merged to obtain the target table image feature.

[0086] Here, in step 301, the following processing is performed on each sub-table image: extracting visual features of the sub-table image to obtain the third visual features of the sub-table image, and extracting semantic features of the sub-table image to obtain the first semantic features of the sub-table image. In practical applications, feature extraction can be achieved from different levels, such as the visual level and the semantic level; the visual level is the bottom layer commonly understood, i.e., contours, edges, colors, textures, and shapes, etc., and the semantic level is the high-level layer commonly understood, which is the image expression that is closest to human understanding.

[0087] In some embodiments, visual feature extraction can be performed on M sub-table images to obtain M third visual features by executing the following steps: for each sub-table image, visual feature extraction is performed on the sub-table image through E first convolutional layers to obtain E intermediate visual features, different first convolutional layers have receptive fields of different sizes, and E is an integer greater than 1; the E intermediate visual features are spliced ​​to obtain the third visual feature of the sub-table image. Correspondingly, semantic feature extraction can be performed on M sub-table images to obtain M first semantic features by executing the following steps: for each sub-table image, semantic feature extraction is performed on the sub-table image through F second convolutional layers to obtain F intermediate semantic features, different second convolutional layers have receptive fields of different sizes, the size of the receptive field of the second convolutional layer is larger than the size of the receptive field of the first convolutional layer, and F is an integer greater than 1; the F intermediate semantic features are spliced ​​to obtain the first semantic feature of the sub-table image.

[0088] Here, for feature extraction at the visual level and the semantic level, the receptive fields used in feature extraction at different levels may be different. Specifically, for each sub-table image, visual features of the sub-table image are extracted through E first convolutional layers to obtain E intermediate visual features, and different first convolutional layers have receptive fields of different sizes; then the E intermediate visual features are spliced ​​to obtain the third visual feature of the sub-table image. For each sub-table image, semantic features of the sub-table image are extracted through F second convolutional layers to obtain F intermediate semantic features, wherein different second convolutional layers have receptive fields of different sizes, and the size of the receptive field of the second convolutional layer is larger than the size of the receptive field of the first convolutional layer, so that the extracted features can carry semantic information; then the F intermediate semantic features are spliced ​​to obtain the first semantic feature of the sub-table image. Taking the feature extraction model (such as the backbone network) used for feature extraction to extract 5 layers of features as an example, the receptive fields of the 1st to 3rd layers are relatively small, and the features of interest are the visual features of the underlying layers, such as texture, color, edge, etc.; while the receptive fields of the higher layers (such as the 4th to 5th layers) are relatively large, and the extracted features carry semantic information, i.e., semantic features, which are more abstract. In step 302, the third visual feature and the first semantic feature of each sub-table image are fused (such as concatenating, adding, multiplying, etc.) to obtain the sub-table image features of each sub-table image. In this way, the feature expression capability of the sub-table image features of the sub-table image can be improved.

[0089] In step 303, visual features are extracted from the target table image to obtain a fourth visual feature of the target table image, and semantic features are extracted from the target table image to obtain a second semantic feature of the target table image. In practical applications, feature extraction can also be implemented from different levels for the target table image, such as the visual level and the semantic level. In some embodiments, the following steps can be performed to extract visual features from the target table image to obtain a fourth visual feature: extract visual features from the target table image through E first convolutional layers to obtain E intermediate visual features of the target table image; and splice the E intermediate visual features of the target table image to obtain a fourth visual feature. Correspondingly, the following steps can be performed to extract semantic features from the target table image to obtain a second semantic feature: extract semantic features from the target table image through F second convolutional layers to obtain F intermediate semantic features of the target table image; and splice the F intermediate semantic features of the target table image to obtain a second semantic feature. In step 304, the fourth visual feature of the target table image and the second semantic feature are fused to obtain the target table image feature. In this way, the feature expression capability of the subtable image characteristics of the subtable image can be improved.

[0090] Combining the above steps 301 to 304, the feature expression capability of the sub-table image features of each sub-table image and the target table image features can be improved, thereby further improving the accuracy of table recognition based on each sub-table image feature and the target table image feature.

[0091] Step 104: Perform table recognition on the target table image features and the M sub-table image features through the table recognition model to obtain a table recognition result of the table image.

[0092] In step 104, the table recognition model is called to perform table recognition, and table recognition is performed on the target table image features and the M sub-table image features, thereby obtaining a table recognition result of the table image. Here, the table recognition result may include the table content of the table (including text, image, etc.), the structure of the table (including the number of rows and columns of the table, etc.), the cell content of a specific cell in the table, the content of a specific row in the table, the content of a specific column in the table, etc. In actual applications, what table recognition result is specifically output can be determined based on the table recognition prompt information input by the user when triggering the table recognition instruction. For example, the table recognition prompt information can be: the cell content of a specific cell in the output table (such as the cell in the 2nd row and the 3rd column), the content of a specific row in the output table, the content of a specific column in the output table, the table structure of the output table, the table text of the output table, etc.

[0093] In some embodiments, Figure 3 The step 104 shown can be implemented by executing the following steps: determining the position information of the M sub-table images in the table image; encoding the position information of the M sub-table images to obtain M position coding features; performing table recognition on the target table image features, the M sub-table image features, and the M position coding features through a table recognition model to obtain a table recognition result of the table image.

[0094] Here, when performing table recognition, it is also necessary to model the positional relationship between the local part of the table image (i.e., each sub-table image) and the overall table image, that is, to determine the positional information of the sub-table image corresponding to each sub-table image feature in the table image. In practical applications, the positional information of each sub-table image in the table image can be determined through a regional positioning network model. Then, the positional information of each sub-table image in the table image is encoded to obtain the positional coding feature corresponding to each sub-table image, and the positional coding feature is used to characterize the positional relationship between the corresponding sub-table image and the table image. Then, through the table recognition model, the target table image feature, M sub-table image features, and M position coding features are used for table recognition to obtain the table recognition result of the table image. In this way, by modeling the positional relationship between the local part of the table image (i.e., each sub-table image) and the overall table image, the table recognition accuracy of the table recognition result can be improved.

[0095] In some embodiments, see Figure 8 The training process of the table recognition model includes: step 401, obtaining an initial table recognition model and table image samples for training the initial table recognition model, the table image samples include table samples, and the table image samples carry sample labels; step 402, segmenting the table image samples to obtain M sub-table image samples with a target size; step 403, resizing the table image samples to obtain target table image samples with a target size; step 404, encoding the M sub-table image samples to obtain M sub-sample features, and encoding the target table image samples to obtain sample features; step 405, performing table recognition on the sample features and the M sub-sample features through the initial table recognition model to obtain a predicted table recognition result of the table image sample; step 406, updating the model parameters of the initial table recognition model based on the difference between the predicted table recognition result and the sample label to obtain a table recognition model.

[0096] In step 401, first obtain an initial table recognition model and a table image sample for training, the table image sample includes a table sample, and the table image sample carries a sample label. In some embodiments, the initial table recognition model can be constructed based on a large model. In step 402, the table image sample is segmented to obtain M sub-table image samples with a target size, wherein the specific implementation process of step 402 can refer to step 101 and will not be repeated here. In step 403, the table image sample is resized to obtain a target table image sample with a target size, wherein the specific implementation process of step 403 can refer to step 102 and will not be repeated here. In step 404, the M sub-table image samples are encoded to obtain M sub-sample features, and the target table image sample is encoded to obtain sample features, wherein the specific implementation process of step 404 can refer to step 103 and will not be repeated here. In step 405, the sample features and the M sub-sample features are subjected to table recognition through the initial table recognition model to obtain the predicted table recognition result of the table image sample, wherein the specific implementation process of step 405 can be implemented with reference to step 104 and will not be repeated here. In step 406, the difference between the predicted table recognition result and the sample label is obtained, and the value of the loss function of the initial table recognition model is determined based on the difference between the predicted table recognition result and the sample label, and the model parameters of the initial table recognition model are updated based on the value of the loss function to obtain the table recognition model.

[0097] In some embodiments, the initial table recognition model includes a first table recognition sub-model and a second table recognition sub-model, and the parameter amount of the model parameters of the first table recognition sub-model is greater than the parameter amount of the model parameters of the second table recognition sub-model; based on this, based on the difference between the predicted table recognition result and the sample label, the table recognition model can be obtained by performing the following including updating the model parameters of the initial table recognition model: based on the difference between the predicted table recognition result and the sample label, updating the model parameters of the second table recognition sub-model to obtain the table recognition model.

[0098] Here, the initial table recognition model is composed of a first table recognition sub-model and a second table recognition sub-model, wherein the first table recognition sub-model can be constructed based on a large model, which is pre-trained, and the model parameters of the first table recognition sub-model are fixed; the model parameters in the second table recognition sub-model are not fixed and need to be learned. And the parameter amount of the model parameters of the first table recognition sub-model is more than the parameter amount of the model parameters of the second table recognition sub-model. In this way, when training the initial table recognition model, the second table recognition sub-model with relatively fewer model parameters is actually trained, thereby ensuring the accuracy of the table recognition model, improving the training efficiency of the model, and reducing the occupation of hardware resources by model training. Therefore, based on the difference between the predicted table recognition result and the sample label, the model parameters of the second table recognition sub-model in the initial table recognition model are updated to obtain the table recognition model.

[0099] In some embodiments, through the table recognition model, table recognition can be performed on the target table image features and M sub-table image features by executing the following steps to obtain a table recognition result of the table image: through the first table recognition sub-model, table recognition is performed on the target table image features and M sub-table image features to obtain a first table recognition result of the table image; through the second table recognition sub-model, table recognition is performed on the target table image features and M sub-table image features to obtain a second table recognition result of the table image; the first table recognition result and the second table recognition result are processed to obtain a table recognition result of the table image.

[0100] Here, it can be seen from the above that the table recognition model includes a first table recognition sub-model and a second table recognition sub-model. Therefore, when performing table recognition through the table recognition model, the first table recognition sub-model can be used to perform table recognition on the target table image features and M sub-table image features to obtain a first table recognition result of the table image; and the second table recognition sub-model can be used to perform table recognition on the target table image features and M sub-table image features to obtain a second table recognition result of the table image; thus, the sum of the first table recognition result and the second table recognition result is used as the table recognition result of the table image. In this way, the accuracy of table recognition can be further improved.

[0101] Applying the above-mentioned embodiment of the present application, the table image is first segmented to obtain M sub-table images with a target size, and the table image is resized to obtain a target table image with a target size, where the target size is a model input size corresponding to a table recognition model; then, the M sub-table images are encoded to obtain M sub-table image features, and the target table image is encoded to obtain target table image features; finally, table recognition is performed on the target table image features and the M sub-table image features through the table recognition model to obtain a table recognition result of the table image.

[0102] Here, (1) a table recognition model is used to realize table recognition of table images, without relying on OCR recognition technology, thus avoiding the influence of OCR recognition error on table recognition; (2) the table image is segmented using the image input size of the table recognition model so that the sub-table image has a target size and can adapt to the input size of the table recognition model, thus avoiding the compression deformation caused by compressing the table image to the target size in order for the table recognition model to process the image features of the table image, thereby ensuring that the image features of the table image can be better preserved; (3) the table recognition model is used to perform table recognition on the target table image features and M sub-table image features, so that the table recognition model can pay attention to the relationship between the local features of the table image (i.e., each sub-table image feature) and the overall features of the table image (i.e., the target table image feature). In this way, the accuracy of table recognition of table images can be improved through the embodiments of the present application.

[0103] The following describes an exemplary application of the embodiment of the present application in an actual application scenario. Documents are an important way to save information, and tables are the most common and intuitive form of information organization in documents, which contain a lot of structured information of users. Obtaining these structured information helps to build a huge database for data storage and management. In actual scenarios, what can be obtained is usually a table document in the form of an image, so how to make the computer understand the table document in the form of an image is an urgent problem to be solved. In the related art, OCR recognition is performed on the table image through OCR recognition technology, and then the recognition of the table image content is realized based on the OCR recognition result. Since table recognition depends on OCR recognition, the upper limit of the table recognition accuracy is the upper limit of the OCR recognition accuracy, and for some complex table images, OCR recognition cannot give an accurate result. For example, in complex scenarios such as a cell containing multiple lines of text and the text distance between two adjacent cells is particularly close, OCR recognition will parse the content originally located in the same cell into the content of multiple cells, or the content that should originally belong to two cells will be parsed into the content of one cell. In this way, the table recognition performance of the table image is poor.

[0104] Based on this, an embodiment of the present application provides a method for processing a table image to at least solve the above-mentioned problems. The embodiment of the present application implements a table recognition model based on a multimodal large language model (Large Language Model, LLM, also known as a multi-model large model), adopts the text recognition ability (textrecognize) and understanding ability of the multimodal large language model, and provides an intelligent table recognition method that does not use OCR recognition. Among them, the multimodal large language model can compare image features and text features, so its encoder layer can extract text information from the table image, providing innate conditions for OCR-free. In addition, because it does not rely on a pre-prepared OCR model, it can not only avoid the accumulation of OCR errors, but also retain complete visual information, including but not limited to font information, color information, layout information, location information, etc. In the training stage, the visual features of the table image sample can be used as the visual modality input of the multimodal large language model.

[0105] See also Fig. 9 , Fig. 9 1 is a flow chart of a table image processing method provided in an embodiment of the present application. Here, the table image processing method includes: (1) positioning the table area; (2) obtaining the table image; (3) segmenting the table image; (4) visual feature encoding; (5) constructing a visual feature set; (6) table recognition processing based on a large model.

[0106] It should be noted that the multimodal large language model in the embodiment of the present application is not limited. For example, the mPLUG-Owl large model can use the LoRA strategy to fine-tune the multimodal large language model (referred to as the large model) during the training phase. Because most of the current large models are trained based on prompt words, three types of prompt words are exemplarily designed in the embodiment of the present application: Category 1: Strengthen the text recognition ability of the model. The prompt words of this category are similar to: output the current text; Category 2: Strengthen the ability to understand the table structure. The prompt words of this category are: output the structure of the current table; Category 3: Strengthen high-order understanding ability. This is done in the form of questions and answers, so some questions need to be set in advance, such as please output the information corresponding to {XXX}, where {XXX} and the answer are pre-set matching pairs.

[0107] Among them, (1) the positioning of the table area can be achieved by using a network model used for target detection or image segmentation. In practical applications, in order to improve the positioning accuracy of the table area, some special version analysis models can be selected to distinguish some areas that are similar to the table, such as charts, thereby improving the positioning accuracy of the table area.

[0108] (2) Obtain a table image. Cut the table area out of the initial table image to obtain a table image. At the same time, in order to better improve the performance of subsequent table recognition, the table lines in the table image can be erased. The erasing method is as follows: for horizontal lines, use several (such as 10) pixels adjacent to the horizontal line above and below to replace; for vertical lines, use several (such as 10) pixels adjacent to the left and right to replace. The purpose of this is to prevent more attention from being paid to the table lines during table recognition. At the same time, the erasing method adopted in the embodiment of the present application can maintain the color consistency of the table image to the greatest extent.

[0109] (3) Segmentation of table images. The visual modality of the large model has a specified resolution, but the size of the table image varies. If the table image is forcibly resized to a specified scale, it will cause serious compression deformation. In order to alleviate this problem, in an embodiment of the present application, the table image is segmented according to the visual modality scale of the large model, so that the scale of the obtained sub-table image matches the visual modality scale of the large model. At the same time, in order to make the model understand the relationship between the local (the segmented sub-table image) and the whole (the table image before segmentation), the unsegmented table image can also be resized to a specified scale (that is, a scale that matches the visual modality scale of the large model). In this way, assuming that the table image is segmented to obtain M sub-table images, then adding the reszie of the original image will obtain a total of (M+1) small images of the specified scale.

[0110] (4) Visual feature encoding. Encode the (M+1) small images of a specified scale obtained in the previous layer (for example, a CNN model or a Transformer model can be used) to obtain the sub-table visual features of the M sub-table images (i.e., sub-table image features) and 1 table visual feature (i.e., target table image features).

[0111] (5) Construction of visual feature set. The sub-table visual features obtained in step (4) are only for each sub-table image itself, without modeling the local and overall. Therefore, the Transformer model can be used here to add the position information of the sub-table image in the table image. As an example, see Fig.10 , Fig.10 is a schematic diagram of image segmentation provided by an embodiment of the present application. Here, the image is segmented in the order from left to back and from top to bottom, and the sub-images obtained by segmentation are arranged to obtain a group of sub-images arranged horizontally, thereby determining the position information of each sub-image. In this way, the position information corresponding to each sub-table image is obtained for subsequent table recognition. In this way, the constructed visual feature set includes the sub-table visual features of M sub-table images and the table visual features of 1 table image, and carries the position information corresponding to each sub-table image.

[0112] (6) Table recognition processing based on the large model: Based on the sub-table visual features of the M sub-table images, the table visual features of one table image, and the position information corresponding to each sub-table image, the table recognition processing is performed through the large model to obtain the table recognition result of the table image.

[0113] The application of the above-mentioned embodiments of the present application does not rely on the OCR recognition engine, and utilizes the understanding ability of the large model, which can not only complete the understanding of the table structure, but also complete high-order understanding (such as the extraction of specified information in the table), thereby improving the generalization and robustness of table recognition in table images.

[0114] The following continues to describe the exemplary structure of the table image processing device 555 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 2 As shown, the software modules in the table image processing device 555 stored in the memory 550 may include: a segmentation module 5551, used to segment the table image to obtain M sub-table images with a target size, where M is an integer greater than 1, and the target size is the image input size corresponding to the table recognition model; an adjustment module 5552, used to resize the table image to obtain a target table image with the target size; an encoding module 5553, used to encode the M sub-table images to obtain M sub-table image features, and to encode the target table image to obtain target table image features; a table recognition module 5554, used to perform table recognition on the target table image features and the M sub-table image features through the table recognition model to obtain a table recognition result of the table image.

[0115] In some embodiments, the segmentation module 5551 is also used to identify the table border line in the table image to obtain the first pixel point of the table border line; determine the second pixel point within a preset range of the first pixel point, the second pixel point is a pixel point of a non-table border line; replace the pixel value of the first pixel point with the pixel value of the second pixel point to obtain a target table image; segment the target table image according to the target size to obtain the M sub-table images with the target size.

[0116] In some embodiments, the encoding module 5553 is also used to extract visual features of each sub-table image according to N feature sizes to obtain N first visual features of the sub-table image, where N is an integer greater than 1; convert the feature sizes of the N first visual features of the sub-table image into the target feature sizes to obtain N target first visual features, and splice the N target first visual features to obtain sub-table image features of the sub-table image.

[0117] In some embodiments, the encoding module 5553 is also used to extract visual features from the M sub-table images to obtain M third visual features, and to extract semantic features from the M sub-table images to obtain M first semantic features; for each sub-table image, the third visual features and the first semantic features of the sub-table image are fused to obtain the sub-table image features of the sub-table image.

[0118] In some embodiments, the encoding module 5553 is also used to extract visual features of each sub-table image through E first convolutional layers to obtain E intermediate visual features, where different first convolutional layers have receptive fields of different sizes, and E is an integer greater than 1; and concatenate the E intermediate visual features to obtain a third visual feature of the sub-table image.

[0119] In some embodiments, the encoding module 5553 is also used to extract semantic features of each sub-table image through F second convolutional layers to obtain F intermediate semantic features, different second convolutional layers have receptive fields of different sizes, and F is an integer greater than 1; the F intermediate semantic features are spliced ​​to obtain the first semantic feature of the sub-table image.

[0120] In some embodiments, the table recognition module 5554 is also used to obtain an initial table recognition model and table image samples for training the initial table recognition model, the table image samples including table samples, the table image samples carrying sample labels; segmenting the table image samples to obtain M sub-table image samples with a target size; resizing the table image samples to obtain target table image samples with the target size; encoding the M sub-table image samples to obtain M sub-sample features, and encoding the target table image samples to obtain sample features; performing table recognition on the sample features and the M sub-sample features through the initial table recognition model to obtain a predicted table recognition result of the table image sample; updating the model parameters of the initial table recognition model based on the difference between the predicted table recognition result and the sample label to obtain the table recognition model.

[0121] In some embodiments, the initial table recognition model includes a first table recognition sub-model and a second table recognition sub-model, and the parameter amount of the model parameters of the first table recognition sub-model is greater than the parameter amount of the model parameters of the second table recognition sub-model; the table recognition module 5554 is also used to update the model parameters of the second table recognition sub-model based on the difference between the predicted table recognition result and the sample label to obtain the table recognition model.

[0122] In some embodiments, the table recognition module 5554 is also used to determine the position information of the M sub-table images in the table image; encode the position information of the M sub-table images to obtain M position coding features; and perform table recognition on the target table image features, the M sub-table image features, and the M position coding features through the table recognition model to obtain a table recognition result of the table image.

[0123] It should be noted that the description of the device embodiment in this application is similar to the description of the method embodiment above, and has similar beneficial effects as the method embodiment, which will not be described in detail here. The unfinished technical details in the table image processing device provided in the embodiment of this application can be understood based on the description of the technical details in the method embodiment above.

[0124] The embodiment of the present application also provides a computer program product, which includes computer executable instructions or computer programs, and the computer executable instructions or computer programs are stored in a computer readable storage medium. The processor of the electronic device reads the computer executable instructions or computer program from the computer readable storage medium, and the processor executes the computer executable instructions or computer program, so that the electronic device executes the table image processing method provided in the embodiment of the present application.

[0125] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the method for processing table images provided in the embodiment of the present application.

[0126] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0127] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0128] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0129] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0130] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for processing a table image, characterized in that: The method comprises: Segment the table image to obtain M sub-table images with target sizes, where M is an integer greater than 1, and the target size is the image input size corresponding to the table recognition model; resizing the table image to obtain a target table image having the target size; Encoding the M sub-table images to obtain M sub-table image features, and encoding the target table image to obtain target table image features; The table recognition model is used to perform table recognition on the target table image features and the M sub-table image features to obtain a table recognition result of the table image.

2. The method according to claim 1, characterized in that The table image is segmented to obtain M sub-table images with target sizes, including: Identify a table border line in the table image to obtain a first pixel point of the table border line; Determine a second pixel point within a preset range of the first pixel point, where the second pixel point is a pixel point other than a table border line; Replacing the pixel value of the first pixel point with the pixel value of the second pixel point to obtain a target table image; The target table image is segmented according to the target size to obtain the M sub-table images having the target size.

3. The method according to claim 1, characterized in that The encoding of the M sub-table images to obtain M sub-table image features includes: For each sub-table image, extract visual features of the sub-table image according to N feature sizes to obtain N first visual features of the sub-table image, where N is an integer greater than 1; The feature sizes of the N first visual features of the sub-table image are converted into target feature sizes to obtain N target first visual features, and the N target first visual features are spliced ​​to obtain sub-table image features of the sub-table image.

4. The method according to claim 1, characterized in that The encoding of the M sub-table images to obtain M sub-table image features includes: Performing visual feature extraction on the M sub-table images to obtain M third visual features, and performing semantic feature extraction on the M sub-table images to obtain M first semantic features; For each sub-table image, the third visual feature and the first semantic feature of the sub-table image are fused to obtain a sub-table image feature of the sub-table image.

5. The method according to claim 4, characterized in that The extracting visual features of the M sub-table images to obtain M third visual features includes: For each sub-table image, extract visual features of the sub-table image through E first convolutional layers to obtain E intermediate visual features, where different first convolutional layers have receptive fields of different sizes, and E is an integer greater than 1; The E intermediate visual features are concatenated to obtain a third visual feature of the sub-table image.

6. The method according to claim 4, characterized in that The extracting semantic features of the M sub-table images to obtain M first semantic features includes: For each sub-table image, semantic features are extracted from the sub-table image through F second convolutional layers to obtain F intermediate semantic features, where different second convolutional layers have receptive fields of different sizes, and F is an integer greater than 1; The F intermediate semantic features are concatenated to obtain a first semantic feature of the subtable image.

7. The method according to claim 1, characterized in that The training process of the table recognition model includes: Acquire an initial table recognition model and table image samples for training the initial table recognition model, wherein the table image samples carry sample labels; Segmenting the table image sample to obtain M sub-table image samples with a target size; resizing the table image sample to obtain a target table image sample having the target size; Encoding the M sub-table image samples to obtain M sub-sample features, and encoding the target table image samples to obtain sample features; Performing table recognition on the sample features and the M sub-sample features through the initial table recognition model to obtain a predicted table recognition result of the table image sample; Based on the difference between the predicted table recognition result and the sample label, the model parameters of the initial table recognition model are updated to obtain the table recognition model.

8. The method according to claim 7, characterized in that The initial table recognition model includes a first table recognition sub-model and a second table recognition sub-model, wherein the parameter amount of the model parameters of the first table recognition sub-model is greater than the parameter amount of the model parameters of the second table recognition sub-model; The updating of the model parameters of the initial table recognition model based on the difference between the predicted table recognition result and the sample label to obtain the table recognition model includes: Based on the difference between the predicted table recognition result and the sample label, the model parameters of the second table recognition sub-model are updated to obtain the table recognition model.

9. The method according to claim 1, characterized in that The process of performing table recognition on the target table image features and the M sub-table image features through the table recognition model to obtain a table recognition result of the table image includes: Determine the position information of the M sub-table images in the table image; Encoding the position information of the M sub-table images to obtain M position coding features; The table recognition model is used to perform table recognition on the target table image features, the M sub-table image features, and the M position coding features to obtain a table recognition result of the table image.

10. A table image processing device, characterized in that: The device comprises: A segmentation module, used for segmenting the table image to obtain M sub-table images with a target size, where M is an integer greater than 1, and the target size is the image input size corresponding to the table recognition model; An adjustment module, used for adjusting the size of the table image to obtain a target table image with the target size; An encoding module, used for encoding the M sub-table images to obtain M sub-table image features, and encoding the target table image to obtain target table image features; The table recognition module is used to perform table recognition on the target table image features and the M sub-table image features through the table recognition model to obtain a table recognition result of the table image.

11. An electronic device, characterized in that: The electronic device comprises: A memory for storing computer executable instructions; A processor, configured to implement the method for processing a table image as described in any one of claims 1 to 9 when executing the computer executable instructions stored in the memory.

12. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the method for processing a table image as described in any one of claims 1 to 9 is implemented.

13. A computer program product comprising computer executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the method for processing a table image according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Table identification method, table identification model training method, apparatus and device

    CN116645685A

  • Table analysis model training method and table analysis method and device

    CN117496543A

  • Form image field extraction

    US10572725B1