Method, system, device and storage medium for avoiding automatic optical detection of raw material defects
Through three-dimensional optical scanning and image-vector conversion technology, combined with the graph encoder and comparison learning principle of supervised training, the problem of low accuracy in raw material defect detection in the existing technology is solved, and the precise detection and management of raw material defects is achieved.
Patent Information
- Application Number
- CN202411289489.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-09-13
AI Technical Summary
The existing automatic optical detection system for raw material defects is difficult to fully capture the three-dimensional shape and complex surface characteristics of raw materials, resulting in low accuracy of defect detection.
Through the auxiliary motion platform, a comprehensive optical image set is constructed, and a graph encoder and defect detection module are used for precise identification and classification of defects using image-vector conversion technology, supervised training, combined with multi-layer adjacent samples and comparison learning principles.
Accurate detection of raw material defects is achieved, the accuracy and efficiency of detection is improved, and decision-making is avoided through automatic plans and defect detection orders are generated, achieving seamless connection between detection and management.
Smart Images

Figure CN119169329B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to fields related to automated detection, and in particular to methods, systems, equipment and storage media for avoiding automated optical detection of raw material defects. Background Art
[0002] In modern industrial production, quality control of raw materials is a key link in ensuring product quality. Timely detection and effective management of raw material defects are of great significance for improving production efficiency, reducing scrap rates, and enhancing product competitiveness. With the rapid development of computer vision and artificial intelligence technologies, automatic optical inspection technology (AOI) has gradually become an important means of raw material defect detection. However, traditional AOI systems are often limited to two-dimensional image analysis, which makes it difficult to fully capture the three-dimensional morphology and complex surface features of raw materials, resulting in limited accuracy in defect detection.
[0003] In the current related technologies, the automatic optical detection of raw material defects has a technical problem of low accuracy of defect detection. Summary of the invention
[0004] The present application provides a method, system, device and storage medium for automatic optical detection and avoidance of raw material defects, uses an auxiliary motion platform to perform three-dimensional optical scanning of the target raw materials, constructs a comprehensive optical image set, and converts the image data into vector form through image-to-vector conversion technology. Through supervised training of graph encoders and defect detection modules, combined with multi-layer adjacency samples and comparative learning principles, defects are accurately identified and classified. After defects are detected, avoidance decisions are automatically made, a defect detection order is generated, and raw material defect management is performed based on the avoidance plan, realizing seamless connection between detection and management, and other technical means, thereby achieving the technical effect of realizing accurate detection of raw material defects.
[0005] The present application provides a method for avoiding automatic optical detection of raw material defects, including:
[0006] The target raw material is subjected to three-dimensional optical scanning imaging by an auxiliary motion platform to determine an optical image set, wherein the optical image set is marked with a relative spatial position; image-to-vector conversion is used as the underlying logic to supervise the training of a graph encoder, and based on the graph encoder, vector conversion and multiple image fusion are performed on the optical image set to determine an image vector set; interactive optical defect records are performed, and multiple neighborhood aggregations are recursively performed based on a preset defect influence, and multi-layer adjacent samples are determined and a defect graph network is mined, and the contrast learning principle is introduced to supervise the training of a defect detection module; the image vector set is traversed, and defect contrast detection and plan avoidance decision-making are performed in combination with the defect detection module to determine a defect detection list; the defect detection list is displayed on a terminal, and raw material defect management is performed based on an avoidance plan.
[0007] In a possible implementation, after determining the optical image set, the following processing is performed:
[0008] The optical image set is traversed, and contrast enhancement regions are identified and marked based on a preset contrast, wherein each contrast enhancement region is marked with a contrast enhancement coefficient; the contrast enhancement region is processed based on the contrast enhancement coefficient to determine a contrast processing region; and the contrast processing region is replaced for the optical image set.
[0009] In a possible implementation, the determining of the image vector set performs the following processing:
[0010] Performing vector conversion on the optical image set to determine an initial image vector, wherein the optical image set includes multi-view overlapping images at the same position; traversing the initial image vectors, clustering them at the same position, and dividing them into single image vector clusters and multi-cluster overlapping image vectors; traversing the multi-cluster overlapping image vectors to perform intra-cluster fusion, combining the single image vector cluster, and integrating to determine the image vector set.
[0011] In a possible implementation, the determining of multi-layer adjacent samples performs the following processing:
[0012] Taking the preset defect influence as a reference, determine the first defect influence, traverse the optical defect record, and determine the first-order sample; taking the first defect influence as a reference, superimpose the preset defect influence, determine the second defect influence, traverse the optical defect record, and determine the second-order sample; superimpose the preset defect influence to determine the Nth defect influence, and determine the N-order sample based on the optical defect record; perform positive serialization integration of the first-order sample, the second-order sample, and the N-order sample by neighborhood recursion to determine the multi-layer adjacent samples, wherein the positive serialization is from high defect influence to low defect influence, and the multi-layer adjacent samples are marked with a learning rate, and the learning rate is positively correlated with the defect influence.
[0013] In a possible implementation, the mining defect graph network performs the following processing:
[0014] The multi-layer adjacency samples are traversed, and samples are screened layer by layer based on a preset frequency to determine multi-layer adjacency optimization samples; the multi-layer adjacency optimization samples are traversed, defect features are extracted and vector conversion is performed to determine the defect graph network, wherein the defect graph network is consistent with the multi-layer adjacency optimization sample structure; the weight distribution is determined based on the learning rate, and the defect graph network is labeled.
[0015] In a possible implementation, the contrastive learning principle is introduced to supervise the training of the defect detection module and perform the following processing:
[0016] Based on the multi-layer adjacent samples and mining the mapping relationship of the defect graph network, a positive sample set and a negative sample set are determined, wherein the positive sample is a contrast matching defect class, and the negative sample is a contrast non-matching defect class; polarization processing is performed on the positive sample set and the negative sample set, wherein the polarization processing includes maximization of the positive sample set and minimization of the negative sample set, and the maximization method is maximization of the cosine distance; the contrastive learning principle is introduced, and supervised training is performed based on the positive sample set and the negative sample set after polarization processing.
[0017] In a possible implementation, the defect detection module is combined to perform defect comparison detection and plan avoidance decision, determine the defect detection list, and perform the following processing:
[0018] The defect detection module includes a rule layer and a solution layer; through comparison and matching, defect detection based on the image vector set is performed based on the rule layer to determine a single detection sequence; in combination with the weight distribution, the single detection sequence is traversed and weighted calculation is performed to determine the overall quality coefficient; the single detection sequence is traversed, and based on the weight distribution, a plan avoidance decision is made in combination with the solution layer to determine the avoidance plan; the single detection sequence, the overall quality coefficient and the avoidance plan are integrated to determine the defect detection order.
[0019] The present application also provides a raw material defect automatic optical detection and avoidance system, comprising:
[0020] A three-dimensional optical scanning module, the three-dimensional optical scanning module is used to perform three-dimensional optical scanning imaging of the target raw material through an auxiliary motion platform to determine an optical image set, wherein the optical image set is marked with a relative spatial position; an image vector set determination module, the image vector set determination module is used to supervise the training of a graph encoder with image-vector conversion as the underlying logic, and based on the graph encoder, the optical image set is vector converted and multiple images are fused to determine the image vector set; a defect detection model training module, the defect detection model training module is used for interactive optical defect records, recursively performs multiple neighborhood aggregations based on a preset defect influence, determines multi-layer adjacent samples and mines a defect graph network, introduces the contrast learning principle, and supervises the training of the defect detection module; a defect detection list determination module, the defect detection list determination module is used to traverse the image vector set, and perform defect contrast detection and plan avoidance decision-making in combination with the defect detection module to determine the defect detection list; a raw material defect management module, the raw material defect management module is used to display the defect detection list on the terminal and manage raw material defects based on the avoidance plan.
[0021] The present application also provides an electronic device, including:
[0022] A memory for storing executable instructions;
[0023] The processor is used to implement a method for avoiding automatic optical detection of raw material defects when executing executable instructions stored in the memory.
[0024] The present application also provides a computer-readable storage medium, comprising:
[0025] A computer program is stored thereon, and when the program is executed by a processor, a method for avoiding automatic optical detection of raw material defects is implemented.
[0026] The method, system, device and storage medium for automatic optical detection and avoidance of raw material defects proposed in this application first perform three-dimensional optical scanning imaging of the target raw material through an auxiliary motion platform to determine an optical image set, wherein the optical image set is marked with a relative spatial position, and then use image-to-vector conversion as the underlying logic to supervise the training of a graph encoder. Based on the graph encoder, the optical image set is vector converted and multiple images are fused to determine the image vector set, and then interactive optical defect records are recorded, and multiple neighborhood aggregations are recursively performed based on the preset defect influence degree to determine multi-layer adjacent samples and mine the defect graph network. The contrast learning principle is introduced to supervise the training of a defect detection module, and then the image vector set is traversed, and defect contrast detection and plan avoidance decision-making are performed in combination with the defect detection module to determine a defect detection list. Finally, the defect detection list is displayed on the terminal, and raw material defect management is performed based on the avoidance plan, thereby achieving the technical effect of accurately detecting raw material defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the accompanying drawings of the embodiment of the present invention will be briefly introduced below. A flow chart is used in the present application to illustrate the operations performed by the system according to the embodiment of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps can be processed in reverse order or simultaneously as needed. At the same time, other operations can also be added to these processes, or one or more operations can be removed from these processes.
[0028] Figure 1 A schematic flow chart of a method for avoiding automatic optical detection of raw material defects provided in an embodiment of the present application.
[0029] Figure 2 A schematic diagram of the structure of the system for automatic optical detection and avoidance of raw material defects provided in an embodiment of the present application.
[0030] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0031] Explanation of the accompanying drawings: three-dimensional optical scanning module 10, image vector set determination module 20, defect detection model training module 30, defect detection order determination module 40, raw material defect management module 50. DETAILED DESCRIPTION
[0032] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below.
[0033] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0034] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict, and the terms "first\second" involved are merely to distinguish similar objects and do not represent a specific ordering of objects. The terms "including" and "having" and any variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products, or devices. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of this application. The terms used herein are for the purpose of describing the embodiments of the present application only.
[0035] The present application embodiment provides a method for avoiding automatic optical detection of raw material defects, such as Figure 1 As shown, the method includes:
[0036] Step S100, three-dimensional optical scanning and imaging of the target raw material is performed through the auxiliary motion platform to determine an optical image set, wherein the optical image set is marked with a relative spatial position. Specifically, the auxiliary motion platform refers to a mechanical device that can be automatically or manually controlled to perform precise movements (such as translation, rotation, etc.), which is used to carry and move the optical scanning head to perform multi-angle scanning on the target raw material. The target raw material is subjected to a full range of three-dimensional optical scanning through the auxiliary motion platform. The three-dimensional optical scanning is a process of non-contact scanning of the surface of an object using optical principles and technologies, and obtaining its three-dimensional shape and texture information. The three-dimensional morphological information of the raw material surface is captured by a high-precision optical sensor, and a series of images containing spatial position information are generated. These images are combined to form an optical image set, which is a set of optical images containing multiple viewing angles and angles of the target raw material surface, and each image carries its spatial position information relative to the whole.
[0037] In a possible implementation, after the optical image set is determined, step S100 further includes step S110, traversing the optical image set, identifying and marking contrast enhancement areas based on a preset contrast, wherein each contrast enhancement area is marked with a contrast enhancement coefficient. Specifically, the entire optical image set is traversed, and a pixel-by-pixel contrast analysis is performed on each image. Based on a preset contrast threshold (i.e., a preset contrast), areas with a contrast lower than the threshold are identified, and these areas are considered to be low-contrast areas, i.e., these areas are visually blurred or difficult to identify. For the purpose of enhancing low-contrast areas, a contrast enhancement coefficient is calculated. For each low-contrast area, a contrast enhancement coefficient is calculated based on the difference between its current contrast and the preset threshold, and the coefficient is used to guide the subsequent contrast enhancement processing to ensure that the degree and direction of enhancement (such as positive enhancement) are appropriate. Step S120, based on the contrast enhancement coefficient as a standard, the contrast enhancement area is processed to determine the contrast processing area. Specifically, by adjusting parameters such as brightness, contrast, and saturation, the low-contrast area is enhanced to improve its contrast, so that it is visually clearer. These enhanced regions are called contrast-processed regions. Step S130, for the optical image set, the contrast-processed regions are replaced. Specifically, the original, difficult-to-identify low-contrast regions in the optical image set are replaced with contrast-enhanced contrast-processed regions, so as to facilitate efficient and accurate feature recognition and defect detection, especially for the recognition of detail regions such as boundaries. This implementation method improves the quality of the optical image set by optimizing the contrast of the optical image set, making subsequent image analysis and processing more accurate and efficient.
[0038] Step S200, with image-to-vector conversion as the underlying logic, supervise the training of the graph encoder, based on the graph encoder, perform vector conversion and multiple image fusion on the optical image set to determine the image vector set. Specifically, the image-to-vector conversion refers to the process of converting image data into a numerical vector, and the graph encoder is a neural network model that can learn complex features in an image and encode them into vectors. Using the supervised trained graph encoder as the underlying logic, each image in the optical image set is converted into a vector form, and these vectors are used to capture key feature information in the image. Next, vector conversion is performed on multi-view overlapping images of the same position, and through a multiple image fusion method (such as feature splicing), the vectors from different viewpoints are fused into a comprehensive image vector to fully describe the features of the position. Finally, the image vectors after vector conversion and multiple image fusion are collected to form an image vector set.
[0039] In a possible implementation, the step of determining the image vector set, step S200 further includes step S210, performing vector conversion on the optical image set to determine the initial image vector, wherein the optical image set includes multiple perspective overlapping images at the same position. Specifically, through image feature extraction and encoding, each image in the optical image set is vector converted, and the pixel data of the image is converted into a feature vector. These feature vectors capture key information in the image, such as texture, color, shape, etc., and ignore unimportant details. In this way, each image in the optical image set is converted into an initial image vector. The optical image set includes a collection of overlapping images from multiple perspectives, which are taken at the same position but at different angles or lighting conditions. Step S220, traverse the initial image vectors, cluster them at the same position, and divide them into single image vector clusters and multiple clusters of overlapping image vectors. Specifically, traverse all initial image vectors and cluster them according to the spatial position information of the images they represent. Since the optical image set contains multi-perspective overlapping images at the same location, the system can identify which vectors come from images at the same location, and divide these initial image vectors into two categories through clustering: single image vector clusters (containing only vectors from a single image) and multi-cluster overlapping image vectors (containing vectors from overlapping images from multiple perspectives). Step S230, traverse the multi-cluster overlapping image vectors to perform intra-cluster fusion, combine the single image vector clusters, and integrate and determine the image vector set. Specifically, traverse all multi-cluster overlapping image vectors, and fuse the vectors in each cluster. The fusion method is to calculate the average value of the vectors to generate a comprehensive vector that can represent the multi-perspective image features of the location. Then, these comprehensive vectors are integrated with the vectors in the single image vector cluster to form a complete image vector set. This implementation method integrates image information from different perspectives and removes redundant information through the fusion of multi-cluster overlapping image vectors, providing a more comprehensive scene description.
[0040] Step S300, interactive optical defect records, recursively perform multiple neighborhood aggregations based on the preset defect influence, determine multiple layers of adjacent samples and mine the defect graph network, introduce the contrastive learning principle, and supervise the training of the defect detection module. Specifically, collect known optical defect information in an interactive manner to form an optical defect record. Based on the preset defect influence, multiple neighborhood aggregations are performed in a recursive manner. The defect influence is an indicator of the degree of influence of the defect on the quality or performance of the target raw material, that is, according to the severity and scope of influence of the defect, the search range is gradually expanded to determine the multiple layers of adjacent samples related to the defect. The structural relationship between these adjacent samples is mined to form a defect graph network. The defect graph network is a graph structure network that describes the relationship between the defect and its adjacent samples, which is used to reveal the complexity and diversity of the defect. Finally, the contrastive learning principle is introduced, and the defect detection module is supervised and trained using positive and negative samples so that it can accurately identify defects.
[0041] In a possible implementation, the step S300 of determining multiple layers of adjacent samples further includes a step S310, determining a first defect influence degree based on the preset defect influence degree, traversing the optical defect record, and determining a first-order sample. Specifically, a preset defect influence degree is set as a starting value, and twice the preset defect influence degree is determined as the first defect influence degree, traversing all recorded optical defect data, and screening out samples whose defect influence degrees are between the preset defect influence degree and the first defect influence degree as first-order samples. Step S320, based on the first defect influence degree as a reference, superimposing the preset defect influence degree, determining a second defect influence degree, traversing the optical defect record, and determining a second-order sample. Specifically, on the basis of the first defect influence degree, superimposing the preset defect influence degree, a second defect influence degree is obtained. Traverse the optical defect data again, and screen out samples whose defect influence degrees are between the first defect influence degree and the second defect influence degree as second-order samples. Step S330, superimpose the preset defect influence to determine the Nth defect influence, and determine the Nth order sample based on the optical defect record. Specifically, repeat the above process of increasing the defect influence and screening samples, each time increasing the preset defect influence increment until all defect influence levels that need to be analyzed are covered. According to the defect influence obtained by the last increment, the corresponding Nth order sample is screened out. Step S340, perform positive serialization integration of the first-order samples, the second-order samples, and the Nth order samples by neighborhood recursion to determine the multi-layer adjacent samples, wherein the positive serialization is from high defect influence to low defect influence, and the multi-layer adjacent samples are marked with a learning rate, and the learning rate is positively correlated with the defect influence. Specifically, the first-order samples, the second-order samples, and the Nth order samples are sorted in order from high to low defect influence to form a positively serialized multi-layer adjacent sample set. The learning rate is marked for each level of sample set, and the learning rate is positively correlated with the defect impact, that is, samples with high defect impact are given higher weights during the training process. This implementation method sets different learning rates for samples at different levels, which can make the model pay more attention to defects that have a greater impact on the quality of the target raw materials, thereby improving learning efficiency and effect, and improving the prediction accuracy and robustness of the model.
[0042] In a possible implementation, the defect graph network mining step S300 further includes step S350, traversing the multi-layer adjacent samples, using the preset frequency as a constraint, screening samples one by one in the adjacent layer, and determining the multi-layer adjacent optimized samples. Specifically, starting from the lowest-order sample layer, traverse the multi-layer adjacent samples layer by layer. Set a preset frequency constraint, which is the threshold of the number of times the sample appears in the layer. According to the preset frequency constraint, screen each layer, remove those adjacent layers that do not meet the frequency requirements, until all adjacent layers are traversed, and finally obtain a multi-layer adjacent optimized sample set. Step S360, traverse the multi-layer adjacent optimized samples, extract defect features and perform vector conversion, and determine the defect graph network, wherein the defect graph network is consistent with the multi-layer adjacent optimized sample structure. Specifically, traverse each sample in the multi-layer adjacent optimized samples in turn. Perform feature extraction on each sample, and convert the extracted defect features into vector form. According to the structure of multi-layer adjacency optimization samples (i.e., the adjacency relationship between each layer) and the vector representation of each sample, a defect graph network is constructed. The nodes in the network correspond to samples, and the edges represent the adjacency relationship between samples. Step S370, determine the weight distribution based on the learning rate, and identify the defect graph network. Specifically, according to the learning rate of each layer sample identification, obtain the learning rate value corresponding to each layer. Based on the learning rate value, assign weights to each layer in the defect graph network. Layers with higher learning rates obtain higher weights. Identify the weight information on the defect graph network. This implementation method screens samples by presetting frequency constraints, removes outlier samples, and retains more representative samples. By converting defect features into vector form and constructing a defect graph network based on the structure of multi-layer adjacency samples, the originally scattered data is organized into a structured form, so that the model can more accurately capture the characteristics and laws of defects, thereby improving the prediction accuracy and robustness of the model.
[0043] In a possible implementation, the contrastive learning principle is introduced to supervise the training of the defect detection module, and step S300 further includes step S380, based on the multi-layer adjacent samples and mining the mapping relationship of the defect graph network, determining the positive sample set and the negative sample set, wherein the positive sample is a contrast matching defect class, and the negative sample is a contrast non-matching defect class. Specifically, based on the multi-layer adjacent samples and the constructed defect graph network, the similarities and differences between the samples are analyzed, and the mapping relationship between the samples in the defect graph network is mined. According to the mapping relationship, samples with similar defect features and belonging to the same category are classified as positive sample sets (contrast matching defect classes) for positive example matching in contrastive learning, and samples with different defect features or not belonging to the category are classified as negative sample sets (contrast non-matching defect classes) for counter-example matching in contrastive learning. Step S390, polarization processing is performed on the positive sample set and the negative sample set, wherein the polarization processing includes maximization of the positive sample set and minimization of the negative sample set, and the maximization method is maximization of the cosine distance. Specifically, by maximizing the cosine similarity between positive samples, the samples in the positive sample set are more clustered in the feature space, and the similarity within them is increased, that is, the similarity between positive samples is maximized. Similarly, by reducing the cosine similarity between negative samples and positive samples, the samples in the negative sample set are more dispersed in the feature space, and the difference between them and the positive sample set is increased, that is, the similarity between negative samples and positive samples is minimized. Step S3100, introduces the contrastive learning principle, and performs supervised training based on the positive sample set after polarization processing and the negative sample set. Specifically, based on the positive sample set and the negative sample set after polarization processing, a contrastive learning framework is constructed, which includes two main parts: one is the similarity measurement between positive samples, which is used to shorten the distance between positive samples; the other is the difference measurement between negative samples and positive samples, which is used to increase the distance between negative samples and positive samples. Under the contrastive learning framework, the positive sample set and the negative sample set are used to perform supervised training on the defect detection module. During the training process, the model parameters are adjusted through the optimization algorithm so that the model can accurately distinguish between positive and negative samples, that is, it can accurately identify the sample categories with similar defect characteristics. This implementation method builds a contrastive learning framework and introduces polarized sample sets for training, making the training process more efficient and targeted, and improving the accuracy of detection.
[0044] Step S400, traverse the image vector set, combine the defect detection module to perform defect comparison detection and plan avoidance decision, and determine the defect detection list. Specifically, traverse the image vector set, and use the trained defect detection module to perform defect comparison detection on each image vector. Through comparison and matching, defects that match the known defect features are identified, and decisions are made based on the severity and impact range of the defects, combined with the preset avoidance plan, and corresponding treatment measures or suggestions are generated to reduce the impact of defects on production quality and efficiency. Finally, a defect detection list containing defect detection information and avoidance plans is generated.
[0045] In a possible implementation, the defect detection module is combined with defect comparison detection and plan avoidance decision-making to determine the defect detection list. Step S400 further includes step S410, and the defect detection module includes a rule layer and a solution layer. Specifically, the rule layer defines the basic rules and logic of defect detection, including defect recognition standards, threshold settings, etc. The rule layer is the core of defect detection and determines which features or patterns are considered defects. The solution layer is used to provide a series of processing solutions or plans for different defect types based on the detection results of the rule layer, including repair suggestions, production process adjustments, etc., aiming to reduce the occurrence of defects or mitigate the impact of defects. Step S420, through comparison and matching, based on the rule layer, defect detection based on the image vector set is performed to determine a single detection sequence. Specifically, the image vector set is compared with the defect features defined in the rule layer to find images that meet the defect features. According to the comparison results, the defect position in the image is marked, and a single detection sequence containing all detected defects is generated. Step S430, in combination with the weight distribution, traverse the single detection sequence and perform weighted calculation to determine the overall quality coefficient. Specifically, traverse the single detection sequence, and calculate an overall quality coefficient based on the weight and quantity of each defect, which reflects the overall quality level of the target raw material. Step S440, traverse the single detection sequence, make a plan avoidance decision based on the weight distribution and in combination with the solution layer, and determine the avoidance plan. Specifically, analyze each defect in the single detection sequence, and select the most appropriate plan for avoidance or processing based on the type, location, severity and weight distribution of the defect, combined with the plan provided in the solution layer. Step S450, integrate the single detection sequence, the overall quality coefficient and the avoidance plan to determine the defect detection order. Specifically, the single detection sequence, the overall quality coefficient and the avoidance plan are integrated together to form a complete defect detection list, that is, the defect detection list is a detailed report containing the defect detection results of the target raw material, including the specific information of the defect, the overall quality assessment of the target raw material and the recommended avoidance plan. This implementation method realizes accurate detection and effective response to defects by combining the rule layer and the solution layer. Among them, the rule layer ensures the accuracy and reliability of defect detection, and the solution layer provides targeted processing suggestions to help reduce the occurrence and impact of defects. By traversing the single detection sequence and performing weighted calculations, the overall quality coefficient of the product is determined, providing a quantitative indicator for product quality assessment. Finally, all information is integrated to generate a defect detection list, which provides strong support for subsequent production improvements, helps to improve the quality control level of target raw materials and reduce the defect rate.
[0046] Step S500, the defect detection list is displayed on the terminal, and the raw material defect management is performed based on the avoidance plan. Specifically, the defect detection list is displayed on the terminal device, which can be a computer screen, a mobile device screen, etc., so that the production personnel or management personnel can be aware of the defect situation of the target raw material in a timely manner. At the same time, the raw material defects are managed based on the avoidance plan, including but not limited to the classification and processing of defective raw materials, tracing and tracing, and improving the production process. The embodiment of the present application adopts the use of an auxiliary motion platform to perform three-dimensional optical scanning of the target raw material, construct a comprehensive optical image set, and convert the image data into a vector form through the image-vector conversion technology. Through the supervised training of the graph encoder and the defect detection module, combined with the multi-layer adjacent samples and the contrast learning principle, the defects are accurately identified and classified. After the defects are detected, the plan avoidance decision is automatically made, the defect detection list is generated, and the raw material defect management is performed based on the avoidance plan, and the seamless connection of detection and management and other technical means are realized, and the technical effect of realizing the accurate detection of raw material defects is achieved.
[0047] In the above, refer to Figure 1 The method for avoiding the automatic optical detection of raw material defects according to an embodiment of the present invention is described in detail. Figure 2 A system for avoiding automatic optical detection of raw material defects according to an embodiment of the present invention is described.
[0048] The system for avoiding the automatic optical detection of raw material defects according to the embodiment of the present invention is used to solve the technical problem of low accuracy of defect detection in the existing automatic optical detection of raw material defects, and achieve the technical effect of accurately detecting raw material defects. The system for avoiding the automatic optical detection of raw material defects includes: a three-dimensional optical scanning module 10, an image vector set determination module 20, a defect detection model training module 30, a defect detection list determination module 40, and a raw material defect management module 50.
[0049] The three-dimensional optical scanning module 10 is used to perform three-dimensional optical scanning imaging of the target raw material through an auxiliary motion platform to determine an optical image set, wherein the optical image set is marked with a relative spatial position; the image vector set determination module 20 is used to supervise the training of a graph encoder with image-vector conversion as the underlying logic, and based on the graph encoder, the optical image set is vector converted and multiple images are fused to determine the image vector set; the defect detection model training module 30 is used for interactive optical defect records, recursively performs multiple neighborhood aggregations based on a preset defect influence, determines multi-layer adjacent samples and mines a defect graph network, introduces the contrast learning principle, and supervises the training of the defect detection module; the defect detection list determination module 40 is used to traverse the image vector set, and perform defect contrast detection and plan avoidance decision-making in combination with the defect detection module to determine the defect detection list; the raw material defect management module 50 is used to display the defect detection list on the terminal and manage raw material defects based on the avoidance plan.
[0050] The specific configuration of the three-dimensional optical scanning module 10 will be described in detail below. As described above, after determining the optical image set, the three-dimensional optical scanning module 10 may further include: a contrast enhancement region identification unit for traversing the optical image set, identifying and marking contrast enhancement regions based on a preset contrast, wherein each contrast enhancement region is marked with a contrast enhancement coefficient; a contrast processing region determination unit for processing the contrast enhancement region based on the contrast enhancement coefficient as a standard to determine the contrast processing region; and a region replacement unit for replacing the contrast processing region for the optical image set.
[0051] The specific configuration of the image vector set determination module 20 will be described in detail below. As described above, to determine the image vector set, the image vector set determination module 20 may further include: a vector conversion unit for performing vector conversion on the optical image set to determine the initial image vector, wherein the optical image set includes multi-view overlapping images at the same position; a clustering unit for traversing the initial image vector, clustering at the same position, and dividing the image vector into a single image cluster and multiple overlapping image clusters; an integration unit for traversing the multiple overlapping image clusters to perform intra-cluster fusion, combining the single image vector cluster, and integrating to determine the image vector set.
[0052] The specific configuration of the defect detection model training module 30 will be described in detail below. As described above, to determine multiple layers of adjacent samples, the defect detection model training module 30 may further include: a first-order sample determination unit for determining a first defect influence degree based on the preset defect influence degree, traversing the optical defect record, and determining a first-order sample; a second-order sample determination unit for determining a second defect influence degree based on the first defect influence degree, superimposing the preset defect influence degree, traversing the optical defect record, and determining a second-order sample; an N-order sample determination unit for determining an Nth defect influence degree by superimposing the preset defect influence degree, and determining an N-order sample based on the optical defect record; a multi-layer adjacent sample determination unit for performing positive serialization integration of the first-order sample, the second-order sample, and the N-order sample by neighborhood recursion to determine the multi-layer adjacent samples, wherein the positive serialization is from high defect influence degree to low defect influence degree, and the multi-layer adjacent samples are marked with a learning rate, and the learning rate is positively correlated with the defect influence degree.
[0053] Among them, the defect graph network mining and defect detection model training module 30 may further include: a sample screening unit for traversing the multi-layer adjacency samples, taking a preset frequency as a constraint, performing sample screening on an adjacent layer basis, and determining multi-layer adjacency optimized samples; a defect graph network determination unit for traversing the multi-layer adjacency optimized samples, extracting defect features and performing vector conversion, and determining the defect graph network, wherein the defect graph network is consistent with the multi-layer adjacency optimized sample structure; an identification unit for determining a weight distribution based on the learning rate and identifying the defect graph network.
[0054] Among them, the introduction of contrastive learning principle, supervised training of defect detection module, defect detection model training module 30 can further include: a positive and negative sample set determination unit is used to determine the positive sample set and the negative sample set based on the multi-layer adjacent samples and mining the mapping relationship of the defect graph network, wherein the positive sample is a contrast matching defect class, and the negative sample is a contrast non-matching defect class; a polarization processing unit is used to perform polarization processing on the positive sample set and the negative sample set, wherein the polarization processing includes maximizing the positive sample set and minimizing the negative sample set, and the maximization method is maximizing the cosine distance; a supervised training unit is used to introduce the contrastive learning principle, and perform supervised training based on the positive sample set and the negative sample set after polarization processing.
[0055] The specific configuration of the defect detection list determination module 40 will be described in detail below. As described above, the defect detection comparison detection and plan avoidance decision are performed in combination with the defect detection module to determine the defect detection list. The defect detection list determination module 40 may further include: a defect detection unit is used for the defect detection module to include a rule layer and a solution layer, and through comparison and matching, the defect detection based on the image vector set is performed based on the rule layer to determine the single detection sequence; the assembly quality coefficient determination unit is used to combine the weight distribution, traverse the single detection sequence and perform weighted calculation to determine the assembly quality coefficient; the plan avoidance decision unit is used to traverse the single detection sequence, based on the weight distribution, combine the solution layer to make a plan avoidance decision, and determine the avoidance plan; the defect detection list determination unit is used to integrate the single detection sequence, the assembly quality coefficient and the avoidance plan to determine the defect detection list.
[0056] The system for avoiding automatic optical detection of raw material defects provided in the embodiment of the present invention can execute the method for avoiding automatic optical detection of raw material defects provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0057] Although the present application makes various references to certain modules in the system according to the embodiments of the present application, any number of different modules may be used and run on the user terminal and / or server, and the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0058] Based on the foregoing embodiments, the embodiments of the present application further provide an electronic device and a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of the electronic device, it can implement the method described in any of the foregoing embodiments.
[0059] Figure 3 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, showing a block diagram of an exemplary electronic device suitable for implementing an implementation of the present invention. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention. The electronic device is in the form of a general computing device, and its components may include but are not limited to an input device 301, a processor 302, a memory 303, and an output device 304. Among them, the processor 302 may be one or more; the memory 303 may include a computer-readable medium and at least one program product, and the program product has a set (at least one) of program modules, which are configured to perform the functions of each embodiment of the present application.
[0060] The memory 303 shown in the embodiment of the present invention may adopt any combination of one or more computer-readable media; the computer-readable storage medium may be, but is not limited to, an infrared, semiconductor system, device or component, or any combination of the above, for storing software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the method for avoiding automatic optical detection of raw material defects in the embodiment of the present invention. The processor 302 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 303, thereby realizing the above-mentioned method for avoiding automatic optical detection of raw material defects.
[0061] The above specific implementation manner does not constitute a limitation to the protection scope of the present application. It should be understood by those skilled in the art that various modifications, combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application. In some cases, the actions or steps recorded in the present application can be performed in an order different from that in the embodiment and can still achieve the desired results. In addition, the process depicted in the accompanying drawings does not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A method for avoiding automatic optical detection of raw material defects, characterized in that: The method comprises: Performing three-dimensional optical scanning imaging of the target raw material by means of an auxiliary motion platform to determine an optical image set, wherein the optical image set is marked with a relative spatial position; Using image-to-vector conversion as the underlying logic, supervise the training of a graph encoder, and based on the graph encoder, perform vector conversion and multi-image fusion on the optical image set to determine an image vector set; Interactive optical defect records, recursively perform multiple neighborhood aggregations based on the preset defect impact, determine multi-layer adjacent samples and mine the defect graph network, introduce contrastive learning principles, and supervise the training of defect detection modules; Traversing the image vector set, combining the defect detection module to perform defect comparison detection and plan avoidance decision-making, and determining a defect detection list; The defect detection sheet is displayed on the terminal, and the raw material defect management is performed based on the avoidance plan; the multi-layer adjacent samples are determined, including: Taking the preset defect influence as a reference, determining a first defect influence, traversing the optical defect records, and determining a first-order sample; Taking the first defect influence as a reference, superimposing the preset defect influence to determine a second defect influence, traversing the optical defect records to determine a second-order sample; Superimposing the preset defect influence degrees to determine the Nth defect influence degree, and determining the Nth order sample based on the optical defect record; Performing positive serialization integration of neighborhood recursion on the first-order samples, the second-order samples, and even the N-order samples to determine the multi-layer adjacent samples, wherein the positive serialization is from high defect impact to low defect impact, and the multi-layer adjacent samples are marked with a learning rate, and the learning rate is positively correlated with the defect impact; The method of mining a defect graph network comprises: Traversing the multi-layer adjacency samples, screening samples in each adjacency layer with a preset frequency as a constraint, and determining multi-layer adjacency optimization samples; Traversing the multi-layer adjacency optimization samples, extracting defect features and performing vector conversion, and determining the defect graph network, wherein the defect graph network is consistent with the multi-layer adjacency optimization sample structure; A weight distribution is determined based on the learning rate, and the defect graph network is identified.
2. The method for avoiding automatic optical detection of raw material defects according to claim 1, characterized in that: After the optical image set is determined, the method further comprises: Traversing the optical image set, identifying and marking contrast enhancement regions based on a preset contrast, wherein each contrast enhancement region is marked with a contrast enhancement coefficient; Taking the contrast enhancement coefficient as a standard, processing the contrast enhancement area to determine a contrast processing area; For the optical image set, the contrast processing area is replaced.
3. The method for avoiding automatic optical detection of raw material defects according to claim 1, characterized in that: The step of determining the image vector set comprises: Performing vector conversion on the optical image set to determine an initial image vector, wherein the optical image set includes overlapping images of multiple viewing angles at the same position; Traversing the initial image vectors, clustering them based on the same position, and dividing them into single image vector clusters and multiple clusters of overlapping image vectors; The multiple clusters of overlapping image vectors are traversed to perform intra-cluster fusion, and the single image vector cluster is combined to determine the image vector set through integration.
4. The method for avoiding automatic optical detection of raw material defects according to claim 1, characterized in that: The introduction of contrastive learning principle and supervised training of defect detection module include: Based on the multi-layer adjacency samples and mining the mapping relationship of the defect graph network, a positive sample set and a negative sample set are determined, wherein the positive sample is a comparison matching defect class, and the negative sample is a comparison non-matching defect class; Performing polarization processing on the positive sample set and the negative sample set, wherein the polarization processing includes maximizing the positive sample set and minimizing the negative sample set, and the maximization method is maximizing the cosine distance; The contrastive learning principle is introduced, and supervised training is performed based on the positive sample set after polarization processing and the negative sample set.
5. The method for avoiding automatic optical detection of raw material defects according to claim 1, characterized in that: Combined with the defect detection module, defect comparison detection and plan avoidance decision-making are carried out to determine the defect detection list, including: The defect detection module includes a rule layer and a solution layer; By comparison and matching, defect detection based on the image vector set is performed based on the rule layer to determine a single detection sequence; In combination with the weight distribution, the single detection sequence is traversed and weighted calculation is performed to determine the total quality coefficient; Traversing the single detection sequence, making a plan avoidance decision based on the weight distribution and in combination with the solution layer, and determining an avoidance plan; The defect detection list is determined by integrating the single detection sequence, the assembly quality coefficient and the avoidance plan.
6. Raw material defect automatic optical detection and avoidance system, characterized by: The system is used to implement the method for avoiding automatic optical detection of raw material defects according to any one of claims 1 to 5, and the system comprises: A three-dimensional optical scanning module, the three-dimensional optical scanning module is used to perform three-dimensional optical scanning imaging on the target raw material through the auxiliary motion platform to determine an optical image set, wherein the optical image set is marked with a relative spatial position; An image vector set determination module, the image vector set determination module is used to supervise the training of a graph encoder based on image-vector conversion to underlying logic, and to perform vector conversion and multi-image fusion on the optical image set based on the graph encoder to determine an image vector set; A defect detection model training module, which is used for interactive optical defect recording, recursively performs multiple neighborhood aggregations based on a preset defect impact, determines multi-layer adjacent samples and mines a defect graph network, introduces contrastive learning principles, and supervises the training of a defect detection module; A defect detection list determination module, the defect detection list determination module is used to traverse the image vector set, combine the defect detection module to perform defect comparison detection and plan avoidance decision-making, and determine the defect detection list; A raw material defect management module is used to display the defect detection form on the terminal and manage the raw material defects based on the avoidance plan.
7. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable instructions; A processor, for implementing the method for avoiding automatic optical detection of raw material defects as described in any one of claims 1 to 5 when executing executable instructions stored in the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for avoiding automatic optical detection of raw material defects as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Casting appearance defect detection method based on deep learning
CN113096098A
Small sample target detection method based on multi-view feature fusion and meta-feature coding
CN118196575A