A text image quality detection method, system, device and medium

By employing a hybrid framework of convolutional neural networks and Transformer encoders, and combining optimized linear correlation and rank correlation metrics, a reference-free text image quality detection model is constructed. This solves the problems of accuracy and robustness in text image quality assessment, and achieves efficient detection under reference-free conditions.

CN120047381BActive Publication Date: 2025-11-07DONGFANG (GUANGZHOU) HEAVY MASCH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411881127.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-11-07
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

Existing image quality assessment methods perform poorly on text images, especially lacking effective feature extraction for character and detail edges, and traditional no-reference image quality assessment methods suffer from inaccurate evaluation results.

Method used

A text image quality detection model without reference images is adopted. It uses a hybrid framework consisting of a convolutional neural network and a Transformer-based encoder, combines subjective scoring and detection results, and optimizes the model using OLCC and OSROCC evaluation metrics to perform text image quality detection.

Benefits of technology

It achieves accurate and real-time evaluation of text image quality under no-reference conditions, improving detection accuracy and robustness, and is suitable for practical application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047381B_ABST
    Figure CN120047381B_ABST
Patent Text Reader

Abstract

The application discloses a kind of text image quality detection method, system, equipment and medium, the method includes: obtaining text image, text image is divided into training set and test set;Text image quality detection model is constructed, and training set is input into text image quality detection model for training;Test set is input into the text image quality detection model that has been trained, obtains detection result, and text image quality detection model is evaluated and optimized.The application detects the quality of text image using the text image quality detection model without reference image, does not need fixed reference image, is more suitable for practical application scene, is more flexible and practical, improves the detection precision of text image quality evaluation, and improves the accuracy and robustness of text image quality detection, realizes accurate and real-time text image quality evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of image quality evaluation, and particularly relates to a text image quality detection method, system, device and medium. BACKGROUND

[0002] Most of the existing image quality evaluation methods are usually used for evaluating natural scene images, and perform poorly on text images. The quality evaluation of natural scene images often depends on the features of color, texture and structure information. The content of text images mainly includes characters and detailed edges, and the color and texture information contained is limited. The main effective information of text images is concentrated in the high-frequency region and the edge, which leads to the fact that most image quality evaluation methods cannot extract key features or identify quality defects from text images. In addition, it is very difficult to obtain a high-quality reference image in the process of text image quality evaluation. For example, in OCR applications, there may be noise, blur, distortion and other problems between the scanned copy and the original image, and even a high-quality reference image may not perfectly match the characteristics of each different type of text image. Therefore, the effectiveness of most quality evaluation methods is limited.

[0003] Traditional text image quality evaluation mainly relies on manual visual inspection, which has the problems of strong subjectivity, low efficiency and poor consistency. With the continuous development of computer vision and image processing technology, it becomes more feasible to use automatic methods to evaluate the quality of text images. Image quality evaluation is divided into subjective evaluation and objective evaluation, and objective evaluation is further divided into full reference (FR-IQA), semi-reference (RR-IQA) and no reference (NR-IQA). The full reference image quality evaluation method mainly uses the difference between the distorted image and the ideal reference image to evaluate the quality of the distorted image. The semi-reference image quality evaluation method uses prior knowledge to extract a small amount of feature information of the ideal reference image, and compares it with the feature information of the distorted image to complete the quality evaluation of the distorted image. The no reference image quality evaluation method NR-IQA evaluates the quality of a distorted image without any reference image, which is more suitable for actual application scenarios. For text image quality evaluation,

[0004] The traditional NR-IQA method uses the perception characteristics of the human visual system (HVS) to obtain useful features from the image to be evaluated for modeling, and maps the image distortion degree to a quality score; for example, Liu et al. proposed the SNP-NIQE algorithm, which extracts the natural statistical characteristics of the distorted image from three aspects of structure, naturalness and perceptibility, and combines unsupervised learning to evaluate the image quality; Li et al. proposed using a histogram to represent the brightness statistical features and structure statistical features to perceive the image quality changes, called NRSL, and using a rotation-invariant local binary pattern to extract the structure features.

[0005] For text image quality evaluation, it is difficult to obtain high-quality reference images, and FR-IQA and RR-IQA methods are not applicable; however, traditional NR-IQA methods have certain limitations, which can easily lead to inaccurate evaluation results. SUMMARY

[0006] In order to solve the problems existing in the prior art, the present application provides a text image quality detection method, system, device and medium, which uses a no-reference image text image quality detection model to detect the quality of text images, improves the detection accuracy of text image quality evaluation, and improves the accuracy and robustness of text image quality detection, and realizes accurate and real-time text image quality evaluation.

[0007] In order to solve the above problems, the first aspect of the present application provides a text image quality detection method, comprising:

[0008] Obtaining a text image, dividing the text image into a training set and a test set;

[0009] Constructing a text image quality detection model, inputting the training set into the text image quality detection model for training;

[0010] Inputting the test set into the trained text image quality detection model to obtain a detection result, and evaluating and optimizing the text image quality detection model.

[0011] Further, the evaluation of the text image quality detection model comprises:

[0012] Obtaining subjective scores of the text images, combining the subjective scores with the output detection results, and evaluating the optimized linear correlation between the subjective scores and the detection results (OLCC):

[0013]

[0014] Wherein, N represents the number of batches of images, y i and respectively represent the subjective score of the i-th image and the output detection result, which are obtained by the subjective score of the actual human eye labeling data and the text image quality detection model detecting a single training picture; and respectively represent the average value of the subjective score and the average value of the detection result, m i is the weight corresponding to the i-th image, which is used to adjust the weight proportion of the improved OLCC.

[0015] Further, the evaluation of the text image quality detection model further comprises:

[0016] Obtaining the subjective scores of the text images and the ranking between the subjective scores;

[0017] obtaining the detection results and the order between the detection results;

[0018] based on the subjective score order and the detection result order, evaluating rank correlation between the subjective scores and the detection results OSROCC:

[0019]

[0020] wherein, v i and p i respectively represent y i and The order in the subjective score sequence and the detection result sequence, w3 is the corresponding weight, used to adjust the amplitude of the overall monotonicity.

[0021] Further, the text image quality detection model is constructed, and the training set is input into the text image quality detection model for training, including:

[0022] inputting the text image into the first feature extraction module to obtain a first feature image;

[0023] inputting the first feature image into the second feature extraction module to obtain a second feature image;

[0024] splicing the first feature image and the second feature image through a full connection layer to map an output image quality detection result.

[0025] Further, the text image quality detection model is constructed, and the training set is input into the text image quality detection model for training, and further includes:

[0026] generating position encoding information based on the first feature image;

[0027] combining the position encoding information with the first feature image to obtain a first feature image with position information, and inputting the first feature image with position information into the second feature extraction module.

[0028] Further, the text image quality detection model is constructed, and the training set is input into the text image quality detection model for training, and further includes:

[0029] using a minimum regression loss function to train the text image quality detection model:

[0030]

[0031] wherein, n represents the number of encoder layers, q i is the detection result of the i-th image, s i is the subjective score of the i-th image, and w1 and w2 are the corresponding weights of the detection result and the subjective score respectively.

[0032] Further, the first feature extraction module is a convolutional neural network, and the second feature extraction module is a transformer-based encoder.

[0033] The second aspect of the application provides a text image quality detection system for implementing the text image quality detection method, comprising a text image quality detection model and a model evaluation module, wherein the text image quality detection model comprises:

[0034] a first feature extraction module configured to extract features of an input text image and output a first feature image;

[0035] a position encoding module configured to generate position encoding information for the first feature image output by the first feature extraction module and form a first feature image with position information;

[0036] a second feature extraction module configured to extract features of the first feature image with position information and output a second feature image;

[0037] a fully connected layer configured to concatenate the first feature image and the second feature image and map an output detection result;

[0038] The model evaluation module is configured to evaluate and optimize the detection accuracy of the text image quality detection model in combination with the subjective score of the text image.

[0039] The third aspect of the application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0040] The fourth aspect of the application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the steps of the above method.

[0041] Compared with the prior art, the application has the following beneficial effects:

[0042] The application discloses a text image quality detection method, system, device and medium, which comprises the following steps: acquiring a text image, dividing the text image into a training set and a test set; constructing a text image quality detection model, inputting the training set into the text image quality detection model for training; inputting the test set into the trained text image quality detection model to obtain a detection result, and evaluating and optimizing the text image quality detection model; using a text image quality detection model without a reference image to detect the text image quality, which does not require a fixed reference image and is more suitable for actual application scenarios, is more flexible and practical, improves the detection accuracy of text image quality evaluation, and improves the accuracy and robustness of text image quality detection, thereby realizing accurate and real-time text image quality evaluation. BRIEF DESCRIPTION OF DRAWINGS

[0043] The specific embodiments of the present application will be further described with reference to the drawings, wherein:

[0044] Figure 1 A structural schematic diagram of a text image quality detection system described in the embodiments;

[0045] Figure 2 A flow chart of a text image quality detection method described in the embodiments;

[0046] Figure 3 A text image quality detection model training flow chart of a text image quality detection method described in the embodiments;

[0047] Figure 4 A structural schematic diagram of a computer device described in the embodiments. DETAILED DESCRIPTION

[0048] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.

[0049] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative labor are within the scope of protection of the present application.

[0050] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

[0051] It is to be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus.

[0052] In the description of the present application, it also needs to be explained that, unless otherwise explicitly specified and limited, the terms "set", "connected" should be understood broadly, for example, can be fixedly connected, can also be detachably connected, or integrally connected; can be mechanically connected, can also be electrically connected; can be directly connected, can also be indirectly connected through an intermediate medium, can be the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0053] The embodiment of the present application discloses a text image quality detection system, a system structure diagram is as shown in Figure 1 The text image quality detection system includes a text image quality detection model and a model evaluation module. The text image quality detection model includes a first feature extraction module, a position coding module, a second feature extraction module and a full connection layer. The first feature extraction module is used for feature extraction of the input text image, and outputs a first feature image. The position coding module is used for generating position coding information for the first feature image output by the first feature extraction module, forming a first feature image with position information. The second feature extraction module is used for feature extraction of the first feature image with position information, and outputs a second feature image. The full connection layer is used for splicing the first feature image and the second feature image, and mapping and outputting a detection result. The model evaluation module is used for combining the subjective score of the text image to evaluate and optimize the detection accuracy of the text image quality detection model.

[0054] In one embodiment, the first feature extraction module is a convolutional neural network, and the second feature extraction module is a transformer-based encoder. The convolutional neural network includes four convolutional blocks 1, 2, 3 and 4, which perform four downsampling operations on the input text image to obtain four downsampling results:

[0055] x1∈B1×C1×H1×W1

[0056] x2∈B1×C2×H2×W2

[0057] x3∈B1×C3×H3×W3

[0058] x4 e B1 x C4 x H4 x W4

[0059] wherein B i denotes the batch size of the current batch i, C i denotes the number of channels of the i-th layer output, H i and W i denote the image of the i-th layer output.

[0060] The convolutional neural network extracts multi-scale local features from the input image through four convolutional blocks. Specifically, a normalization layer, a pooling layer and a dropout process are further arranged after the convolutional block. The pooling layer pools x1, x2 and x3, so that their tensors are aligned as

[0061] x1, x2, x3 e B4 x C4 x H4 x W4

[0062] The features after the dropout process are added in a concatenated manner, and x4 is obtained

[0063] x5 e B4 x C4 x H4 x W4

[0064] and input into the transformer-based encoder.

[0065] The position encoding module generates position encoding information based on the output x5 to form a first feature image with position information. By setting the position encoding module, the permutation invariant property of the transformer is processed. The transformer-based encoder performs attention weighting on the first feature image with position information, and outputs a second feature image:

[0066]

[0067] wherein B i denotes the batch size of the current batch i, k i denotes the weight corresponding to the i-th layer output, C i denotes the number of channels of the i-th layer output, W4 and H4 denote the image of the 4-th layer output.

[0068] The second feature image is added in a concatenated manner after the pooling layer and the fully connected layer, and is input into the fully connected layer to map the image quality detection result.

[0069] For text image quality detection, local features at different positions often have correlations, such as the relationship between edge and texture quality and text, so long-distance capture is conducive to providing global context information, thereby improving the accuracy of text image quality detection. In addition, the Transformer can adaptively assign weights to each feature element through self-attention weights, so that the model pays more attention to important quality features such as text font blur, alignment, picture noise, etc.

[0070] The application introduces a hybrid framework composed of CNN and Transformer to model global and local information for text image quality detection, and proposes a no-reference text image quality detection model considering that it is difficult to obtain high-quality text reference images. CNN is good at extracting local features of images, and Transformer can effectively capture long-distance dependencies between global images through a self-attention mechanism. By combining the two, local and global information can be better integrated to improve the understanding of image content and obtain better IQA performance.

[0071] Based on the above text image quality detection system, the embodiment of the application also discloses a text image quality detection method, which comprises the following steps: Figure 2 , including:

[0072] S1, obtaining a text image, and dividing the text image into a training set and a test set.

[0073] S2, constructing a text image quality detection model, and inputting the training set into the text image quality detection model for training.

[0074] In one embodiment, step S2 comprises:

[0075] inputting the text image into a first feature extraction module to obtain a first feature image.

[0076] Based on the first feature image, position encoding information is generated.

[0077] The position encoding information is combined with the first feature image to obtain a first feature image with position information.

[0078] The first feature image with position information is input into a second feature extraction module to obtain a second feature image.

[0079] The first feature image and the second feature image are spliced through a fully connected layer to map an output image quality detection result.

[0080] Specifically, the first feature extraction module is a convolutional neural network, and the second feature extraction module is a transformer-based encoder.

[0081] In one embodiment, step S2 further comprises:

[0082] The text image quality detection model is trained by using a regression loss function for minimization:

[0083]

[0084] wherein n represents the number of encoder layers, q i is the detection result of the i-th image, s i is the subjective score of the i-th image, w1 and w2 are the weights corresponding to the detection result and the subjective score respectively, and the corresponding weights are used to make the detection result of the text image quality detection model more tend to the subjective score, so as to obtain a more robust detection result.

[0085] S3, inputting the test set into the trained text image quality detection model to obtain a detection result, and evaluating and optimizing the text image quality detection model, wherein the evaluation indexes of the text image quality detection model include an optimized linear correlation coefficient (OLCC) and an optimized Spearman rank-order correlation coefficient (OSROCC).

[0086] The OLCC describes the linear correlation between the subjective score and the objective detection result, and by measuring the linear correlation between the subjective score (the score of the text image quality given by the human eye) and the objective detection result (the image quality score given by the text image quality detection model), the best linear transformation is found to make the objective detection result more close to the subjective score.

[0087] In an embodiment, the evaluation of the text image quality detection model comprises:

[0088] The subjective score of the text image is obtained, and the optimized linear correlation OLCC between the subjective score and the output detection result is evaluated by combining the subjective score and the output detection result:

[0089]

[0090] wherein N represents the number of batches of images, y i and respectively represent the subjective score of the i-th image and the output detection result, and are obtained by the subjective score of the actual human eye labeled data and the detection of the text image quality detection model on a single training picture, respectively; and respectively represent the average value of the subjective score and the average value of the detection result, m iis the weight corresponding to the i-th image, used to adjust the weight proportion of the improved OLCC.

[0091] The monotonicity of the text image quality detection model is measured by using the OSROCC, and the correlation between the ranks of the subjective scores and the objective detection results is calculated, focusing on the consistency in the ranking between the two, without considering the absolute value of the score difference. The Spearman rank correlation coefficient is a non-parametric statistical method that calculates the relationship between subjective evaluation and objective evaluation based on ranking, to adjust the objective score to achieve the best consistency with the subjective score in ranking.

[0092] In one embodiment, the evaluation of the text image quality detection model further comprises:

[0093] Obtain the subjective scores of the text images and the ranking between the subjective scores.

[0094] Obtain the output detection results and the ranking between the detection results.

[0095] Based on the subjective score ranking and the detection result ranking, evaluate the rank correlation OSROCC between the subjective scores and the detection results:

[0096]

[0097] wherein v i and p i represent y i and The ranking position in the sequence of subjective scores and detection results, w3 is the corresponding weight, used to adjust the magnitude of the overall monotonicity. The training set images are pre-trained and segmented when entering the text image quality detection model, so that the training set images are split in the same batch, v i represents the subjective score part, i.e. its corresponding part ranking with the detection result part; p i represents the sequence position of the training set image after being detected and ranked by the text image quality detection model. Through OSROCC, different local weights can be effectively used to dynamically allocate attention and evaluate the images.

[0098] The training process of the text image quality detection model is as follows Figure 3 , obtain the text images, divide the text images into training set and test set. From each training image in the training set, 100 blocks of size 512x512 pixels are randomly selected, and model preprocessing and configuration are performed simultaneously: using Adam optimizer, weight decay is 5x10 -3 , the text image quality detection model is trained for a maximum of 10 epochs, and the batch size is 48. The learning rate of the text image quality detection model is initially set to 3x10-5 and reduce the learning rate by 10 times after each epoch.

[0099] Specifically, ResNet50 is used as the CNN backbone network, and the weight is initialized with Imagenet. The number of encoder layers used in the transformer is 2.

[0100] The output feature F corresponding to the transformer-based encoder T is:

[0101]

[0102] where B represents the batch size, k i represents the weight corresponding to the output of the i-th layer, C i represents the number of channels of the output of the i-th layer, and W4 and H4 represent the image output of the fourth layer. Specifically, k i The value of can be represented as 0.6+0.1×i.

[0103] For each image batch, the text image quality detection model is trained by minimizing the regression loss:

[0104]

[0105] where n represents the number of encoder layers, q i is the detection result of the i-th image, s i is the subjective score of the i-th image, and w1 and w2 are the weights corresponding to the detection result and the subjective score, respectively. The corresponding weights are used, and specifically, w1 is 0.9 and w2 is 0.7.

[0106] In the test phase, 100 512×512 pixel blocks are randomly sampled from the test images of the test set, and input into the trained text image quality detection model. The detection result scores are average-pooled to obtain the final quality score.

[0107] Optimal linear correlation between subjective score and detection result OLCC is evaluated:

[0108]

[0109] where N represents the number of images in the batch, y i and represent the subjective score and the output detection result of the i-th image, respectively, and represent the average value of the subjective score and the average value of the detection result, respectively, m i is the weight corresponding to the i-th image, and specifically, m i is

[0110]

[0111] The monotonicity of the text image quality detection model is measured by using the OSROCC, and the calculation formula is:

[0112]

[0113] Wherein, v i represents y i The ranking position in the subjective score sequence, p i represents The ranking position in the detection result sequence, w3 is the corresponding weight, used to adjust the amplitude of the overall monotonicity, specifically, w3 is 0.2.

[0114] The text image quality detection model without reference image is used to detect the text image quality, which does not need fixed reference image, is more suitable for actual application scene, is more flexible and practical, improves the detection precision of text image quality evaluation, and improves the accuracy and robustness of text image quality detection, realizes accurate and real-time text image quality evaluation.

[0115] The above various modules in the text image quality detection system can be realized by software, hardware and their combinations. The above various modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to call and execute the operations corresponding to the above various modules by the processor.

[0116] In an embodiment, a computer device is provided, which can be a server or terminal integrated with a scheduler, and its internal structure diagram can be as shown in Figure 4 The computer device includes a processor, a memory and a network interface connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The computer program is executed by the processor to implement a text image quality detection method.

[0117] In an embodiment, a computer device is provided, which includes a memory and a processor, and the memory stores a computer program. The processor executes the computer program to implement the following steps:

[0118] Obtaining a text image, dividing the text image into a training set and a test set;

[0119] A text image quality detection model is constructed, and the training set is input into the text image quality detection model for training.

[0120] The test set is input into the trained text image quality detection model to obtain a detection result, and the text image quality detection model is evaluated and optimized.

[0121] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0122] The subjective scores of the text images are obtained, and the subjective scores and the output detection results are combined to evaluate the optimized linear correlation between the subjective scores and the detection results OLCC:

[0123]

[0124] Wherein, N represents the number of batches of images, y i and respectively represent the subjective scores of the i-th image and the output detection results, which are obtained by the subjective scores of the actual human eye labeling data and the text image quality detection model detecting a single training picture, respectively; and respectively represent the average value of the subjective scores and the average value of the detection results, m i is the weight corresponding to the i-th image, which is used to adjust the weight proportion of the improved OLCC.

[0125] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0126] The subjective scores of the text images are obtained, and the subjective scores and the output detection results are combined to evaluate the subjective scores and the detection results between the optimized linear correlation OLCC:

[0127] The output detection results and the sorting between the detection results are obtained;

[0128] Based on the subjective score sorting and the detection result sorting, the rank correlation between the subjective scores and the detection results OSROCC is evaluated:

[0129]

[0130] Wherein, v i and p i respectively represent y i and The sorting positions in the subjective score sequence and the detection result sequence, and w3 is the corresponding weight, which is used to adjust the amplitude of the overall monotonicity.

[0131] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0132] The text image is input into the first feature extraction module to obtain a first feature image;

[0133] inputting the first feature image into a second feature extraction module to obtain a second feature image;

[0134] splicing the first feature image and the second feature image through a full connection layer to map an output image quality detection result.

[0135] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0136] generating position encoding information based on the first feature image;

[0137] combining the position encoding information with the first feature image to obtain a first feature image with position information, and inputting the first feature image with position information into the second feature extraction module.

[0138] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0139] training the text image quality detection model using a regression loss function:

[0140]

[0141] wherein n represents the number of encoder layers, q i is the detection result of the i-th image, s i is the subjective score of the i-th image, w1 and w2 are weights corresponding to the detection result and the subjective score, respectively.

[0142] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program, when executed by a processor, implements the following steps:

[0143] obtaining a text image, and dividing the text image into a training set and a test set;

[0144] constructing a text image quality detection model, and inputting the training set into the text image quality detection model for training;

[0145] inputting the test set into the trained text image quality detection model to obtain a detection result, and evaluating and optimizing the text image quality detection model.

[0146] In one embodiment, the computer program, when executed by the processor, also implements the following steps:

[0147] obtaining a subjective score of the text image, combining the subjective score with the output detection result, and evaluating the optimized linear correlation between the subjective score and the detection result OLCC:

[0148]

[0149] wherein N represents the number of batches of images, y i and respectively represent the subjective score of the i-th image and the output detection result, which are obtained by the subjective score of the actual human eye labeled data and the text image quality detection model detecting a single training picture respectively; and respectively represent the average value of the subjective score and the average value of the detection result, m i is the weight corresponding to the i-th image, which is used to adjust the weight proportion of the improved OLCC.

[0150] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0151] Obtaining the subjective scores of the text images and the ranking between the subjective scores;

[0152] Obtaining the output detection results and the ranking between the detection results;

[0153] Based on the subjective score ranking and the detection result ranking, evaluating the rank correlation OSROCC between the subjective score and the detection result:

[0154]

[0155] wherein v i and p i respectively represent y i and The ranking position in the subjective score sequence and the detection result sequence, w3 is the corresponding weight, which is used to adjust the amplitude of the overall monotonicity.

[0156] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0157] Inputting the text image into the first feature extraction module to obtain the first feature image;

[0158] Inputting the first feature image into the second feature extraction module to obtain the second feature image;

[0159] Splicing the first feature image and the second feature image through the full connection layer to map the output image quality detection result.

[0160] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0161] Based on the first feature image, generating position encoding information;

[0162] Combining the position encoding information with the first feature image to obtain the first feature image with position information, and inputting it into the second feature extraction module.

[0163] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0164] The text image quality detection model is trained by using a regression loss function for minimization:

[0165]

[0166] wherein n represents the number of encoder layers, q i is the detection result of the i-th image, s i is the subjective score of the i-th image, w1 and w2 are weights corresponding to the detection result and the subjective score, respectively.

[0167] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiments. Any reference to a memory, database or other medium used in the embodiments provided by the present application can include at least one of a non-volatile and volatile memory. The non-volatile memory can include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory, an optical memory, a high-density embedded non-volatile memory, a resistive memory (ReRAM), a magnetoresistive random access memory (MRAM), a ferroelectric memory (FRAM), a phase change memory (PCM), a graphene memory, etc. The volatile memory can include a random access memory (RAM) or an external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as a static random access memory (SRAM) or a dynamic random access memory (DRAM), etc. The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0168] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, any combination of the technical features is deemed to be within the scope of the present disclosure.

[0169] The above description is merely the preferred embodiments of the present application, and is not intended to limit the present application in any form. Any modification, equivalent change and modification made to the above embodiments according to the technical essence of the present application, without departing from the technical solution of the present application, are still within the scope of the present application.

Claims

1. A method for detecting quality of a text image, characterized in that, The method comprises the following steps: acquiring a text image, and dividing the text image into a training set and a test set; constructing a text image quality detection model, and inputting the training set into the text image quality detection model for training; inputting the test set into the trained text image quality detection model, obtaining a detection result, and evaluating and optimizing the text image quality detection model; the evaluation of the text image quality detection model comprises: acquiring subjective scores of the text image, combining the subjective scores with the output detection result, and evaluating an optimized linear correlation between the subjective scores and the detection result (OLCC); Wherein, N represents the number of batches of images, y i and respectively represent the subjective score of the i-th image and the output detection result, which are obtained by the subjective score of the actual human eye labeled data and the text image quality detection model detecting a single training picture, respectively; and respectively represent the average value of the subjective score and the average value of the detection result, m i is the weight corresponding to the i-th image, which is used to adjust the weight proportion of the improved OLCC.

2. The text image quality detection method of claim 1, wherein, the evaluation of the text image quality detection model further comprises: acquiring subjective scores of the text image and an order of the subjective scores; acquiring the output detection result and an order of the detection result; based on the order of the subjective scores and the order of the detection result, evaluating a rank correlation between the subjective scores and the detection result (OSROCC); wherein v i and p i respectively represent y i and The ranking position in the subjective score sequence and the detection result sequence, w3 is the corresponding weight, used to adjust the amplitude of overall monotony.

3. The text image quality detection method of claim 1, wherein, the construction of the text image quality detection model, and the inputting of the training set into the text image quality detection model for training, comprises: inputting the text image into a first feature extraction module to obtain a first feature image; inputting the first feature image into a second feature extraction module to obtain a second feature image; splicing the first feature image and the second feature image through a full connection layer to output an image quality detection result.

4. The text image quality detection method of claim 3, wherein, the construction of the text image quality detection model, and the inputting of the training set into the text image quality detection model for training, further comprises: generating position encoding information based on the first feature image; combining the position encoding information with the first feature image to obtain a first feature image with position information, and inputting the first feature image with position information into the second feature extraction module.

5. The text image quality detection method of claim 1, wherein, the construction of the text image quality detection model, and the inputting of the training set into the text image quality detection model for training, further comprises: training the text image quality detection model by using a minimum regression loss function: wherein n represents the number of encoder layers, q i is the detection result of the i-th image, s i is the subjective score of the i-th image, and w1 and w2 are the weights corresponding to the detection result and the subjective score, respectively.

6. The text image quality detection method of claim 1, wherein, the first feature extraction module is a convolutional neural network, and the second feature extraction module is a transformer-based encoder.

7. A text image quality detection system for implementing the text image quality detection method according to any one of claims 1 to 6, characterized in that The method comprises a text image quality detection model and a model evaluation module, and the text image quality detection model comprises: a first feature extraction module, configured to perform feature extraction on an input text image, and output a first feature image; a position encoding module, configured to generate position encoding information for the first feature image output by the first feature extraction module, and form a first feature image with position information; a second feature extraction module, configured to perform feature extraction on the first feature image with position information, and output a second feature image; a full connection layer, configured to splice the first feature image and the second feature image, and map an output detection result; the model evaluation module is configured to combine subjective scores of the text image, evaluate and optimize the detection accuracy of the text image quality detection model.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to realize the steps of the method in any one of claims 1 to 6.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 6.

Citation Information

Patent Citations

  • AIGC image quality evaluation method based on text image encoder

    CN118537711A