Defect classification method and system based on dynamic threshold and incremental learning ability

By constructing a multi-source input structure and a dynamic threshold scoring mechanism, the adaptability of the defect classification system to process changes and customer needs was solved, achieving high-quality and flexible classification of defects in glass cover production, and improving the accuracy and adaptability of classification.

CN121542931BActive Publication Date: 2026-04-14ZHUHAI BOTAO TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-20
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing defect classification systems cannot understand the semantic importance of defect locations, cannot adapt to dynamic process changes, are difficult to adapt to different customer needs, and lack a learning mechanism for new defect patterns, resulting in misjudgments or omissions across batches and process scenarios, making it difficult to meet the high-quality, flexible, and sustainable evolution requirements of glass cover production.

Method used

A multi-source input structure is constructed, which integrates defect images, functional region mask maps, and standardized process parameters. Through convolutional feature extraction and context fusion feature encoding, a defect scoring mechanism with dynamic threshold and incremental learning capability is generated. The model is dynamically adjusted in combination with process parameters and customer acceptance configuration, and is periodically updated.

Benefits of technology

It enables accurate classification of defects under different regions and process conditions, adapts to the complex quality management needs of multiple processes and customer scenarios, and improves the accuracy, stability and adaptability of classification, making it suitable for glass cover production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542931B_ABST
    Figure CN121542931B_ABST
Patent Text Reader

Abstract

The application provides a defect grading method and system based on a dynamic threshold and an incremental learning capability, and the method comprises the following steps: constructing a multi-source input structure comprising a defect image, a functional area mask image and a standardized process parameter vector; fusing visual and process context information to generate a context fusion feature vector; outputting a defect acceptability score through a scoring network; combining product acceptance configuration coding and process parameter dynamic adjustment to determine a scoring threshold, and outputting a defect grade label; and storing samples with scores close to the determination boundary in a sample archiving queue, and periodically updating the scoring network. Through the introduction of functional area perception, self-adaptive threshold of working condition and incremental learning mechanism driven by boundary samples, the accuracy and generalization ability of defect determination are significantly improved, and the flexible configuration of the production line and the continuous optimization of the model are effectively supported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of defect detection, and in particular relates to a defect classification method and system based on dynamic threshold and incremental learning capability. Background Technology

[0002] In the manufacturing process of precision functional components such as glass covers, automatic defect detection and classification are core aspects of production decision-making, quality monitoring, and customer delivery. Traditional defect classification systems typically rely on AOI equipment to acquire images and combine them with algorithms based on fixed thresholds to statically judge the visible characteristics of defects, such as shape, size, and location. However, on actual production lines, the factors affecting defect acceptability are far more complex than these surface features. First, different functional areas of the glass cover (such as display windows, optically sensitive areas, and border areas) have significantly different tolerances for defects, but existing methods often fail to understand the semantic importance of the defect's location, leading to a failure to correctly distinguish the true impact of the same defect in different areas. Second, the glass processing process is highly sensitive to environmental and equipment conditions. Process conditions such as hot pressing temperature, conveying speed, pressure fluctuations, and differences in surface coatings directly affect the diffusion trend, visibility, and risk level of defects to product performance. Fixed thresholds cannot adapt to such dynamic changes, easily leading to misjudgments or omissions across batches and process scenarios. Third, different customers and product models have varying requirements for defect levels. Production lines need to switch between different standards in a short period. However, once traditional models are trained, their judgment range is almost fixed, making it difficult to flexibly adjust according to customer needs. Furthermore, new defect patterns constantly emerge during glass cover production (such as special scratches, foreign object adhesion, and new crack morphologies caused by structural stress). Existing systems lack a learning mechanism for real-world evolution, causing the model to gradually deviate from actual production conditions over time, resulting in insufficient long-term usability. Overall, existing technologies generally suffer from key problems such as insufficient understanding of the defect judgment context, limited responsiveness to process changes, difficulty in dynamically adapting to customer standards, and inability to continuously accumulate and learn from on-site data. These shortcomings make it difficult to meet the high-quality, flexible, and sustainable automatic grading requirements of modern glass manufacturing. Summary of the Invention

[0003] The purpose of this invention is to design a defect classification method and system based on dynamic threshold and incremental learning capability, which can integrate process context, spatial semantics and defect appearance features, and has dynamic adaptability and long-term learning capability.

[0004] To achieve the above objectives, a defect classification method based on dynamic threshold and incremental learning capability is provided in a first aspect of the present invention, the method comprising:

[0005] Construct a multi-source input structure, which includes a defect image, a functional region mask image, and a standardized process parameter vector;

[0006] The defect image and the functional region mask image are concatenated along the channel dimension to form a fused image tensor.

[0007] Convolutional feature extraction is performed on the fused image tensor to obtain a visual feature tensor;

[0008] The standardized process parameter vector is mapped to a context embedding vector, and then expanded into a process context tensor with the same spatial dimension as the visual feature tensor through a broadcast mechanism.

[0009] The visual feature tensor and the process context tensor are concatenated in the channel dimension and then subjected to attention-weighted pooling with functional region bias to generate a context fusion feature vector.

[0010] Based on the context-fused feature vector, a defect acceptability score is output through a scoring network;

[0011] Based on the current product acceptance configuration code and the standardized process parameter vector, the scoring threshold is dynamically adjusted, and a defect level label is output based on the comparison between the defect acceptability score and the scoring threshold.

[0012] Samples whose scores are close to the decision boundary and their context information are stored in a sample archiving queue, and the scoring network is periodically updated using the sample archiving queue.

[0013] Furthermore, the functional area mask is automatically generated from the product design structure file and is used to identify the functional area type of each pixel in the glass cover, and is pixel-level aligned with the defect image in spatial location.

[0014] Furthermore, the standardized process parameter vector includes hot pressing temperature, conveying speed, pressing pressure, surface coating type, and batch number. Each parameter is normalized using the mean and standard deviation of historical operating data.

[0015] Furthermore, in the attention-weighted pooling process with functional region bias, different functional regions correspond to different region bias weights, so that the same visual feature produces different fusion response intensities in different functional regions.

[0016] Furthermore, a context consistency regularization term is introduced during the training process of the scoring network. The context consistency regularization term, based on the similarity between fused feature vectors and the region-sensitive weights of corresponding functional regions, constrains defect samples with similar appearance and working conditions to output similar defect acceptability scores.

[0017] Furthermore, the defect acceptability score is superimposed with a temperature deviation excitation term before output. The temperature deviation excitation term is nonlinearly amplified based on the normalized parameter of hot pressing temperature to enhance the model's risk sensitivity under abnormal temperature conditions.

[0018] Furthermore, the dynamic adjustment of the scoring threshold is based on the benchmark scoring range corresponding to the product acceptance configuration code, and is modified in combination with the current standardized process parameter vector and its corresponding process sensitivity weight.

[0019] Furthermore, the defect level labels include three categories: acceptable, unacceptable, and manually reviewed, which correspond to three production line processing actions: automatic release, rejection and scrapping, and delayed decision-making, respectively.

[0020] Furthermore, the sample archiving queue prioritizes the inclusion of samples with a scoring gradient greater than a preset threshold. The scoring gradient represents the sensitivity of the defect acceptability score to the context-fused feature vector, and records with high scoring gradients are retained when the queue capacity reaches its limit.

[0021] A second aspect of the invention provides a defect grading system based on dynamic thresholds and incremental learning capabilities, the system comprising:

[0022] A multi-source input construction module is used to construct a multi-source input structure, which includes a defect image, a functional region mask image, and a standardized process parameter vector.

[0023] The context fusion encoding module is used to concatenate the defect image and the functional region mask image along the channel dimension to form a fused image tensor; perform convolutional feature extraction on the fused image tensor to obtain a visual feature tensor; map the standardized process parameter vector to a context embedding vector, and expand it into a process context tensor with the same spatial dimension as the visual feature tensor through a broadcast mechanism; concatenate the visual feature tensor and the process context tensor along the channel dimension, and perform attention-weighted pooling processing with functional region bias to generate a context fusion feature vector;

[0024] The defect acceptability scoring module is used to output a defect acceptability score through a scoring network based on the context-fused feature vector.

[0025] The dynamic threshold determination module is used to dynamically adjust the scoring determination threshold according to the current product acceptance configuration code and the standardized process parameter vector, and output the defect level label based on the comparison result between the defect acceptability score and the scoring determination threshold.

[0026] The sample archiving and model update module is used to store samples whose scores are close to the decision boundary and their context information into a sample archiving queue, and periodically update the scoring network using the sample archiving queue.

[0027] The beneficial technical effects of the present invention are at least as follows:

[0028] To address the aforementioned issues, this invention provides a defect grading method and system based on dynamic thresholds and incremental learning capabilities. By constructing a multi-source input structure, defect images, functional region masks, and process state parameters are organized in a unified tensor form, enabling the model to perceive the real-world context of the defect from the input end. Through a context-fusion feature encoding module, visual features, region-sensitive features, and production conditions are represented as a unified semantic feature vector, allowing the system to comprehensively understand the actual risk of defects in the current environment. By constructing a defect scoring mechanism with continuous expressive capabilities, and introducing location-sensitive weights and process deviation adjustment terms, the scoring can accurately reflect the changing trends of defect risk in different regions, batches, and operating conditions. Through a dynamic threshold generation method based on process parameters, the final grading determination can automatically adjust according to production line conditions and customer standards, achieving adaptation to dynamic environments. Through a sample archiving and periodic update mechanism, boundary samples and key operating condition samples are continuously collected, enabling the system to continuously evolve with actual on-site conditions and avoid model aging. This invention integrates visual, semantic, and process information throughout the entire grading calculation chain, so that the defect grading results no longer rely on a single image feature, but are dynamically judged based on the real production context. This significantly improves the accuracy, stability, and adaptability of the grading, and is suitable for the complex quality management needs of multiple processes, multiple customers, and multiple scenarios in the current glass cover production. Attached Figure Description

[0029] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.

[0030] Figure 1 This is a flowchart of the defect classification method based on dynamic threshold and incremental learning capability of the present invention.

[0031] Figure 2 This is a framework diagram of the defect classification system based on dynamic threshold and incremental learning capability of the present invention. Detailed Implementation

[0032] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0033] In one or more embodiments, such as Figure 1As shown, a defect classification method based on dynamic threshold and incremental learning capability is disclosed, the method comprising the following:

[0034] S1: Construct a multi-source input structure, which includes a defect image, a functional region mask image, and a standardized process parameter vector;

[0035] Specifically, the purpose of this step is to construct a composite input structure that includes defect image information, functional area identifiers, and production process status, serving as the foundational input for subsequent context-aware modeling. Unlike traditional image processing workflows, the determination of defects in glass covers depends not only on the defect morphology but is also strongly influenced by the region where the defect is located and the production conditions. Therefore, in this step, it is necessary to organize these three types of information in a unified structural manner to provide subsequent modules with multi-source fusion input that includes semantic location and contextual status.

[0036] First, defect images are acquired using industrial cameras configured on the production line's AOI system. A typical configuration is a high-resolution area scan camera, such as the Baslerac A1920-40gm model, with a resolution of 1920×1200. The images are in three-channel RGB format and are uniformly named tensors. Each image contains only one or more defect areas. The original image is not cropped or scaled in this step to ensure that the original defect shape and positional relationship are completely preserved.

[0037] Secondly, in order to incorporate information about each functional area of ​​the glass cover, a region labeling mask was constructed. This mask image is not the output of the image segmentation model, but rather a functional area annotation map automatically generated from the product's design structure files (such as CAD drawings). For example, a cover plate is divided into functional areas such as "display window," "border edge," and "FPC connection area." Each type of area is represented by a different integer number in the mask image, such as display area numbered 1, border numbered 2, and so on. Before each material loading, the system automatically loads the corresponding template based on the product model to ensure that the mask image is consistent with the camera image space, with pixel-level alignment.

[0038] Image Tensor With area mask By stitching along the channel dimensions, a fused image tensor is obtained. ,Right now:

[0039] ;

[0040] in, This indicates the splicing of tensors in the channel dimension. Before splicing, a dimensionality-up process is performed, expanding the two-dimensional matrix into a third-order tensor with a dimension of [dimensionality missing]. In order to communicate with Alignment by channel count. Result after concatenation. The first three channels contain the original image information, while the fourth channel encodes the functional region number to which each pixel belongs. This structure embeds semantic information about "which functional region the defect is located in" at the image level, which helps the model learn spatial distribution sensitivity.

[0041] Next, we introduce the process parameter vector. It includes the environmental and equipment conditions relevant to the defect acceptability determination of the current production batch. Common items include hot pressing temperature (read by the temperature control module of the hot pressing station), conveyor speed (feedback from the conveyor line encoder), pressing pressure (from the electric pressure head controller), surface coating type (obtained by parsing the glass QR code), and batch number (recorded by the MES system). These parameters are uniformly collected and cached at the system level through data interfaces (such as MODBUS, OPCUA, RESTAPI).

[0042] Different parameters have different dimensions, and their raw values ​​cannot be directly input into the model. To make the input processable, it is standardized to a numerical form with a mean of zero and a variance of one. The standardization process is as follows:

[0043] ;

[0044] in, Indicates the first One original process parameter value, It is its mean over the history of the sample. It is the standard deviation. This is the result after normalization. All and Historical operating data from the stable phase of the process is calculated by the statistical system and stored in the configuration file. For example, if the current hot-pressing temperature is 132.8°C, the historical mean is 130°C, and the standard deviation is 1.5, then the normalized result is... The numerical value accurately reflects the degree to which the current parameters deviate from the process baseline. The final output consists of two variables: one is the image input. It includes a three-channel original image and a one-channel region mask; secondly, it contains a standardized process parameter vector. , indicating the production context state.

[0045] S2: Concatenate the defect image and the functional region mask image along the channel dimension to form a fused image tensor; perform convolutional feature extraction on the fused image tensor to obtain a visual feature tensor; map the standardized process parameter vector to a context embedding vector, and expand it into a process context tensor with the same spatial dimension as the visual feature tensor through a broadcast mechanism; concatenate the visual feature tensor and the process context tensor along the channel dimension, and perform attention-weighted pooling processing with functional region bias to generate a context fusion feature vector;

[0046] Specifically, the goal of this step is to fuse the tensors of the image output from the previous step. With normalized process parameter vector Transformed into a single context-fused feature vector This enables subsequent steps to form a dynamic grading judgment basis that conforms to the actual production environment of glass covers, based on a combination of image appearance, spatial location, and process status.

[0047] Input image fusion tensor The image contains RGB three-channel images and functional region numbering channels; therefore, a convolutional neural network is first used to extract its spatial structure features. This network consists of three convolutional layers with kernel sizes of [sizes to be filled in]. , and The number of channels was set to 32, 64, and 128 respectively. After convolution, the spatial dimension was downsampled twice with a stride of 2, so that the feature tensor changed from a size of 128 to 1288. The input size is reduced to Forming visual feature tensors After passing through this network, spatial information related to hierarchical classification, such as defect morphology, edge details, and region encoding, is represented in the channel dimension.

[0048] In order to incorporate process parameters Aligning with the channel dimension of visual features, this step constructs a two-layer perceptron, which... Mapped to context embedding vectors of the same dimension as the visual features To enable the process status information to participate in the fusion synchronously with image features in the spatial dimension, a tensor broadcasting mechanism is used. Expand to This ensures that the image features and process conditions have the same contextual representation at each spatial location. At this point, the image features and process conditions are dimensionally compatible and can be stitched together along the channel dimension.

[0049] The concatenated joint feature tensor It remains a spatial structure and needs to be transformed into a global vector. To ensure that this transformation not only captures the intensity of feature responses but also reflects the real-world characteristic that different functional regions have varying degrees of influence on defects, this step constructs an "attention-weighted pooling mechanism with functional region bias," the core formula of which is as follows:

[0050] ;

[0051] in, Indicates will Through a layer The scalar value after convolution compression is used to measure the response intensity of the feature at that location. For example, when the feature activation is high at the edge of a crack, Usually greater than 0; It is based on the mask in step one. The function area offset item retrieved by the area number, for example, the display area number corresponds to... The border area corresponds to In this way, the same characteristic response will receive higher weight in important areas, thus reflecting the actual production logic that "defects appear in different functional areas and have different risks".

[0052] To enhance the model's sensitivity to abnormal process conditions, this step involves generating the perceptron. A nonlinear amplification term, which is particularly sensitive to temperature fluctuations, was added during the process to normalize the parameters corresponding to the hot-pressing temperature. The transformation is as follows:

[0053] ;

[0054] in, This is the normalized value of the hot-pressing temperature, for example, the normalized result is... At that time, ; To adjust the constant, for example, let it be set as The transformation result is approximately The result is then positive after ReLU nonlinear activation. This amplification mechanism significantly improves the model's sensitivity to defect risks when faced with temperature conditions deviating from normal operating conditions, consistent with empirical rules such as "temperature deviations easily lead to microcrack propagation" during glass hot pressing. After the above attention aggregation and process sensitivity enhancement, the resulting fused feature vector... It is a unified expression that includes information on the appearance of defects, their location semantics, and their process status.

[0055] S3: Based on the context fusion feature vector, output the defect acceptability score through the scoring network;

[0056] Specifically, the task of this step is to use the context fusion feature vector output from the previous step. Construct a "defect acceptability scoring mechanism" that can reflect the actual working conditions of glass cover plates. This scoring mechanism should not only rely on... The image should contain a comprehensive set of features including appearance, semantics of functional areas, and process status. It should also have flexible expressive capabilities so that defects in different batches, regions, and process statuses can be mapped to a continuous acceptable range.

[0057] Unlike traditional methods that use simple classification structures (such as directly outputting OK or NG), this step aims to construct a "continuously interpretable" risk measurement method, making the scoring... It can subtly express the risk changes of defects in different contexts. For example, under the same scratch intensity, if it falls in the center of the display area, the score should be significantly higher; if the current temperature is high or the speed is fast, the score should also shift more towards the unacceptable side. To achieve this fine-grained dynamism, this step uses... As the sole input, by integrating structural design, location sensitivity modeling, and process deviation adjustment mechanisms, a value that can be directly mapped to the level of risk is ultimately generated.

[0058] First, construct a three-layer fully connected scoring network, with the input being a vector. The network's dimensionality changes from 256 to 64 to 16 to 1, with each layer followed by ReLU activation (except the last layer). This allows the model to filter out the most risk-sensitive dimensional combinations from high-dimensional contextual fusion features. To ensure the scoring aligns with real-world production perception, the network output is activated using a Sigmoid function, resulting in the final score. Limited to Within the range, an interpretable risk expression is formed.

[0059] However, the regression structure described above alone is insufficient to meet the requirements of glass cover production. Glass defects often exhibit a characteristic of "slight continuity," for example, mild and moderate bright spots show minimal differences in image features, but require a natural transition during actual acceptance testing. Therefore, this step introduces a "contextual consistency regularization term" into the scoring mechanism. This term directly affects the model training process, ensuring the scoring maintains a natural continuity with the contextually fused features. This regularization term considers not only the similarity of visual features but also the differential weights of functional regions' impact on defects, making the continuity more closely aligned with production logic.

[0060] This step uses the following loss structure (with the number of formulas strictly controlled) to train the scoring network:

[0061] ;

[0062] The meanings of each variable are as follows: Cross-entropy loss based on acceptable / unacceptable labels is used to guide the basic direction of scoring; A sample pair set is typically composed of two images with similar image similarity selected from the same batch, such as two images with slight bright spots. It is the fused feature vector generated in step two; These are the two score values ​​output in this step; The similarity between two samples in the context space is measured; the smaller the value, the closer the defect states are. This is a region-sensitive weight, derived from the functional region mask in step one: for example, if a defect in the display area has a greater impact on the scoring difference, then the corresponding region is assigned a higher value (e.g., The border area is assigned a lower weight (e.g.) ), reflecting the actual acceptance standards; It is the balance coefficient, if it can be taken .

[0063] This regularization structure allows the scoring network to automatically learn that the scores of two defects with nearly identical appearances and similar operating conditions should not suddenly change; while the score differences for defects located in critical areas should be more significant. This scoring mechanism not only reflects visual continuity but also embodies the risk bias of functional areas, directly aligning with the quality inspection principles of the glass cover industry.

[0064] In addition to the continuity regularization term, this step also incorporates a "process deviation adjustment mechanism" to enhance sensitivity to abnormal process conditions in the scoring output. For example, the likelihood of a minor crack becoming unacceptable increases significantly when the temperature is too high. Therefore, this step constructs a temperature-related scoring incentive mechanism that relies on a single formula, avoiding complex stacking:

[0065] ;

[0066] in: This is the original output of the scoring network; This refers to the "normalized hot pressing temperature parameter" obtained in step one; This is the magnification factor, such as when set to... If the temperature deviation is greater, then The larger the value, the higher the score, making the model more cautious under abnormal temperatures.

[0067] For example, when At that time, The temperature excitation term is If the original rating is The new rating is This clearly reflects the characteristic that defects are more likely to be unacceptable under high-temperature conditions.

[0068] The final output includes two variables: continuous ratings. This indicates the unacceptability of the current defect under the current operating conditions and regional semantics; the original score. (For internal verification, but only used in subsequent steps) ).

[0069] S4: Based on the current product acceptance configuration code and the standardized process parameter vector, dynamically adjust the scoring judgment threshold, and output the defect level label based on the comparison result between the defect acceptability score and the scoring judgment threshold;

[0070] Specifically, the task of this step is to analyze the existing scoring results. Based on this, and combined with the actual production line process status and customer acceptance standards, the defect grading judgment criteria are dynamically adjusted, and the final grading label is output. Unlike traditional methods that use static scoring thresholds, this step introduces a process parameter-driven dynamic threshold generation mechanism, enabling the system to automatically tighten or loosen the judgment criteria according to the current production status in actual use. This improves the adaptability and practicality of the grading, making it particularly suitable for typical scenarios like the glass cover industry where process fluctuations affect the grading results.

[0071] The input includes two variables: rating value The scoring network from the previous module is a context-fused feature vector. Nonlinear mapping output; normalized process parameter vector The data is collected by the PLC interface or MES system in step one, including key production parameters such as hot pressing temperature, glass thickness, conveying speed, and material number. In practice, these parameters are typically reported in real time by the underlying control equipment via OPC or MODBUS protocol, refreshed every 100 milliseconds, and stored in the system cache. To ensure consistency with the real-time scoring, the scoring model and the process parameter module should run on the same device or ensure synchronous communication.

[0072] In addition, product acceptance configuration codes also need to be introduced. This code is injected by the host system at the start of each production batch, indicating the customer standard or acceptance level for that batch of glass covers. For example, if a brand's customer number is A, the corresponding acceptance range for the rating is more stringent, while if the internal test board number is T, the acceptance range is wider. This code is usually identified by scanning a QR code when the equipment is loaded, or written into the equipment's memory through the MES task dispatch interface, ensuring that the rating matches the current standard.

[0073] The dynamic adjustment of the scoring criteria follows these basic principles: In the standard setting, for each type of product... Each has a set of preset scoring boundaries For example, regarding customer A's standards, , The middle section represents the manual review area. Based on this, the system considers whether the current process status deviates from the normal range. If the deviation is significant, the system should automatically adjust the boundary threshold to avoid missing defects under risky conditions. This adjustment is accomplished using the following formula:

[0074] ;

[0075] in, For the current product number The corresponding basic scoring range is read from the rule table; It is the current normalized process parameter vector, for example, when the temperature is too high. When the speed is too fast ; These are the scoring sensitivity weights for each type of process parameter, typically obtained through training with historical process data or evaluated and set by engineering experts. For example, the parameter is more sensitive to fluctuations in hot-pressing temperature, so its weight can be set to 0.4, while the weight for glass thickness can be set to 0.2. This is a uniform adjustment coefficient used to control the intensity of the impact of the overall process deviation on the scoring range. Recommended values ​​are as follows: .

[0076] To illustrate with a concrete example: If a customer's standard is... Furthermore, the glass samples currently being tested exhibit the following normalized parameters under their processing conditions: , Set weights Then the projection of the process deviation is multiplied by The correction value was then obtained as 0.084, and the final judgment interval was obtained as follows: , This means that under this operating condition, the system automatically tightens the scoring acceptance range, increasing the stringency of defect judgment.

[0077] The final decision-making logic is a three-stage process:

[0078] ;

[0079] Among them, the label This indicates that the defect level is acceptable, and the system will automatically allow it to proceed. This indicates that it is unacceptable and needs to be removed or scrapped. This indicates that the system is in the manual review phase, and can be configured for random sampling or delayed decision-making depending on the specific scenario. In practice, these three types of output signals can be directly connected to the PLC interface or uploaded to the MES interface via a JSON structure for automatic control or data retention on the production line.

[0080] The output variable is the final defect level label. Its value is Choose one of the three options.

[0081] S5: Store the samples whose scores are close to the decision boundary and their context information into the sample archiving queue, and periodically update the scoring network using the sample archiving queue.

[0082] Specifically, the task of this step is to establish a "sample archiving and periodic update mechanism" based on the existing defect classification and judgment, which is geared towards the actual needs of industrial sites, enabling the system to continuously evolve during long-term operation. This mechanism can assist the model in updating its strategy through historical experience when production batches are updated, equipment status changes, or new defect patterns emerge, thereby maintaining the cutting-edge nature and robustness of the overall classification strategy.

[0083] The input for this step is the final judgment label output from step four. and the scoring value in step three Both are used together for sample selection and dynamic determination of whether to archive. Furthermore, the context fusion features from step two also need to be considered. This feature includes defect images, spatial semantics, and process status. Based on the scoring results and label determination, the system constructs a sample archiving queue. This is for use by the periodic model update module.

[0084] In the sample selection strategy, to avoid the model overfitting to high-confidence data, samples whose scores fall within the boundary region (i.e., scores close to the current score) are preferentially selected. and (The boundary region). These samples represent the locations where the system's judgment is most uncertain, most likely to experience boundary fluctuations, and most susceptible to changes in process conditions or regions. Therefore, the sample collection mechanism does not employ a simple score-based screening method, but instead constructs a risk measurement function based on the "score gradient." This is used to dynamically determine whether to include the sample in the training pool.

[0085] ;

[0086] in This represents the sensitivity gradient of the scoring function to the fused features. This value is obtained by automatic differentiation after the network forward computation and represents the perturbation strength of the current sample to the model output. It is a weighting function used to boost the weights of the weights. The probability of collecting a labeled sample is defined as follows: , , In practice, a data collection threshold can be set. (like When the sample rating gradient reaches the specified sensitivity, the sample and its label are added to the sample pool. The samples include the original image tensors. Process parameter vector Fusion characteristics Rating value and final tag .

[0087] To prevent the long-term accumulation of historical samples from causing training bias or wasting storage resources, a sample pool is used. Maintenance is performed using a "batch cleanup + priority replacement" mechanism. Reaching maximum capacity (e.g.) When ), first according to Sort the values ​​and retain The higher the value, the better. records (e.g.) The remaining portion is sampled proportionally from the low-score difference region (e.g., the sampling ratio of the boundary concentration region is increased to 60%) to form a new sample subset, thereby achieving structural reorganization and gradient coverage balance of the training data.

[0088] The sample pool update frequency can be configured according to the actual production line rhythm and model maintenance capabilities. A typical cycle is recommended to automatically construct a training set once a week and call the model fine-tuning module to correct local parameters. During fine-tuning, the model structure is not re-initialized; only the scoring network and the final scoring threshold estimation module are updated to ensure stability while introducing new knowledge. After training, the performance improvement is evaluated using a validation set, and a threshold gain standard (e.g., an improvement in NG recall exceeding 3%) is set before model deployment, ensuring that updates contribute positively to system performance.

[0089] The output of this step is the dynamic sample pool. Its structure can be represented as:

[0090] ;

[0091] Each record contains the original input, scoring path, and final label result, which are used for model updates and debugging.

[0092] In one or more embodiments, such as Figure 2 As shown, a defect grading system based on dynamic thresholds and incremental learning capabilities is disclosed, the system comprising:

[0093] A multi-source input construction module is used to construct a multi-source input structure, which includes a defect image, a functional region mask image, and a standardized process parameter vector.

[0094] The context fusion encoding module is used to concatenate the defect image and the functional region mask image along the channel dimension to form a fused image tensor; perform convolutional feature extraction on the fused image tensor to obtain a visual feature tensor; map the standardized process parameter vector to a context embedding vector, and expand it into a process context tensor with the same spatial dimension as the visual feature tensor through a broadcast mechanism; concatenate the visual feature tensor and the process context tensor along the channel dimension, and perform attention-weighted pooling processing with functional region bias to generate a context fusion feature vector;

[0095] The defect acceptability scoring module is used to output a defect acceptability score through a scoring network based on the context-fused feature vector.

[0096] The dynamic threshold determination module is used to dynamically adjust the scoring determination threshold according to the current product acceptance configuration code and the standardized process parameter vector, and output the defect level label based on the comparison result between the defect acceptability score and the scoring determination threshold.

[0097] The sample archiving and model update module is used to store samples whose scores are close to the decision boundary and their context information into a sample archiving queue, and periodically update the scoring network using the sample archiving queue.

[0098] It is worth noting that the specific workflow of the defect classification system based on dynamic threshold and incremental learning capability provided in this embodiment of the invention is the same as that of the defect classification method based on dynamic threshold and incremental learning capability described in the above embodiments, and will not be repeated here.

[0099] This invention also provides a defect grading device based on dynamic thresholds and incremental learning capabilities, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps described in the above embodiments of the defect grading method based on dynamic thresholds and incremental learning capabilities, for example... Figure 1 The steps S1 to S5 described above; or, when the processor executes the computer program, it implements the functions of each module in the above system embodiments.

[0100] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the defect grading device based on dynamic thresholds and incremental learning capabilities.

[0101] The defect classification device based on dynamic thresholds and incremental learning capabilities can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. This device may include, but is not limited to, processors and memory. Those skilled in the art will understand that the device may also include input / output devices, network access devices, buses, etc.

[0102] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASACs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the defect grading device based on dynamic threshold and incremental learning capabilities, connecting all parts of the device via various interfaces and lines.

[0103] The memory can be used to store the computer program and / or modules. The processor implements various functions of the defect grading device based on dynamic threshold and incremental learning capability by running or executing the computer program and / or modules stored in the memory and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the operation of the air conditioner controller, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD card), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0104] The defect grading device integrated with dynamic threshold and incremental learning capabilities, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0105] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0106] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A defect classification method based on dynamic threshold and incremental learning ability, characterized in that, The method includes: Construct a multi-source input structure, which includes a defect image, a functional region mask image, and a standardized process parameter vector; The defect image and the functional region mask image are concatenated along the channel dimension to form a fused image tensor. Convolutional feature extraction is performed on the fused image tensor to obtain a visual feature tensor; The standardized process parameter vector is mapped to a context embedding vector, and then expanded into a process context tensor with the same spatial dimension as the visual feature tensor through a broadcast mechanism. The visual feature tensor and the process context tensor are concatenated in the channel dimension and then subjected to attention-weighted pooling with functional region bias to generate a context fusion feature vector. Based on the context-fused feature vector, a defect acceptability score is output through a scoring network; Based on the current product acceptance configuration code and the standardized process parameter vector, the scoring threshold is dynamically adjusted, and a defect level label is output based on the comparison between the defect acceptability score and the scoring threshold. Samples whose scores are close to the decision boundary and their context information are stored in a sample archiving queue, and the scoring network is periodically updated using the sample archiving queue.

2. The defect classification method based on dynamic threshold and incremental learning ability according to claim 1, characterized in that, The functional area mask is automatically generated from the product design structure file and is used to identify the functional area type of each pixel in the glass cover, and is pixel-level aligned with the defect image in spatial location.

3. The defect classification method based on dynamic threshold and incremental learning ability according to claim 1, characterized in that, The standardized process parameter vector includes hot pressing temperature, conveying speed, pressing pressure, surface coating type, and batch number. Each parameter is normalized using the mean and standard deviation of historical operating data.

4. The defect classification method based on dynamic threshold and incremental learning ability according to claim 1, characterized in that, In the attention-weighted pooling process with functional region bias, different functional regions correspond to different region bias weights, so that the same visual features produce different fusion response intensities in different functional regions.

5. The defect classification method based on dynamic threshold and incremental learning ability according to claim 1, characterized in that, The training process of the scoring network introduces a context consistency regularization term. The context consistency regularization term, based on the similarity between fused feature vectors and the region-sensitive weights of corresponding functional regions, constrains defect samples with similar appearance and working conditions to output similar defect acceptability scores.

6. The defect classification method based on dynamic threshold and incremental learning ability according to claim 1, characterized in that, The defect acceptability score is superimposed with a temperature deviation excitation term before output. The temperature deviation excitation term is nonlinearly amplified based on the normalized parameter of hot pressing temperature to enhance the model's risk sensitivity under abnormal temperature conditions.

7. The defect classification method based on dynamic threshold and incremental learning ability according to claim 1, characterized in that, The dynamic adjustment of the scoring threshold is based on the benchmark scoring range corresponding to the product acceptance configuration code, and is modified in combination with the current standardized process parameter vector and its corresponding process sensitivity weight.

8. The defect classification method based on dynamic threshold and incremental learning ability according to claim 1, characterized in that, The defect level labels include three categories: acceptable, unacceptable, and manually reviewed, which correspond to three production line processing actions: automatic release, rejection and scrapping, and delayed decision-making, respectively.

9. The defect classification method based on dynamic threshold and incremental learning ability according to claim 1, characterized in that, The sample archiving queue prioritizes samples with a scoring gradient greater than a preset threshold. The scoring gradient represents the sensitivity of the defect acceptability score to the context-fused feature vector, and records with high scoring gradients are retained when the queue capacity reaches its limit.

10. A defect grading system based on dynamic threshold and incremental learning capability, characterized in that, The system includes: A multi-source input construction module is used to construct a multi-source input structure, which includes a defect image, a functional region mask image, and a standardized process parameter vector. The context fusion encoding module is used to concatenate the defect image and the functional region mask image along the channel dimension to form a fused image tensor; perform convolutional feature extraction on the fused image tensor to obtain a visual feature tensor; map the standardized process parameter vector to a context embedding vector, and expand it into a process context tensor with the same spatial dimension as the visual feature tensor through a broadcast mechanism; concatenate the visual feature tensor and the process context tensor along the channel dimension, and perform attention-weighted pooling processing with functional region bias to generate a context fusion feature vector; The defect acceptability scoring module is used to output a defect acceptability score through a scoring network based on the context-fused feature vector. The dynamic threshold determination module is used to dynamically adjust the scoring determination threshold according to the current product acceptance configuration code and the standardized process parameter vector, and output the defect level label based on the comparison result between the defect acceptability score and the scoring determination threshold. The sample archiving and model update module is used to store samples whose scores are close to the decision boundary and their context information into a sample archiving queue, and periodically update the scoring network using the sample archiving queue.

Citation Information

Patent Citations

  • Self-supervised defect representation learning method in industrial scene

    CN121350837A