Industrial defect detection method and device, electronic equipment and storage medium
By employing a multi-model collaborative reasoning and voting fusion approach, and combining the defect detection of the main model and auxiliary models, the problem of insufficient accuracy and low efficiency in the defect detection of lithium battery products in existing technologies is solved, achieving more efficient defect classification and production line control.
Patent Information
- Application Number
- CN202611090757.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-11-24
AI Technical Summary
In existing technologies, deep learning-based industrial AI defect detection models struggle to balance the accuracy requirements of broad category recognition and fine classification, resulting in insufficient classification accuracy. This is particularly problematic in lithium battery product defect detection, where classification uncertainty and inefficiency persist.
A multi-model inference cluster, including a main model and an auxiliary model, is adopted. Defect classification is performed through a voting fusion mechanism. The main model handles coarse-grained identification at the major category level, while the auxiliary model handles fine-grained discrimination at the minor category level. The rule execution context is constructed by combining machine detection parameters and product type, and a hierarchical rule engine architecture is designed.
It improves the accuracy of product defect classification and production line efficiency, reduces the random errors of single-model detection, makes full use of the collaborative recognition capabilities of multiple models, and optimizes the response time of production line control actions.
Smart Images

Figure CN123160433A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of industrial inspection technology, and in particular relates to an industrial defect detection method, device, electronic equipment and storage medium. Background Technology
[0002] As a core component of lithium batteries, the manufacturing quality of lithium batteries directly determines their safety and lifespan. With the rapid development of the lithium battery industry, the inspection speed of production lines is getting faster and faster. A single production line can generate hundreds of thousands of inspection images per hour, which places extremely high demands on the accuracy and efficiency of defect detection.
[0003] Among related technologies, industrial AI (Artificial Intelligence) defect detection technology based on deep learning has gradually replaced traditional manual inspection methods and become the mainstream solution for product quality inspection. However, due to the wide variety of product defects, including base films, coated films, sprayed films, and other product types, and the large number of defect categories involved, the discrimination ability of a single defect classification model is limited, making it difficult to meet the accuracy requirements of both broad category identification and fine classification, resulting in insufficient classification accuracy. Summary of the Invention
[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes an industrial defect detection method, apparatus, electronic device, and storage medium to improve the accuracy of product defect classification and increase production line efficiency.
[0005] In a first aspect, this application provides an industrial defect detection method, comprising: The image to be detected is input into a multi-model inference cluster to obtain the defect classification results output by each model in the multi-model inference cluster; wherein, the multi-model inference cluster includes multiple main models and multiple auxiliary models, the main models are used to output the classification results at the product defect category level, and the auxiliary models are used to output the classification results at the sub-category level under the category level; The classification results output by each of the main models are fused by voting to obtain a first voting result; the classification results output by each of the auxiliary models are fused by voting to obtain a second voting result. The target classification result of product defects is determined based on the first voting result and the second voting result; A rule execution context is constructed based on the target classification result, the machine detection parameters corresponding to the image to be detected, and the product type; the machine detection parameters are the physical attribute data of product defects collected by the product production line inspection equipment. Iterate through each detection rule in the rule group corresponding to the product type, match the rule execution context with the triggering condition of the detection rule, and if a target detection rule that meets the triggering condition is matched, execute the production line control action corresponding to the target detection rule.
[0006] According to the industrial defect detection method of this application, by having the main model handle coarse-grained identification of product defect categories and the auxiliary model handle fine-grained discrimination of subcategories under the categories, the random errors of single-model detection can be reduced and the accuracy of product defect classification can be improved through multi-model collaborative reasoning and voting fusion. Furthermore, based on the target classification results, the machine detection parameters corresponding to the image to be detected, and the product type, a rule execution context is constructed. By integrating the visual features of defect images with the physical attributes of product defects and product category features, a hierarchical rule engine architecture is designed. When a target detection rule that meets the trigger conditions is matched, the corresponding production line control action is executed, thereby improving the production efficiency of the production line.
[0007] According to one embodiment of this application, the plurality of main models include at least two heterogeneous major category hierarchical classification models, and the plurality of auxiliary models are divided into multiple groups of auxiliary models according to the major category hierarchy of the product defects, and each group of auxiliary models includes at least two heterogeneous minor category hierarchical classification models.
[0008] In this embodiment, by setting multiple master models as at least two heterogeneous major category hierarchical classification models, and dividing multiple auxiliary models into multiple groups of auxiliary models according to the major category hierarchy of product defects, with each group of auxiliary models including at least two heterogeneous minor category hierarchical classification models, multiple classification results can be obtained for both major category hierarchical identification tasks and minor classification tasks, thereby further improving the accuracy of product defect classification.
[0009] According to one embodiment of this application, determining the target classification result of product defects based on the first voting result and the second voting result includes: In the event of a tie in the second voting result, the classification result with the highest number of votes in the first voting result shall be determined as the target classification result; If no tie occurs in the second voting results, the classification result with the highest number of votes in the second voting results shall be determined as the target classification result.
[0010] In this embodiment, when the voting results of the auxiliary model result in a tie, the main model's category-level voting results are used for classification, reducing the risk of misjudgment caused by classification uncertainty in the case of a tie in the sub-categories; when the voting results of the auxiliary model result in no tie, the auxiliary model's voting results are used for classification, making full use of the auxiliary model's ability to identify sub-categories of defects, and further improving the accuracy of product defect classification.
[0011] According to one embodiment of this application, determining the target classification result of product defects based on the first voting result and the second voting result includes: If the first voting result is tied and the second voting result is tied, the classification results in the second voting result are mapped to the classification results of their respective major categories to obtain the third voting result; By merging the first voting result and the third voting result, the classification result with the highest number of votes in the merged voting result is determined as the target classification result.
[0012] In this embodiment, by mapping the classification results of each sub-category level in the second voting result to the major category level to obtain the third voting result, and then fusing the third voting result with the first voting result, the voting result of the auxiliary model can be mapped to the major category level when both the main model and the auxiliary model have a tie in voting. This allows the voting information of different classification levels to be fused and compared at the same level, further improving the accuracy of product defect classification.
[0013] According to one embodiment of this application, the fusion of the first voting result and the third voting result includes: The first voting result and the third voting result are weighted and summed; wherein the weight of the third voting result is higher than the weight of the first voting result.
[0014] In this embodiment, the auxiliary model is considered to be a classification at the fine classification level, and its classification accuracy is better than that of the main model. During the fusion process, the weight of the third voting result is set to be higher than that of the first voting result, so that the third voting result mapped to the major category level has a higher weight in the fusion decision, thereby improving the accuracy of product defect classification.
[0015] According to one embodiment of this application, the step of traversing each detection rule in the rule group corresponding to the product type, matching the rule execution context with the triggering condition of the detection rule, and if a target detection rule that meets the triggering condition is matched, executing the production line control action corresponding to the target detection rule includes: The detection rules within the rule group are traversed sequentially in descending order of preset priority. If a target detection rule that meets the triggering conditions is matched, the production line control action corresponding to the target detection rule is executed, and the traversal matching process is terminated.
[0016] In this embodiment, by traversing each detection rule in the rule group in descending order of preset priority, and executing the corresponding production line control action and terminating the traversal matching process when a target detection rule that meets the triggering conditions is matched, the production line control requirements corresponding to high-priority rules can be responded to first in the manner of short-circuit rules, and the traversal can be terminated after a successful match. This reduces the rule matching calculation overhead, shortens the time from defect detection to production line response, and further improves the production efficiency of the production line.
[0017] According to one embodiment of this application, the product includes a lithium battery separator, and the product type includes at least one of a base film, a coated film, and a sprayed film. The production line control actions include at least one of calibrating the defect level, determining the product's qualification, triggering the production line rejection mechanism, outputting a production line alarm signal, and outputting a production line shutdown command.
[0018] Secondly, this application provides an industrial defect detection device, comprising: The inference module is used to input the image to be detected into a multi-model inference cluster to obtain the defect classification results output by each model in the multi-model inference cluster; wherein, the multi-model inference cluster includes multiple main models and multiple auxiliary models, the main models are used to output the classification results at the product defect category level, and the auxiliary models are used to output the classification results at the sub-category level under the category level; The voting module is used to perform voting fusion on the classification results output by each of the main models to obtain a first voting result; and to perform voting fusion on the classification results output by each of the auxiliary models to obtain a second voting result. The determination module is used to determine the target classification result of the product defect based on the first voting result and the second voting result; The construction module is used to construct a rule execution context based on the target classification result, the machine detection parameters corresponding to the image to be detected, and the product type; the machine detection parameters are the physical attribute data of product defects collected by the product production line inspection equipment; The matching module is used to traverse each detection rule in the rule group corresponding to the product type, match the rule execution context with the triggering condition of the detection rule, and if a target detection rule that meets the triggering condition is matched, execute the production line control action corresponding to the target detection rule.
[0019] According to the industrial defect detection device of this application, by having the main model handle coarse-grained identification of product defect categories and the auxiliary model handle fine-grained discrimination of subcategories under the categories, the device reduces the random errors of single-model detection and improves the accuracy of product defect classification through multi-model collaborative reasoning and voting fusion. Furthermore, based on the target classification results, the machine detection parameters corresponding to the image to be detected, and the product type, a rule execution context is constructed. This integrates the visual features of defect images with the physical attributes of product defects and product category features, and designs a hierarchical rule engine architecture. When a target detection rule that meets the triggering conditions is matched, the corresponding production line control action is executed, thereby improving the production efficiency of the production line.
[0020] Thirdly, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the industrial defect detection method as described in the first aspect above.
[0021] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the industrial defect detection method as described in the first aspect above.
[0022] Fifthly, this application provides a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the industrial defect detection method as described in the first aspect above.
[0023] In a sixth aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the industrial defect detection method as described in the first aspect above.
[0024] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects: According to the industrial defect detection method of this application, by having the main model handle coarse-grained identification of product defect categories and the auxiliary model handle fine-grained discrimination of subcategories under the categories, the random errors of single-model detection can be reduced and the accuracy of product defect classification can be improved through multi-model collaborative reasoning and voting fusion. Furthermore, based on the target classification results, the machine detection parameters corresponding to the image to be detected, and the product type, a rule execution context is constructed. By integrating the visual features of defect images with the physical attributes of product defects and product category features, a hierarchical rule engine architecture is designed. When a target detection rule that meets the trigger conditions is matched, the corresponding production line control action is executed, thereby improving the production efficiency of the production line.
[0025] Furthermore, in some embodiments, by setting multiple master models as at least two heterogeneous major category hierarchical classification models, and dividing multiple auxiliary models into multiple groups of auxiliary models according to the major category hierarchy of product defects, with each group of auxiliary models including at least two heterogeneous minor category hierarchical classification models, multiple classification results can be obtained for both the major category hierarchical identification task and the minor classification task, thereby further improving the accuracy of product defect classification.
[0026] Furthermore, in some embodiments, when the voting results of the auxiliary model result in a tie, the main model's category-level voting results are used for classification, reducing the risk of misjudgment caused by classification uncertainty in the case of a tie in the sub-categories; when the voting results of the auxiliary model result in no tie, the auxiliary model's voting results are used for classification, making full use of the auxiliary model's ability to identify sub-categories of defects, and further improving the accuracy of product defect classification.
[0027] Furthermore, in some embodiments, by mapping the classification results of each sub-category level in the second voting result to the major category level to obtain the third voting result, and fusing the third voting result with the first voting result, it is possible to map the voting result of the auxiliary model to the major category level when both the main model and the auxiliary model have a tie in voting. This allows the voting information of different classification levels to be fused and compared at the same level, further improving the accuracy of product defect classification.
[0028] Furthermore, in some embodiments, the auxiliary model is considered to be for classification at the fine-level classification, with better classification accuracy than the main model. During the fusion process, the weight of the third voting result is set higher than that of the first voting result, so that the third voting result mapped to the major category level has a higher weight in the fusion decision, thereby improving the accuracy of product defect classification.
[0029] Furthermore, in some embodiments, by sequentially traversing each detection rule in the rule group according to a preset priority from high to low, and executing the corresponding production line control action and terminating the traversal and matching process when a target detection rule that meets the triggering conditions is matched, the production line control requirements corresponding to high-priority rules can be responded to first in the manner of short-circuiting rules, and the traversal can be terminated after a successful match. This reduces the rule matching calculation overhead, shortens the time from defect detection to production line response, and further improves the production efficiency of the production line.
[0030] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0031] The above and / or additional aspects and advantages of this application will become apparent and readily understood in conjunction with the following description of the embodiments in conjunction with the accompanying drawings, wherein: Figure 1 This is a schematic flowchart of the industrial defect detection method provided in the embodiments of this application; Figure 2 This is a schematic diagram of the structure of the industrial defect detection device provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0033] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0034] The industrial defect detection method, apparatus, electronic device, and storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0035] Among them, industrial defect detection methods can be applied to terminals, specifically executed by hardware or software within the terminal.
[0036] The terminal includes, but is not limited to, portable communication devices such as mobile phones or tablets with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).
[0037] The following embodiments describe a terminal including a display and a touch-sensitive surface. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
[0038] The industrial defect detection method provided in this application embodiment can be executed by an electronic device or a functional module or entity in an electronic device that can implement the industrial defect detection method. The electronic devices mentioned in this application embodiment include, but are not limited to, servers, industrial control computers, edge computing gateways, embedded processors, programmable logic controllers, Internet of Things gateways, personal computers, workstations, cloud computing nodes, distributed computing systems, mobile terminals, etc. The industrial defect detection method provided in this application embodiment is described below using an electronic device as the execution subject.
[0039] like Figure 1 As shown, the industrial defect detection method includes steps 110, 120, 130, 140 and 150.
[0040] Step 110: Input the image to be detected into the multi-model inference cluster to obtain the defect classification results output by each model in the multi-model inference cluster; wherein, the multi-model inference cluster includes multiple main models and multiple auxiliary models. The main models are used to output the classification results of the product defect category level, and the auxiliary models are used to output the classification results of the sub-categories under the category level.
[0041] In this embodiment, the image to be inspected is image data obtained by industrial product production line inspection equipment at the inspection station when acquiring images of the product. The product can be any industrial product requiring defect inspection, such as lithium battery separators, optical films, metal foils, semiconductor wafers, printed circuit boards, etc. This embodiment does not limit the specific type of product.
[0042] A multi-model inference cluster consists of multiple master models and multiple auxiliary models.
[0043] In industrial production scenarios, product defects can be categorized into several major types based on their macroscopic morphology or generation mechanism, such as scratches, black spots, holes, foreign objects, wrinkles, and color differences. The main model is used for coarse-grained identification of product defects at the major category level. It can perform global feature extraction and high-level semantic analysis on the input image to be detected, and output the major category to which the defect belongs.
[0044] Within each major category level, defects can be further subdivided into various specific defect subcategories. For example, the subcategories under the scratch category can include shallow scratches, deep scratches, continuous scratches, discontinuous scratches, horizontal scratches, and vertical scratches; the subcategories under the black spot category can include solid black spots and hollow black spots. An auxiliary model is used for fine-grained identification of product defects at the subcategories level within the major category level, and can output the classification results for each subcategorie level within the major category level. The auxiliary model is pre-trained for specific subcategories within a particular major category, enabling it to deeply explore the differences between subcategories and improve the accuracy of fine-grained classification.
[0045] In some embodiments, the models in a multi-model inference cluster can employ different neural network architectures. For example, the main model can use a deep convolutional neural network with a large number of parameters and strong feature extraction capabilities; the auxiliary models can use lightweight network structures optimized for specific defect types to improve inference efficiency and reduce the risk of overfitting to fine-grained classification tasks. Each model can be trained based on different training datasets, data augmentation strategies, or loss functions.
[0046] In one example, the image to be detected can be input into a multi-model inference cluster consisting of N main models and M auxiliary models. The N main models and M auxiliary models infer in parallel and output their respective classification results. For example, the major classification results output by each main model can be denoted as C1, C2, ..., CN, and the minor classification results output by each auxiliary model can be denoted as S1, S2, ..., SM.
[0047] Step 120: Perform voting fusion on the classification results output by each main model to obtain the first voting result; perform voting fusion on the classification results output by each auxiliary model to obtain the second voting result.
[0048] In this embodiment, a single model is susceptible to errors such as training sample bias, image noise interference, and high similarity of defect features, leading to random errors, misclassifications, and missed detections in the output classification results, resulting in low accuracy in industrial defect detection. Therefore, this embodiment employs a main model and an auxiliary model for collaborative reasoning and integrates the output results of multiple models through a voting fusion mechanism, thereby improving detection accuracy.
[0049] The first voting result represents the distribution of major categories output by each main model. Specifically, for each major category of defects output by the main model, the number of main models that voted for that category is counted, forming a mapping relationship between the major categories and the corresponding number of votes. For example, assuming that the outputs of the three main models to the image to be detected are "scratch", "scratch", and "black spot", the first voting result is represented as "scratch: 2 votes, black spot: 1 vote".
[0050] The second voting result represents the distribution of the subcategories output by each auxiliary model. Specifically, for each subcategorie output by each auxiliary model, the number of models that voted for that category is counted, forming a mapping relationship between the subcategories and the corresponding number of votes.
[0051] In some embodiments, voting fusion can also employ a weighted fusion method for statistical analysis. For example, different weight coefficients can be assigned to each model based on its classification accuracy on the historical validation set. When counting votes, the votes of each model are multiplied by the corresponding weight coefficient to form a weighted vote count. For instance, if a main model has an accuracy of 95%, the major category it outputs receives a weighted vote count of 0.95; if another main model has an accuracy of 85%, the major category it outputs receives a weighted vote count of 0.85. Through weighted statistics, the model with better classification performance has a greater influence in the voting results.
[0052] In some embodiments, the voting results can also incorporate the confidence information of each model. For example, for the classification result output by each model, the confidence score of the model for the classification category is recorded, and the confidence score is fused with the number of votes or weighted votes to form a multi-dimensional statistical result that includes category, number of votes (or weighted votes) and confidence information, thereby obtaining the voting result.
[0053] Step 130: Determine the target classification result of product defects based on the first voting result and the second voting result.
[0054] In this embodiment of the application, the target classification result is a defect classification result determined based on the first voting result and the second voting result.
[0055] In some embodiments, a simple majority vote strategy can be used to determine the target classification result. Specifically, for the first voting result, the category with the highest number of votes can be determined as the target category; for the second voting result, among the subcategories corresponding to the target category, the subcategory with the highest number of votes can be determined as the target subcategory. The target category and the target subcategory are combined to form the target classification result. For example, if the first voting result is "scratch: 2 votes, black dot: 1 vote", then the target category is "scratch"; if the subcategories under "scratch" in the second voting result are distributed as "horizontal scratch: 2 votes, vertical scratch: 1 vote", then the target subcategory is "horizontal scratch", and the target classification result is "scratch-horizontal scratch".
[0056] In some embodiments, if there is a conflict between the target sub-category determined based on the second voting result and the target major category determined based on the first voting result, that is, the target sub-category determined based on the second voting result does not belong to the target major category determined based on the first voting result, for example, the target sub-category "solid black dot" does not belong to the target major category "scratch", considering that the auxiliary model is used to perform fine-grained identification of product defects at the sub-category level under the major category level, and the identification accuracy of the auxiliary model is higher than that of the main model, the target sub-category determined based on the second voting result can be determined as the target classification result.
[0057] Step 140: Construct a rule execution context based on the target classification results, the machine detection parameters corresponding to the image to be detected, and the product type; the machine detection parameters are the physical attribute data of product defects collected by the product production line inspection equipment.
[0058] In this embodiment, the rule execution context is data used for subsequent rule matching and production line control decisions. The target classification results, the machine detection parameters corresponding to the image to be detected, and the product type can be structurally encapsulated to form a data object including a defect category field, a physical attribute field, and a product type field.
[0059] Among them, the machine detection parameters are the physical attribute data of product defects collected by the product line inspection equipment, including but not limited to indicators such as the area, length, width, position coordinates, grayscale value, and contrast of the defects, which can characterize the geometric features and optical properties of the defects. For example, for the target classification result "longitudinal scratch", the machine detection parameters can include information such as the specific length, width, and estimated depth of the scratch, which can provide information for determining whether the defect meets the production line interception standard.
[0060] The product type refers to the specific category information of the product to be tested. For example, if the product is a lithium battery separator, the product type can include base film, coated film, sprayed film, etc. Considering that the material characteristics, production processes, and quality standards of different product types may vary, adding the product type to the rule execution context enables differentiated testing strategies for different product categories.
[0061] Step 150: Traverse each detection rule in the rule group corresponding to the product type, match the rule execution context with the triggering condition of the detection rule, and if a target detection rule that meets the triggering condition is matched, execute the production line control action corresponding to the target detection rule.
[0062] In this embodiment, the rule engine adopts a hierarchical architecture design, pre-configuring corresponding rule groups for different product types. Each rule group includes multiple detection rules, and each detection rule defines the triggering conditions and corresponding production line control actions.
[0063] Before a product production line starts or when switching product types, the corresponding rule group can be loaded based on the currently produced product type. For example, for the "base film" product type, the base film rule group can be loaded; for the "coated film" product type, the coating film rule group can be loaded.
[0064] In this embodiment, the trigger condition portion of the detection rule defines the logical expression that must be satisfied for the rule to be triggered. This logical expression can be constructed based on fields in the rule execution context, including compound operations such as logical AND, logical OR, and logical NOT, as well as various comparison operations such as greater than, less than, equal to, and range inclusion. For example, the trigger condition can be set to "the target classification result is black dot and the defect area in the machine detection parameters is greater than 5mm". 2 The corresponding production line control action can be to mark defective products.
[0065] It can iterate through each detection rule in the rule group corresponding to the current product type and match the rule execution context with the triggering condition of each detection rule in turn.
[0066] In some embodiments, a sequential execution or priority sorting strategy can be adopted to match the triggering conditions of each detection rule in sequence. For example, when the logical expression of a detection rule evaluates to true, the triggering condition is determined to be met, and the detection rule is identified as the target detection rule. The production line control action corresponding to the target detection rule is then executed, terminating the traversal of subsequent rules, or the traversal continues to evaluate whether there is a higher priority matching rule.
[0067] Production line control actions are response operations performed after the triggering conditions in the target detection rules are triggered, including but not limited to marking defect levels, determining product qualification, triggering production line rejection mechanisms, outputting production line alarm signals, and outputting production line shutdown commands.
[0068] In this embodiment of the application, by setting rule groups, the rules can be dynamically updated. For example, when the production line process parameters are adjusted or the quality standards are changed, the detection rules can be added, deleted or modified through the rule configuration interface without modifying the program code. This decouples the business logic from the system code, thereby improving the flexibility of the production line detection strategy.
[0069] According to the industrial defect detection method of this application, by having the main model handle coarse-grained identification of product defect categories and the auxiliary model handle fine-grained discrimination of subcategories under the categories, the random errors of single-model detection can be reduced and the accuracy of product defect classification can be improved through multi-model collaborative reasoning and voting fusion. Furthermore, based on the target classification results, the machine detection parameters corresponding to the image to be detected, and the product type, a rule execution context is constructed. By integrating the visual features of defect images with the physical attributes of product defects and product category features, a hierarchical rule engine architecture is designed. When a target detection rule that meets the trigger conditions is matched, the corresponding production line control action is executed, thereby improving the production efficiency of the production line.
[0070] In some embodiments, the multiple master models include at least two heterogeneous major category hierarchical classification models, and the multiple auxiliary models are divided into multiple groups of auxiliary models according to the major category hierarchy of product defects. Each group of auxiliary models includes at least two heterogeneous minor category hierarchical classification models.
[0071] In this embodiment, a heterogeneous model refers to a model built using different neural network architectures, different feature extraction strategies, or different training configurations.
[0072] For example, multiple master models include those using ResNet series deep residual networks and those using the VisionTransformer architecture. Heterogeneous master models can perform hierarchical classification of input images from different representation spaces.
[0073] Multiple auxiliary models are divided into groups based on the major categories of product defects. Each group corresponds to a major defect category, and each group includes at least two heterogeneous sub-categorization models. For example, assuming the major defect categories are "scratches" and "black spots," the auxiliary models are divided into two groups: a scratch-type auxiliary model group and a black spot-type auxiliary model group. The scratch-type auxiliary model group includes at least two heterogeneous sub-categorization models, such as an auxiliary model using a lightweight convolutional network based on edge detection enhancement or an auxiliary model using a deep network based on texture analysis. This heterogeneous design of auxiliary models allows for sub-categorization from different feature dimensions within the same major defect category, thereby improving the accuracy of sub-categorization.
[0074] In this embodiment, by setting multiple master models as at least two heterogeneous major category hierarchical classification models, and dividing multiple auxiliary models into multiple groups of auxiliary models according to the major category hierarchy of product defects, with each group of auxiliary models including at least two heterogeneous minor category hierarchical classification models, multiple classification results can be obtained for both major category hierarchical identification tasks and minor classification tasks, thereby further improving the accuracy of product defect classification.
[0075] In some embodiments, determining the target classification result of the product defect based on the first voting result and the second voting result includes: In the event of a tie in the second vote, the classification result with the highest number of votes in the first vote will be determined as the target classification result; If no tie occurs in the second vote, the classification result with the highest number of votes in the second vote will be determined as the target classification result.
[0076] In this embodiment, considering that the main model performs coarse-grained identification of product defects at the broad category level, while the auxiliary model performs fine-grained identification of product defects at the detailed classification level, the auxiliary model is specifically optimized for detailed classification tasks and has higher accuracy in detailed classification. However, its generalization ability is poor in extreme anomaly or unknown defect scenarios, and it is prone to detailed classification errors. The main model, on the other hand, focuses on identifying broad category defects, exhibiting stronger generalization and robustness, thus compensating for the shortcomings of the auxiliary model. Therefore, this embodiment further improves the accuracy of product defect classification by using the second voting result as the priority decision criterion and the first voting result as the fallback decision criterion.
[0077] Specifically, the second voting result records the distribution of votes for each sub-category among the auxiliary models. When two or more sub-categories receive the same number of votes and all receive the highest number of votes in the second voting result, a tie is determined. For example, if the scratch category auxiliary model contains three heterogeneous models with outputs of "horizontal scratch," "vertical scratch," and "horizontal scratch," the second voting result would be "horizontal scratch: 2 votes, vertical scratch: 1 vote," indicating no tie. If there are four heterogeneous models with outputs of "horizontal scratch," "vertical scratch," "vertical scratch," and "horizontal scratch," the second voting result would be "horizontal scratch: 2 votes, vertical scratch: 2 votes," indicating a tie.
[0078] When the second vote results in a tie, it indicates significant uncertainty in the identification of each auxiliary model at the fine-grained classification level. Randomly selecting any of the tied subcategories as the target classification result could lead to a substantial risk of misclassification. Therefore, the classification result with the highest number of votes in the first vote should be determined as the target classification result.
[0079] For example, suppose the first voting result is "scratches: 2 votes, black dots: 1 vote", and the second voting result (scratches auxiliary model group) is "horizontal scratches: 2 votes, vertical scratches: 2 votes", resulting in a tie. In this case, the "scratches" with the highest number of votes in the first voting result can be determined as the target classification result.
[0080] If there is no tie in the second voting results, the classification result with the highest number of votes in the second voting results can be determined as the target classification result. For example, assuming the first voting result is "scratch: 2 votes, black dot: 1 vote", and the second voting result (scratch class auxiliary model group) is "horizontal scratch: 2 votes, vertical scratch: 1 vote", there is no tie. The "horizontal scratch" with the highest number of votes in the second voting results can be determined as the target classification result. The target classification result can include the major category information in the first voting result, such as the target classification result being "scratch-horizontal scratch"; the target classification result may also not include the major category information in the first voting result, such as the target classification result being "horizontal scratch".
[0081] In this embodiment, when the voting results of the auxiliary model result in a tie, the main model's category-level voting results are used for classification, reducing the risk of misjudgment caused by classification uncertainty in the case of a tie in the sub-categories; when the voting results of the auxiliary model result in no tie, the auxiliary model's voting results are used for classification, making full use of the auxiliary model's ability to identify sub-categories of defects, and further improving the accuracy of product defect classification.
[0082] In some embodiments, determining the target classification result of the product defect based on the first voting result and the second voting result includes: If the first and second voting results are tied, the classification results in the second voting results are mapped to the classification results of their respective major categories to obtain the third voting results; The first and third voting results are combined, and the classification result with the highest number of votes in the combined voting results is determined as the target classification result.
[0083] In this embodiment, when the first and second voting results are tied, the voting information of the sub-classification level can be mapped back to the major category level and fused with the voting information of the major category level, thereby improving the accuracy of the target classification result.
[0084] Specifically, the subcategories in the second voting results can be mapped to their respective major categories according to the category hierarchy. For example, "vertical scratches" and "horizontal scratches" belong to the major category "scratches", and "solid black dots" and "hollow black dots" belong to the major category "black dots".
[0085] The votes for each subcategory in the second voting result can be summed and mapped to the major category to form the third voting result. For example, if the first voting result is "scratch: 2 votes, black dot: 2 votes", the second voting result for the scratch-type auxiliary model is "horizontal scratch: 2 votes, vertical scratch: 2 votes", and after mapping to the major category level, the third voting result is represented as "scratch: 4 votes". If there are multiple auxiliary models, the second voting results of each auxiliary model group are mapped and summed separately. For example, if the second voting result for the black dot-type auxiliary model group is "solid black dot: 2 votes, hollow black dot: 1 vote", after mapping, it contributes "black dot: 3 votes", and the third voting result is "scratch: 4 votes, black dot: 3 votes".
[0086] In this embodiment, the first voting result and the third voting result can be merged. For example, the votes for the same major category in the first voting result and the third voting result can be added together by simple summation. Alternatively, a weighted summation method can be used to assign different fusion weights to the first voting result and the third voting result, and the votes for the same major category in the first voting result and the third voting result with the highest number of votes in the merged voting result can be determined as the target classification result.
[0087] In this embodiment, by mapping the classification results of each sub-category level in the second voting result to the major category level to obtain the third voting result, and then fusing the third voting result with the first voting result, the voting result of the auxiliary model can be mapped to the major category level when both the main model and the auxiliary model have a tie in voting. This allows the voting information of different classification levels to be fused and compared at the same level, further improving the accuracy of product defect classification.
[0088] In some embodiments, the merging of the first voting result and the third voting result includes: The first and third votes are weighted and summed; the third vote has a higher weight than the first vote.
[0089] In this embodiment, the auxiliary model is specifically optimized for fine-classification tasks, resulting in higher accuracy in fine-classification identification. However, it has poor generalization ability in extreme anomalies and unknown defect scenarios, making it prone to fine-classification errors. The main model, on the other hand, is designed for identifying broad-category defects, exhibiting stronger generalization and robustness. Therefore, in scenarios where the first and second voting results are tied, the third voting result has higher reference value than the first. The weight of the third voting result can be set higher than that of the first voting result; for example, the weight of the third voting result could be 0.7, and the weight of the first voting result 0.3.
[0090] In this embodiment, the auxiliary model is considered to be a classification at the fine classification level, and its classification accuracy is better than that of the main model. During the fusion process, the weight of the third voting result is set to be higher than that of the first voting result, so that the third voting result mapped to the major category level has a higher weight in the fusion decision, thereby improving the accuracy of product defect classification.
[0091] In some embodiments, each detection rule in the rule group corresponding to the product type is traversed, and the rule execution context is matched with the triggering condition of the detection rule. If a target detection rule that meets the triggering condition is matched, the production line control action corresponding to the target detection rule is executed, including: The detection rules within the rule group are traversed sequentially in descending order of preset priority. If a target detection rule that meets the triggering conditions is matched, the corresponding production line control action is executed, and the traversal matching process is terminated.
[0092] In this embodiment, priorities can be pre-set for each detection rule in the rule group. For example, priorities can be assigned based on the severity of the defect, with the highest priority given to detection rules related to defects affecting product safety performance, and lower priority given to detection rules related to defects involving appearance flaws but not affecting functionality. Alternatively, priorities can be assigned based on the impact range of production line control actions, with higher priority given to detection rules that trigger emergency shutdowns or automatic rejections, and lower priority given to detection rules that trigger marking records or early warning prompts. It should be noted that the priorities of each detection rule can be pre-set or adjusted according to the actual operation of the production line.
[0093] During the traversal, each detection rule in the rule group is read sequentially in descending order of preset priority. For the currently read detection rule, the rule execution context is matched with the triggering condition of the detection rule. If a target detection rule that meets the triggering condition is matched, the production line control action corresponding to the target detection rule is executed, and the traversal matching process is terminated. Other detection rules in the rule group with lower priority than the target detection rule are no longer evaluated.
[0094] Taking the product type as base film as an example, the rule group corresponding to base film includes the following detection rules sorted from highest to lowest priority: Rule A (Priority 1, highest): The target classification result is "black spot" and the defect area is greater than 10mm. 2 The corresponding production line control action is: output a production line stop command; Rule B (Priority 2): The target classification result is classified as "black spot" and the defect area is greater than 5mm. 2 The corresponding production line control action is: triggering the production line rejection mechanism; Rule C (Priority 3): If the target classification result is "scratches" and the scratch length is greater than 15mm, the corresponding production line control action is: output a production line alarm signal; Rule D (Priority 4, lowest): The target classification result is a scratch and the scratch length is less than 5mm. The corresponding production line control action is: determine that the product is qualified.
[0095] When the rule execution context is characterized as "Product type: base film; Target classification result: black dot; Defect area: 6mm", 2 According to the above priority order, rule A is traversed first. If the result is a mismatch, then rule B is traversed. If the match is successful, rule B is determined as the target detection rule, the production line control action corresponding to rule B is executed, and the traversal and matching process is terminated. Rules C and D are no longer traversed.
[0096] In this embodiment, by traversing each detection rule in the rule group in descending order of preset priority, and executing the corresponding production line control action and terminating the traversal matching process when a target detection rule that meets the triggering conditions is matched, the production line control requirements corresponding to high-priority rules can be responded to first in the manner of short-circuit rules, and the traversal can be terminated after a successful match. This reduces the rule matching calculation overhead, shortens the time from defect detection to production line response, and further improves the production efficiency of the production line.
[0097] The industrial defect detection method provided in this application can be executed by an industrial defect detection device. This application uses an industrial defect detection device executing the industrial defect detection method as an example to illustrate the industrial defect detection device provided in this application.
[0098] This application also provides an industrial defect detection device.
[0099] like Figure 2 As shown, the industrial defect detection device includes: The inference module 210 is used to input the image to be detected into the multi-model inference cluster and obtain the classification results of defects output by each model in the multi-model inference cluster. The multi-model inference cluster includes multiple main models and multiple auxiliary models. The main models are used to output the classification results at the product defect category level, and the auxiliary models are used to output the classification results at the sub-category level under the category level. The voting module 220 is used to perform voting fusion on the classification results output by each main model to obtain the first voting result; and to perform voting fusion on the classification results output by each auxiliary model to obtain the second voting result. The determination module 230 is used to determine the target classification result of the product defect based on the first voting result and the second voting result; Module 240 is used to construct a rule execution context based on the target classification result, the machine detection parameters corresponding to the image to be detected, and the product type; the machine detection parameters are the physical attribute data of product defects collected by the product production line inspection equipment. The matching module 250 is used to traverse each detection rule in the rule group corresponding to the product type, match the rule execution context with the triggering condition of the detection rule, and if a target detection rule that meets the triggering condition is matched, the production line control action corresponding to the target detection rule is executed.
[0100] According to the industrial defect detection device of this application, by having the main model handle coarse-grained identification of product defect categories and the auxiliary model handle fine-grained discrimination of subcategories under the categories, the device reduces the random errors of single-model detection and improves the accuracy of product defect classification through multi-model collaborative reasoning and voting fusion. Furthermore, based on the target classification results, the machine detection parameters corresponding to the image to be detected, and the product type, a rule execution context is constructed. This integrates the visual features of defect images with the physical attributes of product defects and product category features, and designs a hierarchical rule engine architecture. When a target detection rule that meets the triggering conditions is matched, the corresponding production line control action is executed, thereby improving the production efficiency of the production line.
[0101] In some embodiments, the determining module 230 is further configured to: In the event of a tie in the second vote, the classification result with the highest number of votes in the first vote will be determined as the target classification result; If no tie occurs in the second vote, the classification result with the highest number of votes in the second vote will be determined as the target classification result.
[0102] In some embodiments, the determining module 230 is further configured to: If the first and second voting results are tied, the classification results in the second voting results are mapped to the classification results of their respective major categories to obtain the third voting results; The first and third voting results are combined, and the classification result with the highest number of votes in the combined voting results is determined as the target classification result.
[0103] In some embodiments, the determining module 230 is further configured to: The first and third votes are weighted and summed; the third vote has a higher weight than the first vote.
[0104] In some embodiments, the matching module 250 is further configured to: The detection rules within the rule group are traversed sequentially in descending order of preset priority. If a target detection rule that meets the triggering conditions is matched, the corresponding production line control action is executed, and the traversal matching process is terminated.
[0105] The industrial defect detection device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific device.
[0106] In some embodiments, such as Figure 3 As shown, this application embodiment also provides an electronic device 300, including a processor 301, a memory 302, and a computer program stored in the memory 302 and executable on the processor 301. When the program is executed by the processor 301, it implements the various processes of the above-described industrial defect detection method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0107] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.
[0108] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described industrial defect detection method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0109] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0110] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described industrial defect detection method.
[0111] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0112] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described embodiments of the industrial defect detection method, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0113] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0114] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0115] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0116] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0117] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0118] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. An industrial defect detection method, characterized in that, include: The image to be detected is input into a multi-model inference cluster to obtain the defect classification results output by each model in the multi-model inference cluster; wherein, the multi-model inference cluster includes multiple main models and multiple auxiliary models, the main models are used to output the classification results at the product defect category level, and the auxiliary models are used to output the classification results at the sub-category level under the category level; The classification results output by each of the main models are fused by voting to obtain a first voting result; the classification results output by each of the auxiliary models are fused by voting to obtain a second voting result. The target classification result of product defects is determined based on the first voting result and the second voting result; A rule execution context is constructed based on the target classification result, the machine detection parameters corresponding to the image to be detected, and the product type; the machine detection parameters are the physical attribute data of product defects collected by the product production line inspection equipment. Iterate through each detection rule in the rule group corresponding to the product type, match the rule execution context with the triggering condition of the detection rule, and if a target detection rule that meets the triggering condition is matched, execute the production line control action corresponding to the target detection rule.
2. The method according to claim 1, characterized in that, The multiple main models include at least two heterogeneous major category hierarchical classification models, and the multiple auxiliary models are divided into multiple groups of auxiliary models according to the major category hierarchy of the product defects. Each group of auxiliary models includes at least two heterogeneous minor category hierarchical classification models.
3. The method according to claim 1, characterized in that, The determination of the target classification result of product defects based on the first voting result and the second voting result includes: In the event of a tie in the second voting result, the classification result with the highest number of votes in the first voting result shall be determined as the target classification result; If no tie occurs in the second voting results, the classification result with the highest number of votes in the second voting results shall be determined as the target classification result.
4. The method according to claim 1, characterized in that, The determination of the target classification result of product defects based on the first voting result and the second voting result includes: If the first voting result is tied and the second voting result is tied, the classification results in the second voting result are mapped to the classification results of their respective major categories to obtain the third voting result; By merging the first voting result and the third voting result, the classification result with the highest number of votes in the merged voting result is determined as the target classification result.
5. The method according to claim 4, characterized in that, The merging of the first voting result and the third voting result includes: The first voting result and the third voting result are weighted and summed; wherein the weight of the third voting result is higher than the weight of the first voting result.
6. The method according to claim 1, characterized in that, The process involves traversing each detection rule in the rule group corresponding to the product type, matching the rule execution context with the triggering conditions of the detection rule, and if a target detection rule that meets the triggering conditions is matched, executing the production line control action corresponding to the target detection rule, including: The detection rules within the rule group are traversed sequentially in descending order of preset priority. If a target detection rule that meets the triggering conditions is matched, the production line control action corresponding to the target detection rule is executed, and the traversal matching process is terminated.
7. The method according to claim 1, characterized in that, The product includes a lithium battery separator, and the product type includes at least one of base film, coated film, and sprayed film. The production line control actions include at least one of calibrating defect level, determining product qualification, triggering production line rejection mechanism, outputting production line alarm signal, and outputting production line shutdown command.
8. An industrial defect detection device, characterized in that, include: The inference module is used to input the image to be detected into a multi-model inference cluster to obtain the defect classification results output by each model in the multi-model inference cluster; wherein, the multi-model inference cluster includes multiple main models and multiple auxiliary models, the main models are used to output the classification results at the product defect category level, and the auxiliary models are used to output the classification results at the sub-category level under the category level; The voting module is used to perform voting fusion on the classification results output by each of the main models to obtain a first voting result; and to perform voting fusion on the classification results output by each of the auxiliary models to obtain a second voting result. The determination module is used to determine the target classification result of the product defect based on the first voting result and the second voting result; The construction module is used to construct a rule execution context based on the target classification result, the machine detection parameters corresponding to the image to be detected, and the product type; the machine detection parameters are the physical attribute data of product defects collected by the product production line inspection equipment; The matching module is used to traverse each detection rule in the rule group corresponding to the product type, match the rule execution context with the triggering condition of the detection rule, and if a target detection rule that meets the triggering condition is matched, execute the production line control action corresponding to the target detection rule.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.
