Image quality detection method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202611273007.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-10-27
AI Technical Summary
[0005]本发明提供一种图像质量检测方法、装置、电子设备和存储介质,用以解决现有技术中降低图像质量检测的准确性的缺陷
[0020]本发明提供的图像质量检测方法、装置、电子设备和存储介质,获取包括原图像和加工图像的待检测信息,将待检测信息输入图像质检模型中,得到图像质检模型输出的针对加工图像的质量检测结果,图像质检模型是基于至少一个目标训练样本和各目标训练样本对应的审核标签训练得到的,目标训练样本包括至少一个目标档位对应的初始训练样本,目标档位为从所有档位中筛选的初始训练样本的标注正确率大于预设准确率、且非极端档位的档位,档位是基于所有初始训练样本各自对应的一致比例确定的,一致比例是基于初始训练样本的多个初始质量检测结果与初始训练样本对应的审核标签确定的。可知,本发明基于一致比例对所有初始训练样本进行分档,仅将标注正确率大于预设准确率、且非极端档位的目标档位的初始训练样本作为参与训练的目标训练样本,自动剔除标注有误、模型完全不掌握和充分掌握的极端档位的初始训练样本,实现了难样本的挖掘,显著提升训练阶段的有效信息密度,从而提高了训练得到的图像质检模型的准确性,也就提高了图像质量检测的准确性。
Smart Images

Figure CN122989689A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image technology, and in particular to an image quality detection method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the large-scale implementation of Artificial Intelligence Generated Content (AIGC) in the e-commerce material production chain, image materials such as white background images, transparent background images, and generated scene images obtained from processing original online product images need to undergo automated compliance and quality review before they are put into use or launched online.
[0003] In related technologies, an image quality inspection model is usually trained based on all the processed images of the acquired samples and the review labels that are used to annotate each processed image. Then, the quality of the processed images is inspected based on the trained image quality inspection model.
[0004] However, in the aforementioned related technologies, the image quality inspection model is trained based on all processed images of the samples and the review labels of each processed image. This makes the image quality inspection model prone to overfitting on simple samples and has limited generalization ability on easily confused or ambiguous samples, thereby reducing the accuracy of image quality detection. Summary of the Invention
[0005] This invention provides an image quality detection method, apparatus, electronic device, and storage medium to address the shortcomings of existing technologies that reduce the accuracy of image quality detection.
[0006] This invention provides an image quality detection method, comprising the following steps.
[0007] Obtain the information to be detected, which includes the original image and the processed image, wherein the processed image is obtained by processing the original image; The information to be detected is input into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on the multiple initial quality inspection results of the initial training samples and the review labels corresponding to the initial training samples.
[0008] According to an image quality detection method provided by the present invention, the step of inputting the information to be detected into an image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model includes: The information to be detected and the prompt information are input into the image quality inspection model. The image quality inspection model performs a first preset number of independent samplings on the information to be detected to obtain the initial quality inspection results corresponding to each independent sampling. The prompt information is used to prompt the image quality inspection model to output the final review analysis information for each review dimension. The initial quality inspection results include the initial comprehensive review results and the initial review information for each review dimension. The initial review information includes the initial review results and the corresponding initial review analysis information. The final comprehensive review result is obtained by taking the mode of all the initial comprehensive review results. For each of the aforementioned review dimensions, the mode of each initial review result for that review dimension is taken to obtain the final review result for that review dimension; Based on the initial audit analysis information for each of the audit dimensions, the final audit analysis information for each audit dimension is determined; The quality inspection result is determined based on the final comprehensive audit result, the final audit result of each audit dimension, and the final audit analysis information of each audit dimension.
[0009] According to an image quality detection method provided by the present invention, the initial quality detection result further includes a confidence level, which is determined based on the ratio of the number of all initial comprehensive review results that are the same as the final comprehensive review result to the first preset number; The determination of the quality inspection result based on the final comprehensive audit result, the final audit results of each audit dimension, and the final audit analysis information of each audit dimension includes: The quality inspection result is determined based on the final comprehensive audit result, the final audit result of each audit dimension, the final audit analysis information of each audit dimension, and the confidence level.
[0010] According to an image quality detection method provided by the present invention, determining the final review analysis information of the review dimension based on the initial review analysis information of each of the review dimensions includes: Obtain all target initial audit results that are identical to the final audit result; The initial audit analysis information corresponding to each of the initial audit results of the aforementioned targets is statistically analyzed to obtain the initial audit analysis information corresponding to the highest frequency. The initial audit analysis information corresponding to the highest frequency is determined as the final audit analysis information.
[0011] According to the image quality detection method provided by the present invention, the review labels corresponding to the target training samples include comprehensive review labels and sub-review labels for each review dimension; the image quality inspection model is trained based on the following method: The target training sample is input into the first initial image quality inspection model to obtain the predicted quality inspection result output by the first initial image quality inspection model. The predicted quality inspection result includes the predicted comprehensive review result and the predicted review result of each review dimension. Based on the predicted comprehensive review results and the comprehensive review labels corresponding to the target training samples, a comprehensive review reward is constructed. Based on the predicted review results of each review dimension and the sub-review tags of each review dimension, the review reward for each dimension is determined. Based on the comprehensive review reward and the dimensional review reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
[0012] According to an image quality detection method provided by the present invention, the step of determining dimension review rewards based on the predicted review results of each review dimension and the sub-review tags of each review dimension includes: If at least one target sub-review label representing a failed review exists among all the sub-review labels corresponding to the target training sample, all target predicted review results representing failed review are filtered from the predicted review results of all the review dimensions, and the review reward for the dimension is determined based on all the target predicted review results and all the target sub-review labels. If there is no target sub-review label representing a failed review among all the sub-review labels corresponding to the target training sample, the dimension review reward is determined based on the number of all predicted review results for the target.
[0013] According to an image quality detection method provided by the present invention, the step of iteratively adjusting the model parameters of a first initial image quality detection model based on the comprehensive review reward and the dimensional review reward to obtain the image quality detection model includes: Based on the output format of the predicted quality detection results and the preset output format, the hard-format gating reward is determined; Based on the comprehensive review reward, the dimensional review reward, and the hard-format gating reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
[0014] According to an image quality detection method provided by the present invention, the step of iteratively adjusting the model parameters of a first initial image quality detection model based on the comprehensive review reward, the dimensional review reward, and the hard format gating reward to obtain the image quality detection model includes: Based on the output length of the predicted quality detection result and the preset output length range, a soft length reward is determined, wherein the preset output length range is the same as the output length range of the first initial image quality inspection model. Based on the comprehensive review reward, the dimensional review reward, the hard format gating reward, and the soft length reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
[0015] According to an image quality detection method provided by the present invention, the method further includes: For each of the initial training samples, the initial training samples are input into the second initial image quality inspection model, and the second initial image quality inspection model performs a second preset number of independent samplings on the initial training samples to obtain the initial quality detection results corresponding to each independent sampling. Based on the initial quality detection results and the audit tags corresponding to the initial training samples, the consistency ratio corresponding to the initial training samples is determined. The initial training samples are discretized into multiple gear levels corresponding to all the consistent proportions; For each gear level, determine the labeling accuracy of all initial training samples corresponding to that gear level; The target level is determined based on the level corresponding to the labeled accuracy rate that is greater than the preset accuracy rate. The initial training sample corresponding to the target gear is determined as the target training sample.
[0016] The present invention also provides an image quality detection device, comprising: An acquisition unit is used to acquire information to be detected, the information to be detected including an original image and a processed image, wherein the processed image is obtained by processing the original image; The first detection unit is used to input the information to be detected into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on multiple initial quality inspection results of the initial training samples and the review labels corresponding to the initial training samples.
[0017] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the image quality detection method as described above.
[0018] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image quality detection method as described above.
[0019] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the image quality detection method as described above.
[0020] The image quality detection method, apparatus, electronic device, and storage medium provided by this invention acquire detection information including the original image and the processed image, input the detection information into an image quality inspection model, and obtain the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on multiple initial quality detection results of the initial training samples and the review labels corresponding to the initial training samples. As can be seen, this invention classifies all initial training samples based on a consistent ratio, and only uses the initial training samples of the target level whose labeling accuracy is greater than the preset accuracy and which are not extreme levels as target training samples to participate in training. It automatically removes the initial training samples of extreme levels that are incorrectly labeled, completely unknown to the model, or fully known by the model, thereby realizing the mining of difficult samples, significantly improving the effective information density in the training stage, and thus improving the accuracy of the trained image quality inspection model, which in turn improves the accuracy of image quality detection. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 This is one of the flowcharts of the image quality detection method provided in the embodiments of the present invention.
[0023] Figure 2 This is the second schematic flowchart of the image quality detection method provided in the embodiments of the present invention.
[0024] Figure 3 This is a schematic diagram of the training process of the image quality inspection model provided in an embodiment of the present invention.
[0025] Figure 4 This is the third flowchart of the image quality detection method provided in this embodiment of the invention.
[0026] Figure 5 This is a schematic diagram of the overall process of the image quality detection method provided in the embodiments of the present invention.
[0027] Figure 6 This is a schematic diagram of the image quality detection device provided in an embodiment of the present invention.
[0028] Figure 7 This is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0030] The following is combined with Figures 1 to 5 The present invention describes an image quality detection method. The subject executing this image quality detection method can be an electronic device such as a computer, tablet computer, terminal, or server, or it can be an image quality detection device installed in the electronic device. This image quality detection device can be implemented through software, hardware, or a combination of both.
[0031] Figure 1This is one of the flowcharts illustrating the image quality detection method provided in this embodiment of the invention, such as... Figure 1 As shown, the image quality detection method includes the following steps: Step 101: Obtain the information to be detected, which includes the original image and the processed image, wherein the processed image is obtained by processing the original image.
[0032] For example, the original image can be an image including the product, and the processed image can be a white background image (product subject + pure white background), a transparent background image (subject subject cutout with alpha channel), or a generated scene image (a scene projection image synthesized by a raw image model based on the transparent background subject), etc. The information to be detected can also include intermediate images obtained by processing the original image, etc., and the present invention does not limit this.
[0033] Step 102: Input the information to be detected into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on the multiple initial quality inspection results of the initial training samples and the review labels corresponding to the initial training samples.
[0034] For example, the information to be detected is input into the image quality inspection model, which performs feature extraction and multimodal fusion processing on the information to be detected, generating quality inspection results for the processed image. The quality inspection results may include the final comprehensive review results and the review information for each review dimension. The review information includes the final review results for each review dimension and the corresponding final review analysis information. The final comprehensive review result refers to the summary of the review results for all review dimensions. The review dimensions include at least one of the following: accuracy of product cutout, accuracy of model cutout, reasonableness of product support, image psoriasis status, integrity of the main body of the product, reasonableness of model cropping, adaptability of product scene, consistency of style and model, consistency of product color, and consistency of product quantity.
[0035] It should be noted that, taking 10 review dimensions as an example, the review labeling system adopts a 10+1 approach, with 10 fine-grained review dimensions and 1 "all passed" category together forming the top-level label space; if any one review dimension is judged as failing the review, the top-level conclusion is "failed," which means the final comprehensive review result is "failed." If all 10 review dimensions pass, the final comprehensive review result is "passed."
[0036] The image quality detection method provided by this invention acquires detection information including the original image and the processed image, inputs the detection information into an image quality inspection model, and obtains the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on multiple initial quality detection results of the initial training samples and the review labels corresponding to the initial training samples. As can be seen, this invention classifies all initial training samples based on a consistent ratio, and only uses the initial training samples of the target level whose labeling accuracy is greater than the preset accuracy and which are not extreme levels as target training samples to participate in training. It automatically removes the initial training samples of extreme levels that are incorrectly labeled, completely unknown to the model, or fully known by the model, thereby realizing the mining of difficult samples, significantly improving the effective information density in the training stage, and thus improving the accuracy of the trained image quality inspection model, which in turn improves the accuracy of image quality detection.
[0037] In one embodiment, Figure 2 This is a second schematic flowchart of the image quality detection method provided in this embodiment of the invention, as shown below. Figure 2 As shown, step 102 above inputs the information to be detected into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model. This can be achieved through the following steps: Step 201: Input the information to be detected and the prompt information into the image quality inspection model. The image quality inspection model performs a first preset number of independent samplings on the information to be detected to obtain the initial quality inspection results corresponding to each independent sampling. The prompt information is used to prompt the image quality inspection model to output the final review analysis information for each review dimension. The initial quality inspection results include the initial comprehensive review results and the initial review information for each review dimension. The initial review information includes the initial review results and the corresponding initial review analysis information.
[0038] For example, the information to be detected and the prompt information are input into the image quality inspection model. The prompt information is used to constrain the image quality inspection model to generate initial quality inspection results according to the preset review dimensions and output format. The image quality inspection model performs a first preset number of independent samplings (e.g., 16 times) on the information to be detected, and obtains initial quality inspection results corresponding to each independent sampling. Taking 16 independent samplings as an example, 16 initial quality inspection results are obtained for the same information to be detected. The initial quality inspection results include the reasoning process corresponding to each independent sampling and the initial quality inspection results corresponding to each independent sampling. Each initial quality inspection result includes an initial comprehensive review result and initial review information corresponding to each review dimension. Each initial review information includes the initial review result under that review dimension and the initial review analysis information used to explain the judgment basis.
[0039] It should be noted that the number of independent samples can also be any integer greater than or equal to 8, such as 8, 24, or 32.
[0040] Step 202: Take the mode of all the initial comprehensive review results to obtain the final comprehensive review result.
[0041] For example, all initial comprehensive review results are statistically analyzed, and the initial comprehensive review result with the highest frequency is extracted as the mode. This mode is determined as the final comprehensive review result. Taking 16 independent samples as an example, for the same information to be detected, if 11 of the 16 initial comprehensive review results are qualified and 5 are unqualified, then the final comprehensive review result is qualified.
[0042] Step 203: For each of the audit dimensions, take the mode of each initial audit result of the audit dimension to obtain the final audit result of the audit dimension.
[0043] For example, for each audit dimension, the initial audit result corresponding to that audit dimension is extracted independently from all initial quality inspection results. The frequency of all initial audit results corresponding to that audit dimension is statistically analyzed, and the initial audit result with the highest frequency is taken as the mode. The mode is then determined as the final audit result for that audit dimension.
[0044] Step 204: Based on the initial audit analysis information of each audit dimension, determine the final audit analysis information of the audit dimension.
[0045] For example, frequency statistics are performed on all initial audit analysis information for this audit dimension, and the initial audit analysis information with the highest frequency is determined as the final audit analysis information for this audit dimension.
[0046] Step 205: Based on the final comprehensive audit result, the final audit results of each audit dimension, and the final audit analysis information of each audit dimension, determine the quality inspection result.
[0047] For example, by integrating the final comprehensive audit results, the final audit results of each audit dimension, and the final audit analysis information of each audit dimension, the final quality inspection result is generated. This quality inspection result encapsulates the full-link audit evidence from top-level decision-making to bottom-level attribution in a structured JSON format.
[0048] In this embodiment, a self-consistent reasoning mechanism based on multiple independent sampling is introduced, which effectively suppresses random noise in single reasoning and significantly improves the robustness of the image quality inspection model in judging fuzzy boundary samples.
[0049] In one embodiment, the initial quality inspection result further includes a confidence level, which is determined based on the ratio of the number of all initial comprehensive review results that are the same as the final comprehensive review result to the first preset number; step 205 above determines the quality inspection result based on the final comprehensive review result, the final review results of each review dimension, and the final review analysis information of each review dimension, which can be implemented in the following ways: The quality inspection result is determined based on the final comprehensive audit result, the final audit result of each audit dimension, the final audit analysis information of each audit dimension, and the confidence level.
[0050] For example, confidence can be calculated based on formula (1): confidence=max_count / K (1) Where max_count represents the number of all initial comprehensive review results that are the same as the final comprehensive review result, K represents the number of independent samples, which is the first preset number, and confidence falls in the interval [1 / K, 1].
[0051] The final quality inspection result is generated by integrating the final comprehensive audit result, the final audit results of each audit dimension, the final audit analysis information of each audit dimension, and the confidence level. For example, the final quality inspection result includes a final comprehensive audit result of "fail" with a confidence level of 0.875, a final audit result of "pass" for audit dimension 1, and final audit analysis information for audit dimension 1 as information A.
[0052] Furthermore, downstream consumption can be performed based on confidence levels. Specifically, the business side pre-sets a first confidence threshold and a second confidence threshold. If the first confidence threshold is greater than the second confidence threshold, the confidence level is compared with both thresholds. If the confidence level is greater than or equal to the first confidence threshold, the application is either directly approved (if the confidence level is at the level of approval) or blocked (if the confidence level is at the level of disapproval). If the confidence level is less than the first confidence threshold but greater than the second confidence threshold, the application enters a secondary quality inspection model for quality review and detection, or is based on preset rules. If the confidence level is less than or equal to the second confidence threshold, the application directly enters a manual review process. Additionally, the final review analysis information for each review dimension can reveal the reasons for failure in specific review dimensions, allowing for targeted rework prompts.
[0053] It should be noted that the confidence level in this invention is determined based on the ratio of the number of all initial comprehensive review results that are the same as the final comprehensive review result to a first preset number, without the need for additional training of classification heads or probability heads, and is naturally compatible with the training objective.
[0054] In this embodiment, the quality detection result is determined based on the final comprehensive review result, the final review result of each review dimension, the final review analysis information of each review dimension, and the confidence level. The introduction of confidence level quantifies the reliability of the model decision and improves the comprehensiveness and accuracy of image quality detection.
[0055] In one embodiment, step 204 above determines the final audit analysis information for each audit dimension based on the initial audit analysis information for each audit dimension, which can be implemented in the following way: Obtain all target initial audit results that are the same as the final audit result; statistically analyze the initial audit analysis information corresponding to each of the target initial audit results to obtain the initial audit analysis information corresponding to the highest frequency; determine the initial audit analysis information corresponding to the highest frequency as the final audit analysis information.
[0056] For example, for each audit dimension, firstly, obtain all target initial audit results that are the same as the final audit result. For instance, if the final audit result is "pass", then all target initial audit results are "pass". Then, perform frequency statistics on the initial audit analysis information corresponding to each target initial audit result to obtain the initial audit analysis information corresponding to the highest frequency. This highest frequency initial audit analysis information is then determined as the final audit analysis information. For example, if there are 11 target initial audit results, and among the initial audit analysis information corresponding to each of these 11 target initial audit results, there are 6 identical initial audit analysis information 1, 3 identical initial audit analysis information 2, and 2 identical initial audit analysis information 3, then initial audit analysis information 1 is determined as the final audit analysis information.
[0057] In this embodiment, the initial audit analysis information corresponding to the highest frequency is determined as the final audit analysis information, and the final audit analysis information is used as the final interpretable reasoning basis, thereby improving the accuracy of the interpretable reasoning basis.
[0058] In one embodiment, the review labels corresponding to the target training samples include comprehensive review labels and sub-review labels for each review dimension; Figure 3 This is a schematic diagram of the training process of the image quality inspection model provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the image quality inspection model is trained based on the following steps: Step 301: Input the target training sample into the first initial image quality inspection model to obtain the predicted quality inspection result output by the first initial image quality inspection model. The predicted quality inspection result includes the predicted comprehensive review result and the predicted review result of each review dimension.
[0059] The target training samples include the original image, the processed image of the original image, and the sample prompt information. The training framework of the first initial image quality inspection model can adopt a distributed training framework.
[0060] For example, the target training sample is input into the first initial image quality inspection model, which performs feature extraction and multimodal fusion processing on the target training sample to generate a predicted quality inspection result for the processed image of the sample. The predicted quality inspection result may include a predicted comprehensive review result and a predicted review result for each review dimension.
[0061] It should be noted that the predicted quality inspection results may also include predicted audit analysis information for each audit dimension, but this invention does not limit this.
[0062] Step 302: Based on the predicted comprehensive review results and the comprehensive review labels corresponding to the target training samples, construct a comprehensive review reward.
[0063] Optionally, if the predicted comprehensive review result matches the comprehensive review label, the comprehensive review reward is determined to be a first value, which is positive; if the comprehensive review label indicates failure but the predicted comprehensive review result indicates success, the comprehensive review reward is determined to be a second value, which is negative; if the comprehensive review label indicates success but the predicted comprehensive review result indicates failure, the comprehensive review reward is determined to be zero.
[0064] For example, a comprehensive review reward is constructed based on the predicted comprehensive review result and the comprehensive review label corresponding to the target training sample. This comprehensive review reward adopts a class-balanced binary classification design. Specifically, when the predicted comprehensive review result matches the comprehensive review label, the comprehensive review reward is a first value, for example, +1.0; when the comprehensive review label is "fail" but the predicted comprehensive review result is "pass" (a false positive error), the comprehensive review reward is a second value, which is negative, for example, -0.5, to impose a penalty, aiming to suppress the biased shortcut behavior that SAPO may exhibit under more lenient pruning; when the comprehensive review label is "pass" but the predicted comprehensive review result is "fail" (a false negative error), the comprehensive review reward is zero, adopting a neutral strategy of no reward and no penalty, aiming to avoid excessive conservatism in the reverse direction; when the format of the predicted comprehensive review result is non-compliant, the comprehensive review reward is zero.
[0065] It should be noted that when the comprehensive review label is "not approved" but the predicted comprehensive review result is "approved", the second value can also take any value in the range of [-1.0, -0.2], or a symmetrical binary classification reward can be used. This invention does not limit this.
[0066] Step 303: Determine the dimension review reward based on the predicted review results of each review dimension and the sub-review tags of each review dimension.
[0067] For example, based on the predicted audit results of each audit dimension and the sub-audit tags of each audit dimension, dimension audit rewards are constructed, and the data source is strictly limited to the predicted audit result field of the audit dimension in the initial quality inspection results.
[0068] Step 304: Based on the comprehensive review reward and the dimensional review reward, iteratively adjust the model parameters of the first initial image quality inspection model to obtain the image quality inspection model.
[0069] The weights for the comprehensive review reward and the dimensional review reward can be set according to the needs. For example, the weight of the comprehensive review reward can be 0.4, and the weight of the dimensional review reward can be 0.25.
[0070] For example, based on the joint optimization objective consisting of the comprehensive review reward and the dimensional review reward, the model parameters of the first initial image quality inspection model are iteratively updated. During the training process, the gradient is softly clipped using the asymmetric soft adaptive policy optimization (SAPO) loss function, which focuses on amplifying the negative gradient signal of false positive errors from the comprehensive review reward, while retaining the continuous gradient flow of the dimensional review reward. This is to suppress the model's biased pass-through speculation behavior while enhancing the model's ability to capture fine-grained single-point violation features until the convergence condition is met, and finally the trained image quality inspection model is obtained.
[0071] In this embodiment, a two-tiered business reward system is established based on comprehensive review rewards and dimensional review rewards. This system complements SAPO's asymmetric characteristics of tight pruning of positive samples and wide pruning of negative samples, enabling the model to continue exploring factor-level representations in a wider update space without degenerating into a single top-level conclusion. This improves the accuracy of the trained image quality inspection model.
[0072] In one embodiment, step 303 above determines the dimension review reward based on the predicted review results of each review dimension and the sub-review tags of each review dimension. This can be implemented in the following way: If at least one target sub-review label representing a failed review exists among all sub-review labels corresponding to the target training sample, all target predicted review results representing failed review are filtered from the predicted review results of all review dimensions, and the dimension review reward is determined based on all target predicted review results and all target sub-review labels; if no target sub-review label representing a failed review exists among all sub-review labels corresponding to the target training sample, the dimension review reward is determined based on the number of all target predicted review results.
[0073] For example, if at least one target sub-label representing a failed review exists among all sub-labels corresponding to the target training sample, all target predicted review results representing failed reviews are filtered from the predicted review results of all review dimensions. All target predicted review results form the set of failed predictions, `pred_neg`, and all target sub-labels form the set of failed labels, `label_neg`. Then, the hit dimension set `hit = pred_neg ∩ label_neg`. Based on `pred_neg` and `label_neg`, precision P and recall R are calculated, and F1 = 2 is calculated. P R / (P+R) represents the dimensional review reward, with F1 as the reward. When hit is an empty set, the dimensional review reward is zero to prevent the extreme risk of missing all violations.
[0074] If there is no target sub-review label representing a failed review among all the sub-review labels corresponding to the target training sample, that is, if all sub-review labels represent a passed review, then the dimension review reward = 1.0 - 0.2 × the number of target predicted review results, and a lower limit of 0.0 is set to protect it. In this way, while suppressing the two types of speculative shortcuts of reporting all passes or all failures in the reverse suppression model, it provides continuous gradient signals for edge decisions that are partially hit, thereby strengthening the model's ability to capture single-point violation features.
[0075] In one embodiment, step 304 above iteratively adjusts the model parameters of the first initial image quality inspection model based on the comprehensive review reward and the dimensional review reward to obtain the image quality inspection model. This can be achieved in the following ways: Based on the output format of the predicted quality detection results and the preset output format, a hard-format gating reward is determined; based on the comprehensive review reward, the dimensional review reward and the hard-format gating reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
[0076] The weight of the hard-format gated reward can be set based on requirements; for example, the weight of the hard-format gated reward is 0.15. The preset output format is: the predicted comprehensive review result includes pass or fail, the predicted review result for each review dimension includes pass or fail, and the predicted review analysis information for each review dimension is B information.
[0077] For example, when the output format of the predicted quality inspection result matches all preset output formats, the hard format gating reward is set to 1; when the output format of the predicted quality inspection result does not match at least one preset output format, the hard format gating reward is set to 0. Then, based on the joint optimization objective consisting of the comprehensive review reward, the dimensional review reward, and the hard format gating reward, the model parameters of the first initial image quality inspection model are iteratively updated to obtain the image quality inspection model.
[0078] It should be noted that hard-formatted gating rewards do not perform truth value alignment checks or self-consistency checks on the inference process and quality inspection results. The purpose is to provide a clean parsing premise for the downstream result reward model.
[0079] In this embodiment, by comprehensively reviewing the reward constraint on the top-level decision-making tendency, using dimensional review rewards to enhance the fine-grained rule alignment capability, and relying on hard-format gating rewards to ensure the determinism of the output structure, the model effectively suppresses speculative behavior that biases towards passing and the randomness of the output format during the iterative update of model parameters, significantly improving the review robustness and output compliance of the image quality inspection model in complex scenarios.
[0080] In one embodiment, the image quality inspection model is obtained by iteratively adjusting the model parameters of the first initial image quality inspection model based on the comprehensive review reward, the dimensional review reward, and the hard-format gating reward. This can be achieved in the following ways: Based on the output length of the predicted quality detection result and the preset output length range, a soft length reward is determined, wherein the preset output length range is the same as the output length range of the first initial image quality inspection model; based on the comprehensive review reward, the dimensional review reward, the hard format gating reward and the soft length reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
[0081] Optionally, if the output length of the predicted quality detection result is within the preset output length range, the soft length reward is determined as a third value, which decreases linearly with the increase of the output length; if the output length of the predicted quality detection result is greater than the maximum output length in the preset output length range, the soft length reward is determined as a fourth value, which is negative.
[0082] The weight of the soft length reward can be set based on the requirements; for example, the weight of the soft length reward is 0.05.
[0083] For example, a soft length reward is determined based on the output length of the predicted quality detection result and a preset output length range. Here, the preset output length range is strictly aligned with the output length range of the first initial image quality detection model. For instance, the maximum output length is set to 2048, and the soft buffer length is set to 1024. The maximum output length and the soft buffer length together constitute the output length range. When the output length of the predicted quality detection result is within the range of [1024, 2048], the soft length reward decreases linearly with the increase in output length, simulating the efficiency loss during model inference. When the output length of the predicted quality detection result is greater than 2048, a truncation mechanism is directly triggered and a heavy penalty is imposed, with the soft length reward set to a preset negative value. This design specifically matches SAPO's soft buffer mechanism. By precisely aligning the long answer penalty boundary with SAPO's soft pruning window in the length dimension, it effectively avoids the mutual coupling oscillations caused by misalignment between the reward and output length in the later stages of training, thereby stabilizing the optimization process.
[0084] Then, based on the joint optimization objective consisting of comprehensive review reward, dimensional review reward, hard format gating reward and soft length reward, the model parameters of the first initial image quality inspection model are iteratively updated to obtain the image quality inspection model.
[0085] In this embodiment, through multi-objective reward collaborative optimization, the accuracy of image quality inspection and format standardization are significantly improved. At the same time, the precise alignment of soft length reward and SAPO caching mechanism forms a reward-loss dual-sided constraint, which ensures the stability of model training and the efficiency of inference.
[0086] In one embodiment, based on the similarity between the predicted review analysis information of each review dimension and the review analysis information of each review dimension output offline by the teacher model, the mean reward of semantic embedding similarity is determined. Based on the comprehensive review reward, dimension review reward, hard format gating reward, soft length reward and mean reward of semantic embedding similarity, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
[0087] The weight corresponding to the semantic embedding similarity mean reward can be set according to the requirements. For example, the weight corresponding to the semantic embedding similarity mean reward is 0.1.
[0088] For example, for each review dimension, the business intranet text embedding service is invoked to embed the predicted review analysis information of the review dimension and the review analysis information of the review dimension output offline by the teacher model into preset dimensions (e.g., 512 dimensions), respectively, to obtain the predicted embedding vector corresponding to the predicted review analysis information and the embedding vector corresponding to the review analysis information. Then, the similarity between the predicted embedding vector and the embedding vector is calculated, and this similarity is mapped to the interval [0, 1] to obtain the mapped similarity corresponding to the review dimension. The average value of the mapped similarities of all review dimensions is used as the semantic embedding similarity mean reward. Then, based on the joint optimization objective composed of comprehensive review reward, dimension review reward, hard format gating reward, soft length reward and semantic embedding similarity mean reward, the model parameters of the first initial image quality inspection model are iteratively updated to obtain the image quality inspection model.
[0089] It should be noted that the semantic embedding similarity mean reward can also be calculated based on any other sentence embedding model, and this invention does not limit it.
[0090] It should be noted that if the embedding service malfunctions when performing the embedding of this review dimension, the similarity of this review dimension will be recorded as 0, without blocking model training.
[0091] It should be noted that the semantic embedding similarity mean reward and the dimensional review reward complement each other: the dimensional review reward reflects the consistency of the conclusion, while the semantic embedding similarity mean reward reflects the consistency of the reasoning path. Together, they suppress opportunistic avoidance paths such as piling up words / repetition / disconnection from the final output in the logical reasoning section. At the same time, the semantic embedding similarity mean reward uses an independent model to score in the embedding space, which does not directly conflict with SAPO's word-level importance ratio.
[0092] It should be noted that when the teacher model generates the review analysis information for each review dimension offline, the review analysis information for each review dimension undergoes two rounds of format simplification. The first round removes specific attribution-free fields, and the second round merges the dimension name + review result into a unified review dimension code to reduce the memory burden on the fine-tuned model.
[0093] In one embodiment, the predicted quality detection results are subjected to duplicate detection. A duplicate detection reward is determined based on the duplicate detection results. The model parameters of the first initial image quality inspection model are iteratively adjusted based on the comprehensive review reward, dimensional review reward, hard format gating reward, soft length reward, semantic embedding similarity mean reward, and duplicate detection reward to obtain the image quality inspection model.
[0094] The weight of the duplicate detection reward can be set based on the requirements. For example, the weight of the duplicate detection reward is 0.05.
[0095] For example, triplet duplication detection is performed on the predicted quality detection results. If a duplication detection is successful, the duplication detection reward is determined to be the fifth value. The fifth value is negative to suppress the repeater degradation that SAPO is prone to under more lenient cropping. Then, based on the joint optimization objective consisting of comprehensive review reward, dimensional review reward, hard format gating reward, soft length reward, semantic embedding similarity mean reward and duplication detection reward, the model parameters of the first initial image quality inspection model are iteratively updated to obtain the image quality inspection model.
[0096] In one embodiment, Figure 4 This is the third flowchart of the image quality detection method provided in this embodiment of the invention, as shown below. Figure 4 As shown, the image quality detection method also includes the following steps: Step 401: For each of the initial training samples, input the initial training samples into the second initial image quality inspection model, and perform a second preset number of independent samplings on the initial training samples through the second initial image quality inspection model to obtain the initial quality detection results corresponding to each independent sampling.
[0097] For example, the initial training samples include initial original image samples and initial processed image samples that have been processed from the initial original image samples. The initial original image samples, initial processed image samples and prompt information samples are spliced together to obtain the initial training samples. The initial training samples are input into the second initial image quality inspection model. The second initial image quality inspection model performs a second preset number of independent samplings (e.g., 16 times) on the initial training samples to obtain the initial quality inspection results corresponding to each independent sampling. The initial quality inspection results include the initial comprehensive review results and the initial review information for each review dimension. The initial review information includes the initial review results and the corresponding initial review analysis information.
[0098] It should be noted that the sample prompt information includes the following: 1) Task definition (describes the specific task to be performed); 2) Task mode (approved / failed); 3) Input image definition (original image, white background image, transparent background image, or generated scene image, etc.); 4) Inspection objects, review rules, failure conditions, exception conditions, etc. for at least one review dimension; 5) Return content format, such as including item-by-item analysis in the reasoning process, and the initial quality inspection results are output in JSON format.
[0099] It should be noted that the base model can also be other open-source models of the same scale, and this invention does not limit this.
[0100] Step 402: Based on the initial quality detection results and the audit labels corresponding to the initial training samples, determine the consistency ratio corresponding to the initial training samples.
[0101] For example, count the number of initial quality detection results that match the review label, and then subtract the number of initial quality detection results that match the review label from the total number of initial quality detection results to obtain the consistency ratio p corresponding to the initial training samples. Taking 16 individual samples as an example, then p∈{0 / 16,1 / 16,…,16 / 16}.
[0102] Step 403: Discretize the initial training samples corresponding to all the consistent proportions into multiple gear levels.
[0103] For example, the consistent proportion p corresponding to all initial training samples is discretized into a preset number (e.g., 10) levels (0%, 10%, 20%, ..., 90%, 100%).
[0104] It should be noted that the number of gears can also be 5 or 20, and this invention does not limit this.
[0105] Step 404: For each gear level, determine the labeling accuracy of all initial training samples corresponding to that gear level.
[0106] For example, the two extreme levels of 0% and 100% are filtered out. The 0% level is suspected to be a labeling error or the model has no grasp of it at all, while the 100% level has been fully grasped by the model. Neither of these is conducive to reinforcement learning exploration. The remaining levels in the middle are the labeling accuracy of all initial training samples.
[0107] Step 405: Determine the target level based on the level corresponding to the labeled accuracy that is greater than the preset accuracy.
[0108] For example, each annotation accuracy rate is compared with a preset accuracy rate, and the level corresponding to the annotation accuracy rate that is greater than the preset accuracy rate is taken as the target level. For example, if the preset accuracy rate is 85%, then the level corresponding to the annotation accuracy rate that is greater than 85% is taken as the target level.
[0109] It should be noted that the preset accuracy rate can be any threshold in the range of 80% to 90%, and this invention does not limit it.
[0110] Step 406: Determine the initial training sample corresponding to the target gear as the target training sample.
[0111] For example, the initial training samples corresponding to the target price are uniformly sampled in three dimensions: "image source (white background image / transparent background image / generated scene image) × product category (first / second / third level category) × label" to obtain all target training samples.
[0112] It should be noted that the target training sample can also be any two-dimensional combination such as image source × product category, image source × label, etc., and this invention does not limit it.
[0113] In this embodiment, all initial training samples are categorized based on a consistent ratio. Only initial training samples with a labeling accuracy greater than a preset accuracy and not in extreme categories are used as target training samples for training. Initial training samples in extreme categories that are incorrectly labeled, completely unknown to the model, or fully understood by the model are automatically removed. This achieves the mining of difficult samples, significantly improves the effective information density during the training phase, avoids simple samples from consuming GPU computing power, and automatically removes incorrectly labeled initial training samples so that subsequent SAPO RL will not be biased by incorrect labels. Layered uniform sampling ensures that the three types of image materials and all dimensional rules are covered, avoiding training set bias.
[0114] It should be noted that the reinforcement learning algorithm of the present invention can also be replaced by symmetric group relative policy optimization, decoupled pruning and dynamic sampling policy optimization, or near-end policy optimization, etc., and the present invention does not limit it in this regard.
[0115] Figure 5 This is a schematic diagram of the overall process of the image quality detection method provided in the embodiments of the present invention, as shown below. Figure 5 As shown, this image quality detection method includes the following stages: Phase A: Obtain the initial training samples and the corresponding audit tags for the initial training samples.
[0116] Phase B: Perform base training to obtain a supervised fine-tuning (SFT) model. Select the model weights corresponding to the optimal training rounds on the SFT model validation set to obtain the second initial image quality inspection model.
[0117] Phase C: Difficult sample mining is performed based on the initial training samples and the corresponding audit labels of the initial training samples using the second initial image quality inspection model to obtain the target training samples.
[0118] Phase D: Based on the target training samples, the first initial image quality inspection model is enhanced by SAPO's asymmetric cropping training to obtain the image quality inspection model.
[0119] Phase E involves reasoning based on the image quality inspection model to obtain the final comprehensive review results, the final review results for each review dimension, the final review analysis information for each review dimension, and the quality inspection results with confidence levels.
[0120] The image quality detection method provided in this embodiment of the invention is applicable to white background images, transparent background images, and generated scenes. Figure 3 Based on typical AIGC image materials, a unified, end-to-end trainable image quality inspection model is presented, which significantly surpasses the overall accuracy of general closed-source / open-source Vision-Language Models (VLMs). Furthermore, a training pipeline that can collaborate with asymmetric cropping RL (SAPO) is designed, including hard sample mining strategies and a multi-reward function system that collaborates with SAPO asymmetric cropping / soft length caching, maximizing reinforcement learning gains, stabilizing training, and suppressing shortcut behaviors that favor passing. Finally, a structured, multi-granular output scheme is designed, simultaneously outputting the final comprehensive review result, the final review results for each review dimension, and the final review analysis information and confidence level for each review dimension in a single inference, facilitating consumption by downstream business units.
[0121] In a specific example, a closed-source multimodal large model is selected as the base model. Training is carried out based on a distributed training framework. The parallelism of the tensor model is set to 2, the parallelism of the pipeline model is set to 2, the micro-batch size is 8, the global total batch size is 128, the base learning rate is 5e-7, the minimum learning rate is 5e-9, the warm-up ratio is 0.05, the maximum number of training epochs is 3, the maximum sequence length is 32768, and the visual encoder, large language model, and cross-modal aligner are not frozen. The SFT model is trained and obtained. The model weights corresponding to the optimal training epoch are selected on the SFT model validation set to obtain the second initial image quality inspection model. The second initial image quality inspection model is used to mine hard samples based on the initial training samples and the review labels corresponding to the initial training samples to obtain the target training samples.
[0122] The initial image quality inspection model uses a distributed training framework with the following key configuration parameters: loss type is sapo, positive sample cropping threshold is 1.0, and negative sample cropping threshold is 1.2. A soft-length caching mechanism is enabled, with a maximum output length of 2048 and a soft cache length of 1024. The excessively long truncation strategy is configured as deletion and disabling excessively long filtering. The inference backend uses a co-existence mode for the inference acceleration engine, with a maximum model length of 8192, a GPU memory utilization limit of 0.4, and a maximum image input of 6 per prompt. Multimodal preprocessing sets the word pixel range to a minimum of 3136 pixels and a maximum of 640000 pixels. Training sampling parameters are configured as follows: 8 samples per group, 8 generation steps per round, and a sampling temperature of 1.0. The core training hyperparameters include: a single-device training batch size of 16, a gradient accumulation step of 8, a learning rate of 1e-6, a training epoch of 3, and a KL constraint coefficient of 0.04. Simultaneously, padding-free optimization is enabled, the visual encoder is frozen, the alignment layer is unfrozen, a distributed optimization strategy is adopted, and an attention acceleration mechanism is used. Under these configurations, the first initial image quality inspection model is trained using SAPO asymmetric cropping based on the target training samples to obtain the image quality inspection model.
[0123] Table 1 shows a comparison example of the image quality inspection model of the present invention with other models. Table 1 compares the overall accuracy, passing class precision, passing class recall, failing class precision, and failing class recall.
[0124] Table 1
[0125] As shown in Table 1, the image quality inspection model of the present invention achieves a recall rate of approximately 86% for non-passing classes (interceptions), while significantly increasing the recall rate for passing classes from 35% to over 80% for closed-source models of the same level. It is the only solution among the comparative models of the same period that achieves over 80% for both passing and non-passing classes, and has the best business feasibility.
[0126] The image quality detection device provided by the present invention is described below. The image quality detection device described below can be referred to in correspondence with the image quality detection method described above.
[0127] Figure 6 This is a schematic diagram of the image quality detection device provided in an embodiment of the present invention, as shown below. Figure 6 As shown, the image quality detection device 600 includes an acquisition unit 601 and a first detection unit 602; wherein: The acquisition unit 601 is used to acquire information to be detected, the information to be detected including the original image and the processed image, wherein the processed image is obtained by processing the original image; The first detection unit 602 is used to input the information to be detected into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on the multiple initial quality inspection results of the initial training samples and the review labels corresponding to the initial training samples.
[0128] The image quality detection device provided by this invention acquires detection information including the original image and the processed image, inputs the detection information into an image quality inspection model, and obtains the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on multiple initial quality detection results of the initial training samples and the review labels corresponding to the initial training samples. As can be seen, this invention classifies all initial training samples based on a consistent ratio, and only uses the initial training samples of the target level whose labeling accuracy is greater than the preset accuracy and which are not extreme levels as target training samples to participate in training. It automatically removes the initial training samples of extreme levels that are incorrectly labeled, completely unknown to the model, or fully known by the model, thereby realizing the mining of difficult samples, significantly improving the effective information density in the training stage, and thus improving the accuracy of the trained image quality inspection model, which in turn improves the accuracy of image quality detection.
[0129] Based on any of the above embodiments, the first detection unit 602 is specifically used for: The information to be detected and the prompt information are input into the image quality inspection model. The image quality inspection model performs a first preset number of independent samplings on the information to be detected to obtain the initial quality inspection results corresponding to each independent sampling. The prompt information is used to prompt the image quality inspection model to output the final review analysis information for each review dimension. The initial quality inspection results include the initial comprehensive review results and the initial review information for each review dimension. The initial review information includes the initial review results and the corresponding initial review analysis information. The final comprehensive review result is obtained by taking the mode of all the initial comprehensive review results. For each of the aforementioned review dimensions, the mode of each initial review result for that review dimension is taken to obtain the final review result for that review dimension; Based on the initial audit analysis information for each of the audit dimensions, the final audit analysis information for each audit dimension is determined; The quality inspection result is determined based on the final comprehensive audit result, the final audit result of each audit dimension, and the final audit analysis information of each audit dimension.
[0130] Based on any of the above embodiments, the initial quality inspection result further includes a confidence level, which is determined based on the ratio of the number of all initial comprehensive review results that are the same as the final comprehensive review result to the first preset number; the first detection unit 602 is specifically used for: The quality inspection result is determined based on the final comprehensive audit result, the final audit result of each audit dimension, the final audit analysis information of each audit dimension, and the confidence level.
[0131] Based on any of the above embodiments, the first detection unit 602 is specifically used for: Obtain all target initial audit results that are identical to the final audit result; The initial audit analysis information corresponding to each of the initial audit results of the aforementioned targets is statistically analyzed to obtain the initial audit analysis information corresponding to the highest frequency. The initial audit analysis information corresponding to the highest frequency is determined as the final audit analysis information.
[0132] Based on any of the above embodiments, the review labels corresponding to the target training samples include comprehensive review labels and sub-review labels for each review dimension; the image quality inspection model is trained in the following manner: The target training sample is input into the first initial image quality inspection model to obtain the predicted quality inspection result output by the first initial image quality inspection model. The predicted quality inspection result includes the predicted comprehensive review result and the predicted review result of each review dimension. Based on the predicted comprehensive review results and the comprehensive review labels corresponding to the target training samples, a comprehensive review reward is constructed. Based on the predicted review results of each review dimension and the sub-review tags of each review dimension, the review reward for each dimension is determined. Based on the comprehensive review reward and the dimensional review reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
[0133] Based on any of the above embodiments, determining the dimension review reward based on the predicted review results of each review dimension and the sub-review tags of each review dimension includes: If at least one target sub-review label representing a failed review exists among all the sub-review labels corresponding to the target training sample, all target predicted review results representing failed review are filtered from the predicted review results of all the review dimensions, and the review reward for the dimension is determined based on all the target predicted review results and all the target sub-review labels. If there is no target sub-review label representing a failed review among all the sub-review labels corresponding to the target training sample, the dimension review reward is determined based on the number of all predicted review results for the target.
[0134] Based on any of the above embodiments, the step of iteratively adjusting the model parameters of the first initial image quality inspection model based on the comprehensive review reward and the dimensional review reward to obtain the image quality inspection model includes: Based on the output format of the predicted quality detection results and the preset output format, the hard-format gating reward is determined; Based on the comprehensive review reward, the dimensional review reward, and the hard-format gating reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
[0135] Based on any of the above embodiments, the step of iteratively adjusting the model parameters of the first initial image quality inspection model based on the comprehensive review reward, the dimensional review reward, and the hard-format gating reward to obtain the image quality inspection model includes: Based on the output length of the predicted quality detection result and the preset output length range, a soft length reward is determined, wherein the preset output length range is the same as the output length range of the first initial image quality inspection model. Based on the comprehensive review reward, the dimensional review reward, the hard format gating reward, and the soft length reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
[0136] Based on any of the above embodiments, the image quality detection device 600 further includes: The second detection unit is used to input the initial training samples into the second initial image quality inspection model for each initial training sample, and to perform a second preset number of independent samplings on the initial training samples through the second initial image quality inspection model to obtain the initial quality inspection result corresponding to each independent sampling. The first determining unit is used to determine the consistency ratio corresponding to the initial training sample based on the audit labels corresponding to each of the initial quality detection results and the initial training sample; A discretization unit is used to discretize all the consistent proportions corresponding to the initial training samples into multiple gear levels; The second determining unit is used to determine the labeling accuracy of all initial training samples corresponding to each gear level. The third determining unit is used to determine the target level based on the level corresponding to the marked accuracy rate which is greater than the preset accuracy rate; The fourth determining unit is used to determine the initial training sample corresponding to the target gear as the target training sample.
[0137] Figure 7 This is a schematic diagram of the physical structure of the electronic device provided in the embodiments of the present invention, such as... Figure 7 As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute an image quality detection method, which includes: acquiring information to be detected, the information to be detected including an original image and a processed image, wherein the processed image is obtained by processing the original image; The information to be detected is input into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on the multiple initial quality inspection results of the initial training samples and the review labels corresponding to the initial training samples.
[0138] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0139] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being able to be stored on a non-transitory computer-readable storage medium, the computer program being executed by a processor, the computer being able to execute the image quality detection method provided by the above methods, the method including: acquiring information to be detected, the information to be detected including an original image and a processed image, the processed image being obtained by processing the original image; The information to be detected is input into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on the multiple initial quality inspection results of the initial training samples and the review labels corresponding to the initial training samples.
[0140] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image quality detection method provided by the above methods, the method comprising: acquiring information to be detected, the information to be detected including an original image and a processed image, wherein the processed image is obtained by processing the original image; The information to be detected is input into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on the multiple initial quality inspection results of the initial training samples and the review labels corresponding to the initial training samples.
[0141] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0142] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An image quality detection method, characterized in that, include: Obtain the information to be detected, which includes the original image and the processed image, wherein the processed image is obtained by processing the original image; The information to be detected is input into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on the multiple initial quality inspection results of the initial training samples and the review labels corresponding to the initial training samples.
2. The image quality detection method according to claim 1, characterized in that, The step of inputting the information to be detected into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model includes: The information to be detected and the prompt information are input into the image quality inspection model. The image quality inspection model performs a first preset number of independent samplings on the information to be detected to obtain the initial quality inspection results corresponding to each independent sampling. The prompt information is used to prompt the image quality inspection model to output the final review analysis information for each review dimension. The initial quality inspection results include the initial comprehensive review results and the initial review information for each review dimension. The initial review information includes the initial review results and the corresponding initial review analysis information. The final comprehensive review result is obtained by taking the mode of all the initial comprehensive review results. For each of the aforementioned review dimensions, the mode of each initial review result for that review dimension is taken to obtain the final review result for that review dimension; Based on the initial audit analysis information for each of the audit dimensions, the final audit analysis information for each audit dimension is determined; The quality inspection result is determined based on the final comprehensive audit result, the final audit result of each audit dimension, and the final audit analysis information of each audit dimension.
3. The image quality detection method according to claim 2, characterized in that, The initial quality inspection results also include a confidence level, which is determined based on the ratio of the number of all initial comprehensive review results that are the same as the final comprehensive review result to the first preset number; The determination of the quality inspection result based on the final comprehensive audit result, the final audit results of each audit dimension, and the final audit analysis information of each audit dimension includes: The quality inspection result is determined based on the final comprehensive audit result, the final audit result of each audit dimension, the final audit analysis information of each audit dimension, and the confidence level.
4. The image quality detection method according to claim 2, characterized in that, The determination of the final audit analysis information for each audit dimension based on the initial audit analysis information for each audit dimension includes: Obtain all target initial audit results that are identical to the final audit result; The initial audit analysis information corresponding to each of the initial audit results of the aforementioned targets is statistically analyzed to obtain the initial audit analysis information corresponding to the highest frequency. The initial audit analysis information corresponding to the highest frequency is determined as the final audit analysis information.
5. The image quality detection method according to claim 1, characterized in that, The review labels corresponding to the target training samples include comprehensive review labels and sub-review labels for each review dimension; the image quality inspection model is trained in the following manner: The target training sample is input into the first initial image quality inspection model to obtain the predicted quality inspection result output by the first initial image quality inspection model. The predicted quality inspection result includes the predicted comprehensive review result and the predicted review result of each review dimension. Based on the predicted comprehensive review results and the comprehensive review labels corresponding to the target training samples, a comprehensive review reward is constructed. Based on the predicted review results of each review dimension and the sub-review tags of each review dimension, the review reward for each dimension is determined. Based on the comprehensive review reward and the dimensional review reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
6. The image quality detection method according to claim 5, characterized in that, The determination of dimension review rewards based on the predicted review results for each of the review dimensions and the sub-review tags for each of the review dimensions includes: If at least one target sub-review label representing a failed review exists among all the sub-review labels corresponding to the target training sample, all target predicted review results representing failed review are filtered from the predicted review results of all the review dimensions, and the review reward for the dimension is determined based on all the target predicted review results and all the target sub-review labels. If there is no target sub-review label representing a failed review among all the sub-review labels corresponding to the target training sample, the dimension review reward is determined based on the number of all predicted review results for the target.
7. The image quality detection method according to claim 5, characterized in that, The step of iteratively adjusting the model parameters of the first initial image quality inspection model based on the comprehensive review reward and the dimensional review reward to obtain the image quality inspection model includes: Based on the output format of the predicted quality detection results and the preset output format, the hard-format gating reward is determined; Based on the comprehensive review reward, the dimensional review reward, and the hard-format gating reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
8. The image quality detection method according to claim 7, characterized in that, The process of iteratively adjusting the model parameters of the first initial image quality inspection model based on the comprehensive review reward, the dimensional review reward, and the hard-format gating reward to obtain the image quality inspection model includes: Based on the output length of the predicted quality detection result and the preset output length range, a soft length reward is determined, wherein the preset output length range is the same as the output length range of the first initial image quality inspection model. Based on the comprehensive review reward, the dimensional review reward, the hard format gating reward, and the soft length reward, the model parameters of the first initial image quality inspection model are iteratively adjusted to obtain the image quality inspection model.
9. The image quality detection method according to any one of claims 1-8, characterized in that, The method further includes: For each of the initial training samples, the initial training samples are input into the second initial image quality inspection model, and the second initial image quality inspection model performs a second preset number of independent samplings on the initial training samples to obtain the initial quality detection results corresponding to each independent sampling. Based on the initial quality detection results and the audit tags corresponding to the initial training samples, the consistency ratio corresponding to the initial training samples is determined. The initial training samples are discretized into multiple gear levels corresponding to all the consistent proportions; For each gear level, determine the labeling accuracy of all initial training samples corresponding to that gear level; The target level is determined based on the level corresponding to the labeled accuracy rate that is greater than the preset accuracy rate. The initial training sample corresponding to the target gear is determined as the target training sample.
10. An image quality detection device, characterized in that, include: An acquisition unit is used to acquire information to be detected, the information to be detected including an original image and a processed image, wherein the processed image is obtained by processing the original image; The first detection unit is used to input the information to be detected into the image quality inspection model to obtain the quality inspection result of the processed image output by the image quality inspection model. The image quality inspection model is trained based on at least one target training sample and the review labels corresponding to each target training sample. The target training sample includes at least one initial training sample corresponding to a target grade. The target grade is the grade selected from all grades where the labeling accuracy of the initial training samples is greater than a preset accuracy and is not an extreme grade. The grade is determined based on the consistency ratio corresponding to each of the initial training samples. The consistency ratio is determined based on multiple initial quality inspection results of the initial training samples and the review labels corresponding to the initial training samples.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the image quality detection method as described in any one of claims 1 to 9.
12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the image quality detection method as described in any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the image quality detection method as described in any one of claims 1 to 9.