Method and system for evaluating PDF (Portable Document Format) document conversion effect
By identifying and filtering important and significant areas in PDF documents, performing weight assignment and IOU suppression processing, the problem of time-consuming and result deviation of PDF document conversion effect evaluation in the prior art is solved, and efficient and accurate evaluation of document conversion effect is achieved. .
Patent Information
- Application Number
- CN202411231609.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2025-02-25
AI Technical Summary
The existing PDF document conversion effect evaluation method takes a long time and there are deviations in the evaluation results. Especially when processing high-resolution pages, pixel-level algorithm comparison leads to inefficient evaluation, and the participation of non-core areas makes the evaluation results look like the human eye. There is a bias in perception.
By identifying the feature areas of important elements in the PDF document, performing significance area detection, giving weights and superimposing feature maps, the area weight value is obtained by cumulative convolution kernel scanning, and the areas with overlay threshold exceeding the IOU suppression are finally filtered out The document conversion effect evaluation is performed in the effective area.
This method can quickly detect a large number of PDF documents with different typesettings and contents, simplify the comparison and evaluation process, improve evaluation efficiency, reduce the deviation between evaluation results and human eye perception, and ensure the impression of the converted document.
Smart Images

Figure CN119516555A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of document conversion evaluation, and in particular to a method and system for evaluating PDF document conversion effects. Background Art
[0002] When converting the format of a PDF document, it is often necessary to evaluate the effect of the converted document. The current common method is to take screenshots of the entire page before and after the conversion for comparison, which has the following defects: 1. For PDF files containing high-resolution pages such as maps and various drawings, the conversion effect evaluation involves pixel-level algorithm comparison, which is time-consuming and inefficient, resulting in the inability to modify the algorithm and adjust parameters in a timely manner according to the evaluation results during the development process; Second, when comparing the entire page image, many marginal elements or non-core areas that the human eye does not pay attention to are also involved in the evaluation process, which not only prolongs the detection and comparison time, but also causes a deviation between the final evaluation result and the human eye's perception, thus affecting the appearance of the converted document.
[0003] Therefore, we need to develop a method and system for evaluating the conversion effect of PDF documents, which can quickly identify a large number of PDF documents with different layouts and contents and detect the significant areas in the PDF pages, so as to ensure that there is no need to compare the entire image when evaluating the document conversion effect, improve the evaluation efficiency, and reduce the deviation of the evaluation results. Summary of the invention
[0004] The purpose of the present invention is to provide a method and system for evaluating the conversion effect of a PDF document, so as to solve the problems mentioned in the above background technology that the existing evaluation method is time-consuming and the evaluation results are biased.
[0005] To achieve the above object, the present invention adopts the following technical solutions: According to one aspect of the present invention, a method for evaluating the conversion effect of a PDF document is provided, and the specific steps of the method are as follows: Identify the characteristic regions of important elements in the PDF document and obtain the regional characteristic map; Performing salient area detection on the PDF document to obtain a salient feature map; Assigning a weight to the regional feature map and superimposing it with the significant feature map to obtain a weighted feature map; Scanning the weight feature map by accumulating convolution kernels to obtain weight values of N regions, and sorting the weight values of the N regions in descending order; Based on IOU suppression, the regions exceeding the overlap threshold in the N regions are removed to obtain a new region weight value ranking; The new area weight values are sorted to obtain a final effective area, and the document conversion effect of the final effective area is evaluated.
[0006] According to another aspect of the present invention, a system for evaluating the conversion effect of a PDF document is provided, the system comprising: a feature recognition module, a saliency detection module, a feature map superposition module, a feature map scanning module, a region screening module and an effect evaluation module. Among them: The feature recognition module is used to identify the feature regions of important elements in the PDF document and obtain a regional feature map; The above-mentioned saliency detection module is used to perform saliency region detection on the PDF document to obtain a saliency feature map; The feature map superposition module is used to assign weights to the regional feature map and superimpose it with the significant feature map to obtain a weighted feature map; The feature map scanning module is used to scan the weight feature map by accumulating convolution kernels to obtain weight values of N regions, and sort the weight values of the N regions in descending order; The region screening module is used to remove regions exceeding the overlap threshold from the N regions based on IOU suppression, and obtain a new region weight value ranking; The effect evaluation module is used to sort according to the new area weight values to obtain the final effective area, and to evaluate the document conversion effect on the final effective area.
[0007] Based on the above solution, before identifying the feature areas of important elements in the PDF document, the method further includes: marking the important elements in the PDF document and using them as training samples to train a convolutional neural network model, wherein the convolutional neural network model uses MobileNetV3 as the basic architecture.
[0008] Furthermore, the trained convolutional neural network model is used to identify the characteristic regions of important elements in the PDF document to obtain a regional feature map; Furthermore, performing salient area detection on the PDF document to obtain a salient feature map specifically includes the following steps: Performing color space conversion on the page image of the PDF document to obtain a first converted image; Calculating a color difference of each pixel in the first conversion image, and calculating a significance value of each pixel in the first conversion image according to the color difference; The significance value is normalized to obtain the significant feature map.
[0009] Based on the above scheme, when scanning the weight feature map by accumulating the convolution kernel, the step size of the convolution kernel is set to the width of the weight feature map × 0.1; and the size of the convolution kernel is set according to the length or width of the weight feature map; specifically including: The length and width of the weight feature map are compared, the smaller value of the length and the width of the weight feature map is selected, and the smaller value is multiplied by 30% as the length and the width of the convolution kernel to obtain the size of the convolution kernel.
[0010] Based on the above solution, the IOU-based suppression removes the areas in the N areas that exceed the overlap threshold, specifically including: According to the descending sorting result of the weight values of the N regions, selecting the region with the largest weight value as the comparison region; Traverse the weight value corresponding areas after the maximum weight value in sequence, and calculate the IOU value with the comparison area in sequence; Compare the IOU value with a preset overlap threshold, and if the IOU value is greater than the overlap threshold, delete the current corresponding area; Repeat the steps of calculating the IOU value and comparing it with the overlap threshold until all the areas corresponding to the weight values after the maximum weight value are traversed and there is no area exceeding the overlap threshold, and obtain a new area weight value ranking.
[0011] Furthermore, the final valid area is screened according to the new area weight value sorting, which specifically includes: According to the new regional weight value sorting, the top three significant regions are selected; Set a weight value comparison threshold, and compare the weight values of the second and third significant regions with the weight value of the first significant region respectively; If the comparison result is less than the weight value comparison threshold, the corresponding significant area is eliminated to obtain the final effective area.
[0012] Furthermore, the document conversion effect is evaluated on the final effective area, and the specific steps are as follows: The final effective area and the converted corresponding area are used as the first evaluation picture and the second evaluation picture respectively; Calculating the histogram feature vectors of the three RGB channels of the first evaluation picture and the second evaluation picture respectively, and merging the channels respectively to obtain two color histograms; Calculating the similarity of the two color histograms according to a correlation algorithm; It is determined whether the conversion effect of the PDF document reaches a preset evaluation standard according to the similarity, and an evaluation result is output.
[0013] The correlation algorithm is a cosine similarity method or a Euclidean distance method; and the determining whether the conversion effect of the PDF document reaches a preset evaluation standard specifically includes: Setting a similarity threshold, and comparing the similarity with the similarity threshold; If the similarity is less than or equal to the similarity threshold, the conversion effect of the PDF document does not meet the preset evaluation standard, the PDF conversion algorithm is adjusted and re-verified until the preset evaluation standard is met, and the evaluation result is output; If the similarity is greater than the similarity threshold, the conversion effect of the PDF document has reached the preset evaluation standard, and the evaluation result is output.
[0014] It can be seen from the above technical solution that compared with the prior art, the present invention has at least the following advantages and positive effects: (1) The present invention can not only quickly detect a large number of PDF documents with different layouts and contents by identifying the characteristic areas of important elements in a PDF document and gradually screening out the final effective areas, but also simplify the final comparison and evaluation process, avoiding the problem of a time-consuming evaluation process due to pixel-level algorithm comparison, thereby improving the work efficiency of developers.
[0015] (2) The present invention can effectively reduce the impact of non-critical areas on the final evaluation results by detecting the significant areas in the PDF document and eliminating marginal elements or non-core areas that the human eye does not pay attention to, thereby reducing the deviation between the final evaluation results and the human eye perception, and ensuring the appearance of the converted document.
[0016] (3) The present invention gradually screens the feature areas by setting the overlap threshold, weight value comparison threshold and similarity threshold, and after obtaining the final effective area, conducts targeted comparison of the page effects before and after conversion, which can greatly reduce the workload and complexity of the final comparison and evaluation process, shorten the evaluation time, and effectively improve the efficiency of document conversion effect evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description only involve 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.
[0018] Figure 1 A flow chart of a method for evaluating PDF document conversion effect provided by an embodiment of the present invention is shown; Figure 2A flow chart of a method for screening feature regions based on IOU suppression provided by an embodiment of the present invention is shown; Figure 3 A flow chart of a method for screening a final effective area provided by an embodiment of the present invention is shown; Figure 4 A flow chart of a method for determining whether a document conversion effect meets a preset evaluation standard provided by an embodiment of the present invention is shown; Figure 5 A schematic diagram showing the structure of a PDF document conversion effect evaluation system provided by an embodiment of the present invention; Figure 6 A schematic diagram showing a result of comparing evaluation durations of PDF document conversion effects provided by an embodiment of the present invention is shown.
[0019] in, Figure 5 The reference numerals in the figures are described as follows: 500-A system for evaluating the conversion effect of a PDF document; 501-Feature recognition module, 5011-Model training unit, 5012-Feature recognition unit; 502-Saliency detection module, 5021-Image preprocessing unit, 5022-Saliency calculation unit; 503-Feature map superposition module, 5031-Weight assignment unit, 5032-Image superposition unit; 504-Feature map scanning module, 5041-Feature map scanning unit, 5042-Weight value sorting unit; 505-Region screening module, 5051-Overlap calculation unit, 5052-Overlapping region elimination unit; 506-Effect evaluation module, 5061-Effective region screening unit, 5062-Conversion effect evaluation unit. DETAILED DESCRIPTION
[0020] In order to more clearly explain the purpose, technical solutions and advantages of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. The example implementation methods can be implemented in various forms and should not be understood as being limited to the examples described herein. On the contrary, these implementation methods are provided to make the present invention more comprehensive and complete, and to fully convey the concepts of the example implementation methods to those skilled in the art.
[0021] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.
[0022] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0023] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0024] The present invention is described in detail below with reference to specific embodiments.
[0025] Example 1 like Figure 1 As shown, an embodiment of the present invention provides a method for evaluating the effect of PDF document conversion, and the specific steps of the method are as follows: S1: Identify the feature regions of important elements in the PDF document and obtain the regional feature map; In this embodiment, the important elements in the PDF document include but are not limited to: pictures, tables, charts and formulas; before identifying the characteristic areas of the important elements in the PDF document, it also includes: marking the important elements in the PDF document and using them as training samples to train the convolutional neural network model. The training samples are generated by both manual marking and automatic marking; since the manual marking of the important elements in the PDF document can cover PDF content in multiple fields, and automatic marking can generate a large number of samples in a short time, the convolutional neural network model is trained by the samples generated by both manual marking and automatic marking, ensuring sufficient training samples while improving the generalization ability of the convolutional neural network model; in addition, during manual marking, since different groups of people have different perceptions of key elements, different groups of people are used to mark, so that the perception of the key elements of the convolutional neural network model can be trained to be closer to the perception of the majority of people to the greatest extent.
[0026] Furthermore, in this embodiment, the convolutional neural network model uses MobileNetV3 as the basic architecture, Adam as the optimizer, and is trained based on cross entropy loss until the output result of the convolutional neural network model reaches a preset accuracy.
[0027] Furthermore, the trained convolutional neural network model is used to identify the characteristic regions of important elements in the PDF document to obtain a regional feature map.
[0028] S2: Perform salient area detection on the PDF document to obtain a salient feature map; Furthermore, after identifying the characteristic regions of important elements in the PDF document, a salient region detection is performed on the PDF document, which specifically includes the following steps: Performing color space conversion on the page image of the PDF document to obtain a first converted image; Calculating a color difference of each pixel in the first conversion image, and calculating a significance value of each pixel in the first conversion image according to the color difference; The significance value is normalized to obtain the significant feature map.
[0029] S3: assigning a weight to the regional feature map and superimposing it with the significant feature map to obtain a weighted feature map; Furthermore, different weights are assigned to different feature maps according to the importance of the region. In this embodiment, the regional feature map obtained in step S1 is assigned a weight of 1.5 times and is superimposed with the significant feature map obtained in step S2 to obtain a weighted feature map.
[0030] S4: Scanning the weight feature map by accumulating convolution kernels to obtain weight values of N regions, and sorting the weight values of the N regions in descending order; Furthermore, after obtaining the weight feature map, the weight feature map is scanned by accumulating convolution kernels. Preferably, in this embodiment, the step size of the convolution kernel is set to the width of the weight feature map × 0.1; and the size of the convolution kernel is set according to the length or width of the weight feature map, specifically: compare the length and width of the weight feature map, select the smaller value of the length and width of the weight feature map, and multiply the smaller value by 30% as the length and width of the convolution kernel, thereby obtaining the size of the convolution kernel.
[0031] Furthermore, when the weight feature map is scanned by accumulating convolution kernels, the number of times the convolution kernel is accumulated is determined by the size of the convolution kernel and the size of the weight feature map. The specific calculation formula is: C = (W-F+1) × (H-F+1) × F 2; Wherein, C is the number of times the convolution kernel is accumulated, W is the width of the weight feature map, H is the length of the weight feature map, and F is the width and length of the convolution kernel.
[0032] S5: Based on IOU suppression, remove the regions exceeding the overlap threshold in the N regions to obtain a new region weight value ranking; Furthermore, after obtaining the weight value ranking results of N regions through step S4, feature regions are screened based on IOU suppression, such as Figure 2 As shown, the specific steps include: S201: According to the descending sorting result of the weight values of the N regions, the region with the largest weight value is selected as the comparison region; S202: traverse the weight value corresponding areas after the maximum weight value in sequence, and calculate the IOU values with the comparison area in sequence; S203: comparing the IOU value with a preset overlap threshold, and if the IOU value is greater than the overlap threshold, deleting the current corresponding area; S204: Repeat the steps of calculating the IOU value and comparing it with the overlap threshold until all regions corresponding to the weight values after the maximum weight value are traversed and there is no region exceeding the overlap threshold, thereby obtaining a new region weight value ranking.
[0033] Specifically, in this embodiment, the overlap threshold is pre-set to 60%; after taking the area corresponding to the largest weight value as the comparison area, the IOU values of the areas corresponding to other weight values and the comparison area are calculated one by one according to the sorting results to determine the overlap between other areas and the comparison area; if the overlap is greater than 60% (that is, the IOU value is greater than the overlap threshold), the weight value corresponding to the area is eliminated from the sorting results, and finally a new area weight value sorting is obtained.
[0034] S6: Sorting according to the new area weight values to obtain a final effective area, and evaluating the document conversion effect of the final effective area.
[0035] Furthermore, the final valid area is selected according to the new area weight values obtained; Figure 3 As shown, the following steps are included: S301: Sorting the top three significant regions according to the new region weight values; S302: setting a weight value comparison threshold, and comparing the weight values of the second and third significant regions with the weight value of the first significant region respectively; S303: If the comparison result is less than the weight value comparison threshold, the corresponding significant area is eliminated to obtain the final effective area.
[0036] Specifically, in this embodiment, the weight value comparison threshold is set to 50%; if the weight value of the second-ranked significant region is lower than 50% of the weight value of the first-ranked significant region, it is determined that the second-ranked significant region does not meet the preset significance requirement, and the second-ranked significant region is eliminated; similarly, the weight value of the third-ranked significant region is compared with the weight value of the first-ranked significant region, if it is lower than 50% of the weight value of the first-ranked significant region, it is eliminated, otherwise it is retained, thereby obtaining the final valid region.
[0037] Furthermore, the document conversion effect is evaluated for the final effective area and the evaluation result is output. Furthermore, before the evaluation result is output, it is also necessary to determine whether the document conversion effect meets the preset evaluation standard, such as Figure 4 As shown, the specific judgment process includes: S401: The final effective area and its converted corresponding area are used as a first evaluation picture and a second evaluation picture respectively; S402: calculating histogram feature vectors of the three RGB channels of the first evaluation picture and the second evaluation picture respectively, and merging the channels respectively to obtain two color histograms; S403: Calculating the similarity between the two color histograms according to a correlation algorithm; S404: Setting a similarity threshold to determine whether the conversion effect of the PDF document meets a preset evaluation standard; S405: If the similarity is less than or equal to the similarity threshold, the conversion effect of the PDF document does not meet the preset evaluation standard, the PDF conversion algorithm is adjusted and re-verified until the preset evaluation standard is met, and the evaluation result is output; S406: If the similarity is greater than the similarity threshold, the conversion effect of the PDF document has reached the preset evaluation standard, and an evaluation result is output.
[0038] Preferably, in this embodiment, the correlation algorithm is a cosine similarity method or an Euclidean distance method; the similarity threshold is set to 0.8; the correlation between the final effective area and its corresponding area after conversion is determined by calculating the similarity between the two. If the similarity is less than or equal to 0.8, it means that the correlation between the final effective area and its corresponding area after conversion is low, and it is determined that the conversion effect of the PDF document does not meet the preset evaluation criteria, and the developer is notified to adjust the document conversion method and re-evaluate the effect until the preset evaluation criteria are met.
[0039] The method for evaluating the conversion effect of a PDF document described in an embodiment of the present invention identifies the characteristic areas of important elements in a PDF document, detects the significant areas in the PDF document, removes marginal elements or non-core areas that are not paid attention to by the human eye, and then gradually screens out the final effective area. This method can not only simplify the final comparison and evaluation process, avoid the problem that the evaluation process is time-consuming due to pixel-level algorithm comparison, but also reduce the influence of non-critical areas on the final evaluation results, reduce the deviation between the final evaluation results and human eye perception, and ensure the look and feel of the converted document; at the same time, by setting an overlap threshold, a weight value comparison threshold, and a similarity threshold to gradually screen the characteristic areas, the effectiveness of the final comparison area can be guaranteed; and by performing targeted comparison of the page effects before and after the conversion, the workload and complexity of the final comparison and evaluation process can be greatly reduced, the evaluation time can be shortened, and the efficiency of document conversion effect evaluation can be effectively improved.
[0040] Example 2 like Figure 5 As shown, an embodiment of the present invention provides a PDF document conversion effect evaluation system 500, the system comprising: a feature recognition module 501, a saliency detection module 502, a feature map superposition module 503, a feature map scanning module 504, a region screening module 505 and an effect evaluation module 506. Among them: A feature recognition module 501 is used to recognize feature regions of important elements in a PDF document and obtain a region feature map; Preferably, in this embodiment, before identifying the feature area of the important elements in the PDF document, it also includes: marking the important elements in the PDF document and using them as training samples, training the convolutional neural network model until the output result of the convolutional neural network model reaches a preset accuracy; wherein the convolutional neural network model uses MobileNetV3 as the basic architecture, Adam as the optimizer, and is trained based on cross entropy loss. The training samples are generated by both manual and automatic annotation.
[0041] The feature recognition module 501 includes: a model training unit 5011 and a feature recognition unit 5012; wherein: The above-mentioned model training unit 5011 is configured to: train the convolutional neural network through the training samples generated in advance until the output result of the convolutional neural network model reaches a preset accuracy; The feature recognition unit 5012 is configured to: recognize feature regions of important elements in a PDF document according to a trained convolutional neural network to obtain a region feature map.
[0042] A saliency detection module 502 is used to perform saliency region detection on the PDF document to obtain a saliency feature map; The saliency detection module 502 includes: an image preprocessing unit 5021 and a saliency calculation unit 5022; wherein: The image preprocessing unit 5021 is configured to: perform color space conversion on the page image of the PDF document to obtain a first converted image; The above-mentioned significance calculation unit 5022 is configured to: calculate the color difference of each pixel in the first conversion image, calculate the significance value of each pixel in the first conversion image according to the color difference, and normalize the significance value to obtain a significant feature map.
[0043] A feature map superposition module 503 is used to assign weights to the regional feature map and superimpose it with the significant feature map to obtain a weighted feature map; The feature map superposition module 503 includes: a weighting unit 5031 and an image superposition unit 5032; wherein: The weight assigning unit 5031 is configured to assign a weight of 1.5 times to the regional feature map obtained in the feature identification unit 5012; The image superposition unit 5032 is configured to superimpose the salient feature map obtained in the saliency calculation unit 5022 and the regional feature map assigned 1.5 times the weight to obtain a weighted feature map.
[0044] A feature map scanning module 504 is used to scan the weight feature map by accumulating convolution kernels to obtain weight values of N regions, and sort the weight values of the N regions in descending order; Preferably, when the weight feature map is scanned by accumulating convolution kernels, the step size of the convolution kernel is set to the width of the weight feature map × 0.1; and the size of the convolution kernel is set according to the length or width of the weight feature map, specifically: the length and width of the weight feature map are compared, the smaller value of the length and width of the weight feature map is selected, and the smaller value is multiplied by 30% as the length and width of the convolution kernel, thereby obtaining the size of the convolution kernel.
[0045] The feature map scanning module 504 includes: a feature map scanning unit 5041 and a weight value sorting unit 5042; wherein: The feature map scanning unit 5041 is configured to: scan the weight feature map obtained in the image superposition unit 5032 by accumulating convolution kernels to obtain weight values of N regions; The weight value sorting unit 5042 is configured to sort the weight values of the N regions obtained in the feature map scanning unit 5041 in descending order to obtain a descending sort result of the weight values of the N regions.
[0046] A region screening module 505 is used to remove regions exceeding an overlap threshold from the N regions based on IOU suppression, and obtain a new region weight value ranking; The area screening module 505 includes: an overlap calculation unit 5051 and an overlap area elimination unit 5052; wherein: The above-mentioned overlap calculation unit 5051 is configured to: select the area with the largest weight value as the comparison area according to the descending sorting result of the weight values of the N areas obtained by the weight value sorting unit 5042, and traverse the weight value corresponding areas after the maximum weight value in sequence, and calculate the IOU value with the comparison area; The above-mentioned overlapping area elimination unit 5052 is configured to: compare the IOU values obtained in sequence in the overlap calculation unit 5051 with a preset overlap threshold, eliminate the areas exceeding the overlap threshold, and obtain a new area weight value ranking.
[0047] The effect evaluation module 506 is used to sort according to the new area weight values to obtain the final effective area, and perform document conversion effect evaluation on the final effective area.
[0048] The effect evaluation module 506 includes: an effective area screening unit 5061 and a conversion effect evaluation unit 5062; wherein: The effective region screening unit 5061 is configured to: select the top three significant regions according to the new region weight values obtained in the overlapping region elimination unit 5052; compare the weight values of the second significant region and the third significant region with the weight value of the first significant region, and eliminate the significant regions whose comparison results are less than a preset weight value comparison threshold, to obtain the final effective region; The conversion effect evaluation unit 5062 is configured to calculate the similarity between the final effective area and the corresponding area after conversion, and compare the similarity with a preset similarity threshold, determine whether the conversion effect of the PDF document meets the preset evaluation standard, and output the evaluation result.
[0049] In this embodiment, the feature recognition module 501 identifies the feature areas of important elements in the PDF document, and the saliency detection module 502 performs saliency area detection on the PDF document, so that marginal elements or non-core areas that are not paid attention to by the human eye can be eliminated, thereby reducing the impact of non-critical areas on the final evaluation results; in the effect evaluation module 506, only the screened effective areas are compared with the corresponding areas after conversion, which can greatly reduce the workload and complexity of the final comparison and evaluation process, shorten the evaluation time, and effectively improve the efficiency of document conversion effect evaluation.
[0050] Example 3 like Figure 6As shown, an embodiment of the present invention provides a result of comparing the evaluation time of the conversion effect of a PDF document. Through experiments, the time required for evaluating the conversion effect of a document by a traditional evaluation method (i.e., selecting a whole page for comparison) and the evaluation method of the present invention (i.e., selecting a valid significant area for comparison) are compared, including the time required for evaluating a 10-page document, a 50-page document, a 100-page document, and a 500-page document.
[0051] It can be seen from the figure that when the evaluation method described in the present invention is adopted (i.e., selecting effective significant areas for comparison), the time required for evaluating the conversion effect of a document can be shortened to about 26% of the time required for the traditional evaluation method. This shows that the evaluation method described in the present invention can effectively reduce the workload and complexity of the evaluation process, shorten the evaluation time, and improve the evaluation efficiency.
[0052] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present invention, which follows the general principles of the present invention and includes common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present invention are indicated by the claims. It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for evaluating the conversion effect of a PDF document, characterized in that: The steps include: Identify the characteristic regions of important elements in the PDF document and obtain the regional characteristic map; Performing salient area detection on the PDF document to obtain a salient feature map; Assigning a weight to the regional feature map and superimposing it with the significant feature map to obtain a weighted feature map; Scanning the weight feature map by accumulating convolution kernels to obtain weight values of N regions, and sorting the weight values of the N regions in descending order; Based on IOU suppression, the regions exceeding the overlap threshold in the N regions are removed to obtain a new region weight value ranking; The new area weight values are sorted to obtain a final effective area, and the document conversion effect of the final effective area is evaluated.
2. The evaluation method according to claim 1, characterized in that: The obtaining of the significant feature map specifically comprises the steps of: Performing color space conversion on the page image of the PDF document to obtain a first converted image; Calculating a color difference of each pixel in the first conversion image, and calculating a significance value of each pixel in the first conversion image according to the color difference; The significance value is normalized to obtain the significant feature map.
3. The evaluation method according to claim 1, characterized in that: When scanning the weight feature map by accumulating the convolution kernel, the step size of the convolution kernel is set to the width of the weight feature map×0.
1.
4. The evaluation method according to claim 1, characterized in that: The size of the convolution kernel is set according to the length or width of the weight feature map; specifically including: The length and width of the weight feature map are compared, the smaller value of the length and the width of the weight feature map is selected, and the smaller value is multiplied by 30% as the length and the width of the convolution kernel to obtain the size of the convolution kernel.
5. The evaluation method according to claim 1, characterized in that: The IOU-based suppression method removes the regions in the N regions that exceed the overlap threshold, specifically including: According to the descending sorting result of the weight values of the N regions, selecting the region with the largest weight value as the comparison region; Traverse the weight value corresponding areas after the maximum weight value in sequence, and calculate the IOU value with the comparison area in sequence; Compare the IOU value with a preset overlap threshold, and if the IOU value is greater than the overlap threshold, delete the current corresponding area; Repeat the steps of calculating the IOU value and comparing it with the overlap threshold until all the areas corresponding to the weight values after the maximum weight value are traversed and there is no area exceeding the overlap threshold, and obtain a new area weight value ranking.
6. The evaluation method according to claim 1, characterized in that: The obtaining of the final effective area specifically includes: According to the new regional weight value sorting, the top three significant regions are selected; Set a weight value comparison threshold, and compare the weight values of the second and third significant regions with the weight value of the first significant region respectively; If the comparison result is less than the weight value comparison threshold, the corresponding significant area is eliminated to obtain the final effective area.
7. The evaluation method according to claim 1, characterized in that: The evaluating of the document conversion effect on the final effective area specifically includes: The final effective area and the converted corresponding area are used as the first evaluation picture and the second evaluation picture respectively; Calculating the histogram feature vectors of the three RGB channels of the first evaluation picture and the second evaluation picture respectively, and merging the channels respectively to obtain two color histograms; Calculating the similarity of the two color histograms according to a correlation algorithm; It is determined whether the conversion effect of the PDF document reaches a preset evaluation standard according to the similarity, and an evaluation result is output.
8. The evaluation method according to claim 7, characterized in that: The determining whether the conversion effect of the PDF document meets the preset evaluation standard specifically includes: Setting a similarity threshold, and comparing the similarity with the similarity threshold; If the similarity is less than or equal to the similarity threshold, the conversion effect of the PDF document does not meet the preset evaluation standard, the PDF conversion algorithm is adjusted and re-verified until the preset evaluation standard is met, and the evaluation result is output; If the similarity is greater than the similarity threshold, the conversion effect of the PDF document has reached the preset evaluation standard, and the evaluation result is output.
9. The evaluation method according to claim 7, characterized in that: The correlation algorithm is a cosine similarity method or a Euclidean distance method.
10. A PDF document conversion effect evaluation system, characterized in that: include: The feature recognition module is used to identify the feature regions of important elements in the PDF document and obtain a regional feature map; A saliency detection module, used to perform saliency region detection on the PDF document to obtain a saliency feature map; A feature map superposition module is used to assign weights to the regional feature map and superimpose it with the significant feature map to obtain a weighted feature map; A feature map scanning module, used to scan the weight feature map by accumulating convolution kernels to obtain weight values of N regions, and sort the weight values of the N regions in descending order; A region screening module is used to remove regions exceeding an overlap threshold from the N regions based on IOU suppression, and obtain a new region weight value ranking; The effect evaluation module is used to sort according to the new area weight values to obtain the final effective area, and to evaluate the document conversion effect of the final effective area.