MES process management and control method and system for circuit breaker production
By constructing a local gradient feature dictionary and hierarchical anchoring technology, the problem of defect signals being overwhelmed in circuit breaker production was solved, enabling focused detection of key quality points, improving detection accuracy and robustness, and realizing automated defect location and closed-loop process control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-11
- Publication Date
- 2026-04-07
AI Technical Summary
Existing machine vision inspection methods suffer from low quality inspection accuracy in circuit breaker production because defect signals are overwhelmed by global good product signals, and workpiece positioning deviations cause inspection failures, making it impossible to effectively identify defects at critical quality points.
A process feature dictionary model library is constructed, which includes gradient dictionaries for good products and defects. Key feature regions are accurately located through hierarchical anchoring technology, local gradient feature energy is calculated, and the total system energy function, which includes spatial smoothing energy, is optimized to achieve accurate identification of defect regions and closed-loop process control.
It significantly improves the accuracy and robustness of defect detection in circuit breaker production, overcomes interference from changes in lighting and local noise, realizes closed-loop control of automated decision-making and defect location, and enhances the level of quality control.
Smart Images

Figure CN121809862A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a MES process control method and system for circuit breaker production. Background Technology
[0002] In the production and assembly of complex electrical components such as circuit breakers, the Manufacturing Execution System (MES) is responsible for coordinating and managing the entire production process. Quality verification of key processes is crucial for ensuring the reliability of the final product; for example, in the grounding screw process, it's essential to ensure the correct installation and tightening of the spring washers. Currently, traditional quality verification relies on manual visual inspection, which is not only inefficient and costly but also susceptible to operator fatigue and subjective factors, making it difficult to guarantee consistent quality control.
[0003] With the development of machine vision technology, automated visual inspection methods have been introduced into production lines. Existing methods typically employ global template matching or classification algorithms based on global features. Operators first collect images of standard good products as templates, and then, in real-time production, compare the image of the workpiece to be inspected with the standard template globally or extract global features for comparison to identify differences and determine whether defects exist.
[0004] However, the existing machine vision methods mentioned above have significant limitations when applied to circuit breaker assembly inspection. First, defect features and good workpieces are highly consistent in most areas, and the defect signal accounts for a very small proportion in the global image. This causes the global matching method to fail because the defect signal is overwhelmed by the good signal. Furthermore, it cannot focus on key features, which leads to the manufacturing execution system erroneously releasing defective products, causing serious quality risks. Summary of the Invention
[0005] To address the technical problem of low quality detection accuracy caused by defects being overwhelmed by global signals in existing visual inspection methods, this invention provides solutions in the following aspects.
[0006] In a first aspect, the present invention provides a MES process control method for circuit breaker production, comprising: A process feature dictionary model library is constructed, which includes a good product gradient dictionary and a defect gradient dictionary associated with the processes of the Manufacturing Execution System (MES). A verification command containing product model ID and process ID is received from the MES. A global anchor point model and baseline relative coordinates are loaded based on the product model ID and process ID. Hierarchical anchoring is performed in the real-time workpiece image to locate and extract real-time key feature regions. Face elements are extracted from the real-time key feature regions, and the local gradient feature vectors of the face elements are calculated. Based on the local gradient feature vectors, the good product gradient dictionary, and the defect gradient dictionary, the good product data energy and defect data energy of the face elements are calculated. Spatial smoothing energy is determined based on the label consistency of adjacent face elements. When labels are inconsistent, the spatial smoothing energy is adjusted based on the angle between the direction vector between face elements and the local edge direction of the face elements. A system total energy function containing good product data energy, defect data energy, and spatial smoothing energy is defined and optimized to generate a globally optimal label field. A process defect score and defect indication map are generated based on the globally optimal label field. The process defect score and defect indication map are fed back to the MES to execute a closed-loop process control.
[0007] This invention addresses the problem of defect signals being overwhelmed by global good product signals by constructing a local gradient feature dictionary associated with the manufacturing execution system (MES) processes. It shifts the detection focus from the global image to a small range of key quality points. Furthermore, by implementing hierarchical anchoring driven by the MES, it accurately locates real-time key feature regions using global anchor points and reference relative coordinates, effectively overcoming target offset issues caused by workpiece positioning deviations. By calculating data energy based on gradient features, it significantly reduces the interference of workshop lighting variations on feature stability. By optimizing the system's total energy function, which includes spatial smoothing energy, and utilizing the spatial consistency of neighborhood information to correct local noise interference, it ensures the connectivity and accuracy of defect region identification, achieving a closed-loop decision-making process with the MES.
[0008] Preferably, the construction of the process feature dictionary model library includes: collecting gold samples and defect samples, and labeling key feature regions; extracting surface elements in the key feature regions, and calculating the local gradient feature vectors of the surface elements; clustering the local gradient feature vectors of all surface elements of all gold samples to generate a good product gradient dictionary; and clustering the local gradient feature vectors of all surface elements of all defect samples to generate a defect gradient dictionary.
[0009] Preferably, the step of performing hierarchical anchoring in the real-time workpiece image to locate and extract real-time key feature regions includes: searching for a global anchor point model in the real-time workpiece image to obtain a global coordinate transformation; applying the global coordinate transformation to the reference relative coordinates to calculate the precise position of the real-time key feature region on the real-time workpiece image, and extracting the real-time key feature region.
[0010] This invention first utilizes a stable structure unaffected by the process to perform coarse positioning, obtaining the overall translation and rotation transformations of the workpiece. Then, combined with the offline calibrated reference relative coordinates, it calculates the actual position of the dynamically changing key feature regions in the real-time image, ensuring that subsequent feature extraction and energy calculation are always performed in the correct region, effectively solving the detection failure problem caused by workpiece positioning tolerance.
[0011] Preferably, the good product data energy and the defective product data energy satisfy the expression: ; In the formula, For face element The energy of good product data; For face element Defect data energy; The x-coordinate of the center of the element; The vertical coordinate of the center of the element; yes The local gradient eigenvectors of the surface element; For good quality gradient dictionary The Middle Local gradient feature vectors; Defect gradient dictionary The Middle Local gradient feature vectors; A graded dictionary for good quality products; For the defect gradient dictionary; The square of the L2 norm; This is a function that takes the minimum value.
[0012] Preferably, after calculating the good data energy and defect data energy of the surface element, the method further includes: performing a unified normalization process on the good data energy and defect data energy, wherein the unified normalization process is to perform linear normalization using the minimum and maximum values of the good data energy and defect data energy of all surface elements in the real-time key feature region.
[0013] This invention normalizes the two types of data energy by using a unified maximum and minimum value, ensuring that the normalized good product data energy and defective data energy are compared on the same scale. This avoids the scale imbalance problem caused by the independent normalization of good product data energy and defective data energy, and guarantees the comparability of the two types of data energy in the subsequent system total energy function.
[0014] Preferably, the spatial smoothing energy satisfies the expression: In the formula, For face element and Spatial smoothing energy; For face element Adjacent face elements; For face element The label at the location; For face element The label at the location; Indicates from face element Pointing to surface element Direction vector and surface element The angle between the local edge directions; It is a natural exponential function; For face element The maximum normalized data energy value.
[0015] The spatial smoothing energy defined in this invention has edge-aware capabilities. When adjacent facet labels are different, the penalty intensity is adjusted according to the edge information between facets. If there is a real edge between adjacent facets, i.e., the direction vector is consistent with the local edge direction, the penalty is small, allowing label jumps; if there is no obvious edge, the penalty is large, suppressing label jumps. Spatial smoothing energy protects the real boundaries of defective regions while smoothing noise in non-edge regions.
[0016] Preferably, the total energy function of the system satisfies the expression: In the formula, The total energy of the system is the label field. For face element The label at the location; Representation of face element In the label The corresponding normalized data energy; For face element Adjacent face elements, This indicates that all face pairs that satisfy the adjacency relationship in the key feature region are traversed. For face element and Spatial smoothing energy; This is a spatial smoothness penalty weight used to balance the relative importance of data energy and spatial smoothness energy.
[0017] This invention transforms the local feature matching problem into a global energy optimization problem by constructing a Gibbs energy function that includes data energy and spatial smoothing energy. Data energy ensures that the labels are as consistent as possible with the observed data, while spatial smoothing energy introduces spatial consistency constraints and uses neighborhood information to smooth out isolated misjudgment points caused by local noise, making the identification results of defective areas more connected and smooth.
[0018] Preferably, the optimization of the total system energy function to generate the globally optimal label field includes: using an iterative conditional mode algorithm to iteratively optimize the label field; in each iteration, scanning each facet in the label field; while keeping the labels of its neighboring facets unchanged, calculating the total system energy when the labels of the scanned facets are good and defective, and selecting the label that minimizes the total system energy as the new label of the scanned facet; stopping the iteration when the label field converges or reaches the maximum number of iterations, thus obtaining the globally optimal label field.
[0019] Preferably, the execution process control closed loop includes: in response to the process defect score being less than a preset area threshold, determining that the process verification is passed, and the manufacturing execution system automatically updates the process status to completed; in response to the process defect score being greater than or equal to the preset area threshold, determining that the process verification is failed, the manufacturing execution system locks the workstation and highlights the defect location according to the defect indication diagram, waiting for manual rework.
[0020] Secondly, the present invention provides a MES process control system for circuit breaker production, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned MES process control method for circuit breaker production is implemented.
[0021] By adopting the above technical solution, a computer program is generated from the above-mentioned MES process control method for circuit breaker production and stored in the memory so that it can be loaded and executed by the processor. Terminal equipment is then made based on the memory and the processor for convenient use.
[0022] The beneficial effects of this invention are as follows: By constructing a local gradient feature dictionary associated with the manufacturing execution system (MES) processes and combining it with hierarchical anchoring technology, this invention successfully solves the problems of defect signals being easily submerged and detection failures caused by workpiece positioning deviations in traditional global matching methods, thus achieving focus on key quality points in circuit breaker assembly. This invention utilizes gradient features robust to illumination to calculate data energy and, by optimizing the system's total energy function, which includes spatial smoothing energy with edge awareness, effectively overcomes the interference of workshop illumination variations and local noise, significantly improving the accuracy and robustness of defect detection. This invention seamlessly integrates visual inspection results into the MES, realizing a closed-loop control system for automated decision-making, workstation locking, and defect localization, thereby improving the quality control level and automation degree of circuit breaker production. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating a MES process control method for circuit breaker production according to the present invention; Figure 2 It is an illustration of a gold sample; Figure 3 This is a schematic illustration of a defective sample; Figure 4 This is a schematic diagram illustrating a real-time workpiece image; Figure 5 This schematically illustrates the key feature regions on a real-time workpiece image. Figure 6 It is a schematic diagram showing the defect indication. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0026] This invention discloses a MES process control method for circuit breaker production, referring to... Figure 1 This includes steps S1-S5: S1. Construct a process feature dictionary model library, which includes a good product gradient dictionary and a defect gradient dictionary associated with the processes of the manufacturing execution system.
[0027] It should be noted that, because similar defects and good products are highly consistent in most areas, traditional global matching methods fail due to signal overload. Furthermore, critical quality points in circuit breaker assembly only occupy a small portion of the image area, and global matching methods cannot focus on these key features. Therefore, in the offline stage, this invention constructs an illumination-robust local gradient feature dictionary focusing only on the critical quality points of a specific process, such as the spring-loaded pad. This dictionary provides a data item model for subsequent Markov random field energy calculations and is associated with the manufacturing execution system processes.
[0028] Specifically, for each process in the manufacturing execution system requiring visual verification, such as the grounding screw process for circuit breakers, gold samples and defect samples are collected. The gold samples are images of good products, and the defect samples are images of defective products, such as images of loose screws. The defect samples are derived from a historical defect database or artificially constructed typical failure states, covering common variations, including but not limited to loose screws, misassemblies, missing parts, and assembly gaps. For example, Figure 2 For a gold sample, Figure 3 This is a defect sample.
[0029] For each process, the location of key feature areas is determined by manual annotation. Specifically, representative images are selected from standard gold samples, and domain experts annotate the areas containing key quality features, such as the area where the spring pad is located.
[0030] Furthermore, a global anchor point model is constructed: based on the identified key feature regions, stable regions with significant geometric features on the gold sample that are unaffected by the inspection process are selected as anchor points, such as the outline of a circuit breaker casing or the fixed structure of a large fish assembly. Edge detection and contour fitting algorithms are used to extract their geometric features, which are then stored in the model library in parametric form. Simultaneously, the reference relative coordinates of the key feature regions relative to the global anchor point model are recorded. These reference relative coordinates represent the positional offset of the key feature regions in the global coordinate system and are used for precise localization of the key feature regions in subsequent online detection.
[0031] Furthermore, in the key feature regions of both gold and defective samples, extraction is performed by sliding with a step size of 1 pixel. Local elements of size, where The dimension is the side length of the element. When the element size is too small, it may contain insufficient texture information; when the element size is too large, it may span multiple features, resulting in impure features. In this embodiment, Set to 8. In other embodiments, implementers can set it according to the actual texture complexity. .
[0032] For each surface element, calculate its local gradient eigenvector, specifically: The gradient magnitude and gradient angle of each pixel in the surface element are calculated using the Sobel operator. The gradient angle is uniformly quantized into 9 intervals using the Histogram of Oriented Gradients (HOG) algorithm. The weighted gradient magnitude of each direction in the surface element is calculated to form a 9-dimensional histogram of oriented gradients, which serves as the local gradient feature vector of the surface element.
[0033] Furthermore, a good product gradient dictionary is constructed, and the K-means clustering algorithm is used to cluster the local gradient feature vectors of all surface elements in the key feature regions of all gold samples, resulting in... Cluster centers, and this The local gradient feature vectors corresponding to the cluster centers constitute the good gradient dictionary, denoted as . .in For the number of good clusters, when Values that are too small will result in a dictionary that is too coarse and cannot represent texture diversity. If the value is too large, it will lead to computational redundancy and may cause overfitting. Therefore, in this embodiment... The value is set to 100. In other embodiments, implementers can set this value according to the diversity of the actual sample. .
[0034] Similarly, a defect gradient dictionary is constructed, and the K-means clustering algorithm is used to cluster the local gradient feature vectors of all surface elements in the key feature regions of all defect samples to obtain... Cluster centers, and this The local gradient feature vectors corresponding to the cluster centers constitute the defect gradient dictionary, denoted as . .in For the number of defect clusters, when If the value is too small, the dictionary will not be able to fully represent the defect features. If the value is too large, it will lead to a decrease in computational efficiency. Therefore, in this embodiment... The value is set to 50. In other embodiments, the implementer can set this value according to the complexity of the actual defect sample. .
[0035] It should be noted that this embodiment only uses the K-means clustering algorithm as an example. Implementers can choose other clustering algorithms according to the actual implementation situation.
[0036] Furthermore, the good product gradient dictionary Defect gradient dictionary The global anchor point model and the baseline relative coordinates of key feature regions are used as a complete process verification model, which is associated with the product model ID and process ID in the manufacturing execution system and stored in the model library.
[0037] S2. Receive the verification instruction containing the product model ID and process ID sent by the manufacturing execution system, load the global anchor point model and reference relative coordinates according to the product model ID and process ID, and perform hierarchical anchoring in the real-time workpiece image to locate and extract real-time key feature areas.
[0038] It should be noted that, since the position of the circuit breaker workpiece in the tooling fixture may be translated or rotated, the coordinates of the key feature area of the defined spring-flat pad in the real-time image are dynamically changing. The workpiece positioning deviation will cause the feature extraction area to shift, which will make the subsequent energy calculation completely fail. Therefore, this invention proposes a hierarchical anchoring process driven by the manufacturing execution system. This process first locates the global anchor point of the workpiece for coarse positioning, and then, based on this anchor point and the process specified by the manufacturing execution system work order, it searches for local anchor points to achieve fine positioning.
[0039] Specifically, when the circuit breaker workpiece is in place at the workstation, the manufacturing execution system identifies the product model ID and the process ID to be verified for the current workpiece, and the vision system sends a start verification command containing these two IDs.
[0040] The vision system loads a global anchor point model from the model library based on the product model ID and acquires real-time workpiece images captured by the camera. For example, Figure 4 This is a real-time image of a workpiece.
[0041] Furthermore, geometric pattern matching is used to search for a global anchor point model in the real-time workpiece image to obtain the global coordinate transformation of the entire workpiece.
[0042] The vision system queries the model library for the relative coordinates of the key feature region of a process with respect to the global anchor point model based on the process ID. It then applies the global coordinate transformation of the workpiece to these relative coordinates, calculates the precise position of the key feature region on the real-time workpiece image, and extracts the real-time key feature region for use in subsequent steps. For example, Figure 5 This refers to the real-time key feature regions on the real-time workpiece image.
[0043] S3. Extract surface elements in the real-time key feature region, calculate the local gradient feature vector of the surface element, and calculate the good data energy and defect data energy of the surface element based on the local gradient feature vector, the good gradient dictionary and the defect gradient dictionary.
[0044] It should be noted that before performing global energy optimization, each node of the Markov random field must be provided with its data energy, which defines the cost of marking each facet as good or defective. Since variations in illumination in the workshop environment can cause pixel value fluctuations, affecting the stability of feature matching, this invention calculates the minimum matching distance between the extracted facet gradient features and the gradient dictionary, using this as input for subsequent optimization data to ensure that the cost is unaffected by illumination.
[0045] Specifically, extraction is performed by sliding across the key feature region in real time, with a step size of 1 pixel. For each surface element, obtain its local gradient feature vector, and calculate the good data energy of the surface element based on the local gradient feature vector.
[0046] The energy of the good product data satisfies the expression: ; In the formula, For face element The smaller the value of the good product data energy, the closer the surface element is to the good product characteristics; The x-coordinate of the center of the element; The vertical coordinate of the center of the element; yes The local gradient eigenvectors of the surface element; For good quality gradient dictionary The Middle Local gradient feature vectors; A graded dictionary for good quality products; The square of the L2 norm; To find the minimum value function. When the local gradient eigenvector of the surface element... The closer to a good product dictionary When any local gradient eigenvector in the vector is used, The smaller the value, the lower the data cost of marking it as a good product; when With good quality gradient dictionary When the differences between all local gradient eigenvectors are large, The larger the value, the more it indicates that... The higher the data cost of marking a product as good.
[0047] Similarly, the defect data energy of the surface element is calculated based on the local gradient eigenvector, and the defect data energy satisfies the expression: ; In the formula, For face element The smaller the value of the defect data energy, the closer the surface element is to the defect feature; The x-coordinate of the center of the element; The vertical coordinate of the center of the element; yes The local gradient eigenvectors of the surface element; Defect gradient dictionary The Middle Local gradient feature vectors; For the defect gradient dictionary; The square of the L2 norm; This is a function that takes the minimum value. When... The closer to the defect dictionary When any local gradient eigenvector in the vector is used, The smaller the value, the lower the data cost of marking it as a defect; when With defect gradient dictionary When the differences between all local gradient eigenvectors are large, The higher the value, the higher the cost of marking the data as defective.
[0048] Furthermore, the energy of good product data and defective data are normalized separately, specifically: ; ; in, For face element Normalized data on good quality products; For face element Energy of normalized defect data; For face element The energy of good product data; For face element Defect data energy; For all key feature regions The minimum value among the good product data energy and the defective data energy; For all key feature regions The maximum value of good product data energy and defective data energy.
[0049] It should be noted that the present invention uses a unified standard to normalize the good product data energy and the defective data energy in order to ensure that the normalized good product data energy and defective data energy are compared on the same scale, and to avoid the scale imbalance problem caused by their respective normalization.
[0050] S4. Determine the spatial smoothing energy based on the consistency of labels of adjacent face elements. When labels are inconsistent, adjust the spatial smoothing energy according to the angle between the direction vector between face elements and the local edge direction of the face elements. Define a total system energy function that includes good data energy, defect data energy and spatial smoothing energy. Optimize the total system energy function to generate the globally optimal label field.
[0051] It should be noted that although the normalized energy of good and defective data includes data matching costs, it may still be affected by local noise. For example, an isolated good cell may have an inflated good data energy due to noise. In circuit breaker assembly quality inspection, a qualified process should have spatial consistency, meaning that the neighbors of good products should also be good products. At the same time, defective regions usually exhibit connectivity. Therefore, the goal of this invention is to find a globally optimal tag field that minimizes the total system energy of the tag field. This total system energy is used to simultaneously penalize data mismatch and spatial inconsistency, thereby using neighborhood information to eliminate noise and amplify connected defect clusters.
[0052] Specifically, we define a Gibbs energy function, with the goal of minimizing the total energy of the system. The Gibbs energy function satisfies the expression: ; In the formula, This represents the total energy of the tag field system; the smaller the value, the more the tag field matches the actual situation. For face element The label at this location can be either "Good" or "Defective"; Representation of face element In the label The corresponding normalized data energy, such as when the element is... When the label is "good quality", For face element Normalized Good Product Data Energy , when the par When the label is "defect", For face element Normalized defect data energy ; , All are surface element coordinates, and surface elements With face element Adjacent to each other in key feature regions; For face element and Spatial smoothing energy; This represents the summation of the normalized data energy corresponding to all face elements in the key feature region under their labels; This indicates that all face pairs that satisfy the adjacency relationship in the key feature region are traversed. This represents the summation of the spatial smoothing energy corresponding to adjacent facets in the key feature region; Spatial smoothness penalty weights are used to balance the relative importance of data energy and spatial smoothness energy. As the value increases, the system tends to produce a smoother label field, but this may cause small defective areas to be incorrectly classified as good areas. The smaller the value, the more sensitive the system is to local anomalies, but this may introduce more noise. In this embodiment, The value is set to 5. In other embodiments, implementers may set this value according to the actual implementation situation.
[0053] The spatial smoothing energy satisfies the following expression: ; In the formula, For face element and Spatial smoothing energy; For face element The label at the location; For face element The label at the location; Indicates from face element Pointing to surface element Direction vector and surface element The angle between the local edge directions; It is a natural exponential function. Used for Perform negative correlation normalization and eliminate angular dimensions; For face element Maximum normalized data energy value: ;Dang yuan Labels and elements at the location When the labels of adjacent face elements are the same, it indicates that the labels of adjacent face elements are consistent, which conforms to the spatial continuity assumption. In this case, the spatial smoothness energy is 0. Conversely, when the labels of face elements are different... Labels and elements at the location When the labels at different locations are different, the penalty intensity is determined based on the direction information: when from the surface element Pointing to surface element Direction vector and surface element When the local edge directions are consistent, from the surface element With face element There may be edges between them, face elements With face element Inconsistent labeling might be reasonable in this situation. Smaller, spatially smoother energy The penalty is smaller; when from the face element Pointing to surface element Direction vector and surface element The larger the angle between the local edge directions, the more it indicates that the surface element... To the noodle There was no obvious change in grayscale between the elements. With face element Inconsistent labeling could be due to noise or errors. Larger, spatially smooth energy The punishment is severe.
[0054] The method for obtaining the local edge direction is as follows: for each surface element, the vector and corresponding direction of the gradient vector of all pixels inside it are taken as the local edge direction of the surface element, wherein the magnitude of the gradient vector of the pixel is the gradient magnitude of the pixel, and the direction is the gradient direction of the pixel.
[0055] Furthermore, the Iterated Conditional Modes (ICM) algorithm is employed to rapidly iteratively optimize the total system energy. Specifically: 1. Initialize a In a label field of varying sizes, if the energy of the normalized good product data is less than the energy of the normalized defect data, the label of the element in the label field is initialized to "good"; if the energy of the normalized good product data is greater than or equal to the energy of the normalized defect data, the label of the element in the label field is initialized to "defect". This represents the number of rows in the real-time key feature region. The number of columns for real-time key feature regions. Let be the side length of the face element.
[0056] 2. Scan each facet in the label field. Calculate the face values of each face value while keeping the labels of all its neighbor face values unchanged. The total system energy when labeled as good and the total system energy when labeled as defective. (Response to surface element) The total system energy when labeled "Good" is less than the total system energy when labeled "Defective," so "Good" is used as the surface element. The new label; conversely, responding to the facet. If the total system energy when labeled "Good" is greater than or equal to the total system energy when labeled "Defective", then "Defective" is used as a surface element. The new tag.
[0057] 3. Repeat step 2 until the tag field converges or the maximum number of iterations is reached. The tag field at the point of cessation is taken as the globally optimal tag field. For defective products, the globally optimal tag field will generate a connected cluster of defective tags at the defect location. Tag field convergence is defined as the number of facets changing in two consecutive iterations being less than 0.1% of the total number of facets, or the change in the total system energy being less than 0.01. In this embodiment, the maximum number of iterations is set to 10. In other embodiments, the implementer can set the maximum number of iterations according to the actual implementation situation.
[0058] S5. Generate process defect scores and defect indication maps based on the global optimal label field, and feed the process defect scores and defect indication maps back to the manufacturing execution system to execute the process control closed loop.
[0059] Specifically, the total number of facets labeled "defect" in the globally optimal label field is used as the process defect score. A higher process defect score indicates a larger defect area and a higher quality risk. The globally optimal label field is converted into a defect indication map of the same size as the key feature region. The defect indication map is a binary image, generated as follows: for each pixel in the key feature region, if the pixel is covered by any facet labeled "defect," the pixel value is set to 1; otherwise, it is set to 0.
[0060] For example, Figure 6 This is a defect indication diagram.
[0061] It should be noted that since the face elements are obtained by sliding in steps of 1 pixel, each pixel will be... Each pixel is covered by a facet, but if any facet covering the pixel is labeled "defect," the pixel is marked as a defect. Let be the side length of the face element.
[0062] Furthermore, when the process defect score is less than the preset area threshold, the process verification passes, and the manufacturing execution system automatically updates the status of the process in the process list from pending inspection to completed, and automatically unlocks the process for the operator and displays the next process to be executed; when the process defect score is greater than or equal to the preset area threshold, the process verification fails, the manufacturing execution system automatically locks the workstation, parses the defect indication diagram, and highlights the pixels with a pixel value of 1 in the key feature area on the workstation screen, accurately indicating the specific location of the spring flat pad assembly defect to the worker, waiting for manual rework.
[0063] In this embodiment, the area threshold is set to 10 facets. In other embodiments, the implementer can adaptively set the area threshold according to the resolution of the key feature area and the minimum size of the actual defect.
[0064] This invention also discloses a MES process control system for circuit breaker production, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, they implement an MES process control method for circuit breaker production according to the present invention.
[0065] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
Claims
1. A MES process control method for circuit breaker production, characterized in that, include: Construct a process feature dictionary model library, which includes a good product gradient dictionary and a defect gradient dictionary associated with the processes of the manufacturing execution system; Receive verification instructions containing product model ID and process ID sent by the manufacturing execution system, load the global anchor point model and reference relative coordinates according to the product model ID and process ID, and perform hierarchical anchoring in the real-time workpiece image to locate and extract real-time key feature areas. Surface cells are extracted from the real-time key feature region, and the local gradient feature vector of the surface cell is calculated. Based on the local gradient feature vector, the good product gradient dictionary, and the defect gradient dictionary, the good product data energy and defect data energy of the surface cell are calculated. The spatial smoothing energy is determined based on the label consistency of adjacent surface cells. When the labels are inconsistent, the spatial smoothing energy is adjusted according to the angle between the direction vector between surface cells and the local edge direction of the surface cell. A system total energy function containing good product data energy, defect data energy, and spatial smoothing energy is defined, and the system total energy function is optimized to generate the globally optimal label field. Based on the globally optimal label field, process defect scores and defect indication maps are generated, and the process defect scores and defect indication maps are fed back to the manufacturing execution system to execute the process control closed loop.
2. The MES process control method for circuit breaker production according to claim 1, characterized in that, The construction process feature dictionary model library includes: Collect gold samples and defect samples, and label key feature regions; extract surface elements in the key feature regions and calculate the local gradient feature vectors of the surface elements; cluster the local gradient feature vectors of all surface elements in the key feature regions of all gold samples to generate a good product gradient dictionary; cluster the local gradient feature vectors of all surface elements in the key feature regions of all defect samples to generate a defect gradient dictionary.
3. The MES process control method for circuit breaker production according to claim 1, characterized in that, The step of performing hierarchical anchoring in the real-time workpiece image to locate and extract real-time key feature regions includes: A global anchor point model is searched in the real-time workpiece image to obtain a global coordinate transformation; the global coordinate transformation is applied to the reference relative coordinates to calculate the precise position of the real-time key feature region on the real-time workpiece image, and the real-time key feature region is extracted.
4. The MES process control method for circuit breaker production according to claim 2, characterized in that, The energy of good product data and the energy of defective data satisfy the expression: ; ; In the formula, For face element The energy of good product data; For face element Defect data energy; The x-coordinate of the center of the element; The vertical coordinate of the center of the element; yes The local gradient eigenvectors of the surface element; For good quality gradient dictionary The Middle Local gradient feature vectors; Defect gradient dictionary The Middle Local gradient feature vectors; A good product gradient dictionary; For the defect gradient dictionary; The square of the L2 norm; This is a function that takes the minimum value.
5. A MES process control method for circuit breaker production according to claim 1 or 4, characterized in that, After calculating the good data energy and defect data energy of the surface element, the following is also included: The energy of good product data and the energy of defective data are uniformly normalized. The uniform normalization process is to perform linear normalization using the minimum and maximum values of the energy of good product data and the energy of defective data of all surface elements in the real-time key feature region.
6. The MES process control method for circuit breaker production according to claim 1, characterized in that, The spatial smoothing energy satisfies the expression: ; In the formula, For face element and Spatial smoothing energy; For face element Adjacent face elements; For face element The label at the location; For face element The label at the location; Indicates from face element Pointing to surface element Direction vector and surface element The angle between the local edge directions; It is a natural exponential function; For face element The maximum normalized data energy value.
7. A MES process control method for circuit breaker production according to claim 1 or 6, characterized in that, The total energy function of the system satisfies the expression: ; In the formula, The total energy of the system is the label field. For face element The label at the location; Representation of face element In the label The corresponding normalized data energy; For face element Adjacent face elements, This indicates that all face pairs that satisfy the adjacency relationship in the key feature region are traversed. For face element and Spatial smoothing energy; This is a spatial smoothness penalty weight used to balance the relative importance of data energy and spatial smoothness energy.
8. The MES process control method for circuit breaker production according to claim 1, characterized in that, The optimization of the system's total energy function to generate a globally optimal label field includes: An iterative conditional mode algorithm is used to iteratively optimize the label field. In each iteration, each facet in the label field is scanned. While keeping the labels of its neighboring facets unchanged, the total system energy is calculated when the labels of the scanned facets are good and defective. The label that minimizes the total system energy is selected as the new label of the scanned facet. The iteration stops when the label field converges or reaches the maximum number of iterations, thus obtaining the globally optimal label field.
9. A MES process control method for circuit breaker production according to claim 1, characterized in that, The closed-loop control of the execution process includes: If the process defect score is less than the preset area threshold, the process verification is deemed passed, and the manufacturing execution system automatically updates the process status to complete. If the process defect score is greater than or equal to the preset area threshold, the process verification is deemed failed, the manufacturing execution system locks the workstation, highlights the defect location according to the defect indicator diagram, and waits for manual rework.
10. A MES process control system for circuit breaker production, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement a MES process control method for circuit breaker production according to any one of claims 1-9.
Citation Information
Patent Citations
Electronic component surface defect detection method based on sample library dictionary
CN103954627A
Product surface detection method based on sliding local neighboring window
CN106780455A
A defect detection method based on dictionary learning
CN109598690A
Hyperspectral image anomaly detection method using double denoising devices to replace artificial prior
CN115222712A
Wafer defect detection data processing method and system
CN120088247A