Quality evaluation method and device based on predicted quality field, and equipment
Patent Information
- Application Number
- CN202611027752.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]本申请的主要目的在于提供一种基于预测质量场的质量评估方法、装置及设备,旨在解决目前的质量评估方法生成的检测结果不全面易产生误判导致质量评估的精准度不高的技术问题
1)利用距离变换和高斯衰减函数,将现有二值缺陷标注自动转换为连续质量场标注的方法,无需额外人工标注即可获得高质量的连续监督信号,无额外标注成本且训练更稳定。
Smart Images

Figure CN122906530A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial testing technology, and in particular to a method, apparatus and equipment for quality assessment based on a predicted quality field. Background Technology
[0002] With the rapid development of manufacturing and precision machining technology, the surface quality assessment of industrial products has become a core part of production control, and its assessment results directly affect the determination of product qualification and the optimization of manufacturing processes.
[0003] Existing quality assessment methods mainly rely on rule-based detection methods based on fixed thresholds. However, these methods generate binary detection results by comparing pixel grayscale or defect area with a preset fixed threshold. The detection results generated by these methods are incomplete and prone to misjudgment. Summary of the Invention
[0004] The main purpose of this application is to provide a quality assessment method, apparatus, and equipment based on a predicted mass field, which aims to solve the technical problem that current quality assessment methods generate incomplete test results, which are prone to misjudgment and thus result in low accuracy of quality assessment.
[0005] To achieve the above objectives, this application proposes a quality assessment method based on a predicted mass field, the method comprising: The defect mask is preprocessed to obtain the mass field annotation value, which includes the mass field annotation value of the defect area and the mass field annotation value of the normal area; The monitoring signal is determined based on the mass field label value; The preset network is trained based on the preset function and the supervision signal to obtain the trained preset network; Acquire the image to be evaluated, and obtain the predicted quality field based on the image to be evaluated and the trained preset network; The image to be evaluated is assessed based on the predicted quality field, and a quality assessment report is generated.
[0006] In one embodiment, the step of performing a quality assessment on the image to be evaluated based on the predicted quality field and generating a quality assessment report includes: The predicted quality field yields a heatmap of the quality field, a spatial gradient field, and a degradation direction map. The image to be evaluated is then evaluated based on the predicted quality field to obtain detection results, continuous quality score indicators, and a temporal degradation report. The warning level of the preset area is obtained based on the predicted mass field and the spatial gradient field; A quality assessment report is generated based on the mass field heat map, the detection results, the continuous quality scoring index, the degradation direction map, the early warning level of the preset area, and the time-series degradation report.
[0007] In one embodiment, the steps of obtaining a mass field heatmap, a spatial gradient field, and a degradation direction map based on the predicted mass field, and evaluating the image to be evaluated based on the predicted mass field to obtain detection results, continuous quality score indicators, and a temporal degradation report include: A mass field thermogram is obtained based on the predicted mass field. The spatial partial derivatives are obtained by performing a convolution operation based on the predicted mass field and the preset operator. The spatial gradient field is obtained based on the spatial partial derivatives. A degradation pattern is generated based on the spatial gradient field and the predicted mass field; Determine the standard deviation and mean of the predicted quality field, and obtain the pass threshold, the size of the image to be evaluated, and the defect threshold; The image to be evaluated is evaluated based on the qualified threshold and the predicted quality field to obtain the detection result; A continuous quality score index is obtained based on the image size to be evaluated, the standard deviation, the mean, and the defect threshold. The predicted quality field is preprocessed to obtain a temporal degradation report.
[0008] In one embodiment, the step of generating a degradation pattern based on the spatial gradient field and the predicted mass field includes: Determine the magnitude and direction of the gradient of the spatial gradient field; A preset range is determined based on the predicted mass field; The degradation direction angle is obtained based on the gradient direction, and the main degradation direction is obtained based on the degradation direction angle and the gradient magnitude; The degradation direction consistency index is obtained based on the degradation principal direction and the gradient magnitude; The target boundary degradation rate is obtained based on the gradient magnitude. A degradation direction map within the preset range is generated based on the gradient magnitude, the gradient direction, the degradation principal direction, the degradation direction consistency index, and the target boundary degradation rate.
[0009] In one embodiment, the step of preprocessing the predicted quality field to obtain a temporal degradation report includes: Determine a first and a second predicted mass field at adjacent times in the predicted mass field, wherein the time corresponding to the first predicted mass field is later than the time corresponding to the second predicted mass field; The second predicted mass field is transformed and aligned to obtain the transformed and aligned second predicted mass field. The temporal quality field difference is obtained based on the first predicted quality field and the transformed and aligned second predicted quality field. The degradation rate, defect threshold arrival time, and degradation acceleration are estimated based on the predicted mass field. A temporal degradation report is obtained based on the temporal quality field difference, the degradation rate, the defect threshold arrival time, and the degradation acceleration.
[0010] In one embodiment, the step of estimating the degradation rate, defect threshold arrival time, and degradation acceleration based on the predicted mass field includes: The mass field sequence within a preset time period is obtained based on the predicted mass field. The index, index mean, and mass mean are obtained from the mass field sequence. The degradation rate is estimated based on the mass field sequence, the index, the index mean, and the mass mean; The arrival time of the defect threshold is estimated based on the degradation rate, the defect threshold, and the mass field sequence. The degradation acceleration is estimated based on the degradation rate and the preset time.
[0011] In one embodiment, the step of obtaining the warning level of a preset region based on the predicted mass field and the spatial gradient field includes: Obtain the image size to be evaluated, warning threshold, defect threshold, preset weight, and preset reference value; A preset area is defined based on the warning threshold and the defect threshold; The predicted mass field is preprocessed to obtain a preset region mask; Based on the preset region, a connected region analysis is performed on the preset region mask to obtain several preset connected regions; Based on the preset connected region, feature values are obtained according to the image size, the predicted quality field, and the spatial gradient field, wherein the feature values include at least the area ratio, the target quality value, and the degradation trend index. Based on the feature value, the preset weight, and the preset reference value, a warning assessment is performed on the preset area to obtain a warning score; The warning level of the preset area is obtained based on the warning score.
[0012] In one embodiment, the step of preprocessing the defect mask to obtain the mass field annotation value includes: Perform a distance transformation on the defect mask to obtain a first distance and a second distance; The region type is determined based on the defect mask, and the region type includes defective regions and normal regions; When the region type is a normal region, the mass field labeling value of the normal region is obtained based on the defect mask, according to the second distance, preset parameters and defect threshold. When the region type is a defect region, a third distance is obtained based on the first distance; based on the defect mask, the mass field label value of the defect region is obtained based on the first distance, the third distance, the defect threshold, and a preset index; The quality field label value is obtained based on the quality field label value of the normal area and the quality field label value of the defective area.
[0013] Furthermore, to achieve the above objectives, this application also proposes a quality assessment device based on a predicted mass field, the quality assessment device based on a predicted mass field comprising: The determination module is used to preprocess the defect mask to obtain the mass field annotation value, which includes the mass field annotation value of the defect area and the mass field annotation value of the normal area; The determining module is further configured to determine a monitoring signal based on the mass field label value; The training module is used to train the preset network based on the preset function and the supervision signal to obtain the trained preset network. The output module is used to acquire the image to be evaluated and obtain the predicted quality field based on the image to be evaluated and the trained preset network. The output module is also used to perform quality assessment on the image to be evaluated based on the predicted quality field and generate a quality assessment report.
[0014] Furthermore, to achieve the above objectives, this application also proposes a quality assessment device based on a predicted mass field, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the quality assessment method based on the predicted mass field as described above.
[0015] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the mass assessment method based on the predicted mass field as described above.
[0016] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the quality assessment method based on the predicted mass field as described above.
[0017] One or more technical solutions proposed in this application have at least the following technical effects: 1) A method that automatically converts existing binary defect labels into continuous mass field labels by using distance transformation and Gaussian decay function can obtain high-quality continuous supervision signals without additional manual labeling, with no additional labeling cost and more stable training.
[0018] 2) By training a deep convolutional network with the supervision signal obtained from the continuous mass field to estimate the continuous mass field of the product surface, the output results will be smoother, and the anti-interference ability of texture background and lighting gradient will be stronger, which can improve the spatial smoothness and robustness of the evaluation results.
[0019] 3) By performing multiple quality assessments on the images to be evaluated and combining these assessments to generate a final quality assessment report, the comprehensiveness of the quality assessment is improved, providing multi-faceted detection and evaluation, and effectively reducing the false judgment rate. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating an embodiment of the quality assessment method based on a predicted mass field provided in this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the quality assessment method based on the predicted mass field provided in this application; Figure 3 This is a flowchart illustrating Embodiment 3 of the quality assessment method based on the predicted mass field provided in this application; Figure 4 This is a schematic diagram of the module structure of the quality assessment device based on the predicted mass field according to an embodiment of this application; Figure 5 This is a schematic diagram of the hardware operating environment involved in the quality assessment method based on the predicted mass field in the embodiments of this application.
[0023] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0024] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0025] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0026] The main solution of this application embodiment is as follows: preprocessing the defect mask to obtain quality field annotation values, the quality field annotation values including quality field annotation values of defect areas and quality field annotation values of normal areas; determining a supervision signal based on the quality field annotation values; training a preset network based on a preset function and the supervision signal to obtain a trained preset network; acquiring an image to be evaluated, and obtaining a predicted quality field based on the image to be evaluated and the trained preset network; performing a quality evaluation on the image to be evaluated based on the predicted quality field, and generating a quality evaluation report.
[0027] Existing technologies generate binary detection results (pass or fail) by comparing pixel grayscale values or defect areas with preset fixed thresholds after performing grayscale threshold segmentation or geometric feature extraction on product surface images. However, these methods lack the ability to determine the degradation direction, degradation rate, and warning level, which can easily lead to misjudgments.
[0028] This application provides a solution that automatically converts existing binary defect masks into continuous quality field annotations using distance transformation and a Gaussian decay function, thereby determining the supervision signal. Based on the supervision signal, a pre-set model is trained, and after acquiring the image to be evaluated, a predicted quality field is obtained, laying the foundation for quality assessment. A quality assessment report is generated based on the predicted quality field output by the model, enabling diversified assessment of data quality.
[0029] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions, such as a quality assessment system based on a predicted quality field. The following description uses a quality assessment system based on a predicted quality field as an example to illustrate this embodiment and the subsequent embodiments. All actions involving the acquisition of signals, information, or data in this application are performed in accordance with the relevant data protection regulations of the country where the application is located and with authorization from the owner of the corresponding device.
[0030] Based on this, embodiments of this application provide a quality assessment method based on a predicted mass field, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the quality assessment method based on the predicted mass field of this application.
[0031] In this embodiment, the quality assessment method based on the predicted mass field includes steps S10 to S50: Step S10: Preprocess the defect mask to obtain the quality field annotation value, which includes the quality field annotation value of the defect area and the quality field annotation value of the normal area.
[0032] Here, the defect mask refers to the binary defect mask for each sample in the training set. (in Indicates the defect area. (Representing normal areas); The binary defect mask is a single-channel image with the same size as the original image. On the original image, the pixel locations where defects exist are marked as white (1) on the mask; normal background or qualified product areas are marked as black (0) on the mask. The quality field label value refers to a pixel-level continuous value (such as any real number between 0.0 and 1.0) specially constructed for training the preset network.
[0033] The mass field typically refers to the position of each pixel on the surface of an industrial product. The quality state is modeled as a continuous scalar value This constitutes a scalar field covering the entire surface of the product. This indicates a state of perfection without any defects. The center represents the most severe defect, while the median value represents different degrees of quality degradation.
[0034] In one embodiment, the step of preprocessing the defect mask to obtain a quality field annotation value includes: performing a distance transformation on the defect mask to obtain a first distance and a second distance; determining a region type based on the defect mask, the region type including a defect region and a normal region; when the region type is a normal region, obtaining a quality field annotation value of the normal region based on the defect mask, according to the second distance, a preset parameter, and a defect threshold; when the region type is a defect region, obtaining a third distance based on the first distance; obtaining a quality field annotation value of the defect region based on the defect mask, according to the first distance, the third distance, the defect threshold, and a preset index; and obtaining a quality field annotation value based on the quality field annotation value of the normal region and the quality field annotation value of the defect region.
[0035] Specifically, distance transformation is an image processing operation that replaces the value of each foreground pixel in a binary mask image with the Euclidean distance from that pixel to the nearest background pixel; the preset parameters are Gaussian decay bandwidth parameters and the preset exponent is the decay exponent; distance transformation can be used to transform the binary defect mask of each sample in the training set. To calculate the Euclidean distance transformation, refer to Equations 1 and 2 below: (Equation 1) (Equation 2) Equation 1 is for The first distance is , where is the distance from a pixel within the defect region to the nearest normal region boundary (representing the "degree of penetration into the defect"); Equation 2 is for The second distance is , which is the distance from a normal region pixel to the nearest defect boundary (representing "degree of distance from the defect"), can also be efficiently calculated using the precise Euclidean distance transformation algorithm of Felzenszwalb and Huttenlocher; the region type can be determined based on the defect mask. This area can then be identified as a defective region. 0 can be identified as a normal area); when the area type is a defect area, the quality field label value is determined by the first distance. Third distance Defect threshold and preset index The result can be obtained by referring to formula 3 below: (Equation 3) By determining the first distance The maximum value yields the third distance. In the formula, the third distance This represents the maximum internal distance of the current defect's connected region (i.e., the farthest distance from the defect's "center" to the boundary). This is the defect threshold (default value is 0.3). This is the attenuation exponent (default value is 1.5). This design allows: (1) Defect center ( (Maximum) This indicates the most severe degradation; (2) Defect boundary ( (location) , representing the quality value at the defect boundary; (3) Index The mass decreases non-linearly with distance—the mass decreases faster near the defect boundary and becomes more gradual and approaches zero closer to the defect center, thus forming a continuous distribution of "most severe at the center and gradually lighter towards the boundary," which is consistent with the physical characteristics of defects.
[0036] For annotations containing multiple unconnected defect regions, each connected region is calculated independently. This ensures that the internal quality distribution of both small and large defects can be reasonably characterized.
[0037] When the region type is normal region, the mass field annotation value is determined by the second distance. Preset parameters and defect threshold The result can be obtained by referring to formula 4 below: (Equation 4) In the formula, This is the Gaussian attenuation bandwidth parameter (default value is 15 pixels, can be adjusted according to image resolution). This design enables: (1) At the boundary of the defect ( ): It is continuously connected to the boundary of the defect area; (2) Locations far from the defect area ): This indicates that the product is in good condition. (3) The width of the transition zone is approximately ( (pixels), within which the quality value ranges from Smooth transition to 1.
[0038] For completely defect-free normal training samples ( All values are 0), marked as the full image. This is the perfect quality field. Finally, continuous quality field annotation values are obtained based on the quality field annotation values of the normal area and the defective area.
[0039] This embodiment converts defect masking into continuous quality field annotation values, making the subsequent training and output process smoother and thus improving the continuity of quality assessment.
[0040] In addition, the generated mass field annotation values can be self-checked and automatically corrected using constraints. The automatically generated mass field annotation values should meet the following constraints, which the system will automatically verify: (1) Range constraint: all pixels ; (2) Continuity constraint: the difference in quality values between adjacent pixels ( (Default value is 0.1). (3) Consistency constraint: within the defect region Normal area ; (4) Symmetry constraint: For defects with symmetrical shape, the mass field should be approximately symmetrically distributed.
[0041] For annotations that do not meet the constraints, automatic parameter adjustment will be triggered (increase). Or adjust Then regenerate.
[0042] In another embodiment, the mass field labeling can be generated using the SDF (Signed Distance Function) instead of the Gaussian decay function, as detailed in Equations 5 and 6 below: (Equation 5) SDF is defined by the defect boundary ( ) is a boundary, piecewise linear mapping to An interval is defined such that the quality value at the boundary is consistent with that of the master scheme. : (Equation 6) in, This is the cutoff distance (default is 30 pixels). This mapping is taken at the defect boundary. The SDF (Self-Derivative Function) scheme linearly increases to 1 towards the normal region and linearly decreases to 0 towards the defect center. Its advantage is its simple mathematical form; its disadvantage is that the transition region changes linearly rather than decays Gaussianly, resulting in a less smooth transition at defect boundaries compared to the Gaussian scheme, and SDF values from different defect regions may interfere with each other. It is recommended to use this scheme in scenarios where defect regions are sparse and non-overlapping. This involves fusing electrical quantities, operating status, and environmental information into a unified multi-dimensional feature vector, overcoming the limitations of traditional methods that rely solely on a single threshold. This allows subsequent evaluations to comprehensively consider the coupled influence of the equipment's own state and the external environment on the measurement data, laying a data foundation for high-precision evaluation.
[0043] This embodiment utilizes distance transformation to automatically convert traditional binary defect labels into continuous mass field labels, achieving a seamless mapping from discrete labels to continuous monitoring signals.
[0044] Step S20: Determine the monitoring signal based on the mass field label value.
[0045] It is understood that the supervision signal refers to the prior known correct result that is strictly paired with each input sample during the model training process and is expected to be approximated by the model output; in this embodiment, the mass field label value obtained according to step S10 can be directly used as the supervision signal of the preset model.
[0046] Step S30: Train the preset network based on the preset function and the supervision signal to obtain the trained preset network.
[0047] It is understandable that training a pre-defined network is an iterative process, and the workflow for each training batch is as follows: (1) Training configuration and strategy, used to set global rules; (2) Input training image data; (3) Output the predicted mass field; (4) The monitoring signal, as the mass field label value, is used together with the output of the preset network to proceed to the next step; (5) The loss function is used to calculate the difference between the predicted mass field and the labeled mass field value, and to obtain the loss; (6) Backpropagation and parameter update - Based on the configuration strategy, the weights of the preset network are corrected using loss.
[0048] It should be noted that training configurations and training strategies may include: Optimizer: AdamW, initial learning rate Weight decay ; Learning rate scheduling: Cosine Annealing, minimum learning rate The cycle is 200 epochs. Data augmentation: random horizontal / vertical flip, random rotation (0° / 90° / 180° / 270°), color dithering (brightness ±10%, contrast ±10%, saturation ±5%), random cropping and scaling (0.8~1.2x); Batch size: 16 (single GPU), input resolution or ; Early stopping strategy: on the validation set Training should be stopped if the performance does not decline for 20 consecutive epochs. Special processing for data augmentation: When geometric transformations (flipping, rotating, cropping) are applied to an image, the corresponding quality field annotations are... The exact same geometric transformation can be applied to maintain spatial alignment.
[0049] In addition, for completely defect-free normal training samples ( The network learns and outputs a mass field consisting entirely of 1s. To prevent the network's output for normal samples from degenerating into a trivial constant of 1 (ignoring spatial structure), the following strategy is adopted: ① The proportion of normal samples in the training set is controlled at 30%~50%; ② Apply synthetic micro-defect enhancement to normal samples (add small low-quality regions at random locations with a probability of 0.3) so that the network maintains its sensitivity to local quality changes even when inputting “almost normal” images; ③ Set the quality value of the synthesized micro-defect to 0.5~0.8 (between normal and defect), and the area to be a circular region with a radius of 5~20 pixels.
[0050] The pre-designed network can be a pre-designed deep convolutional network with an encoder-decoder architecture. The encoder uses a pre-trained feature extraction backbone network (such as ResNet-50 or EfficientNet-B4), and the decoder employs a multi-scale feature fusion structure. Key design features may include: ① Regression head replaces classification head: The last layer of the network uses a single-channel convolution and a sigmoid activation function to output the predicted quality field, instead of the traditional Softmax classification head; ② Multi-scale skip connections: The feature maps of the encoder's 2nd, 3rd, 4th, and 5th layers are passed to the corresponding layers of the decoder through skip connections, preserving high-resolution spatial details; ③ Depthwise separable convolutional decoder: Each layer of the decoder uses depthwise separable convolutions to reduce the number of parameters, and it can be trained on a single card.
[0051] The preset function can be a structured regression loss function used to calculate the difference between the predicted quality field and the labeled quality field value, and to continuously improve the capabilities of the preset model based on this difference. The structured regression loss function includes at least pixel-level regression loss, gradient consistency loss, and defect boundary focusing loss, which can be understood by referring to Equation 7 below: (Equation 7) in, For the structured regression loss function, For pixel-level regression loss, For gradient consistency loss, Focus on loss at the defect boundary. , as well as The loss weights (usually set to the default value) , , ).
[0052] In addition, the pixel-level regression loss is obtained by Smooth L1 Loss, as shown in Equation 8 below: (Equation 8) in, Smooth L1 Loss is a loss function used for regression tasks. It is the predicted quality field output during the pre-set model training process, and 'This refers to the image size input during model training.' It is the labeled value of the mass field.
[0053] In addition, the gradient consistency loss can be calculated using Equation 9 below: (Equation 9) Equation 9 uses partial derivatives calculated through the mass field to obtain the gradient consistency loss. Gradient consistency loss ensures that the spatial variation pattern of the predicted quality field is consistent with the label, preventing unreasonable local mutations.
[0054] In addition, the calculation of the defect boundary focusing loss can be referred to the following formula 10: (Equation 10) in, This is the defect boundary zone region. The defect boundary focusing loss imposes an additional penalty on the boundary region, thereby enhancing the prediction accuracy at the boundary.
[0055] In this embodiment, a preset network is trained by using a preset function and a supervision signal to obtain a trained preset network, thereby improving the accuracy of the subsequent output prediction quality field.
[0056] In another embodiment, the structured three-term loss can be replaced by a simple pixel-level L2 loss, as detailed in Equation 11 below: (Equation 11) L2 loss is simple to implement and stable to train, requiring no adjustment of the λ2 and λ3 weights. However, it lacks gradient consistency constraints, which may lead to unreasonable local abrupt changes in the predicted quality field. Furthermore, it lacks boundary focusing, resulting in lower prediction accuracy at defect boundaries. It is recommended as an initial solution for rapid prototyping.
[0057] Step S40: Obtain the image to be evaluated, and obtain the predicted quality field based on the image to be evaluated and the trained preset network.
[0058] The image to be evaluated refers to the surface image of a product awaiting quality assessment or inspection. The predicted quality field is typically a two-dimensional scalar field with continuous real values per pixel, strictly aligned with the input image space, output by a pre-trained deep convolutional regression network after performing a single forward inference on the input surface image to be evaluated. For example, an image of the surface of an industrial product can be acquired, and the predicted quality field can be obtained based on this image and a pre-set network to describe information such as the quality status of the industrial product.
[0059] Step S50: Perform a quality assessment on the image to be evaluated based on the predicted quality field, and generate a quality assessment report.
[0060] It should be noted that quality assessment typically refers to a systematic process that uses specific sensing methods and analytical models to quantitatively measure the conformity, integrity, and consistency of a product's surface or internal state, and to provide an interpretable quality judgment. In addition, a quality assessment report is at least a unified summary and evaluation that combines test results, continuous quality scoring indicators, degradation trend maps, warning levels, and time-series degradation reports.
[0061] This embodiment provides a quality assessment method based on a predicted quality field. The method involves preprocessing a defect mask to obtain quality field annotation values, which include quality field annotation values for defective regions and normal regions. A monitoring signal is determined based on these quality field annotation values. A preset network is trained using a preset function and the monitoring signal to obtain a trained preset network. An image to be evaluated is acquired, and a predicted quality field is obtained based on the image and the trained preset network. The image is then evaluated based on the predicted quality field, and a quality assessment report is generated. By using the predicted quality field to assess the image's quality, defective regions can be identified more accurately, improving the accuracy of the quality assessment.
[0062] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Step S50 includes steps S501 to S503: Step S501: Obtain the mass field heatmap, spatial gradient field, and degradation direction map based on the predicted mass field, and evaluate the image to be evaluated based on the predicted mass field to obtain the detection results, continuous quality score index, and temporal degradation report.
[0063] It should be noted that a quality field heatmap typically refers to a visual image generated by replacing each scalar value in the predicted quality field with a color vector in a color space according to a preset color mapping rule, thus visually representing the spatial distribution of surface quality; a spatial gradient field is a two-dimensional vector field that includes gradient direction (representing the direction of fastest quality improvement, i.e., the direction away from the defect center) and gradient magnitude (reflecting the rate of quality change); a degradation direction map is usually an engineered definition of gradient direction information derived from the spatial gradient field, used to represent the spatial direction map of surface quality deterioration from normal to the defect core; detection results typically refer to binary detection results obtained by applying different thresholds to the quality field, with different thresholds corresponding to different levels of quality standards; continuous quality scoring indicators are usually scalar measures extracted from the predicted quality field to quantify the surface quality state; and a time-series degradation report is usually a structured analysis document describing the time-series degradation law of surface quality by periodically detecting the same target area throughout the product's entire life cycle or long-term service, extracting and recording the sequence changes of the continuous quality field and derived scoring indicators.
[0064] Step S502: Obtain the early warning level of the preset region based on the predicted mass field and the spatial gradient field.
[0065] It should be noted that the preset region is a new region defined by the quality field in this invention; the warning level can be divided into different levels (such as low risk, medium risk, and high risk). Specifically, the steps of obtaining the warning level of the preset region based on the predicted quality field and the spatial gradient field include: obtaining the image size to be evaluated, the warning threshold, the defect threshold, the preset weight, and the preset reference value; defining the preset region based on the warning threshold and the defect threshold; preprocessing the predicted quality field to obtain a preset region mask; performing connected component analysis on the preset region mask based on the preset region to obtain several preset connected regions; obtaining feature values based on the preset connected regions according to the image size, the predicted quality field, and the spatial gradient field, wherein the feature values include at least area ratio, target quality value, and degradation trend index; performing a warning evaluation on the preset region based on the feature values, the preset weight, and the preset reference value to obtain a warning score; and obtaining the warning level of the preset region based on the warning score.
[0066] In one embodiment, the image size to be evaluated, the warning threshold, the defect threshold, the preset weight, and the preset reference value are obtained. The specific method for defining the subcritical region can be referred to in Equation 12 below: (Equation 12) In the formula, The predicted mass field obtained in step S40, This is the warning threshold (default value is 0.5). This is the defect threshold (default value is 0.3), and Subcritical region The physical meaning is: the mass at these locations has begun to degrade. The degree of degradation has exceeded the warning level. However, it has not yet met the defect judgment criteria. ).
[0067] Through the The formula for performing double threshold segmentation and extracting the subcritical region mask by taking the difference set can be found in Equation 13 below: (Equation 13) right Perform connected component analysis to obtain Subcritical connected regions .
[0068] For each subcritical connected region Calculate its characteristic values, which include at least the area percentage, target quality value, and degradation trend index. The specific calculation can be referred to Formula 14 below:
[0069]
[0070]
[0071] (Equation 14) in, Subcritical connected region The corresponding area percentage The size of the image to be evaluated. This represents the average quality value of the subcritical connected region. This represents the target quality value (minimum quality value) for the subcritical connected region. It serves as an indicator of the degradation trend in subcritical connected regions. Let this be the unit vector pointing from this point to the nearest defect region. This indicates that the subcritical region as a whole is degrading towards defects (high risk). This indicates that the degradation trend is not obvious or that recovery is underway.
[0072] A comprehensive early warning score is calculated for each subcritical region, as detailed in Formula 15 below: (Equation 15) in, For early warning scoring, , , To preset weights, This is the area normalization reference value (preset reference value).
[0073] The warning level can be obtained based on the warning score, as shown in the following example: ①Low risk ( ): Logs are recorded, but no notifications are sent; this area is in the early stages of degradation and does not require intervention at this time; ②Medium risk ( ): Send a yellow alert to the quality management system, suggesting increasing the testing frequency or scheduling a focused inspection during the next maintenance; ③ High risk ( ): A red alert has been issued, indicating that the area is highly likely to develop into a defect in the short term. It is recommended to arrange an inspection or preventative treatment immediately.
[0074] Step S503: Generate a quality assessment report based on the mass field heat map, the detection results, the continuous quality scoring index, the degradation direction map, the early warning level of the preset area, and the time-series degradation report.
[0075] In practice, the system outputs a structured quality assessment report, which may include the following: (1) Mass field thermogram: displayed in pseudo-color The spatial distribution is shown, with red representing low quality and green representing high quality; (2) Degradation direction map: Gradient arrows are superimposed on the defect area to indicate the degradation trend; (3) Subcritical region labeling map: Highlighting the subcritical regions and their risk levels; (4) Continuous quality scoring: , , , Four core indicators; (5) Multi-standard test results: based on the quality standards specified by the user. Binary detection results (compatible with traditional system integration); (6) Time series degradation report: degradation rate, trend prediction, and recommended maintenance time window.
[0076] This embodiment obtains a quality field heatmap, spatial gradient field, and degradation direction map based on the predicted quality field, and evaluates the image to be evaluated based on the predicted quality field to obtain detection results, continuous quality scoring indicators, and temporal degradation reports. It also obtains a warning level for a preset area based on the predicted quality field and the spatial gradient field. Finally, it generates a quality assessment report based on the quality field heatmap, the detection results, the continuous quality scoring indicators, the degradation direction map, the warning level for the preset area, and the temporal degradation report. By performing quality assessment through the predicted quality field and generating a quality assessment report, the accuracy of quality assessment is effectively improved, and certain directions and suggestions are provided for subsequent product maintenance.
[0077] Based on the first embodiment of this application, in the third embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 Step S501 includes steps A11 to A18: Step A11: Obtain the mass field thermogram based on the predicted mass field.
[0078] It should be noted that a mass field heatmap typically refers to a visualization image generated by replacing each scalar value in the predicted mass field with a color vector in a color space one-to-one according to a preset color mapping rule. This image is used to intuitively present the spatial distribution of surface mass. For example, red can represent low mass and green can represent high mass in a heatmap.
[0079] Step A12: Perform a convolution operation based on the predicted mass field and the preset operator to obtain the spatial partial derivative.
[0080] Specifically, the predicted quality field of the network output can be... Spatial partial derivatives can be calculated using preset operators (such as the Sobel operator). and For specific calculations, please refer to Formula 16 below:
[0081] (Equation 16) in, and for Sobel horizontal and vertical convolution kernels, This indicates a convolution operation. Compared to simple difference, the Sobel operator has a built-in Gaussian smoothing effect, reducing noise interference with gradient estimation.
[0082] Step A13: Obtain the spatial gradient field based on the spatial partial derivatives.
[0083] It should be noted that the spatial gradient field is typically a complete vector description of the spatial variation of mass distribution. The definition is related to the spatial partial derivative, and the specific definition formula can be found in Equation 17 below: (Equation 17) in, and These are discrete approximations of spatial partial derivatives, representing the rates of change in the horizontal and vertical directions, respectively.
[0084] Step A14: Generate a degradation pattern based on the spatial gradient field and the predicted mass field.
[0085] It should be noted that a degradation direction diagram is a type of graph that typically reflects degradation information such as the degradation rate and direction of a product's surface.
[0086] In one embodiment, the step of generating a degradation pattern based on the spatial gradient field and the predicted quality field includes: determining the gradient magnitude and gradient direction of the spatial gradient field; determining a preset range based on the predicted quality field; obtaining a degradation direction angle based on the gradient direction, and obtaining a degradation principal direction based on the degradation direction angle and the gradient magnitude; obtaining a degradation direction consistency index based on the degradation principal direction and the gradient magnitude; obtaining a target boundary degradation rate based on the gradient magnitude; and generating a degradation pattern within the preset range based on the gradient magnitude, the gradient direction, the degradation principal direction, the degradation direction consistency index, and the target boundary degradation rate.
[0087] Specifically, the magnitude and direction of the gradient can be directly determined from the spatial gradient field, as shown in Equation 18 below:
[0088] (Equation 18) in, The gradient magnitude reflects the rate of mass change. This represents the gradient direction, which reflects the direction of quality improvement. It's important to note that... Direction The direction of increase (quality improvement). Therefore, the degradation direction (defect propagation direction) is the negative gradient direction. .
[0089] The preset range determined by the predicted quality field refers to the defect region and its neighborhood ( , The default value is within 0.2. Within this preset range, for each defect area... (No. The process of calculating the principal degradation direction, degradation direction consistency index, and target boundary degradation rate for each connected region can be referred to Equation 19 below:
[0090]
[0091] (Equation 19) in, The main direction of degradation, The degenerate direction angle is expressed as the gradient magnitude. The weighted average ensures that the direction of more severe degradation has a greater influence; This is an index of consistency in the direction of degradation. A value close to 1 indicates a highly consistent degradation direction (such as linearly propagating cracks), while a value close to 0 indicates a diffuse degradation direction (such as corrosion propagating in all directions). This consistency index is used to help determine the type of defect. The target boundary degradation rate reflects the degradation rate at the location of the most drastic quality change at the defect boundary and can be used to determine the degree of defect propagation activity. Within the defect region and its neighborhood (… , Within the default range of 0.2), the generated degradation pattern may include: (1) For each sampling point (8 pixels apart), draw a plot starting from that point and along... The direction of the arrow, the length of the arrow is Proportional; (2) Arrow color according to Value mapping: small gradient ( → Blue (flat area); Medium gradient ( → Yellow (transition region); large gradient ( → Red (rapidly degraded area); (3) Mark or overlay the main degradation direction, degradation direction consistency index and target boundary degradation rate to intuitively show the expansion trend of defects.
[0092] Understandably, after obtaining the main degradation direction, the degradation direction consistency index, and the target boundary degradation rate, not only can these values be used to generate a degradation direction map, but also to directly output recommendations for quality assessment and maintenance.
[0093] Step A15: Determine the standard deviation and mean of the predicted quality field, and obtain the pass threshold, the image size to be evaluated, and the defect threshold.
[0094] The size of the image to be evaluated, as well as the standard deviation and mean of the predicted quality field, can be used to determine the continuous quality scoring index; different levels of stringency of quality standards correspond to different pass thresholds.
[0095] Step A16: Evaluate the image to be evaluated based on the qualified threshold and the predicted quality field to obtain the detection result.
[0096] It should be noted that the test results are usually binary test results, for example, the product quality can be divided into qualified and unqualified; the qualified threshold is a threshold used as a reference for judgment based on the test results.
[0097] In one embodiment, the predicted mass field Apply qualified threshold The binary detection result can be expressed by the following formula 20: (Equation 20) in, For the qualified threshold, different These values correspond to different levels of stringency in quality standards, for example: (1) (Corresponding to strict standards): Only the most severe defective areas are judged as unqualified, applicable to functional safety level testing; (2) (Corresponding to medium standard): Areas with moderate or higher degradation are judged as unqualified, applicable to general industrial-grade testing; (3) (Corresponding to lenient standards): Even slightly degraded areas are judged as unqualified, which is applicable to the appearance quality level inspection.
[0098] In addition, for the same mass field, the scanning qualification threshold Calculate each threshold from 0 to 1. The detection performance indicators (true positive rate, false positive rate) were used to obtain the preset curve: (1) Horizontal axis (FPR): Pass threshold The higher the score, the more normal areas are misjudged as defects—corresponding to the cost of "over-quality control" under stricter quality standards; (2) Vertical axis (TPR): Pass threshold The higher the value, the more real defects are detected—corresponding to a detection rate under stricter quality standards; (3) Each point on the curve corresponds to a quality standard (one (Value), users can select the operating point on the curve that best suits their needs. Additionally, the area under the curve can be calculated as a comprehensive evaluation index of the quality of the mass field estimation.
[0099] Step A17: Obtain a continuous quality score index based on the image size to be evaluated, the standard deviation, the mean, and the defect threshold.
[0100] Continuous quality scoring indicators include overall map quality score, target quality value, defect severity score, and quality uniformity index; these scoring indicators can be calculated using the following formula 21:
[0101]
[0102]
[0103] (Equation 21) in, The size of the image to be evaluated. To score the overall image quality, This is the target quality value (used to locate the worst-performing area). Integrate the severity of the defect (used to quantify the total impact of the defect). The defect threshold. To predict the standard deviation of the mass field, To predict the mean of the mass field, It is a quality uniformity index; in addition, It can simultaneously reflect the defect area and severity: large-area shallow defects and small-area deep defects may have the same... Value, but can be obtained through distinguish. A value close to 1 indicates a uniform quality distribution, while a value close to 0 indicates significant local quality differences.
[0104] Step A18: Preprocess the predicted quality field to obtain a temporal degradation report.
[0105] It should be noted that a time-series degradation report typically refers to a report that tracks the degradation of product quality over time.
[0106] In one feasible implementation, step A18 may include steps B11 to B15: Step B11: Determine the first and second predicted mass fields at adjacent times in the predicted mass field, wherein the time corresponding to the first predicted mass field is later than the time corresponding to the second predicted mass field; Specifically, determine the predicted mass field at time... and Corresponding predicted mass field and .
[0107] Step B12: Transform and align the second predicted mass field to obtain the transformed and aligned second predicted mass field; Specifically, in a fixed workstation scenario (products are photographed from the same position), the affine transformation matrix is calculated through feature point matching: for time... and Images acquired and Local keypoints with uniqueness and repetition are detected independently, and their descriptors are calculated. Based on the similarity of the descriptors, a correspondence matching relationship between feature points in two images is established. A robust estimation algorithm is used to optimize the correspondence matching relationship to obtain matching pairs. The affine transformation matrix is solved based on the least squares method of the matching pairs. Then, the... The transformation and alignment process is performed to obtain the second predicted mass field after transformation and alignment. The specific transformation and alignment process can be referred to Equation 22 below: (Equation 22) in, This is the second predicted mass field after transformation and alignment. Let A be the second predicted mass field and A be the affine transformation matrix.
[0108] In mobile product scenarios (the same product is photographed from different locations), alignment is achieved through product contour matching. First, the product area mask is extracted, and then the transformation parameters are estimated by minimizing the mask overlap error.
[0109] Additionally, the NCC (Normalized Cross-Correlation) coefficients of the normal regions in the two aligned frames can be calculated. The time markers are unreliable for alignment, and the difference results should be used with caution.
[0110] In another embodiment, dense optical flow (such as FlowNet2) can be used instead of feature point matching for temporal quality field alignment. The specific transformation process can be referred to in Equation 23 below: (Equation 23) Where (u(x,y), v(x,y)) is the optical flow method's estimation of each pixel from I. t-1 To I t The advantages of optical flow in displacement field estimation are its ability to handle non-rigid deformations (such as deformations of flexible materials) and higher alignment accuracy. However, its disadvantages include significantly higher computational cost compared to feature point matching, and potentially unreliable optical flow estimation in large-area uniform texture regions (such as metal plates). Therefore, this alternative is recommended when the product exhibits non-rigid deformations or requires precise alignment due to minute displacements.
[0111] Step B13: Obtain the temporal quality field difference based on the first predicted quality field and the transformed and aligned second predicted quality field; Specifically, the calculation process for obtaining the temporal mass field difference based on the first predicted mass field and the transformed and aligned second predicted mass field can be referred to in Equation 24 below: (Equation 24) in, For time-series quality field difference, For the first predicted mass field, This is the second predicted mass field after transformation and alignment; additionally, This indicates quality degradation (the quality at the current moment is lower than that at the previous moment). This indicates an improvement in quality (such as after maintenance / cleaning). This indicates that the quality is stable.
[0112] In addition, significant degradation regions can be extracted based on temporal mass field differences. The definition of a significant degradation region can be found in Equation 25 below: (Equation 25) in, Significantly degraded areas, The threshold for significant degradation (default value is 0.05) is used to filter estimation noise; connected component analysis is performed on significantly degraded regions to obtain statistical characteristics such as the area, average degradation, and maximum degradation of each significantly degraded region, which can be used as a reference for quality assessment.
[0113] Step B14: Estimate the degradation rate, defect threshold arrival time, and degradation acceleration based on the predicted mass field; In one embodiment, the step of estimating the degradation rate, defect threshold arrival time, and degradation acceleration based on the predicted mass field includes: obtaining a mass field sequence over a preset time period based on the predicted mass field; obtaining an index, an index mean, and a mass mean based on the mass field sequence; estimating the degradation rate based on the mass field sequence, the index, the index mean, and the mass mean; estimating the defect threshold arrival time based on the degradation rate, the defect threshold, and the mass field sequence; and estimating the degradation acceleration based on the degradation rate and the preset time period.
[0114] For example, the preset time is Obtain the mass field sequence within time T. The degradation rate of the product surface within time T can be estimated. The specific calculation can be referred to the following formula 26: (Equation 26) Among them, index Arranged in forward chronological order ( Earliest time within the corresponding window , Corresponding to the current moment ), The index mean, The average quality within the window; if This indicates that the quality of the pixel has been deteriorating over time. The degradation rate.
[0115] For pixels whose quality continuously degrades over time, the defect threshold arrival time can be estimated. The specific calculation can be referred to Equation 27 below: (Equation 27) Among them, the defect threshold arrival time Specifically, it is the estimated time required for the quality of the pixel to drop to the defect threshold based on the current degradation rate; this estimate is often used to develop predictive maintenance plans.
[0116] The degradation acceleration can also be estimated for each region based on the degradation rate and a preset time. The specific calculation can be referred to Equation 28 below: (Equation 28) in, For the region Estimated degradation acceleration, For the region At any moment The average degradation rate, The magnitude of its degradation rate. This indicates that the degradation is accelerating (meaning urgent action is needed). This indicates that the degradation is slowing down (meaning it can be handled as planned).
[0117] Step B15: Obtain a temporal degradation report based on the temporal quality field difference, the degradation rate, the defect threshold arrival time, and the degradation acceleration.
[0118] Understandably, the timing degradation report can not only display timing quality field differences, degradation rate, defect threshold arrival time, and degradation acceleration, but also trend predictions and suggested maintenance time windows for product maintenance reference.
[0119] This embodiment obtains a quality field heatmap based on the predicted quality field; performs a convolution operation on the predicted quality field and a preset operator to obtain spatial partial derivatives; obtains a spatial gradient field based on the spatial partial derivatives; generates a degradation direction map based on the spatial gradient field and the predicted quality field; determines the standard deviation and mean of the predicted quality field, and obtains the pass threshold, the size of the image to be evaluated, and the defect threshold; evaluates the image to be evaluated based on the pass threshold and the predicted quality field to obtain detection results; obtains a continuous quality scoring index based on the size of the image to be evaluated, the standard deviation, the mean, and the defect threshold; preprocesses the predicted quality field to obtain a temporal degradation report; and generates a final quality assessment report by combining multiple quality assessments, thereby improving the comprehensiveness of the quality assessment, providing multiple aspects of detection and evaluation, and effectively reducing the false positive rate.
[0120] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the quality assessment method based on the predicted mass field of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0121] This application also provides a quality assessment device based on a predicted mass field; please refer to... Figure 4 The quality assessment device based on the predicted mass field includes: The determination module 10 is used to preprocess the defect mask to obtain the quality field annotation value, which includes the quality field annotation value of the defect area and the quality field annotation value of the normal area.
[0122] The determining module 10 is further configured to determine a monitoring signal based on the mass field label value.
[0123] The training module 20 is used to train the preset network based on the preset function and the supervision signal to obtain the trained preset network.
[0124] Output module 30 is used to acquire the image to be evaluated and obtain the predicted quality field based on the image to be evaluated and the trained preset network.
[0125] The output module 30 is also used to perform quality assessment on the image to be evaluated based on the predicted quality field and generate a quality assessment report.
[0126] The quality assessment device based on predicted quality field provided in this application, employing the quality assessment method based on predicted quality field in the above embodiments, can solve the technical problem that current quality assessment methods generate incomplete detection results, which easily lead to misjudgments and thus low accuracy in quality assessment. Compared with the prior art, the beneficial effects of the quality assessment device based on predicted quality field provided in this application are the same as those of the quality assessment method based on predicted quality field provided in the above embodiments, and other technical features in the quality assessment device based on predicted quality field are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0127] In one embodiment, the output module 30 is further configured to obtain a quality field heatmap, a spatial gradient field, and a degradation direction map based on the predicted quality field, and to evaluate the image to be evaluated based on the predicted quality field to obtain detection results, a continuous quality score index, and a temporal degradation report; to obtain a warning level for a preset area based on the predicted quality field and the spatial gradient field; and to generate a quality assessment report based on the quality field heatmap, the detection results, the continuous quality score index, the degradation direction map, the warning level for the preset area, and the temporal degradation report.
[0128] In one embodiment, the output module 30 is further configured to: obtain a quality field heatmap based on the predicted quality field; perform a convolution operation on the predicted quality field and a preset operator to obtain spatial partial derivatives; obtain a spatial gradient field based on the spatial partial derivatives; generate a degradation direction map based on the spatial gradient field and the predicted quality field; determine the standard deviation and mean of the predicted quality field, and obtain a pass threshold, an image size to be evaluated, and a defect threshold; evaluate the image to be evaluated based on the pass threshold and the predicted quality field to obtain a detection result; obtain a continuous quality score index based on the image size to be evaluated, the standard deviation, the mean, and the defect threshold; and preprocess the predicted quality field to obtain a temporal degradation report.
[0129] In one embodiment, the output module 30 is further configured to: determine the gradient magnitude and gradient direction of the spatial gradient field; determine a preset range based on the predicted mass field; obtain a degradation direction angle based on the gradient direction, and obtain a degradation principal direction based on the degradation direction angle and the gradient magnitude; obtain a degradation direction consistency index based on the degradation principal direction and the gradient magnitude; obtain a target boundary degradation rate based on the gradient magnitude; and generate a degradation direction map within the preset range based on the gradient magnitude, the gradient direction, the degradation principal direction, the degradation direction consistency index, and the target boundary degradation rate.
[0130] In one embodiment, the output module 30 is further configured to: determine a first predicted quality field and a second predicted quality field at adjacent times in the predicted quality field, wherein the time corresponding to the first predicted quality field is later than the time corresponding to the second predicted quality field; transform and align the second predicted quality field to obtain a transformed and aligned second predicted quality field; obtain a temporal quality field difference based on the first predicted quality field and the transformed and aligned second predicted quality field; estimate the degradation rate, defect threshold arrival time, and degradation acceleration based on the predicted quality field; and obtain a temporal degradation report based on the temporal quality field difference, the degradation rate, the defect threshold arrival time, and the degradation acceleration.
[0131] In one embodiment, the output module 30 is further configured to obtain a mass field sequence within a preset time period based on the predicted mass field; obtain an index, an index mean, and a mass mean based on the mass field sequence; estimate a degradation rate based on the mass field sequence, the index, the index mean, and the mass mean; estimate a defect threshold arrival time based on the degradation rate, a defect threshold, and the mass field sequence; and estimate a degradation acceleration based on the degradation rate and the preset time.
[0132] In one embodiment, the output module 30 is further configured to acquire the image size to be evaluated, a warning threshold, a defect threshold, a preset weight, and a preset reference value; define a preset region based on the warning threshold and the defect threshold; preprocess the predicted quality field to obtain a preset region mask; perform connected component analysis on the preset region mask based on the preset region to obtain several preset connected regions; obtain feature values based on the preset connected regions according to the image size, the predicted quality field, and the spatial gradient field, wherein the feature values include at least area ratio, target quality value, and degradation trend index; perform a warning assessment on the preset region according to the feature values, the preset weight, and the preset reference value to obtain a warning score; and obtain a warning level for the preset region based on the warning score.
[0133] In one embodiment, the determining module 10 is further configured to perform distance transformation on the defect mask to obtain a first distance and a second distance; determine the region type based on the defect mask, the region type including defect region and normal region; when the region type is a normal region, obtain the quality field label value of the normal region based on the defect mask, according to the second distance, a preset parameter, and a defect threshold; when the region type is a defect region, obtain a third distance based on the first distance; obtain the quality field label value of the defect region based on the defect mask, according to the first distance, the third distance, the defect threshold, and a preset index; and obtain the quality field label value based on the quality field label value of the normal region and the quality field label value of the defect region.
[0134] This application provides a quality assessment device based on a predicted quality field. The quality assessment device based on a predicted quality field includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the quality assessment method based on the predicted quality field in the first embodiment described above.
[0135] The following is for reference. Figure 5 This document illustrates a structural schematic diagram of a quality assessment device based on a predicted quality field suitable for implementing embodiments of this application. The quality assessment device based on a predicted quality field in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), tablets, PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The quality assessment device based on the predicted mass field shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0136] like Figure 5As shown, the quality assessment device based on the predicted mass field may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in ROM (Read Only Memory) 1002 or a program loaded from storage device 1003 into RAM (Random Access Memory) 1004. The RAM 1004 also stores various programs and data required for the operation of the quality assessment device based on the predicted mass field. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, LCDs (Liquid Crystal Displays), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the quality assessment device based on the predicted mass field to communicate wirelessly or wiredly with other devices to exchange data. Although a quality assessment device based on the predicted mass field with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0137] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0138] The quality assessment device based on predicted quality fields provided in this application, employing the quality assessment method based on predicted quality fields in the above embodiments, can solve the technical problem that current quality assessment methods generate incomplete detection results, which easily lead to misjudgments and thus low accuracy in quality assessment. Compared with the prior art, the beneficial effects of the quality assessment device based on predicted quality fields provided in this application are the same as those of the quality assessment method based on predicted quality fields provided in the above embodiments, and other technical features in this quality assessment device based on predicted quality fields are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0139] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0140] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0141] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the quality assessment method based on the predicted mass field in the above embodiments.
[0142] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory or Flash Memory), optical fibers, CD-ROM (CD-Read Only Memory), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0143] The aforementioned computer-readable storage medium may be included in a quality assessment device based on a predictive quality field; or it may exist independently and not be assembled into a quality assessment device based on a predictive quality field.
[0144] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by a quality assessment device based on a predicted quality field, the quality assessment device based on the predicted quality field performs the following actions: preprocesses a defect mask to obtain quality field annotation values, the quality field annotation values including quality field annotation values for defective regions and quality field annotation values for normal regions; determines a supervision signal based on the quality field annotation values; trains a preset network based on a preset function and the supervision signal to obtain a trained preset network; acquires an image to be evaluated and obtains a predicted quality field based on the image to be evaluated and the trained preset network; performs a quality assessment on the image to be evaluated based on the predicted quality field, and generates a quality assessment report.
[0145] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LAN (Local Area Network) or WAN (Wide Area Network)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0146] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0147] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0148] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned quality assessment method based on a predicted mass field. This addresses the technical problem that current quality assessment methods generate incomplete detection results, leading to misjudgments and low accuracy in quality assessment. Compared to existing technologies, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the quality assessment method based on a predicted mass field provided in the above embodiments, and will not be elaborated upon here.
[0149] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method for quality assessment based on a predicted mass field.
[0150] The computer program product provided in this application can solve the technical problem that current quality assessment methods generate incomplete detection results, which are prone to misjudgment and thus result in low accuracy of quality assessment. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the quality assessment method based on predicted mass field provided in the above embodiments, and will not be repeated here.
[0151] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A quality assessment method based on a predicted mass field, characterized in that, The quality assessment method based on the predicted mass field includes: The defect mask is preprocessed to obtain the mass field annotation value, which includes the mass field annotation value of the defect area and the mass field annotation value of the normal area; The monitoring signal is determined based on the mass field label value; The preset network is trained based on the preset function and the supervision signal to obtain the trained preset network; Acquire the image to be evaluated, and obtain the predicted quality field based on the image to be evaluated and the trained preset network; The image to be evaluated is assessed based on the predicted quality field, and a quality assessment report is generated.
2. The method as described in claim 1, characterized in that, The step of performing a quality assessment on the image to be assessed based on the predicted quality field and generating a quality assessment report includes: The predicted quality field yields a heatmap of the quality field, a spatial gradient field, and a degradation direction map. The image to be evaluated is then evaluated based on the predicted quality field to obtain detection results, continuous quality score indicators, and a temporal degradation report. The warning level of the preset area is obtained based on the predicted mass field and the spatial gradient field; A quality assessment report is generated based on the mass field heat map, the detection results, the continuous quality scoring index, the degradation direction map, the early warning level of the preset area, and the time-series degradation report.
3. The method as described in claim 2, characterized in that, The steps of obtaining a mass field heatmap, spatial gradient field, and degradation direction map based on the predicted mass field, and evaluating the image to be evaluated based on the predicted mass field to obtain detection results, continuous quality score indicators, and temporal degradation reports include: A mass field thermogram is obtained based on the predicted mass field. The spatial partial derivatives are obtained by performing a convolution operation based on the predicted mass field and the preset operator. The spatial gradient field is obtained based on the spatial partial derivatives. A degradation pattern is generated based on the spatial gradient field and the predicted mass field; Determine the standard deviation and mean of the predicted quality field, and obtain the pass threshold, the size of the image to be evaluated, and the defect threshold; The image to be evaluated is evaluated based on the qualified threshold and the predicted quality field to obtain the detection result; A continuous quality score index is obtained based on the image size to be evaluated, the standard deviation, the mean, and the defect threshold. The predicted quality field is preprocessed to obtain a temporal degradation report.
4. The method as described in claim 3, characterized in that, The step of generating a degradation pattern based on the spatial gradient field and the predicted mass field includes: Determine the magnitude and direction of the gradient of the spatial gradient field; A preset range is determined based on the predicted mass field; The degradation direction angle is obtained based on the gradient direction, and the main degradation direction is obtained based on the degradation direction angle and the gradient magnitude; The degradation direction consistency index is obtained based on the degradation principal direction and the gradient magnitude; The target boundary degradation rate is obtained based on the gradient magnitude. A degradation direction map within the preset range is generated based on the gradient magnitude, the gradient direction, the degradation principal direction, the degradation direction consistency index, and the target boundary degradation rate.
5. The method as described in claim 3, characterized in that, The step of preprocessing the predicted quality field to obtain the temporal degradation report includes: Determine a first and a second predicted mass field at adjacent times in the predicted mass field, wherein the time corresponding to the first predicted mass field is later than the time corresponding to the second predicted mass field; The second predicted mass field is transformed and aligned to obtain the transformed and aligned second predicted mass field. The temporal quality field difference is obtained based on the first predicted quality field and the transformed and aligned second predicted quality field. The degradation rate, defect threshold arrival time, and degradation acceleration are estimated based on the predicted mass field. A temporal degradation report is obtained based on the temporal quality field difference, the degradation rate, the defect threshold arrival time, and the degradation acceleration.
6. The method as described in claim 5, characterized in that, The step of estimating the degradation rate, defect threshold arrival time, and degradation acceleration based on the predicted mass field includes: The mass field sequence within a preset time period is obtained based on the predicted mass field. The index, index mean, and mass mean are obtained from the mass field sequence. The degradation rate is estimated based on the mass field sequence, the index, the index mean, and the mass mean; The arrival time of the defect threshold is estimated based on the degradation rate, the defect threshold, and the mass field sequence. The degradation acceleration is estimated based on the degradation rate and the preset time.
7. The method as described in claim 2, characterized in that, The step of obtaining the early warning level of the preset region based on the predicted mass field and the spatial gradient field includes: Obtain the image size to be evaluated, warning threshold, defect threshold, preset weight, and preset reference value; A preset area is defined based on the warning threshold and the defect threshold; The predicted mass field is preprocessed to obtain a preset region mask; Based on the preset region, a connected region analysis is performed on the preset region mask to obtain several preset connected regions; Based on the preset connected region, feature values are obtained according to the image size, the predicted quality field, and the spatial gradient field, wherein the feature values include at least the area ratio, the target quality value, and the degradation trend index. Based on the feature value, the preset weight, and the preset reference value, a warning assessment is performed on the preset area to obtain a warning score; The warning level of the preset area is obtained based on the warning score.
8. The method as described in claim 1, characterized in that, The step of preprocessing the defect mask to obtain the mass field annotation value includes: Perform a distance transformation on the defect mask to obtain a first distance and a second distance; The region type is determined based on the defect mask, and the region type includes defective regions and normal regions; When the region type is a normal region, the mass field labeling value of the normal region is obtained based on the defect mask, according to the second distance, preset parameters and defect threshold. When the region type is a defect region, a third distance is obtained based on the first distance; based on the defect mask, the mass field label value of the defect region is obtained based on the first distance, the third distance, the defect threshold, and a preset index; The quality field label value is obtained based on the quality field label value of the normal area and the quality field label value of the defective area.
9. A quality assessment device based on a predicted mass field, characterized in that, The quality assessment device based on the predicted mass field includes: The determination module is used to preprocess the defect mask to obtain the mass field annotation value, which includes the mass field annotation value of the defect area and the mass field annotation value of the normal area; The determining module is further configured to determine a monitoring signal based on the mass field label value; The training module is used to train the preset network based on the preset function and the supervision signal to obtain the trained preset network. The output module is used to acquire the image to be evaluated and obtain the predicted quality field based on the image to be evaluated and the trained preset network. The output module is also used to perform quality assessment on the image to be evaluated based on the predicted quality field and generate a quality assessment report.
10. A quality assessment device based on a predicted mass field, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the mass assessment method based on a predicted mass field as described in any one of claims 1 to 8.