Table reconstruction method, device, electronic device and storage medium

By extracting features of table images and performing grid line reconstruction and cell merging, the problem of poor table recognition performance in the existing technology is solved, and more efficient table recognition and reconstruction are achieved.

CN117973337BActive Publication Date: 2024-10-11INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410102694.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2024-10-11
Estimated Expiration
2044-01-24

AI Technical Summary

Technical Problem

In existing table recognition technology, the content recognition branch lacks the interdependence between structures, resulting in poor recognition performance.

Method used

By acquiring table images, extracting image features and determining cell categories, coordinates and pixel masks, grid line reconstruction and cell merging are performed, interdependencies between cells are fused, and structure and content information are used to achieve table reconstruction.

Benefits of technology

The performance of table recognition is improved, the table structure can be more accurately identified and reconstructed, and the accuracy and efficiency of recognition are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117973337B_ABST
    Figure CN117973337B_ABST
Patent Text Reader

Abstract

The present invention provides a table reconstruction method, device, electronic device and storage medium, which are applied to the field of image processing technology. The method comprises: obtaining a table image; extracting image features of the table image, and determining the cell category, cell coordinates and cell pixel mask of the table image according to the image features; reconstructing grid lines according to the cell coordinates and the cell pixel mask to obtain a first table, and merging cells of the first table according to the cell category to obtain a second table; wherein the cell category includes blank cells, basic cells and merged cells.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a table reconstruction method, device, electronic equipment and storage medium. Background Art

[0002] Table recognition technology refers to the use of computer systems to automatically parse the table area contained in an image into a structured table and store it. Table recognition technology can quickly and effectively help people recognize and understand the table content in an image, and can quickly parse the table in the image into a computer-readable format to facilitate the electronic storage of the table content and subsequent content analysis.

[0003] The table recognition technology architecture in the prior art is to first separate the structure recognition branch and the content recognition branch of the table image, and then realize the structured analysis of the table content through merging processing.

[0004] However, due to the difference in modal information between the structure recognition branch and the content recognition branch, the content recognition branch lacks the interdependence between structures and has poor recognition performance. Summary of the invention

[0005] The present invention provides a table reconstruction method, device, electronic device and storage medium, which are used to solve the problem that content recognition branches of table recognition technology in the prior art lack interdependence between structures and have poor recognition performance.

[0006] The present invention provides a table reconstruction method, comprising: acquiring a table image; extracting image features of the table image, and determining the cell category, cell coordinates and cell pixel mask of the table image according to the image features; reconstructing grid lines according to the cell coordinates and the cell pixel mask to obtain a first table, and merging cells of the first table according to the cell category to obtain a second table; wherein the cell category includes blank cells, basic cells and merged cells.

[0007] According to a table reconstruction method provided by the present invention, the cell category, cell coordinates and cell pixel mask of the table image are determined according to the image features, including: determining a first candidate box and a first candidate feature; predicting a target object feature according to the image features, the first candidate box and the first candidate feature; and obtaining the cell category, the cell coordinates and the cell pixel mask by decoding the target object feature.

[0008] According to a table reconstruction method provided by the present invention, the target object feature is determined according to the image feature, the first candidate frame and the first candidate feature, including: performing a multi-head self-attention transformation on the first candidate feature to obtain a second candidate feature; performing frame area interest alignment on the first candidate frame and the image feature to obtain a first frame feature; performing dynamic convolution module enhancement on the second candidate feature and the first frame feature to obtain a second frame feature, and determining a second candidate frame based on the second frame feature, and updating the first candidate frame to the second candidate frame; performing mask area interest alignment on the second frame feature and the image feature to obtain a first pixel mask; performing dynamic convolution module enhancement on the second candidate feature and the first pixel mask to obtain the target object feature.

[0009] According to a table reconstruction method provided by the present invention, the obtaining of the table image includes: resizing the image to be processed according to a preset size; identifying the position of the table in the image to be processed, and segmenting the table image from the image to be processed according to the position of the table.

[0010] According to a table reconstruction method provided by the present invention, the extraction of image features of the table image includes: determining the feature expression of the table image through a convolutional neural network, determining the multi-scale feature representation of the feature expression through a feature pyramid network, and obtaining the image features.

[0011] According to a table reconstruction method provided by the present invention, before obtaining the table image, the method further includes: obtaining training data, the training data including training images and image labels, the image labels including category labels, coordinate labels and pixel labels; inputting the training image into a table recognition model to obtain a first cell category, a first cell coordinate and a first cell pixel mask; determining a first loss according to the first cell category and the category label, determining a second loss according to the first cell coordinate and the coordinate label, and determining a third loss according to the first cell pixel mask and the pixel label; performing weighted summation of the first loss, the second loss and the third loss based on a predefined weight coefficient to obtain a target loss; and updating the model parameters of the table recognition model according to the target loss.

[0012] According to a table reconstruction method provided by the present invention, the step of extracting image features of the table image and determining the cell category, cell coordinates and cell pixel mask of the table image based on the image features comprises: extracting the image features of the table image through the table recognition model, and predicting the cell category, cell coordinates and cell pixel mask of the table image based on the image features.

[0013] The present invention also provides a table reconstruction device, comprising: an acquisition module and a processing module; the acquisition module is used to acquire a table image; the processing module is used to extract image features of the table image, and determine the cell category, cell coordinates and cell pixel mask of the table image according to the image features; grid line reconstruction is performed according to the cell coordinates and the cell pixel mask to obtain a first table, and cells of the first table are merged according to the cell category to obtain a second table; wherein the cell category includes blank cells, basic cells and merged cells.

[0014] According to a table reconstruction device provided by the present invention, the processing module is used to: determine a first candidate box and a first candidate feature; predict target object features based on the image features, the first candidate box and the first candidate feature; and obtain the cell category, the cell coordinates and the cell pixel mask by decoding the target object features.

[0015] According to a table reconstruction device provided by the present invention, the processing module is used to: perform a multi-head self-attention transformation on the first candidate feature to obtain a second candidate feature; perform frame area interest alignment on the first candidate frame and the image feature to obtain a first frame feature; perform dynamic convolution module enhancement on the second candidate feature and the first frame feature to obtain a second frame feature, and determine a second candidate frame based on the second frame feature, and update the first candidate frame to the second candidate frame; perform mask area interest alignment on the second frame feature and the image feature to obtain a first pixel mask; perform dynamic convolution module enhancement on the second candidate feature and the first pixel mask to obtain the target object feature.

[0016] According to a table reconstruction device provided by the present invention, the acquisition module is used to: resize the image to be processed according to a preset size; identify the position of the table in the image to be processed, and segment the table image from the image to be processed according to the table position.

[0017] According to a table reconstruction device provided by the present invention, the processing module is used to: determine the feature expression of the table image through a convolutional neural network, determine the multi-scale feature representation of the feature expression through a feature pyramid network, and obtain the image feature.

[0018] According to a table reconstruction device provided by the present invention, the acquisition module is used to: acquire training data, the training data includes training images and image labels, the image labels include category labels, coordinate labels and pixel labels; the processing module is used to: input the training images into a table recognition model to obtain a first cell category, a first cell coordinate and a first cell pixel mask; determine a first loss according to the first cell category and the category label, determine a second loss according to the first cell coordinate and the coordinate label, and determine a third loss according to the first cell pixel mask and the pixel label; perform weighted summation of the first loss, the second loss and the third loss based on a predefined weight coefficient to obtain a target loss; and update the model parameters of the table recognition model according to the target loss.

[0019] According to a table reconstruction device provided by the present invention, the processing module is used to: extract image features of the table image through the table recognition model, and predict the cell category, cell coordinates and cell pixel mask of the table image according to the image features.

[0020] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above table reconstruction methods are implemented.

[0021] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the table reconstruction methods described above are implemented.

[0022] The table reconstruction method, device, electronic device and storage medium provided by the present invention can obtain a table image; extract the image features of the table image, and determine the cell category, cell coordinates and cell pixel mask of the table image according to the image features; reconstruct the grid lines according to the cell coordinates and the cell pixel mask to obtain a first table, and merge the cells of the first table according to the cell category to obtain a second table; wherein the cell category includes blank cells, basic cells and merged cells. Through this scheme, the cell category, cell coordinates and cell pixel mask of the table image can be determined according to the image features, and the second table can be reconstructed according to the cell category, cell coordinates and cell pixel mask. Since the cell category, cell coordinates and cell pixel mask can fuse the interdependence between cells, the information between the structure and the content can be used simultaneously to achieve table reconstruction, thereby improving recognition performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 It is one of the flow charts of the table reconstruction method provided by the present invention;

[0025] Figure 2 This is the second flow chart of the table reconstruction method provided by the present invention;

[0026] Figure 3 This is the third flow chart of the table reconstruction method provided by the present invention;

[0027] Figure 4 is a structural schematic diagram of a table reconstruction device provided by the present invention;

[0028] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0031] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present invention is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0032] In order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", etc. are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. are not limiting the quantity and execution order.

[0033] The embodiments of the present invention describe some exemplary embodiments for the purpose of explanation. It should be understood that the present invention can be implemented in other ways that are not specifically shown in the drawings.

[0034] The above implementation is described in detail below with reference to specific embodiments and drawings.

[0035] like Figure 1 As shown, an embodiment of the present invention provides a table reconstruction method, which can be applied to a table reconstruction device. The table reconstruction method may include S101-S103:

[0036] S101. A table reconstruction device obtains a table image.

[0037] The above table image is an image containing table elements.

[0038] Optionally, the table reconstruction device may perform a size conversion process on the image to be processed according to a preset size; identify a table position in the image to be processed, and segment the table image from the image to be processed according to the table position.

[0039] Specifically, the table reconstruction device can perform a preprocessing operation on the input image, and the preprocessing operation includes first adjusting the size of the input image to a preset size (img W *imgH ), where img W Indicates the image width, img H represents the image height, and then the table position in the input image is detected by the table image detection algorithm. Finally, the image containing the table is segmented according to the table position to obtain a table image, which can be represented as a matrix (img W *img H *img C ), where img C Indicates the number of image channels.

[0040] S102: The table reconstruction device extracts image features of the table image, and determines the cell category, cell coordinates, and cell pixel mask of the table image according to the image features.

[0041] Among them, cell categories include blank cells, basic cells and merged cells.

[0042] Optionally, the table reconstruction device may determine the feature expression of the table image through a convolutional neural network, and determine the multi-scale feature representation of the feature expression through a feature pyramid network to obtain the image feature.

[0043] Specifically, the table reconstruction device can perform multiplexing operations such as convolution, pooling, residual connection and activation through a convolutional neural network to obtain the feature expression of the table image, and then realize the multi-scale feature expression of the feature expression of the table image through a feature pyramid network, and finally obtain the image feature of the table image, which can be expressed as a matrix W img *H img *C img .

[0044] Optionally, the table reconstruction device can determine a first candidate box and a first candidate feature; predict target object features based on the image features, the first candidate box and the first candidate feature; and obtain the cell category, the cell coordinates and the cell pixel mask by decoding the target object features.

[0045] Specifically, the table reconstruction device can use the encoder group to perform feature encoding on the input image features, and then use the decoder group to decode according to different goals. First, the table reconstruction device can randomly initialize the learnable first candidate box and the first candidate feature, wherein the number of the first candidate box and the first candidate feature can be set to 300, the dimension of the first candidate box can be set to 4, and the dimension of the first candidate feature can be set to 256. Then, the candidate features and the candidate boxes are mutually constrained by the dynamic convolution module, and the final object features can be encoded. Specifically including: the table reconstruction device can perform a multi-head self-attention transformation on the first candidate feature to obtain the second candidate feature; use a bilinear interpolation algorithm to align the frame area interest of the first candidate box and the image feature to obtain the first frame feature, so that the frame feature can be obtained more accurately to improve the sensitivity to small areas. Afterwards, the second candidate feature and the first frame feature are enhanced by a dynamic convolution module to obtain a second frame feature, and a second candidate frame is determined based on the second frame feature, and the first candidate frame is updated to the second candidate frame; afterward, the second frame feature and the image feature are aligned with the mask region interest to obtain a first pixel mask; the second candidate feature and the first pixel mask are enhanced by a dynamic convolution module to obtain a target object feature. After obtaining the target object feature, the table reconstruction device can obtain the cell category through the classification decoder, obtain the cell coordinates through the bounding box decoder, and obtain the cell pixel mask through the pixel mask decoder.

[0046] Optionally, after obtaining the second frame feature, the second frame feature can be classified and regressed through a candidate frame decoder to obtain a second candidate frame, and the first candidate frame can be replaced with the second candidate frame to achieve the update of the first candidate frame.

[0047] Optionally, the classification decoder may include 5 linear layers, the bounding box decoder may include 3 linear layers, and the pixel mask decoder may include four consecutive convolutional layers, one deconvolutional layer, and one 1×1 convolutional layer. The four consecutive convolutional layers are used to capture the hierarchical features of the input, the deconvolutional layer is used to upsample the spatial resolution of the image features, and the 1×1 convolutional layer is used to reduce the number of channels in the image features to obtain the mask prediction of the current stage.

[0048] Optionally, before acquiring the table image, the table reconstruction device may acquire training data, the training data including training images and image labels, the image labels including category labels, coordinate labels and pixel labels; input the training image into the table recognition model to obtain a first cell category, a first cell coordinate and a first cell pixel mask; determine a first loss based on the first cell category and the category label, determine a second loss based on the first cell coordinate and the coordinate label, and determine a third loss based on the first cell pixel mask and the pixel label; perform weighted summation of the first loss, the second loss and the third loss based on a predefined weight coefficient to obtain a target loss; and use the AdamW optimization algorithm to update the model parameters of the table recognition model according to the target loss.

[0049] Specifically, Figure 2 As shown, after the training image is input into the table recognition model, the table recognition model can first extract image features from the training image, then encode the features through the encoder group, and then decode the features through the decoder group. Then, the target loss is calculated based on the decoding result and the image label. Finally, the gradient update of the table recognition model is realized through the target loss.

[0050] Alternatively, if Figure 3 As shown, the table reconstruction device can extract the image features of the table image through the above-mentioned table recognition model, and predict the cell category, cell coordinates and cell pixel mask of the table image according to the image features.

[0051] S103 , the table reconstruction device reconstructs grid lines according to the cell coordinates and the cell pixel mask to obtain a first table, and merges cells of the first table according to the cell category to obtain a second table.

[0052] Specifically, continue to refer to Figure 3 For the output cell coordinate set, the table reconstruction device can first filter out the cell coordinates with a confidence level lower than a preset threshold through a maximum suppression algorithm, and then reconstruct the first table based on the filtered cell coordinate set and the cell pixel mask area through the set horizontal line threshold and vertical line threshold, merge the cells of the first table according to the output cell category, generate the logical structure of the table according to the merged cell set, and backfill the cell content to obtain a reconstructed second table.

[0053] The embodiment of the present invention can fuse the interdependence between cells during the training process, can simultaneously utilize the information between the structure and the content, and there is shared information and some model parameters between different cells, which can improve the training effect of the model; during the testing and reasoning process, only the regression box that fuses the cell layout and content information needs to be inferred, and the required model storage space complexity is small. In the testing phase, the model is directly converted from an image containing a table to a structured sequence, and the required model decoding time is greatly reduced, which can effectively improve the recognition performance of the table image recognition architecture in terms of quality and efficiency.

[0054] In an embodiment of the present invention, the cell category, cell coordinates and cell pixel mask of the table image can be determined based on the image features, and the second table can be reconstructed based on the cell category, cell coordinates and cell pixel mask. Since the cell category, cell coordinates and cell pixel mask can integrate the interdependence between cells, the information between the structure and the content can be used simultaneously to realize the reconstruction of the table, thereby improving the recognition performance.

[0055] The above mainly introduces the solution provided by the embodiment of the present invention from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed in this article, the embodiment of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0056] The table reconstruction method provided in the embodiment of the present invention can be executed by a table reconstruction device or a control module for table reconstruction in the table reconstruction device. In the embodiment of the present invention, the table reconstruction device provided in the embodiment of the present invention is described by taking the table reconstruction method executed by the table reconstruction device as an example.

[0057] It should be noted that the embodiment of the present invention can divide the table reconstruction device into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0058] like Figure 4As shown, an embodiment of the present invention provides a table reconstruction device 400. The table reconstruction device 400 includes: an acquisition module 401 and a processing module 402. The acquisition module 401 is used to acquire a table image; the processing module 402 is used to extract image features of the table image, and determine the cell category, cell coordinates and cell pixel mask of the table image according to the image features; grid line reconstruction is performed according to the cell coordinates and the cell pixel mask to obtain a first table, and cells of the first table are merged according to the cell category to obtain a second table; wherein the cell category includes blank cells, basic cells and merged cells.

[0059] Optionally, the processing module 402 is used to: determine a first candidate box and a first candidate feature; predict target object features based on the image features, the first candidate box and the first candidate feature; and obtain the cell category, the cell coordinates and the cell pixel mask by decoding the target object features.

[0060] Optionally, the processing module 402 is used to: perform a multi-head self-attention transformation on the first candidate feature to obtain a second candidate feature; perform frame area interest alignment on the first candidate box and the image feature to obtain a first frame feature; perform dynamic convolution module enhancement on the second candidate feature and the first box feature to obtain a second box feature, and determine a second candidate box based on the second box feature, and update the first candidate box to the second candidate box; perform mask area interest alignment on the second box feature and the image feature to obtain a first pixel mask; perform dynamic convolution module enhancement on the second candidate feature and the first pixel mask to obtain the target object feature.

[0061] Optionally, the acquisition module 401 is used to: perform size conversion processing on the image to be processed according to a preset size; identify a table position in the image to be processed, and segment the table image from the image to be processed according to the table position.

[0062] Optionally, the processing module 402 is used to: determine the feature expression of the table image through a convolutional neural network, determine the multi-scale feature representation of the feature expression through a feature pyramid network, and obtain the image feature.

[0063] Optionally, the acquisition module 401 is used to: acquire training data, the training data including training images and image labels, the image labels including category labels, coordinate labels and pixel labels; the processing module 402 is used to: input the training image into a table recognition model to obtain a first cell category, a first cell coordinate and a first cell pixel mask; determine a first loss based on the first cell category and the category label, determine a second loss based on the first cell coordinates and the coordinate label, and determine a third loss based on the first cell pixel mask and the pixel label; perform weighted summation of the first loss, the second loss and the third loss based on a predefined weight coefficient to obtain a target loss; and update the model parameters of the table recognition model according to the target loss.

[0064] Optionally, the processing module 402 is used to: extract image features of the table image through the table recognition model, and predict cell categories, cell coordinates, and cell pixel masks of the table image according to the image features.

[0065] In an embodiment of the present invention, the cell category, cell coordinates and cell pixel mask of the table image can be determined based on the image features, and the second table can be reconstructed based on the cell category, cell coordinates and cell pixel mask. Since the cell category, cell coordinates and cell pixel mask can integrate the interdependence between cells, the information between the structure and the content can be used simultaneously to realize the reconstruction of the table, thereby improving the recognition performance.

[0066] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the table reconstruction method, which includes: obtaining a table image; extracting image features of the table image, and determining the cell category, cell coordinates and cell pixel mask of the table image according to the image features; reconstructing the grid lines according to the cell coordinates and the cell pixel mask to obtain a first table, and merging the cells of the first table according to the cell category to obtain a second table; wherein the cell category includes blank cells, basic cells and merged cells.

[0067] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0068] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the table reconstruction method provided by the above methods, and the method includes: obtaining a table image; extracting image features of the table image, and determining the cell category, cell coordinates and cell pixel mask of the table image based on the image features; reconstructing grid lines according to the cell coordinates and the cell pixel mask to obtain a first table, and merging cells of the first table according to the cell category to obtain a second table; wherein the cell categories include blank cells, basic cells and merged cells.

[0069] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the above-mentioned table reconstruction methods, the methods comprising: acquiring a table image; extracting image features of the table image, and determining the cell category, cell coordinates and cell pixel mask of the table image based on the image features; reconstructing grid lines based on the cell coordinates and the cell pixel mask to obtain a first table, and merging cells of the first table based on the cell category to obtain a second table; wherein the cell categories include blank cells, basic cells and merged cells.

[0070] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0071] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0072] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A table reconstruction method, characterized in that: include: Get the table image; Extracting image features of the table image, and determining the cell category, cell coordinates, and cell pixel mask of the table image according to the image features; Reconstructing grid lines according to the cell coordinates and the cell pixel mask to obtain a first table, and merging cells of the first table according to the cell category to obtain a second table; Wherein, the cell categories include blank cells, basic cells and merged cells; The step of determining the cell category, cell coordinates, and cell pixel mask of the table image according to the image features includes: Determine a first candidate frame and a first candidate feature; Performing a multi-head self-attention transformation on the first candidate feature to obtain a second candidate feature; Performing frame region interest alignment on the first candidate frame and the image feature to obtain a first frame feature; Performing dynamic convolution module enhancement on the second candidate feature and the first frame feature to obtain a second frame feature, determining a second candidate frame based on the second frame feature, and updating the first candidate frame to the second candidate frame; Performing mask region interest alignment on the second frame feature and the image feature to obtain a first pixel mask; Performing dynamic convolution module enhancement on the second candidate feature and the first pixel mask to obtain a target object feature; The cell category, the cell coordinates and the cell pixel mask are obtained by decoding the target object features.

2. The table reconstruction method according to claim 1, characterized in that: The step of obtaining a table image comprises: Performing size conversion processing on the image to be processed according to a preset size; The position of a table in the image to be processed is identified, and the table image is segmented from the image to be processed according to the position of the table.

3. The table reconstruction method according to claim 1, characterized in that: The step of extracting the image features of the table image comprises: The feature expression of the table image is determined by a convolutional neural network, and the multi-scale feature representation of the feature expression is determined by a feature pyramid network to obtain the image feature.

4. The table reconstruction method according to any one of claims 1 to 3, characterized in that: Before obtaining the table image, the method further includes: Acquire training data, wherein the training data includes training images and image labels, and the image labels include category labels, coordinate labels, and pixel labels; Inputting the training image into a table recognition model to obtain a first cell category, a first cell coordinate, and a first cell pixel mask; Determine a first loss according to the first cell category and the category label, determine a second loss according to the first cell coordinates and the coordinate label, and determine a third loss according to the first cell pixel mask and the pixel label; Performing a weighted summation of the first loss, the second loss, and the third loss based on a predefined weight coefficient to obtain a target loss; The model parameters of the table recognition model are updated according to the target loss.

5. The table reconstruction method according to claim 4, characterized in that: The step of extracting image features of the table image and determining the cell category, cell coordinates, and cell pixel mask of the table image according to the image features includes: The image features of the table image are extracted by the table recognition model, and the cell category, cell coordinates and cell pixel mask of the table image are predicted according to the image features.

6. A table reconstruction device, characterized in that: include: Acquisition module and processing module; The acquisition module is used to acquire the table image; The processing module is used to extract image features of the table image, and determine the cell category, cell coordinates and cell pixel mask of the table image according to the image features; Reconstructing grid lines according to the cell coordinates and the cell pixel mask to obtain a first table, and merging cells of the first table according to the cell category to obtain a second table; Wherein, the cell categories include blank cells, basic cells and merged cells; The processing module is used to: Determine a first candidate frame and a first candidate feature; Performing a multi-head self-attention transformation on the first candidate feature to obtain a second candidate feature; Performing frame region interest alignment on the first candidate frame and the image feature to obtain a first frame feature; Performing dynamic convolution module enhancement on the second candidate feature and the first frame feature to obtain a second frame feature, determining a second candidate frame based on the second frame feature, and updating the first candidate frame to the second candidate frame; Performing mask region interest alignment on the second frame feature and the image feature to obtain a first pixel mask; Performing dynamic convolution module enhancement on the second candidate feature and the first pixel mask to obtain a target object feature; The cell category, the cell coordinates and the cell pixel mask are obtained by decoding the target object features.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the table reconstruction method according to any one of claims 1 to 5 are implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the table reconstruction method according to any one of claims 1 to 5 are implemented.