Typesetting image analysis method and device, equipment, storage medium and product

Through the deep learning model, target detection and evaluation of layout images are performed to generate optimization strategies, which solves the problem of low efficiency of layout image analysis in the existing technology and achieves efficient layout optimization of financial research report PPT documents.

CN118570830APending Publication Date: 2024-08-30北京中关村科金技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410680725.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The typesetting image analysis efficiency in the existing technology is low, and the typesetting image cannot be accurately identified and optimized, especially in financial research report PPT document scenarios, and the effect is not ideal.

Method used

By inputting the target layout image into the deep learning model for target detection and evaluation, an optimization strategy is generated, including adjusting element position, size and font style to improve the balance and readability of the layout.

Benefits of technology

The efficiency and accuracy of typesetting image analysis are improved. The generated optimization strategy can automatically adjust the typesetting elements to make the layout more beautiful and easy to read. It is suitable for financial research report PPT documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570830A
    Figure CN118570830A
Patent Text Reader

Abstract

The invention provides a typesetting image analysis method and device, equipment, a storage medium and a product, and relates to the field of artificial intelligence, and the method comprises the steps: obtaining a to-be-recognized target typesetting image; inputting the target typesetting image into a first target deep learning model to perform target detection on the target typesetting image to obtain a detection result; evaluating the target typesetting image according to the detection result to obtain an evaluation result; and generating an optimization strategy according to the evaluation result. According to the method, the target typesetting image is input into the first target deep learning model for target detection, so that the typesetting form and / or element content included in the target typesetting image is determined, the evaluation result of the target typesetting image is generated, and the optimization measure for the target typesetting image is generated according to the evaluation result. Therefore, the analysis efficiency of the typesetting image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence, and in particular, to a method, device, equipment, storage medium and product for analyzing typeset images. Background Art

[0002] Document layout analysis is to segment and identify document images according to different semantic functions and area categories, segmenting text areas, table areas, formula areas, graphic areas and other areas, and determine the category to which each area belongs. In the prior art, typesetting images are generally analyzed by deep learning models. However, this analysis technology has a limited coverage and cannot accurately identify typesetting images, resulting in low analysis efficiency for typesetting images. Summary of the invention

[0003] The embodiments of the present application provide a typesetting image analysis method, device, equipment, storage medium and product to solve the problem of low typesetting image analysis efficiency in the prior art.

[0004] To solve the above problems, this application is implemented as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for analyzing a typeset image, the method comprising:

[0006] Obtaining a target typeset image to be identified;

[0007] Inputting the target typesetting image into a first target deep learning model to perform target detection on the target typesetting image to obtain a detection result, wherein the detection result is used to indicate the typesetting form and / or element content included in the target typesetting image;

[0008] Evaluate the target typesetting image according to the detection result to obtain an evaluation result, wherein the evaluation result is used to indicate a typesetting score of the target typesetting image;

[0009] An optimization strategy is generated according to the evaluation result, and the optimization strategy is used to optimize the typesetting form and the element content of the target typesetting image.

[0010] Optionally, before inputting the target typesetting image into the first deep learning model to perform target detection on the target typesetting image and obtaining the detection result, the method further includes:

[0011] Acquire a first training data set, the first training data set comprising a plurality of first typesetting sample images and a plurality of first label information, the plurality of first typesetting sample images and the plurality of first label information correspond one to one, the first label information is used to indicate the typesetting form and element content of the corresponding first typesetting sample images;

[0012] Inputting the first training data set into a first deep learning model for target detection, outputting a plurality of prediction values, wherein the plurality of prediction values ​​correspond one-to-one to the plurality of first layout sample images, and the first deep learning model is a target detection model;

[0013] Performing loss calculation on the multiple prediction values ​​and the multiple first label information to obtain a target loss value;

[0014] The first deep learning model is updated according to the target loss value to obtain the first target deep learning model.

[0015] Optionally, performing loss calculation on the multiple prediction values ​​and the multiple second label information to obtain a target loss value includes:

[0016] Performing loss calculation on the multiple prediction values ​​and the multiple second label information to obtain a classification loss value, a confidence loss value, and a positioning loss value;

[0017] Obtain a first weight coefficient, a second weight coefficient, and a third weight coefficient, wherein the first weight coefficient corresponds to the classification loss value, the second weight coefficient corresponds to the confidence loss value, and the third weight coefficient corresponds to the positioning loss value;

[0018] The classification loss value, the confidence loss value and the positioning loss value are weighted according to the first weight coefficient, the second weight coefficient and the third weight coefficient to obtain the target loss value.

[0019] Optionally, updating the first deep learning model according to the target loss value to obtain the first target deep learning model includes:

[0020] Updating the first deep learning model according to the target loss value to obtain an updated first deep learning model;

[0021] A plurality of transformation layers are set in the updated first deep learning model to obtain the first target deep learning model, and the plurality of transformation layers are respectively connected to a plurality of bottleneck layers included in the first target deep learning model.

[0022] Optionally, evaluating the target typeset image according to the detection result to obtain an evaluation result includes:

[0023] Inputting the detection result into a second target deep learning model for evaluation to obtain the evaluation result;

[0024] Before inputting the detection result into the second target deep learning model for evaluation and obtaining the evaluation result, the method further includes:

[0025] Acquire a second training data set, wherein the second training data set includes a plurality of second typesetting sample images and a plurality of second label information, wherein the plurality of typesetting sample images and the plurality of label information correspond to each other one by one, and the label information is used to indicate the typesetting form and element content of the corresponding typesetting sample image;

[0026] Performing denoising and standardization processing on the second training data set to obtain a third training data set;

[0027] The second deep learning model is updated using the second training data set to obtain a second target deep learning model, where the second target deep learning model is used to evaluate the input typeset image.

[0028] Optionally, generating an optimization strategy according to the evaluation result includes:

[0029] Acquire a preset optimization strategy, wherein the preset optimization strategy includes at least one of the following: element position adjustment of the typesetting image, element size adjustment of the typesetting image, and font and style adjustment of the typesetting image;

[0030] The third deep learning model is updated according to the preset optimization strategy to obtain a third target deep learning model, wherein the third target deep learning model is used to analyze the input evaluation result and generate an optimization strategy;

[0031] The evaluation results are input into the third target deep learning model for analysis to obtain the optimization strategy.

[0032] In a second aspect, an embodiment of the present application further provides a typesetting image analysis device, comprising:

[0033] An acquisition module, used for acquiring a target typesetting image to be recognized;

[0034] A detection module, used for inputting the target typesetting image into a first target deep learning model to perform target detection on the target typesetting image to obtain a detection result, wherein the detection result is used to indicate the typesetting form and / or element content included in the target typesetting image;

[0035] An evaluation module, used to evaluate the target typesetting image according to the detection result to obtain an evaluation result, wherein the evaluation result is used to indicate a typesetting score of the target typesetting image;

[0036] A generation module is used to generate an optimization strategy according to the evaluation result, wherein the optimization strategy is used to optimize the typesetting form and the element content of the target typesetting image.

[0037] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor; the processor is used to read the program in the memory to implement the steps of the method described in the first aspect above.

[0038] In a fourth aspect, an embodiment of the present application further provides a readable storage medium for storing a program, which, when executed by a processor, implements the steps in the method described in the first aspect above.

[0039] In a fifth aspect, an embodiment of the present application further provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps in the method described in the first aspect.

[0040] The present application provides a method, device, equipment, storage medium and product for analyzing a typesetting image, the method comprising: obtaining a target typesetting image to be identified; inputting the target typesetting image into a first target deep learning model to perform target detection on the target typesetting image to obtain a detection result, the detection result being used to indicate the typesetting form and / or element content included in the target typesetting image; evaluating the target typesetting image according to the detection result to obtain an evaluation result, the evaluation result being used to indicate the typesetting score of the target typesetting image; generating an optimization strategy according to the evaluation result, the optimization strategy being used to optimize the typesetting form and the element content of the target typesetting image. The present application determines the typesetting form and / or element content included in the target typesetting image by inputting the target typesetting image into a first target deep learning model for target detection, thereby generating an evaluation result for the target typesetting image, and generating optimization measures for the target typesetting image according to the evaluation result, thereby improving the analysis efficiency of the typesetting image. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 It is a flowchart of a method for analyzing a typesetting image provided in an embodiment of the present application;

[0043] Figure 2 It is one of the schematic diagrams of the model structure provided in the embodiment of the present application;

[0044] Figure 3The second schematic diagram of the model structure provided in the embodiment of the present application;

[0045] Figure 4 It is a structural schematic diagram of a typesetting image analysis device provided in an embodiment of the present application;

[0046] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0048] The terms "first", "second" etc. in the embodiments of the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. In addition, the terms "include" and "have" and any variation thereof are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment. In addition, "and / or" is used in the present application to represent at least one of connected objects, such as A and / or B and / or C, representing the inclusion of separate A, separate B, separate C, and A and B all exist, B and C all exist, A and C all exist, and 7 situations that A, B and C all exist.

[0049] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a method for analyzing typesetting images provided in an embodiment of the present application. Figure 1 As shown, the analysis method of the layout image may include the following steps:

[0050] Step 101: Obtain a target layout image to be identified.

[0051] In this embodiment, the target layout image is generally an image including layout content, and its analysis is mainly for segmentation and recognition according to different semantic functions and area categories, thereby segmenting text areas, table areas, formula areas, graphic areas and other areas, and determining the category to which each area belongs.

[0052] Specifically, in this embodiment, the target layout image is explained by taking the PPT document image as an example. Specifically, the current corporate office scenes contain a large number of PPT documents. Image-based layout analysis is the basic technology for document structuring, which is crucial for the digital storage of corporate data and the digital transformation of enterprises. Existing layout analysis technologies are generally aimed at PDF documents such as scientific literature and newspapers, and rarely analyze PPT documents. In particular, in financial research report PPT scenarios, existing document layout analysis technologies cannot be applied, or the accuracy is low and the effect is not ideal. Accordingly, this application provides an analysis method for PPT document images.

[0053] Step 102: Input the target typesetting image into a first target deep learning model to perform target detection on the target typesetting image to obtain a detection result, wherein the detection result is used to indicate the typesetting form and / or element content included in the target typesetting image.

[0054] In this embodiment, the first target deep learning model is a target detection model. Specifically, the target detection model is a computer vision technology used to detect the location of objects in an image or video and classify them into different categories. This model usually combines the two tasks of target location and target classification.

[0055] The target layout image is input into the first target deep learning model to perform target detection on the target layout image to obtain a detection result, wherein the detection result mainly includes the layout form and / or element content included in the target layout image. Specifically, the elements in the PPT presentation are analyzed and classified, including the position, size, alignment, etc. of the elements.

[0056] Step 103: Evaluate the target typeset image according to the detection result to obtain an evaluation result, wherein the evaluation result is used to indicate a typeset score of the target typeset image.

[0057] In this embodiment, the target layout image is evaluated based on the generated detection result to obtain an evaluation result. Specifically, the balance, symmetry and information density indicators of the layout are mainly evaluated to generate an evaluation result.

[0058] Exemplarily, the detection result is evaluated by a trained evaluation model to output the evaluation result. The detection result can also be evaluated by a preset evaluation rule, which is not specifically limited in this embodiment.

[0059] Step 104: Generate an optimization strategy according to the evaluation result, wherein the optimization strategy is used to optimize the typesetting form and the element content of the target typesetting image.

[0060] In this embodiment, an optimization strategy is generated through the evaluation results, wherein the optimization strategy provides a series of optimization strategies to improve the quality of the layout. The optimization strategy includes automatically adjusting the element position, spacing, size, font, etc. to make the layout more beautiful and readable.

[0061] The present application provides a method for analyzing a typesetting image, the method comprising: obtaining a target typesetting image to be identified; inputting the target typesetting image into a first target deep learning model to perform target detection on the target typesetting image to obtain a detection result, wherein the detection result is used to indicate the typesetting form and / or element content included in the target typesetting image; evaluating the target typesetting image according to the detection result to obtain an evaluation result, wherein the evaluation result is used to indicate a typesetting score of the target typesetting image; generating an optimization strategy according to the evaluation result, wherein the optimization strategy is used to optimize the typesetting form and the element content of the target typesetting image.

[0062] In some feasible embodiments, optionally, before inputting the target typesetting image into the first deep learning model to perform target detection on the target typesetting image and obtaining the detection result, the method further includes:

[0063] Acquire a first training data set, the first training data set comprising a plurality of first typesetting sample images and a plurality of first label information, the plurality of first typesetting sample images and the plurality of first label information correspond one to one, the first label information is used to indicate the typesetting form and element content of the corresponding first typesetting sample images;

[0064] Inputting the first training data set into a first deep learning model for target detection, outputting a plurality of prediction values, wherein the plurality of prediction values ​​correspond one-to-one to the plurality of first layout sample images, and the first deep learning model is a target detection model;

[0065] Performing loss calculation on the multiple prediction values ​​and the multiple first label information to obtain a target loss value;

[0066] The first deep learning model is updated according to the target loss value to obtain the first target deep learning model.

[0067] In this embodiment, the first training data set includes multiple first layout sample images and multiple first label information. Specifically, a large number of research report PPT presentations are collected and each document is manually annotated. Exemplarily, about 1,000 research report PPT documents are collected from companies and related cooperative institutions, and each page of these documents is converted into pictures, and 3,200 of them are selected as data sets. This data set is divided into training set, verification set, and test set, which contain 2,400, 400, and 400 images respectively. In view of the characteristics of financial research report PPT, the labels are set to 11 categories: title, text, picture, table, picture title, table title, header, footer, figure caption, table caption, and logo.

[0068] Data annotation for layout analysis: Each image was manually annotated using the open source data annotation software cvat, and the 11 elements in each image were annotated, with the location and category of each element marked. After the annotation was completed, each annotated sample was cross-checked by three annotators to ensure that the annotation data was correct.

[0069] After the annotation is completed, the Financial Research Report Layout Analysis (FRRLA) dataset is obtained. FRRLA is a Chinese document layout analysis dataset for financial research report PPT presentation scenarios, including the following 11 labels in Table 1:

[0070] Table 1

[0071]

[0072] Therefore, the first training data set is input into the first deep learning model for target detection, and multiple prediction values ​​are output. The loss function of multiple first label information is calculated through the multiple prediction values ​​to obtain the target loss value. The first deep learning model is updated through the target loss value to obtain the first target deep learning model.

[0073] Optionally, performing loss calculation on the multiple prediction values ​​and the multiple second label information to obtain a target loss value includes:

[0074] Performing loss calculation on the multiple prediction values ​​and the multiple second label information to obtain a classification loss value, a confidence loss value, and a positioning loss value;

[0075] Obtain a first weight coefficient, a second weight coefficient, and a third weight coefficient, wherein the first weight coefficient corresponds to the classification loss value, the second weight coefficient corresponds to the confidence loss value, and the third weight coefficient corresponds to the positioning loss value;

[0076] The classification loss value, the confidence loss value and the positioning loss value are weighted according to the first weight coefficient, the second weight coefficient and the third weight coefficient to obtain the target loss value.

[0077] In this embodiment, the training uses the pytorch toolbox and is trained on the labeled layout analysis data set. Loss calculation is performed on the multiple predicted values ​​and the multiple second label information to obtain classification loss values, confidence loss values, and positioning loss values. The Loss function contains three parts, namely, classification loss, confidence loss, and positioning loss, where λ is a weight coefficient, which is 1.5, 2.5, and 0.5 respectively:

[0078] Loss = λ1L cls +λ2L obj +λ3L loc

[0079] Among them, Loss is the target loss value, λ1 is the first weight coefficient, λ2 is the first weight coefficient, and λ3 is the second weight coefficient. The stochastic gradient optimization algorithm is used for training, and all trainable parameters are initialized using the He initialization method. The initial learning rate is 0.01, the momentum is 0.9, and the training is completed after 300 rounds.

[0080] Optionally, updating the first deep learning model according to the target loss value to obtain the first target deep learning model includes:

[0081] Updating the first deep learning model according to the target loss value to obtain an updated first deep learning model;

[0082] A plurality of transformation layers are set in the updated first deep learning model to obtain the first target deep learning model, and the plurality of transformation layers are respectively connected to a plurality of bottleneck layers included in the first target deep learning model.

[0083] In this embodiment, if Figure 2 and Figure 3 As shown, Figure 2 and Figure 3 The schematic diagram of the model structure in this embodiment is that the document layout detection model is based on the yolov5 network architecture. The improvement is that a Transformation layer is added after the CSP module of the original yolov5 structure to enhance the target detection capability of the model. Figure 2 The model inputs an image and outputs the detected target location. Multi-resolution output is used to detect targets of different sizes, where Output0 detects small-sized targets, Output1 detects small-sized targets, and Output2 detects small-sized targets.

[0084] The transformation layer introduces a self-attention global self-attention mechanism to model the long-distance spatial dependencies between feature map elements to extract more discriminative target features. Figure 3 . Specifically, the feature vector output by the original CSP module is (batch_size, c, h, w), where batch_size is the size of each batch, c is the number of channels, and h and w are the width and height of the feature map, respectively. When in use, the last two dimensions of the feature map are flattened into one dimension. At this time, the feature map vector is converted to (batch_size, c, h*w). Each element (h*w) of the last dimension is regarded as a token. After input into the Transformation layer, the transformed token is output. The output dimension is the same as the input vector dimension, and the dimension is still (batch_size, c, h*w). After that, the transformed vector of the last dimension is expanded back to the original (h, w), and the dimension becomes (batch_size, c, h, w). In the Transformation layer architecture, the architecture regards each element of the feature map as a token, inputs the feature map, and outputs the transformed feature map token. The input and output dimensions remain unchanged.

[0085] Optionally, evaluating the target typeset image according to the detection result to obtain an evaluation result includes:

[0086] Inputting the detection result into a second target deep learning model for evaluation to obtain the evaluation result;

[0087] Before inputting the detection result into the second target deep learning model for evaluation and obtaining the evaluation result, the method further includes:

[0088] Acquire a second training data set, wherein the second training data set includes a plurality of second typesetting sample images and a plurality of second label information, wherein the plurality of typesetting sample images and the plurality of label information correspond to each other one by one, and the label information is used to indicate the typesetting form and element content of the corresponding typesetting sample image;

[0089] Performing denoising and standardization processing on the second training data set to obtain a third training data set;

[0090] The second deep learning model is updated using the second training data set to obtain a second target deep learning model, where the second target deep learning model is used to evaluate the input typeset image.

[0091] In this embodiment, the detection result can be evaluated by the second target deep learning model to obtain the evaluation result. Specifically, before obtaining the second target deep learning model, the second deep learning model needs to be trained and updated to obtain the second target deep learning model.

[0092] Specifically, the second deep learning model is updated by the second training data set to obtain the second target deep learning model, wherein the second training data set includes multiple second layout sample images and multiple second label information. Specifically, data collection and preparation: collect sample data of PPT layout, including PPT presentations with different layout qualities. Preprocess the collected data, including removing noise, standardizing data format, etc. Feature extraction: extract features from each PPT presentation, which may include the distance, alignment, and balance between elements. Computer vision and natural language processing techniques can be used to extract image and text features. Label data: manually label the collected PPT presentations, and label each sample with a corresponding layout quality label, such as excellent, good, good, medium, slightly worse, poor, and very poor. Model selection and training: according to the characteristics of the problem and the characteristics of the data, choose to use a neural network for evaluation. The labeled data set is divided into a training set and a test set, the training set is used to train the evaluation model, and the test set is used to evaluate the performance of the model. Model evaluation and tuning: Use the test set to evaluate the evaluation model and calculate the model's accuracy, precision, recall and other indicators to evaluate the model's performance. Based on the evaluation results, tune the model by adjusting the model's parameters, increasing the amount of training data, etc. Model application: Apply the trained evaluation model to a new PPT presentation to evaluate its layout quality. Based on the evaluation results, provide corresponding optimization suggestions to help improve the quality of the PPT layout.

[0093] Optionally, generating an optimization strategy according to the evaluation result includes:

[0094] Acquire a preset optimization strategy, wherein the preset optimization strategy includes at least one of the following: element position adjustment of the typesetting image, element size adjustment of the typesetting image, and font and style adjustment of the typesetting image;

[0095] The third deep learning model is updated according to the preset optimization strategy to obtain a third target deep learning model, wherein the third target deep learning model is used to analyze the input evaluation result and generate an optimization strategy;

[0096] The evaluation results are input into the third target deep learning model for analysis to obtain the optimization strategy.

[0097] In this embodiment, the third deep learning model is updated by a preset optimization strategy to obtain a third target deep learning model, whereby the evaluation results are analyzed by the third target deep learning model to obtain an optimization strategy. Specifically, the balance, symmetry and information density indicators of the layout are automatically output by the third target deep learning model. According to the evaluation results, a series of optimization strategies are provided to improve the quality of the layout. The optimization strategy includes automatically adjusting the position, spacing, size, font, etc. of the elements included in the typeset image to make the layout more beautiful and easy to read.

[0098] Exemplarily, the optimization strategy includes the following:

[0099] Adjust the position of elements in the layout image: adjust the position of elements according to the relationship between elements and the overall layout requirements to make them more balanced and symmetrical. Specifically: Determine the position of the main elements: place important text, images or charts in the center or prominent position of the page to attract the audience's attention. Adjust the position of secondary elements: place secondary elements around the main elements to form an overall balance and harmony. Use alignment tools: use the alignment tools provided by the PPT software to ensure that the alignment between elements is consistent and make the layout neater.

[0100] Element sizing for typography and images: Adjust the size of elements to make them more legible, based on their importance and content length. Specifically: Adjust text box size based on content length: Adjust the size of text boxes based on the length of the text and font size to ensure that the text does not overflow or appear too crowded. Adjust the proportions of images and charts: Adjust the size of images and charts based on their importance so that they take up the appropriate space on the page while maintaining clarity and readability.

[0101] Font selection and style adjustment of typesetting images: Select fonts that are suitable for the theme and content, and adjust the font style to enhance the readability and visual effect of the layout. Specifically: Choose the right font: According to the theme and content of the PPT, choose a suitable font type, such as formal, relaxed, technological, etc., to convey the corresponding atmosphere and emotions. Adjust the font style: According to the importance and level of the text, adjust the size, thickness, color, etc. of the font to highlight the key points and improve readability.

[0102] See also Figure 4 , Figure 4 is a structural diagram of a typesetting image analysis device provided in an embodiment of the present application. Figure 4 As shown, the typesetting image analysis device 400 includes:

[0103] An acquisition module 410 is used to acquire a target typesetting image to be identified;

[0104] A detection module 420 is used to input the target typesetting image into a first target deep learning model to perform target detection on the target typesetting image to obtain a detection result, wherein the detection result is used to indicate the typesetting form and / or element content included in the target typesetting image;

[0105] An evaluation module 430, configured to evaluate the target typesetting image according to the detection result to obtain an evaluation result, wherein the evaluation result is used to indicate a typesetting score of the target typesetting image;

[0106] The generation module 440 is used to generate an optimization strategy according to the evaluation result, and the optimization strategy is used to optimize the typesetting form and the element content of the target typesetting image.

[0107] Optionally, also include:

[0108] A data acquisition module, used to acquire a first training data set, wherein the first training data set includes a plurality of first typesetting sample images and a plurality of first label information, wherein the plurality of first typesetting sample images and the plurality of first label information correspond to each other one by one, and the first label information is used to indicate the typesetting form and element content of the corresponding first typesetting sample images;

[0109] A model detection module, used for inputting the first training data set into a first deep learning model for target detection, and outputting a plurality of prediction values, wherein the plurality of prediction values ​​correspond one-to-one to the plurality of first layout sample images, and the first deep learning model is a target detection model;

[0110] A loss calculation module, used to perform loss calculation on the multiple predicted values ​​and the multiple first label information to obtain a target loss value;

[0111] A model updating module is used to update the first deep learning model according to the target loss value to obtain the first target deep learning model.

[0112] Optionally, the loss calculation module includes:

[0113] A loss calculation submodule, used to perform loss calculation on the multiple prediction values ​​and the multiple second label information to obtain a classification loss value, a confidence loss value and a positioning loss value;

[0114] A weight acquisition module, used to acquire a first weight coefficient, a second weight coefficient and a third weight coefficient, wherein the first weight coefficient corresponds to the classification loss value, the second weight coefficient corresponds to the confidence loss value, and the third weight coefficient corresponds to the positioning loss value;

[0115] A weight calculation module is used to perform weight calculation on the classification loss value, the confidence loss value and the positioning loss value according to the first weight coefficient, the second weight coefficient and the third weight coefficient respectively to obtain the target loss value.

[0116] Optionally, the model updating module includes:

[0117] A model updating submodule, used to update the first deep learning model according to the target loss value to obtain an updated first deep learning model;

[0118] A model setting module is used to set multiple transformation layers in the updated first deep learning model to obtain the first target deep learning model, and the multiple transformation layers are respectively connected to the multiple bottleneck layers included in the first target deep learning model.

[0119] Optionally, the evaluation module 430 includes:

[0120] An evaluation submodule, used for inputting the detection result into a second target deep learning model for evaluation to obtain the evaluation result;

[0121] Also includes:

[0122] An acquisition submodule is used to acquire a second training data set, wherein the second training data set includes a plurality of second typesetting sample images and a plurality of second label information, wherein the plurality of typesetting sample images and the plurality of label information correspond to each other one by one, and the label information is used to indicate the typesetting form and element content of the corresponding typesetting sample image;

[0123] A processing submodule, configured to perform denoising and standardization processing on the second training data set to obtain a third training data set;

[0124] The first updating submodule is used to update the second deep learning model using the second training data set to obtain a second target deep learning model, and the second target deep learning model is used to evaluate the input typesetting image.

[0125] Optionally, the generating module 440 includes:

[0126] A strategy acquisition submodule, used to acquire a preset optimization strategy, wherein the preset optimization strategy includes at least one of the following: element position adjustment of a typesetting image, element size adjustment of a typesetting image, and font and style adjustment of a typesetting image;

[0127] A second updating submodule is used to update the third deep learning model according to the preset optimization strategy to obtain a third target deep learning model, wherein the third target deep learning model is used to analyze the input evaluation result and generate an optimization strategy;

[0128] An analysis submodule is used to input the evaluation result into the third target deep learning model for analysis to obtain the optimization strategy.

[0129] The present application also provides an electronic device. Figure 5 , the electronic device may include a processor 501, a memory 502, and a program 5021 stored in the memory 502 and executable on the processor 501.

[0130] When the program 5021 is executed by the processor 501, it can achieve Figure 1 Any step in the corresponding method embodiment:

[0131] Obtaining a target typeset image to be identified;

[0132] Inputting the target typesetting image into a first target deep learning model to perform target detection on the target typesetting image to obtain a detection result, wherein the detection result is used to indicate the typesetting form and / or element content included in the target typesetting image;

[0133] Evaluate the target typesetting image according to the detection result to obtain an evaluation result, wherein the evaluation result is used to indicate a typesetting score of the target typesetting image;

[0134] An optimization strategy is generated according to the evaluation result, and the optimization strategy is used to optimize the typesetting form and the element content of the target typesetting image.

[0135] Optionally, before inputting the target typesetting image into the first deep learning model to perform target detection on the target typesetting image and obtaining the detection result, the method further includes:

[0136] Acquire a first training data set, the first training data set comprising a plurality of first typesetting sample images and a plurality of first label information, the plurality of first typesetting sample images and the plurality of first label information correspond one to one, the first label information is used to indicate the typesetting form and element content of the corresponding first typesetting sample images;

[0137] Inputting the first training data set into a first deep learning model for target detection, outputting a plurality of prediction values, wherein the plurality of prediction values ​​correspond one-to-one to the plurality of first layout sample images, and the first deep learning model is a target detection model;

[0138] Performing loss calculation on the multiple prediction values ​​and the multiple first label information to obtain a target loss value;

[0139] The first deep learning model is updated according to the target loss value to obtain the first target deep learning model.

[0140] Optionally, performing loss calculation on the multiple prediction values ​​and the multiple second label information to obtain a target loss value includes:

[0141] Performing loss calculation on the multiple prediction values ​​and the multiple second label information to obtain a classification loss value, a confidence loss value, and a positioning loss value;

[0142] Obtain a first weight coefficient, a second weight coefficient, and a third weight coefficient, wherein the first weight coefficient corresponds to the classification loss value, the second weight coefficient corresponds to the confidence loss value, and the third weight coefficient corresponds to the positioning loss value;

[0143] The classification loss value, the confidence loss value and the positioning loss value are weighted according to the first weight coefficient, the second weight coefficient and the third weight coefficient to obtain the target loss value.

[0144] Optionally, updating the first deep learning model according to the target loss value to obtain the first target deep learning model includes:

[0145] Updating the first deep learning model according to the target loss value to obtain an updated first deep learning model;

[0146] A plurality of transformation layers are set in the updated first deep learning model to obtain the first target deep learning model, and the plurality of transformation layers are respectively connected to a plurality of bottleneck layers included in the first target deep learning model.

[0147] Optionally, evaluating the target typeset image according to the detection result to obtain an evaluation result includes:

[0148] Inputting the detection result into a second target deep learning model for evaluation to obtain the evaluation result;

[0149] Before inputting the detection result into the second target deep learning model for evaluation and obtaining the evaluation result, the method further includes:

[0150] Acquire a second training data set, wherein the second training data set includes a plurality of second typesetting sample images and a plurality of second label information, wherein the plurality of typesetting sample images and the plurality of label information correspond to each other one by one, and the label information is used to indicate the typesetting form and element content of the corresponding typesetting sample image;

[0151] Performing denoising and standardization processing on the second training data set to obtain a third training data set;

[0152] The second deep learning model is updated using the second training data set to obtain a second target deep learning model, where the second target deep learning model is used to evaluate the input typeset image.

[0153] Optionally, generating an optimization strategy according to the evaluation result includes:

[0154] Acquire a preset optimization strategy, wherein the preset optimization strategy includes at least one of the following: element position adjustment of the typesetting image, element size adjustment of the typesetting image, and font and style adjustment of the typesetting image;

[0155] The third deep learning model is updated according to the preset optimization strategy to obtain a third target deep learning model, wherein the third target deep learning model is used to analyze the input evaluation result and generate an optimization strategy;

[0156] The evaluation results are input into the third target deep learning model for analysis to obtain the optimization strategy.

[0157] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned typesetting image analysis method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0158] The embodiment of the present application further provides a computer program product, which is stored in a storage medium. The computer program product is executed by at least one processor to implement the various processes of the above-mentioned typesetting image analysis method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0159] It should be noted that, in this article, the terms "include", "comprises" or any other variations 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 existence of other identical elements in the process, method, article or device including the element.

[0160] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0161] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for analyzing a typesetting image, characterized in that: The method comprises: Obtaining a target typeset image to be identified; Inputting the target typesetting image into a first target deep learning model to perform target detection on the target typesetting image to obtain a detection result, wherein the detection result is used to indicate the typesetting form and / or element content included in the target typesetting image; Evaluate the target typesetting image according to the detection result to obtain an evaluation result, wherein the evaluation result is used to indicate a typesetting score of the target typesetting image; An optimization strategy is generated according to the evaluation result, and the optimization strategy is used to optimize the typesetting form and the element content of the target typesetting image.

2. The method according to claim 1, characterized in that Before inputting the target typesetting image into the first deep learning model to perform target detection on the target typesetting image and obtaining the detection result, the method further includes: Acquire a first training data set, the first training data set comprising a plurality of first typesetting sample images and a plurality of first label information, the plurality of first typesetting sample images and the plurality of first label information correspond one to one, the first label information is used to indicate the typesetting form and element content of the corresponding first typesetting sample images; Inputting the first training data set into a first deep learning model for target detection, outputting a plurality of prediction values, wherein the plurality of prediction values ​​correspond one-to-one to the plurality of first layout sample images, and the first deep learning model is a target detection model; Performing loss calculation on the multiple prediction values ​​and the multiple first label information to obtain a target loss value; The first deep learning model is updated according to the target loss value to obtain the first target deep learning model.

3. The method according to claim 2, characterized in that The performing loss calculation on the multiple prediction values ​​and the multiple second label information to obtain a target loss value includes: Performing loss calculation on the multiple prediction values ​​and the multiple second label information to obtain a classification loss value, a confidence loss value, and a positioning loss value; Obtain a first weight coefficient, a second weight coefficient, and a third weight coefficient, wherein the first weight coefficient corresponds to the classification loss value, the second weight coefficient corresponds to the confidence loss value, and the third weight coefficient corresponds to the positioning loss value; The classification loss value, the confidence loss value and the positioning loss value are weighted according to the first weight coefficient, the second weight coefficient and the third weight coefficient to obtain the target loss value.

4. The method according to claim 2, characterized in that: The updating the first deep learning model according to the target loss value to obtain the first target deep learning model includes: Updating the first deep learning model according to the target loss value to obtain an updated first deep learning model; A plurality of transformation layers are set in the updated first deep learning model to obtain the first target deep learning model, and the plurality of transformation layers are respectively connected to a plurality of bottleneck layers included in the first target deep learning model.

5. The method according to claim 1, characterized in that The step of evaluating the target typesetting image according to the detection result to obtain an evaluation result includes: Inputting the detection result into a second target deep learning model for evaluation to obtain the evaluation result; Before inputting the detection result into the second target deep learning model for evaluation and obtaining the evaluation result, the method further includes: Acquire a second training data set, wherein the second training data set includes a plurality of second typesetting sample images and a plurality of second label information, wherein the plurality of typesetting sample images and the plurality of label information correspond to each other one by one, and the label information is used to indicate the typesetting form and element content of the corresponding typesetting sample image; Performing denoising and standardization processing on the second training data set to obtain a third training data set; The second deep learning model is updated using the second training data set to obtain a second target deep learning model, where the second target deep learning model is used to evaluate the input typeset image.

6. The method according to claim 1, characterized in that Generating an optimization strategy according to the evaluation result includes: Acquire a preset optimization strategy, wherein the preset optimization strategy includes at least one of the following: element position adjustment of the typesetting image, element size adjustment of the typesetting image, and font and style adjustment of the typesetting image; The third deep learning model is updated according to the preset optimization strategy to obtain a third target deep learning model, wherein the third target deep learning model is used to analyze the input evaluation result and generate an optimization strategy; The evaluation results are input into the third target deep learning model for analysis to obtain the optimization strategy.

7. A device for analyzing typesetting images, characterized in that: The device comprises: An acquisition module, used for acquiring a target typesetting image to be recognized; A detection module, used for inputting the target typesetting image into a first target deep learning model to perform target detection on the target typesetting image to obtain a detection result, wherein the detection result is used to indicate the typesetting form and / or element content included in the target typesetting image; An evaluation module, used to evaluate the target typesetting image according to the detection result to obtain an evaluation result, wherein the evaluation result is used to indicate a typesetting score of the target typesetting image; A generation module is used to generate an optimization strategy according to the evaluation result, wherein the optimization strategy is used to optimize the typesetting form and the element content of the target typesetting image.

8. An electronic device, comprising: A memory, a processor, and a program stored in the memory and executable on the processor; wherein the processor is used to read the program in the memory to implement the steps in the method for analyzing a typeset image as described in any one of claims 1 to 6.

9. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the steps in the method for analyzing a typesetting image according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product is stored in a storage medium, and the computer program product is executed by at least one processor to implement the steps in the method for analyzing a layout image according to any one of claims 1 to 6.