Image detection method and device based on large language model, image recognition method and device, electronic equipment, storage medium and program product

Through a large language model combined with file structure detection and multi-scale feature extraction, the complexity of information extraction in document images is solved, accurate detection and information extraction of diverse documents are achieved, and the adaptability and efficiency of the model are improved.

CN118552969APending Publication Date: 2024-08-27BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Application Number
CN202410788455.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

The file structure represented in the file image is complex and diverse, making it difficult to accurately extract the information required by the user.

Method used

Using an image detection method based on a large language model, through file structure detection and multi-scale feature extraction, combined with the attention mechanism, the table image blocks are processed to identify and extract target information in the file.

Benefits of technology

It achieves accurate information detection of diverse document images, improves the adaptability and generalization capabilities of large language models, avoids model fine-tuning for different application scenarios, and improves the efficiency of document information extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552969A
    Figure CN118552969A
Patent Text Reader

Abstract

The invention provides an image detection method and device based on a large language model, an image recognition method and device, electronic equipment, a storage medium and a program product, and relates to the technical field of artificial intelligence, in particular to the technical field of computer vision, the technical field of deep learning, the technical field of intelligent questions and answers and the technical field of large models. According to the specific implementation scheme, in response to a detection instruction, a file image specified by a target object and detection demand information are determined; performing file structure detection on the file image to obtain a file structure attribute represented by the file image; and processing the file structure attribute and the detection demand information by using a large language model so as to determine target file information matched with the detection demand information from the file image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the field of computer vision technology, deep learning technology, and large model technology. Background Art

[0002] With the rapid development of science and technology, in application scenarios such as commodity trading and bill reimbursement, file information related to the file content can be easily extracted from file images based on computer vision technology, so as to realize the conversion of image information into text, numerical values ​​and other information required by users, so that users can easily obtain the information they need in the file. Summary of the invention

[0003] The present disclosure provides an image detection method, an image recognition method, an apparatus, an electronic device, a storage medium, and a program product based on a large language model.

[0004] According to one aspect of the present disclosure, there is provided an image detection method based on a large language model, comprising: in response to a detection instruction, determining a file image and detection requirement information specified by a target object; performing file structure detection on the file image to obtain file structure attributes represented by the file image; and processing the file structure attributes and detection requirement information using a large language model to facilitate determining target file information matching the detection requirement information from the file image.

[0005] According to another aspect of the present disclosure, there is provided an image recognition method, including: performing multi-scale feature extraction on a table image block in a document image to obtain table image features of N scales, where N is an integer greater than 1; fusing the table image features of the N scales to obtain table fusion features, where the table fusion features include row fusion features and column fusion features; processing the row fusion features and the column fusion features based on an attention mechanism to obtain cell sub-attributes; and recognizing the table image blocks based on the cell sub-attributes to obtain table information displayed based on the table structure.

[0006] According to another aspect of the present disclosure, there is provided an image detection device based on a large language model, comprising: a first determination module, for determining a file image and detection requirement information specified by a target object in response to a detection instruction; a detection module, for performing file structure detection on the file image to obtain file structure attributes represented by the file image; and a target file information acquisition module, for processing the file structure attributes and detection requirement information using a large language model, so as to determine target file information matching the detection requirement information from the file image.

[0007] According to another aspect of the present disclosure, an image recognition device is provided, including: a table image feature acquisition module, used to perform multi-scale feature extraction on a table image block in a document image to obtain table image features of N scales, where N is an integer greater than 1; a table fusion feature acquisition module, used to fuse table image features of N scales to obtain table fusion features, where the table fusion features include row fusion features and column fusion features; a cell sub-attribute acquisition module, used to process row fusion features and column fusion features based on an attention mechanism to obtain cell sub-attributes; and a recognition module, used to recognize table image blocks based on cell sub-attributes to obtain table information displayed based on a table structure.

[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method as described above.

[0010] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method described above when executed by a processor.

[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0013] Figure 1 Schematically illustrates an exemplary system architecture to which a large language model-based image detection method, an image recognition method, and an apparatus can be applied according to an embodiment of the present disclosure;

[0014] Figure 2 A flowchart of an image detection method based on a large language model according to an embodiment of the present disclosure is schematically shown;

[0015] Figure 3 A schematic diagram schematically shows a document image according to an embodiment of the present disclosure;

[0016] Figure 4The application scenario diagram of the image detection method based on the large language model according to the embodiment of the present disclosure is schematically shown;

[0017] Figure 5 A diagram schematically shows an application scenario of an image detection method based on a large language model according to another embodiment of the present disclosure;

[0018] Figure 6 The schematic diagram of the table recognition model according to the embodiment of the present disclosure is shown;

[0019] Figure 7 The schematic diagram of the feature extraction network according to the embodiment of the present disclosure is shown;

[0020] Figure 8 The schematic diagram of the feature fusion network according to the embodiment of the present disclosure is shown;

[0021] Fig. 9 The schematic diagram shows the principle diagram of sample data generation according to an embodiment of the present disclosure;

[0022] Fig.10 The system architecture diagram of the question-answering system based on the large language model according to the embodiment of the present disclosure is schematically shown;

[0023] Fig.11 The flowchart of the image recognition method according to the embodiment of the present disclosure is schematically shown;

[0024] Fig.12 A block diagram of an image detection device based on a large language model according to an embodiment of the present disclosure is schematically shown;

[0025] Fig.13 A block diagram schematically shows an image recognition device according to an embodiment of the present disclosure; and

[0026] Fig.14 A schematic block diagram of an image detection method and an image recognition method based on a large language model, which can be used to implement an embodiment of the present disclosure, is shown. DETAILED DESCRIPTION

[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0028] In the technical solution disclosed in the present invention, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations, necessary confidentiality measures are taken, and do not violate public order and good morals.

[0029] The inventors have found that the file structure represented in the file image is usually complex, and the file types represented in the file image tend to be diversified, making it difficult to accurately extract the information required by the user from the file images of the diversified file types.

[0030] The embodiments of the present disclosure provide an image detection method, an image recognition method, an apparatus, an electronic device, a storage medium and a program product based on a large language model. The image detection method based on a large language model includes: in response to a detection instruction, determining a file image and detection requirement information specified by a target object; performing file structure detection on the file image to obtain a file structure attribute represented by the file image; and processing the file structure attribute and detection requirement information using a large language model to determine target file information matching the detection requirement information from the file image.

[0031] According to the embodiments of the present disclosure, by performing file structure detection on a file image, the file structure attribute can more accurately indicate the personalized layout of the file in the file image. By using a large language model to process the file structure attribute and the detection requirement information specified by the target object, the large language model can more accurately detect the target file information that matches the detection requirement information of the target object from the file image based on the matching degree between the detection requirement information and the file structure attribute, while more accurately understanding the layout of the file in the file image, so that the target file information can more accurately match the requirements of the target object, and the large language model can realize more accurate file information detection for a variety of file images, avoiding the operation process of fine-tuning the large model for different application scenarios, and improving the adaptability and generalization ability of the large language model for a variety of information detection scenarios.

[0032] Figure 1 An exemplary system architecture to which a large language model-based image detection method, an image recognition method, and an apparatus can be applied according to an embodiment of the present disclosure is schematically shown.

[0033] It should be noted that Figure 1The examples shown are only examples of system architectures to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios. For example, in another embodiment, an exemplary system architecture to which the large language model-based image detection method and apparatus can be applied may include a terminal device, but the terminal device may implement the large language model-based image detection method and apparatus provided in the embodiments of the present disclosure without interacting with the server.

[0034] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0035] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).

[0036] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0037] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for the content browsed by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to the user request) to the terminal device.

[0038] “The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system. It solves the defects of traditional physical hosts and VPS services ("Virtual Private Server", or "VPS"), such as difficult management and weak business scalability. The server can also be a server of a distributed system, or a server combined with blockchain.”

[0039] It should be noted that the image detection method and image recognition method based on the large language model provided in the embodiments of the present disclosure can generally be executed by the terminal device 101, 102, or 103. Accordingly, the image detection device and image recognition device based on the large language model provided in the embodiments of the present disclosure can also be set in the terminal device 101, 102, or 103.

[0040] Alternatively, the image detection method and image recognition method based on the large language model provided in the embodiment of the present disclosure may also be generally executed by the server 105. Accordingly, the image detection device and image recognition device based on the large language model provided in the embodiment of the present disclosure may generally be arranged in the server 105. The image detection method and image recognition method based on the large language model provided in the embodiment of the present disclosure may also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the image detection device and image recognition device based on the large language model provided in the embodiment of the present disclosure may also be arranged in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.

[0041] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0042] Figure 2 The flowchart of the image detection method based on the large language model according to the embodiment of the present disclosure is schematically shown.

[0043] like Figure 2 As shown, the image detection method based on the large language model includes operations S210 to S230.

[0044] In operation S210, in response to a detection instruction, a document image and detection requirement information specified by a target object are determined.

[0045] In operation S220, a file structure detection is performed on the file image to obtain a file structure attribute represented by the file image.

[0046] In operation S230, the document structure attributes and the detection requirement information are processed using the large language model to determine target document information matching the detection requirement information from the document image.

[0047] According to the embodiments of the present disclosure, the detection instruction may be generated based on the interactive operation of the target object, for example, the detection instruction may be generated based on the detection requirement information input by the target object in the interactive interface. Alternatively, the detection instruction may be generated based on other methods, for example, the detection instruction may be generated based on preset configuration conditions, and the configuration conditions may include a position trigger condition in response to the detection of the file image, a preset time configuration condition, etc. The embodiments of the present disclosure do not limit the specific method of generating the detection instruction.

[0048] According to the embodiments of the present disclosure, the document image can represent any type of document, form, document web page, etc. The embodiments of the present disclosure do not limit the file type represented by the document image, and those skilled in the art can select it according to actual needs.

[0049] According to the embodiments of the present disclosure, the detection requirement information may include any type of information such as text, numerical value, etc. that characterizes the requirements of the target object. The detection requirement information may be obtained based on the interactive operation of the target object, or may also be obtained based on other types of methods, such as preset configuration information. The embodiments of the present disclosure do not limit the specific method of obtaining the detection requirement information, and those skilled in the art may select it according to actual needs.

[0050] According to an embodiment of the present disclosure, the file structure attribute may include a layout mode representing any file content information such as text, numerical value, formula, table, image, etc. in the file. The file structure attribute may be represented based on an attribute identifier.

[0051] According to an embodiment of the present disclosure, detecting a file image may include detecting the file image based on a target detection model to obtain a detection frame image block representing the file structure attribute. The detection frame image block may include any type of information such as text, table, image, etc. corresponding to the file structure attribute.

[0052] According to an embodiment of the present disclosure, the file structure attribute includes at least one of the following: a file name attribute, a summary attribute, a comment attribute, an image identification attribute, and a table identification attribute.

[0053] According to an embodiment of the present disclosure, the file name attribute may represent the name of the entire file, such as "xx restaurant invoice" and the like.

[0054] According to an embodiment of the present disclosure, the summary attribute may represent the summary content of the file. The annotation attribute may represent the annotation content in the file. The image identification attribute may represent the number of the image in the file, such as " Figure 1 ”. The table identification attribute can represent the number of the table in the file, such as "Table 1".

[0055] According to an embodiment of the present disclosure, file structure attributes may also include page number attributes, image attributes, table attributes, title attributes, formula attributes, and any other type of attributes that can characterize the file structure. The embodiment of the present disclosure does not limit the specific type of file structure attributes.

[0056] According to an embodiment of the present disclosure, the file structure attribute can be represented based on the attribute identifier. The file structure attribute can also include a position attribute, which can represent the layout position of each attribute identifier in the file, so as to more accurately represent the layout mode of each content part of the file in the file image by using the file structure attribute.

[0057] According to an embodiment of the present disclosure, using a large language model to process file structure attributes and detection requirement information may include generating prompt information based on the file structure attributes and detection requirement information. The prompt information may be used to assist the large language model to more accurately understand the information content corresponding to the attribute identifier of the file structure attribute in the file image, and the layout of the information content corresponding to the attribute identifier in the file, so as to combine

[0058] According to an embodiment of the present disclosure, a large language model (LLM) may include a deep learning model trained using a large amount of text data. For example, a large language model may include a model constructed based on a neural network model such as a Transformer model to understand the meaning of language text and generate natural language text. A large language model can process natural language tasks. Since a large language model typically contains billions of parameters, large-scale parameters can help the large language model learn complex patterns in natural language data, thereby performing better in natural language processing (NLP) tasks.

[0059] In one example, text information in an image block corresponding to text structure attributes can be identified based on a text recognition algorithm, so that prompt information can be generated by combining the text information of the identified image block, the file structure attributes and the detection requirement information, so that a large language model can perform the detection task of the target file information according to the text information of the identified image block, so as to improve the detection accuracy of the target file information and reduce the computational overhead and time.

[0060] It should be understood that the text recognition algorithm may include any type of text recognition algorithm such as an OCR (Optical Character Recognition) algorithm.

[0061] Figure 3A schematic diagram of a document image according to an embodiment of the present disclosure is schematically shown.

[0062] like Figure 3 As shown, by performing file structure detection on the file image 300, multiple detection frames in the file image 300 can be obtained. The multiple detection frames can be a table mark detection frame 311, a table detection frame 312, a text detection frame 321, an image detection frame 331 and an image mark detection frame 332.

[0063] The table mark detection frame 311 has a table mark attribute, the table detection frame 312 has a table attribute, the text detection frame 321 has a text attribute, the image detection frame 331 has an image attribute, and the image mark detection frame 332 has an image mark attribute.

[0064] In one example, the position attribute corresponding to the detection box can be obtained based on file structure detection of the file image, multiple detection boxes can be sorted according to the position attribute, and the file information in each detection box can be identified based on the OCR algorithm. The file information in each identified detection box is arranged based on the sorting relationship between the multiple detection boxes, so that the large language model can accurately understand the layout of the file information of each part of the file in the file image.

[0065] According to an embodiment of the present disclosure, the file structure attribute can be characterized based on an attribute identifier corresponding to the type of the file structure attribute. For example, text can be used to represent the text attribute, text_title can be used to represent the text title attribute, figure_title can be used to represent the image identifier attribute, table can be used to represent the table attribute, formula can be used to represent the formula attribute, reference can be used to represent the comment attribute, and abstract can be used to represent the abstract attribute.

[0066] According to the embodiments of the present disclosure, the file image can be detected based on the target detection algorithm, and the target detection algorithm can include the RT-DETR (Real-Time Detetction Transformer) model algorithm to perform file structure detection on the file image. However, it is not limited to this, and the file structure detection can also be performed based on other types of target detection algorithms. The embodiments of the present disclosure do not limit the specific type of the target object detection algorithm, and those skilled in the art can select it according to actual needs.

[0067] Figure 4 The application scenario diagram of the image detection method based on the large language model according to an embodiment of the present disclosure is schematically shown.

[0068] like Figure 4As shown, multiple detection frames can be obtained based on file structure detection of the file image 400. The multiple detection frames can be an image detection frame P411, a file name detection frame M411, and five text detection frames T411, T412, T413, T414, and T415. By determining the position coordinates (position attributes) of the image detection frame P411, the file name detection frame M411, and the five text detection frames T411, T412, T413, T414, and T415, and clustering the position coordinates of the image detection frame P411, the file name detection frame M411, and the five text detection frames T411, T412, T413, T414, and T415 according to the coordinates of a preset coordinate axis, for example, clustering according to the x-coordinate of the X-axis, it is possible to determine that the layout of the file image 400 is divided into three columns, and in each column, the five text detection frames T411, T412, T413, T414, and T415 are respectively noted with position indexes 1, 2, 3, 4, and 5 according to the position from top to bottom, so that the text information in the text detection frames T411, T412, T413, T414, and T415 can be arranged in order among multiple columns. Thus, text information determined according to the order of the files in the file image 400 can be obtained.

[0069] According to an embodiment of the present disclosure, image detection based on a large language model may further include: generating a detection instruction in response to an interactive operation of a target object on an interactive interface; and pushing target file information to the target object.

[0070] In one example, the interactive interface may be a touch display interface of a terminal device such as a smartphone of the target object, and the target object may generate a detection instruction by inputting detection requirement information in the interactive interface.

[0071] In one example, the target file information can be sent to the target object's terminal device so that the target object can conveniently browse the target file information matching the detection requirement information through the touch display interface of the terminal device, thereby enabling the target object to conveniently and quickly browse the required file information.

[0072] According to the embodiments of the present disclosure, the target file information may include any type of information, such as text, numerical values, tables, images, etc. The embodiments of the present disclosure do not limit the specific type of the file information.

[0073] According to the embodiments of the present disclosure, the file structure detection can be performed on the file image based on the target detection model with a small amount of model parameters, so that the target detection model with a small amount of model parameters and the general large language model can be combined to extract the target file information of various types of file images more accurately, so that the target file information can be more accurately adapted to the needs of the target object. In this way, the accurate file information extraction for file images with diverse and complex file structure attributes can be improved, so that the image detection method based on the large language model provided by the embodiments of the present disclosure can improve the adaptability of file information extraction for diverse file images, adapt to diverse file information extraction tasks, and improve the processing efficiency of complex structure file information.

[0074] According to an embodiment of the present disclosure, performing file structure detection on a file image to obtain file structure attributes represented by the file image includes: detecting a table image block having table attributes to obtain cell sub-attributes.

[0075] According to an embodiment of the present disclosure, the document image may include a table image block, and the table image block may be an image block having a table attribute in the document image.

[0076] According to an embodiment of the present disclosure, detecting a table image block having table attributes may include detecting the table image block based on a target detection algorithm. The cell sub-attribute may include attributes of cells constituting the table in the table image block.

[0077] It should be understood that a cell can be a closed area in a table surrounded by table lines. Alternatively, a cell in a table image block can also be an area that is not surrounded by table lines, or is only partially surrounded by table lines, and the cell sub-attributes can be determined based on cell information such as text and values ​​in the cell. A cell can be obtained by merging multiple rows of initial cells, or a cell can be obtained by merging multiple columns of initial cells. Alternatively, a cell can be obtained by merging multiple columns of initial cells and merging multiple rows of initial cells, or a cell can be obtained by splitting the initial cell.

[0078] According to an embodiment of the present disclosure, the cell sub-attribute may include at least one of the following: a cell position sub-attribute, a cell area sub-attribute.

[0079] According to an embodiment of the present disclosure, the cell position sub-attribute may include the position of the cells constituting the table in the table. The cell position sub-attribute may be determined based on any one or more of the four vertices of the cell region, or the cell sub-attribute may also be determined by the center point position of the cell region.

[0080] According to an embodiment of the present disclosure, a cell area sub-attribute may characterize the area occupied by a cell in a table. For example, the cell area sub-attribute may be characterized based on the cell area area, or may be characterized based on the area ratio relationship between a cell and other cells. Alternatively, the cell area sub-attribute may be represented based on other methods, such as representing the cell area sub-attribute based on the positional relationship between the current cell and the next cell. The embodiments of the present disclosure are not limited to this.

[0081] In one example, the cell area sub-attribute can be determined based on the number of rows and / or columns occupied by the cell. For example, the cell sub-attribute can be based on the sub-attribute identifier <rowspan=3> to indicate that the cell is a cell obtained by merging 3 rows. For another example, the cell sub-attribute can be based on the sub-attribute identifier <colspan=3> to indicate that the cell is a cell obtained by merging 3 columns. For another example, the cell sub-attribute can also include (<rowspan=3><colspan=3>). It should be understood that in this example, 3 can be the number of merged rows or columns.

[0082] In one example, the cell area sub-attributes can also be represented based on the arrangement of the cells. For example, the positional relationship between the current cell and the next cell can be represented based on the line break identifier to facilitate determining the table area occupied by the cell information, and it can also help the subsequent large model to regenerate editable cells and cell information based on the line break identifier.

[0083] In an example, the identifier "hello" may be used to indicate that the text information of a cell is "hello".

[0084] In one example, two cells in the first row and the second row in the same column may be represented based on the identifier "hello, yes", such as the cells shown in Table 1.

[0085] Table 1

[0086]

[0087] It should be understood that the cell area sub-attribute can be set to a corresponding sub-attribute identifier based on the characteristics of the table, as long as it can characterize the area occupied by the cell in the table.

[0088] According to an embodiment of the present disclosure, the target file information includes target table information displayed based on a table structure.

[0089] According to an embodiment of the present disclosure, a table image block can be identified based on cell sub-attributes to obtain table information displayed based on a table structure. The table information can include any type of cell information such as text and values ​​recorded in the cell, and the cell information is arranged according to the cell sub-attributes, so that the table information can be displayed according to the table structure.

[0090] According to an embodiment of the present disclosure, the target table information can represent the target cell information that matches the detection requirement information. The target cell information can be arranged according to a table structure that matches the detection requirement information and displayed on the terminal device of the target object, so as to more accurately display part of the table information that matches the detection requirement information to the target object, thereby improving the efficiency of the target object in obtaining the target file information.

[0091] Figure 5 An application scenario diagram of an image detection method based on a large language model according to another embodiment of the present disclosure is schematically shown.

[0092] like Figure 5 As shown, in this application scenario, the interactive interface of the smart phone can display an information input box K501 in the first display state 510, and the target object can input the detection requirement information and the file image to be detected in the information input box K501 through the interactive operation on the interactive interface. In response to the interactive operation of the target object, the first display state 510 can display the detection requirement information "analyze the sales volume of type A cars from 2001 to 2003" input by the target object in the first display box 511, and can also display the icon of the file image input by the target object in the second display box 512, and the icon of the file image can represent the image scans of the sales report for 2001, the sales report for 2002, and the sales report for 2003 that need to be detected. The smart phone can send the detection requirement information and the image scans of the sales report in 2001, the sales report in 2002, and the sales report in 2003 to the server, and the server can execute the image detection method based on the large language model provided by the embodiment of the present disclosure to determine the target file information that matches the detection requirement information of the target object from the image scans of the sales report in 2001, the sales report in 2002, and the sales report in 2003. The target file information can be target table information displayed in a table structure with multiple cells. The target table information can be shown in Table 2.

[0093] Table 2

[0094]

[0095] like Figure 5As shown, the target table information can be displayed in the feedback display box 521 in the second display state 520 of the interactive interface. The feedback display box 521 can also display feedback information for prompting the target object to browse conveniently. The feedback information can be "Sales volume of type A cars from 2001 to 2009... The statistical results are shown in the table below". The feedback information can be generated based on the large language model processing detection demand information and file structure attributes.

[0096] According to an embodiment of the present disclosure, detecting a table image block with table attributes to obtain cell sub-attributes may include: performing multi-scale feature extraction on the table image block to obtain table image features of N scales, where N is an integer greater than 1; fusing the table image features of N scales to obtain table fusion features, where the table fusion features include row fusion features and column fusion features; and processing the row fusion features and column fusion features based on an attention mechanism to obtain cell sub-attributes.

[0097] According to an embodiment of the present disclosure, multi-scale feature extraction can be performed on the table image block based on multiple convolutional neural network layers to obtain multi-scale table image features.

[0098] According to an embodiment of the present disclosure, fusing the table image features of N scales may include fusing the table image features of N scales based on an attention network algorithm. However, it is not limited thereto, and the table image features of N scales may also be fused based on a cascaded convolutional neural network layer.

[0099] According to an embodiment of the present disclosure, a plurality of row fusion features may be included, and the plurality of row fusion features may be obtained by dividing the initial table fusion features obtained after fusion according to the row direction of the table. A plurality of column fusion features may be included, and the plurality of column fusion features may be obtained by dividing the initial table fusion features obtained after fusion according to the column direction of the table.

[0100] According to an embodiment of the present disclosure, processing row fusion features and column fusion features based on an attention mechanism may include performing attention enhancement on multiple row fusion features and multiple column fusion features respectively based on an attention network algorithm to obtain multiple enhanced row fusion features and multiple enhanced column fusion features. Cell sub-attributes may be obtained by processing the enhanced multiple row fusion features and the enhanced multiple column fusion features based on a pre-trained detection branch network layer. The enhanced multiple row fusion features may capture cell layout attributes such as cell areas and cell positions between multiple rows of cells in a table image block. The enhanced multiple column fusion features may capture cell layout attributes such as cell areas and cell positions between multiple columns of cells in a table image block. Thus, the attention mechanism may be used to process multiple row fusion features and multiple column fusion features to more accurately capture the dependencies between cell sub-attributes such as the positional relationship and layout area relationship between cells in a table image block, thereby improving the detection accuracy of cell sub-attributes.

[0101] Figure 6 The schematic diagram shows a principle diagram of a table recognition model according to an embodiment of the present disclosure.

[0102] like Figure 6 As shown, the table recognition model 600 may include a feature extraction network 610 and a feature fusion network, and the feature fusion network may include an attention fusion layer 621 and an output layer 622. The feature extraction network 610 may include a plurality of cascaded convolutional neural network layers, each of which may output table image features corresponding to a preset scale. The attention fusion layer 621 may be constructed based on an attention network algorithm, for example, the attention fusion layer 621 may be constructed based on a self-attention network algorithm. The output layer 622 may be constructed based on a detection head of a target detection algorithm, so that the cell may be used as a detection frame to more accurately determine the cell sub-attributes of each of the plurality of cells in the table, and to improve the detection accuracy of the positional relationship between the plurality of cells.

[0103] like Figure 6 As shown, the table image block P601 is input into the feature extraction network 610, which can output table image features of multiple scales, and fuse the table image features of multiple scales to obtain row fusion features and column fusion features. The attention fusion network 621 can perform attention enhancement on the row fusion features and column fusion features respectively to obtain enhanced row fusion features and enhanced column fusion features. The enhanced row fusion features and enhanced column fusion features are spliced ​​and input into the output layer 622. The output layer 622 can output the first cell sub-attribute 601 in the table image block P601.

[0104] like Figure 6As shown, the first cell sub-attribute 601 may include a sub-attribute identifier and an identifier position, and the sub-attribute identifier may include a cell type identifier of the cell, a line break identifier, a merged multi-row identifier, and a merged multi-column identifier. The first cell sub-attribute 601 and multiple row fusion features can be input into the attention fusion network 621, and the enhanced row fusion features of the second round are output. The first cell sub-attribute 601 and multiple column fusion features are input into the attention fusion network 621, and the enhanced column fusion features of the second round are output. The second cell sub-attribute can be obtained by processing the enhanced row fusion features of the second round and the enhanced column fusion features of the second round using the output layer 622.

[0105] It should be understood that the i-th cell sub-attribute output by the table recognition model in the i-th round can be input into the attention fusion layer of the table recognition model in the i+1-th round, so that the attention fusion layer can fuse the i-th cell sub-attribute with the row fusion feature and the column fusion feature respectively based on the attention mechanism in the i+1-th round to obtain the i+1-th cell sub-attribute in the i+1-th round, so as to improve the detection accuracy of the cell sub-attributes.

[0106] In one example, the output layer of the table recognition model can be constructed based on the Gate Recurrent Unit (GRU) algorithm, so that the table structure relationship between multiple row fusion features and multiple column fusion features can be captured based on the gated recurrent unit, thereby improving the detection accuracy of cell sub-attributes.

[0107] According to an embodiment of the present disclosure, fusing table image features of N scales may include: fusing the table image features of the nth scale with the up-sampled features of the nth scale to obtain the first intermediate features of the nth scale; fusing the down-sampled features of the n-1th scale and the first intermediate features of the n-1th scale to obtain the second intermediate features of the n-1th scale; and determining the table fusion features based on the second intermediate features of the 1st scale.

[0108] According to an embodiment of the present disclosure, the upsampled feature of the nth scale is obtained by performing an upsample operation on the first intermediate feature of the n-1th scale, the first intermediate feature of the 1st scale is a table image feature of the 1st scale, and N≥n>1.

[0109] According to an embodiment of the present disclosure, the downsampled features at the n-1th scale are obtained by performing a downsampling operation on the second intermediate features at the nth scale, and the first intermediate features at the Nth scale are used as the second intermediate features at the Nth scale.

[0110] According to an embodiment of the present disclosure, determining the table fusion feature according to the second intermediate feature of the first scale includes: dividing the second intermediate feature of the first scale into row features based on the row quantity attribute to obtain multiple row fusion features; and dividing the second intermediate feature of the first scale into column features based on the column quantity attribute to obtain multiple column fusion features.

[0111] According to an embodiment of the present disclosure, determining the table fusion feature according to the second intermediate feature of the first scale may include determining the row quantity attribute and the column quantity attribute according to the channel reduction multiple of the table image block characterized by the Nth scale. The second intermediate feature of the first scale is divided according to the number of rows to obtain a plurality of row fusion features, and the second intermediate feature of the first scale is divided according to the number of columns to obtain a plurality of column fusion features.

[0112] It should be noted that the row quantity attribute can represent the number of row fusion features, and the row quantity attribute can be referred to as the row quantity. The column quantity attribute can represent the number of column fusion features, and the column quantity attribute can be referred to as the column quantity.

[0113] Figure 7 The schematic diagram shows a principle diagram of a feature extraction network according to an embodiment of the present disclosure.

[0114] like Figure 7 As shown, the feature extraction network 700 may include a first feature extraction layer 711, a second feature extraction layer 712, a third feature extraction layer 713, and a fourth feature extraction layer 714. The first feature extraction layer 711, the second feature extraction layer 712, the third feature extraction layer 713, and the fourth feature extraction layer 711 may perform multi-scale feature extraction on the table image block P701.

[0115] like Figure 7 As shown, the table image block P701 is input into the first feature extraction layer 711, and the table image features of the 4th scale are output. The table image features of the 4th scale are input into the second feature extraction layer 712, and the table image features of the 3rd scale are obtained. The table image features of the 3rd scale are input into the third feature extraction layer 713, and the table image features of the 2nd scale are obtained. The table image features of the 2nd scale are input into the fourth feature extraction layer 714, and the table image features of the 1st scale are obtained. It should be understood that in this embodiment, N=4.

[0116] like Figure 7As shown, in the case of n=2, the table image feature of the first scale is used as the first intermediate feature of the first scale. The first intermediate feature of the first scale is input to the upsampling layer 7211, and the upsampling layer 7211 performs an upsampling operation on the first intermediate feature of the first scale to obtain the upsampled feature of the second scale. Fusion of the table image feature of the nth scale with the upsampled feature of the nth scale to obtain the first intermediate feature of the nth scale may include: splicing the upsampled feature of the second scale and the table image feature of the second scale and inputting them into the first intermediate fusion layer 7212, which can realize the fusion of the table image feature of the second scale and the upsampled feature of the second scale, and output the first intermediate feature of the second scale.

[0117] like Figure 7 As shown, in the case of n=3, the first intermediate feature of the second scale is input to the upsampling layer 7221, and the upsampling layer 7221 performs an upsampling operation on the first intermediate feature of the second scale to obtain an upsampled feature of the third scale. Fusion of the table image feature of the nth scale with the upsampled feature of the nth scale to obtain the first intermediate feature of the nth scale may include: splicing the upsampled feature of the third scale and the table image feature of the third scale and inputting them into the first intermediate fusion layer 7222, so as to achieve fusion of the table image feature of the third scale with the upsampled feature of the third scale to obtain the first intermediate feature of the third scale.

[0118] like Figure 7 As shown, in the case of N=n=4, the first intermediate feature of the third scale is input to the upsampling layer 7231, and the upsampling layer 7231 performs an upsampling operation on the first intermediate feature of the third scale to obtain an upsampled feature of the fourth scale. Fusion of the table image feature of the nth scale with the upsampled feature of the nth scale to obtain the first intermediate feature of the nth scale may include: splicing the upsampled feature of the fourth scale and the table image feature of the fourth scale and inputting them into the first intermediate fusion layer 7232, so as to achieve fusion of the table image feature of the fourth scale with the upsampled feature of the fourth scale to obtain the first intermediate feature of the fourth scale.

[0119] like Figure 7As shown, in the case of N=n=4, fusing the downsampled features of the n-1th scale and the first intermediate features of the n-1th scale to obtain the second intermediate features of the n-1th scale may include: using the first intermediate features of the 4th scale as the second intermediate features of the 4th scale. The second intermediate features of the 4th scale are input into the downsampling layer 7311, and the downsampling layer 7311 performs a downsampling operation on the second intermediate features of the 4th scale to obtain the downsampled features of the 3rd scale. Fusing the downsampled features of the n-1th scale and the first intermediate features of the n-1th scale to obtain the second intermediate features of the n-1th scale may include: splicing the downsampled features of the 3rd scale and the table image features of the 3rd scale and inputting them into the second intermediate fusion layer 7312, which can achieve the fusion of the table image features of the 3rd scale and the downsampled features of the 3rd scale to obtain the second intermediate features of the 3rd scale.

[0120] like Figure 7 As shown, in the case of n=3, the second intermediate feature of the third scale is input to the downsampling layer 7321, and the downsampling layer 7321 performs a downsampling operation on the second intermediate feature of the third scale to obtain the downsampled feature of the second scale. Fusion of the downsampled feature of the n-1th scale and the first intermediate feature of the n-1th scale to obtain the second intermediate feature of the n-1th scale may include: splicing the downsampled feature of the second scale and the table image feature of the second scale and inputting them into the second intermediate fusion layer 7322, which can achieve fusion of the table image feature of the second scale and the downsampled feature of the second scale to obtain the second intermediate feature of the second scale.

[0121] like Figure 7 As shown, in the case of n=2, the second intermediate feature of the second scale is input to the downsampling layer 7331, and the downsampling layer 7331 performs a downsampling operation on the second intermediate feature of the second scale to obtain the downsampled feature of the first scale. Fusion of the downsampled feature of the n-1th scale and the first intermediate feature of the n-1th scale to obtain the second intermediate feature of the n-1th scale may include: splicing the downsampled feature of the first scale and the table image feature of the first scale and inputting them into the second intermediate fusion layer 7332, which can achieve fusion of the table image feature of the first scale and the downsampled feature of the first scale to obtain the second intermediate feature of the first scale.

[0122] like Figure 7 As shown, according to the second intermediate feature of the first scale, determining the table fusion feature may include inputting the second intermediate feature of the first scale into the feature segmentation layer 7411 to obtain the row fusion feature 701 and the column fusion feature 702. The table fusion feature may include the row fusion feature 701 and the column fusion feature 702.

[0123] In one example, the first intermediate fusion layer and the second intermediate fusion layer can be constructed based on a convolutional neural network algorithm.

[0124] In one example, the feature extraction network can also be constructed based on a lightweight backbone network algorithm.

[0125] In one example, the first to fourth scales may be 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the size of the table image block, respectively. The number of rows of the row fusion feature and the number of columns of the column fusion feature may be determined according to the fourth scale and the height (H) and width (W) of the table image block.

[0126] In one example, the number of rows may be expressed as H / 32, and the number of columns may be expressed as W / 32. H and W represent the height and width of the table image block, respectively.

[0127] In one example, the table sub-attribute may be represented based on an element tag of HTML (Hyper Text Markup Language). Table file information having a table structure may be generated based on the HTML element tag and cell information recognized from the table image block.

[0128] According to an embodiment of the present disclosure, by fusing table image features of multiple scales with upsampled features corresponding to the scales, and fusing first intermediate features of multiple scales with second intermediate features of corresponding scales, to obtain second intermediate features of the first scale, the semantic attributes of multiple cells in the table image block, as well as the positional relationship and size relationship between multiple cells can be fully extracted and fused based on a multi-level joint fusion method for table image features, first intermediate features, and second intermediate features, thereby avoiding the loss of cell attributes and dependencies between cells. By dividing the second intermediate features of the first scale into multiple row fusion features and multiple column fusion features, and then processing the multiple row fusion features and the multiple column fusion features separately based on the attention mechanism, the enhanced multiple row fusion features and the enhanced multiple column fusion features can more accurately represent the table structure relationship between cells in different rows, and accurately represent the table structure relationship between cells in different columns. Therefore, by generating cell sub-attributes based on the enhanced multiple row fusion features and the enhanced multiple column fusion features, the relationship between cell sub-attributes can be more accurately detected.

[0129] Figure 8 The principle diagram of a feature fusion network according to an embodiment of the present disclosure is schematically shown.

[0130] like Figure 8As shown, the feature fusion network 800 may include an attention fusion layer 810 and an output layer 820. In the i-th round, multiple row fusion features 801 may be input into the attention fusion layer 810 with the i-1-th table sub-attribute, and the first multi-head attention sub-layer of the attention fusion layer 810 may perform attention fusion on the multiple row fusion features 801 to obtain multiple enhanced row fusion features. The enhanced multiple row fusion features are used as query features, and the i-1-th table sub-attribute is used as the key feature and value feature, and input into the second multi-head attention sub-layer of the attention fusion layer 810 for multi-head attention fusion to obtain multiple target row fusion features of the i-th round. Multiple column fusion features 801 may be input into the attention fusion layer 810 with the i-1-th table sub-attribute, and the first multi-head attention sub-layer of the attention fusion layer 810 may perform column attention fusion on the multiple column fusion features 801 to obtain multiple enhanced column fusion features. The enhanced multiple column fusion features are used as query features, and the i-1th table sub-attribute is used as the key feature and value feature, and input into the second multi-head attention sub-layer of the attention fusion layer 810 for multi-head attention fusion to obtain the multiple target column fusion features of the i-th round. The concatenation result of the multiple target row fusion features of the i-th round and the multiple target column fusion features of the i-th round is input into the output layer 820 to output the i-th table sub-attribute.

[0131] According to an embodiment of the present disclosure, the table recognition model provided by the embodiment of the present disclosure can be trained based on sample data.

[0132] Fig. 9 The schematic diagram shows a principle diagram of sample data generation according to an embodiment of the present disclosure.

[0133] like Fig. 9 As shown, the corpus to be screened and the structure identifier can be input into the corpus arrangement component 901, and the structure identifier can be characterized based on the HTML element tag, for example, based on the identifier, and the characterization is performed. The corpus arrangement component 901 can arrange the corpus to be screened and the structure identifier to obtain the initial arrangement corpus data, and generate page data from the arranged initial sample data. The page data may include table data corresponding to the structure identifier. By inputting the table data into the image generation component 902, the image information of the table data can be generated to obtain a sample table image block P901. It should be noted that the table data can have a variety of table format attributes, and the table format attributes can include cell fill attributes, table line attributes, and the like. The number of sample table image blocks P901 can include one or more, and the sample table image block P901 can also represent the table data of the diversified table format attributes. The sample table image block P901 can include a wireless table, a double-line table, and the like.

[0134] In order to obtain the cell coordinates of the wireless table. The sample table image block P901 can be input into the annotation information generation component 903. The annotation information generation component 903 can generate a reference sample table image with fully enclosed table lines, which is used to find the cell position in the sample table image block P901. Use the straight line detection tool to determine all the table line intersections of the reference sample table image and determine the vertices of the cells in the table. Generate the detection frame coordinates related to the cell based on the known table structure identifier. Use the cell detection frame coordinates to annotate the cells in the sample table image block P901 to obtain the annotated sample table image block. According to

[0135] Based on the initial layout corpus data and the annotated sample table image blocks, sample data for training the table recognition model can be generated. The sample data includes the HTML structure and the coordinates of each cell.

[0136] According to an embodiment of the present disclosure, using a large language model to process file structure attributes and detection requirement information may include: using a large language model to process prompt information.

[0137] According to an embodiment of the present disclosure, the prompt information may include a prompt tag sequence based on a prompt template and used to help a language model understand the requirement intention of detecting the requirement information. The prompt tag sequence can be used to help a large language model understand the target file information extraction task of the prompt information.

[0138] According to an embodiment of the present disclosure, prompt information is generated based on the text to be processed and the detection requirement information. The text to be processed can be determined based on the associated file structure attributes and attribute image block text. The attribute image block text is obtained by performing text recognition on the attribute image block in the file image. The attribute image block associated with the file structure attribute can be obtained by performing file structure detection on the file image. The attribute image block can include a table image block, a text image block, a title image block, and the like.

[0139] According to the embodiments of the present disclosure, by updating the corresponding prompt template based on the detection requirement information, the associated file structure attributes and the text to be processed, the prompt information can more accurately represent the file information corresponding to each file structure attribute in the file image, and the large language model can more accurately understand the detection requirement intention of the target object based on the detection requirement information in the prompt information. Therefore, using the large language model to process the prompt information can enable the large language model to more accurately identify and extract the target file information corresponding to the detection requirement intention of the target object from the file image, improve the interpretability of the large language model in the process of performing the target file information extraction, avoid the black box processing process that occurs in the large language model during the execution of the target file information extraction task, improve the interpretability of the large language model in executing the processing task, and facilitate timely adjustment of the extraction strategy of the target file information.

[0140] Fig.10 The system architecture diagram of the question-answering system based on the large language model according to an embodiment of the present disclosure is schematically shown.

[0141] like Fig.10 As shown, the question-answering system 1000 may include a target detection module, a prompt engineering module, a large language model module, and a service module. The target detection module may include multiple target detection models. Multiple target detection models may be used to detect attribute image blocks in file images, and to detect cells in table image blocks, respectively. The model parameter amount of the target detection model may be smaller than the model parameter amount of the large language model. The prompt engineering module may be used to configure the associated prompt template for the detection requirement information and the file structure attribute. And the prompt information may be generated based on the identified text to be processed, the detection requirement information, and the file structure attribute. The large language model module may be used to control the large language model to process the prompt information, and perform the information extraction task of the target file information to generate the target file information. The service module may provide a service interface for the smart terminal, or provide an offline software development kit, so that the target object can call the target detection model and the large language model of the question-answering system 1000 through the question-answering method to detect the file image of the business license, form, contract, etc., and obtain the target file information.

[0142] According to an embodiment of the present disclosure, the question-answering system may also have other functions, such as vector storage, vector retrieval, multi-page file interception, etc.

[0143] An embodiment of the present disclosure also provides an image recognition method.

[0144] Fig.11 The flowchart of the image recognition method according to the embodiment of the present disclosure is schematically shown.

[0145] like Fig.11 As shown, the image recognition method includes operations S1110 to S1140.

[0146] In operation S1110, multi-scale feature extraction is performed on the table image block in the document image to obtain table image features of N scales, where N is an integer greater than 1.

[0147] In operation S1120, table image features of the N scales are fused to obtain table fusion features, where the table fusion features include row fusion features and column fusion features.

[0148] In operation S1130, the row fusion features and the column fusion features are processed based on the attention mechanism to obtain cell sub-attributes.

[0149] In operation S1140, the table image block is identified based on the cell sub-attributes to obtain table information displayed based on the table structure.

[0150] According to an embodiment of the present disclosure, fusing table image features of N scales to obtain table fusion features includes: fusing table image features of the nth scale with upsampled features of the nth scale to obtain first intermediate features of the nth scale, wherein the upsampled features of the nth scale are obtained by performing an upsampling operation on the first intermediate features of the n-1th scale, the first intermediate features of the 1st scale are table image features of the 1st scale, the nth scale is greater than the n-1th scale, N≥n>1; fusing downsampled features of the n-1th scale and the first intermediate features of the n-1th scale to obtain second intermediate features of the n-1th scale, wherein the downsampled features of the n-1th scale are obtained by performing a downsampling operation on the second intermediate features of the nth scale, and the second intermediate features of the Nth scale are the first intermediate features of the Nth scale; and determining the table fusion features according to the second intermediate features of the 1st scale.

[0151] According to an embodiment of the present disclosure, determining the table fusion feature according to the second intermediate feature of the first scale includes: dividing the second intermediate feature of the first scale into row features based on the row quantity attribute to obtain multiple row fusion features; and dividing the second intermediate feature of the first scale into column features based on the column quantity attribute to obtain multiple column fusion features.

[0152] According to an embodiment of the present disclosure, the table image block is identified based on the cell sub-attributes to obtain table information displayed based on the table structure, including: determining the cell text corresponding to the cell attributes from the text obtained by identifying the table image block; and constructing the table information based on the cell attributes and the cell text.

[0153] According to an embodiment of the present disclosure, the cell sub-attribute includes at least one of the following: a cell position sub-attribute and a cell area sub-attribute.

[0154] It should be noted that the table recognition method provided in the embodiments of the present disclosure can be implemented based on the table recognition model provided in the above embodiments. The exemplary execution process of the table recognition method provided in the embodiments of the present disclosure can be implemented based on the relevant description of the table recognition model in the above embodiments. The embodiments of the present disclosure will not be repeated here.

[0155] Fig.12 A block diagram of an image detection device based on a large language model according to an embodiment of the present disclosure is schematically shown.

[0156] like Fig.12As shown, the image detection device 1200 based on the large language model includes: a first determination module 1210, a detection module 1220 and a target file information acquisition module 1230.

[0157] The first determination module 1210 is used to determine the document image and detection requirement information specified by the target object in response to the detection instruction.

[0158] The detection module 1220 is used to perform file structure detection on the file image to obtain the file structure attributes represented by the file image.

[0159] The target file information obtaining module 1230 is used to process the file structure attributes and the detection requirement information using the large language model, so as to determine the target file information matching the detection requirement information from the file image.

[0160] According to an embodiment of the present disclosure, the file structure attribute includes a table attribute.

[0161] According to an embodiment of the present disclosure, the detection module includes a detection submodule.

[0162] The detection submodule is used to detect the table image block with table attributes to obtain cell sub-attributes, wherein the file image includes the table image block.

[0163] According to an embodiment of the present disclosure, the detection submodule includes a table image feature obtaining unit, a fusion unit and a cell sub-attribute obtaining unit.

[0164] The table image feature acquisition unit is used to perform multi-scale feature extraction on the table image block to obtain table image features of N scales, where N is an integer greater than 1.

[0165] The fusion unit is used to fuse the table image features of N scales to obtain table fusion features, and the table fusion features include row fusion features and column fusion features.

[0166] The cell sub-attribute obtaining unit is used to process row fusion features and column fusion features based on the attention mechanism to obtain cell sub-attributes.

[0167] According to an embodiment of the present disclosure, the fusion unit includes: a first fusion subunit, a second fusion subunit and a table fusion feature acquisition subunit.

[0168] The first fusion subunit is used to fuse the table image feature of the nth scale with the upsampled feature of the nth scale to obtain the first intermediate feature of the nth scale, wherein the upsampled feature of the nth scale is obtained by performing an upsampling operation on the first intermediate feature of the n-1th scale, and the first intermediate feature of the 1st scale is the table image feature of the 1st scale, and N≥n>1.

[0169] The second fusion subunit is used to fuse the downsampled features of the n-1th scale and the first intermediate features of the n-1th scale to obtain the second intermediate features of the n-1th scale, wherein the downsampled features of the n-1th scale are obtained by performing a downsampling operation on the second intermediate features of the nth scale, and the first intermediate features of the Nth scale are used as the second intermediate features of the Nth scale.

[0170] The table fusion feature obtaining subunit is used to determine the table fusion feature according to the second intermediate feature of the first scale.

[0171] According to an embodiment of the present disclosure, the target file information includes target table information displayed based on a table structure.

[0172] According to an embodiment of the present disclosure, the target file information obtaining module includes a prompt information processing submodule.

[0173] The prompt information processing submodule is used to process the prompt information using a large language model, wherein the prompt information is generated based on the text to be processed and the detection requirement information, the text to be processed is determined based on the associated file structure attributes and attribute image block text, and the attribute image block text is obtained by performing text recognition on the attribute image block in the file image.

[0174] According to an embodiment of the present disclosure, the image detection device 1200 based on a large language model further includes: a detection instruction generating module and a sending module.

[0175] The detection instruction generation module is used to generate a detection instruction in response to the target object's interactive operation on the interactive interface.

[0176] The sending module is used to push the target file information to the target object.

[0177] Fig.13 The block diagram of an image recognition device according to an embodiment of the present disclosure is schematically shown.

[0178] like Fig.13 As shown, the image recognition device 1300 includes: a table image feature acquisition module 1310 , a table fusion feature acquisition module 1320 , a cell sub-attribute acquisition module 1330 and a recognition module 1340 .

[0179] The table image feature acquisition module 1310 is used to perform multi-scale feature extraction on the table image block in the document image to obtain table image features of N scales, where N is an integer greater than 1.

[0180] The table fusion feature acquisition module 1320 is used to fuse the table image features of each of the N scales to obtain the table fusion features, which include row fusion features and column fusion features.

[0181] The cell sub-attribute obtaining module 1330 is used to process the row fusion features and the column fusion features based on the attention mechanism to obtain the cell sub-attributes.

[0182] The recognition module 1340 is used to recognize the table image block based on the cell sub-attributes to obtain the table information displayed based on the table structure.

[0183] According to an embodiment of the present disclosure, the table fusion feature acquisition module includes: a first fusion submodule, a second fusion submodule and a table fusion feature fusion submodule.

[0184] The first fusion submodule is used to fuse the table image feature of the nth scale with the upsampled feature of the nth scale to obtain the first intermediate feature of the nth scale, wherein the upsampled feature of the nth scale is obtained by performing an upsampling operation on the first intermediate feature of the n-1th scale, the first intermediate feature of the 1st scale is the table image feature of the 1st scale, the nth scale is greater than the n-1th scale, and N≥n>1.

[0185] The second fusion submodule is used to fuse the downsampled features of the n-1th scale and the first intermediate features of the n-1th scale to obtain the second intermediate features of the n-1th scale, wherein the downsampled features of the n-1th scale are obtained by performing a downsampling operation on the second intermediate features of the nth scale, and the second intermediate features of the Nth scale are the first intermediate features of the Nth scale.

[0186] The table fusion feature fusion submodule is used to determine the table fusion feature according to the second intermediate feature of the first scale.

[0187] According to an embodiment of the present disclosure, the table fusion feature fusion submodule includes: a first division unit and a second division unit.

[0188] The first division unit is used to perform row feature division on the second intermediate feature of the first scale based on the row quantity attribute to obtain a plurality of row fusion features.

[0189] The second division unit is used to perform column feature division on the second intermediate feature of the first scale based on the column quantity attribute to obtain a plurality of column fusion features.

[0190] According to an embodiment of the present disclosure, the recognition module includes a cell text determination submodule and a table information construction submodule.

[0191] The cell text determination submodule is used to determine the cell text corresponding to the cell attribute from the text obtained by recognizing the table image block.

[0192] The table information construction submodule is used to construct table information based on cell attributes and cell text.

[0193] According to an embodiment of the present disclosure, the cell sub-attribute includes at least one of the following: a cell position sub-attribute and a cell area sub-attribute.

[0194] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0195] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method as described above.

[0196] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method as described above.

[0197] According to an embodiment of the present disclosure, a computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the method as described above.

[0198] Fig.14 A schematic block diagram suitable for implementing an image detection method and an image recognition method based on a large language model that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0199] like Fig.14 As shown, the device 1400 includes a computing unit 1401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1402 or a computer program loaded from a storage unit 1408 into a random access memory (RAM) 1403. In the RAM 1403, various programs and data required for the operation of the device 1400 can also be stored. The computing unit 1401, the ROM 1402, and the RAM 1403 are connected to each other via a bus 1404. An input / output (I / O) interface 1405 is also connected to the bus 1404.

[0200] A number of components in the device 1400 are connected to the I / O interface 1405, including: an input unit 1406, such as a keyboard, a mouse, etc.; an output unit 1407, such as various types of displays, speakers, etc.; a storage unit 1408, such as a disk, an optical disk, etc.; and a communication unit 1409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1409 allows the device 1400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0201] The computing unit 1401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1401 performs the various methods and processes described above, such as an image detection method or an image recognition method based on a large language model. For example, in some embodiments, the image detection method or image recognition method based on a large language model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1400 via the ROM 1402 and / or the communication unit 1409. When the computer program is loaded into the RAM 1403 and executed by the computing unit 1401, one or more steps of the image detection method or image recognition method based on the large language model described above may be performed. Alternatively, in other embodiments, the computing unit 1401 may be configured to execute an image detection method or an image recognition method based on a large language model in any other appropriate manner (for example, by means of firmware).

[0202] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0203] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0204] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0205] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0206] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0207] A computer system may include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server combined with a blockchain.

[0208] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0209] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. An image detection method based on a large language model, comprising: In response to the detection instruction, determining the document image and detection requirement information specified by the target object; Performing file structure detection on the file image to obtain file structure attributes represented by the file image; as well as The file structure attributes and the detection requirement information are processed using a large language model, so as to determine target file information matching the detection requirement information from the file image.

2. The method according to claim 1, wherein: The file structure attributes include table attributes; The performing of file structure detection on the file image to obtain the file structure attribute represented by the file image includes: The table image block having the table attribute is detected to obtain cell sub-attributes, wherein the file image includes the table image block.

3. The method according to claim 2, wherein: The detecting of the table image block having the table attribute to obtain the cell sub-attribute includes: Performing multi-scale feature extraction on the table image block to obtain table image features of N scales, where N is an integer greater than 1; Fusing the table image features of the N scales to obtain table fusion features, where the table fusion features include row fusion features and column fusion features; The row fusion features and the column fusion features are processed based on the attention mechanism to obtain the cell sub-attributes.

4. The method according to claim 3, wherein: The fusion of the table image features of N scales includes: Fusing the table image feature of the nth scale with the upsampled feature of the nth scale to obtain a first intermediate feature of the nth scale, wherein the upsampled feature of the nth scale is obtained by performing an upsampling operation on the first intermediate feature of the n-1th scale, and the first intermediate feature of the 1st scale is the table image feature of the 1st scale, N≥n>1; Fusing the downsampled features of the n-1th scale and the first intermediate features of the n-1th scale to obtain the second intermediate features of the n-1th scale, wherein the downsampled features of the n-1th scale are obtained by performing a downsampling operation on the second intermediate features of the nth scale, and the first intermediate features of the Nth scale are used as the second intermediate features of the Nth scale; and The table fusion feature is determined according to the second intermediate feature of the first scale.

5. The method according to claim 2, wherein: The cell sub-attribute includes at least one of the following: Cell position sub-properties, cell range sub-properties.

6. The method according to claim 2, wherein: The target file information includes target table information displayed based on a table structure.

7. The method according to claim 1, wherein: The processing of the file structure attributes and the detection requirement information by using a large language model includes: The large language model is used to process prompt information, wherein the prompt information is generated based on the text to be processed and the detection requirement information, the text to be processed is determined based on associated file structure attributes and attribute image block text, and the attribute image block text is obtained by performing text recognition on the attribute image block in the file image.

8. The method according to claim 1, wherein: The file structure attribute includes at least one of the following: File name attribute, summary attribute, comment attribute, image identification attribute, table identification attribute.

9. The method according to claim 1, further comprising: In response to the target object's interactive operation on the interactive interface, generating a detection instruction; as well as Push the target file information to the target object.

10. An image recognition method, comprising: Perform multi-scale feature extraction on the table image block in the document image to obtain table image features of N scales, where N is an integer greater than 1; Fusing the table image features of the N scales to obtain table fusion features, where the table fusion features include row fusion features and column fusion features; Processing the row fusion features and the column fusion features based on an attention mechanism to obtain the cell sub-attribute; as well as The table image block is identified based on the cell sub-attribute to obtain table information displayed based on the table structure.

11. The method according to claim 10, wherein: The fusion of the table image features of N scales to obtain the table fusion features includes: Fusing the table image feature of the nth scale with the upsampled feature of the nth scale to obtain a first intermediate feature of the nth scale, wherein the upsampled feature of the nth scale is obtained by performing an upsampling operation on the first intermediate feature of the n-1th scale, the first intermediate feature of the first scale is the table image feature of the first scale, the nth scale is greater than the n-1th scale, and N≥n>1; Fusing the downsampled features of the n-1th scale and the first intermediate features of the n-1th scale to obtain the second intermediate features of the n-1th scale, wherein the downsampled features of the n-1th scale are obtained by performing a downsampling operation on the second intermediate features of the nth scale, and the second intermediate features of the Nth scale are the first intermediate features of the Nth scale; and The table fusion feature is determined according to the second intermediate feature of the first scale.

12. The method according to claim 11, wherein: Determining the table fusion feature according to the second intermediate feature of the first scale includes: Performing row feature division on the second intermediate feature of the first scale based on the row quantity attribute to obtain a plurality of row fusion features; and The second intermediate features of the first scale are divided into column features based on the column quantity attribute to obtain a plurality of the column fusion features.

13. The method according to claim 10, wherein: The identifying the table image block based on the cell sub-attribute to obtain table information displayed based on the table structure includes: Determining a cell text corresponding to the cell attribute from the text recognized from the table image block; The table information is constructed based on the cell attributes and the cell text.

14. The method according to claim 10 or 13, wherein: The cell sub-attribute includes at least one of the following: Cell position sub-properties, cell range sub-properties.

15. An image detection device based on a large language model, comprising: A first determination module, configured to determine, in response to a detection instruction, a document image and detection requirement information specified by a target object; A detection module, used to perform file structure detection on the file image to obtain file structure attributes represented by the file image; as well as The target file information obtaining module is used to process the file structure attributes and the detection requirement information using a large language model, so as to determine the target file information matching the detection requirement information from the file image.

16. The device according to claim 15, wherein: The file structure attributes include table attributes; Wherein, the detection module comprises: The detection submodule is used to detect the table image block having the table attribute to obtain the cell sub-attribute, wherein the file image includes the table image block.

17. The device according to claim 16, wherein: The detection submodule comprises: a table image feature obtaining unit, used for performing multi-scale feature extraction on the table image block to obtain table image features of N scales, where N is an integer greater than 1; A fusion unit, used for fusing the table image features of the N scales to obtain a table fusion feature, wherein the table fusion feature includes a row fusion feature and a column fusion feature; The cell sub-attribute obtaining unit is used to process the row fusion feature and the column fusion feature based on the attention mechanism to obtain the cell sub-attribute.

18. The device according to claim 17, wherein: The fusion unit comprises: A first fusion subunit is used to fuse the table image feature of the nth scale with the upsampled feature of the nth scale to obtain a first intermediate feature of the nth scale, wherein the upsampled feature of the nth scale is obtained by performing an upsampling operation on the first intermediate feature of the n-1th scale, and the first intermediate feature of the 1st scale is the table image feature of the 1st scale, and N≥n>1; A second fusion subunit is used to fuse the downsampled features of the n-1th scale and the first intermediate features of the n-1th scale to obtain the second intermediate features of the n-1th scale, wherein the downsampled features of the n-1th scale are obtained by performing a downsampling operation on the second intermediate features of the nth scale, and the first intermediate features of the Nth scale are used as the second intermediate features of the Nth scale; and The table fusion feature obtaining subunit is used to determine the table fusion feature according to the second intermediate feature of the first scale.

19. The device according to claim 16, wherein: The target file information includes target table information displayed based on a table structure.

20. The device according to claim 15, wherein: The target file information obtaining module includes: A prompt information processing submodule is used to process prompt information using the large language model, wherein the prompt information is generated based on the text to be processed and the detection requirement information, the text to be processed is determined based on the associated file structure attributes and attribute image block text, and the attribute image block text is obtained by performing text recognition on the attribute image block in the file image.

21. The apparatus according to claim 15, further comprising: A detection instruction generating module, used for generating a detection instruction in response to the target object's interactive operation on the interactive interface; as well as A sending module is used to push the target file information to the target object.

22. An image recognition device, comprising: The table image feature acquisition module is used to perform multi-scale feature extraction on the table image block in the file image to obtain table image features of N scales, where N is an integer greater than 1; A table fusion feature acquisition module is used to fuse the table image features of each of the N scales to obtain a table fusion feature, wherein the table fusion feature includes a row fusion feature and a column fusion feature; A cell sub-attribute obtaining module, used for processing the row fusion feature and the column fusion feature based on an attention mechanism to obtain the cell sub-attribute; as well as The recognition module is used to recognize the table image block based on the cell sub-attribute to obtain table information displayed based on the table structure.

23. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.

24. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 10 to 14.

25. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 14.

26. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Text structuring processing method and device, electronic equipment and storage medium

    CN113627439A

  • Image target detection method and device, equipment and storage medium

    CN113936256A

  • Table recognition method and device, computer equipment and storage medium

    CN114005125A

  • Table structure identification method based on image instance segmentation

    CN115331245A

  • Method and device for restoring table structure, electronic equipment and storage medium

    CN115620325A

Cited By

  • Data identification method and device, computer equipment, storage medium and program product

    CN120318842A