Industrial product quality detection method and system based on machine vision

By combining multispectral imaging and neural networks, the shortcomings of single-spectral imaging in existing technologies have been solved, enabling efficient industrial product quality inspection and intelligent control, and providing high-quality defect location and classification reports.

CN121353263APending Publication Date: 2026-01-16ZHUHAI LILONG SOFTWARE CO LTD

Patent Information

Application Number
CN202511733837.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

Existing visual inspection methods for industrial products are limited to single-spectrum imaging, which cannot acquire the optical features of internal materials and microscopic defects. The defect judgment threshold is fixed and cannot adapt to the fluctuation of process parameters during production. Texture and shape features are not effectively combined, resulting in poor defect recognition stability. The defect probability output is not correlated with the real-time production status, and the generation of control commands is rigid.

Method used

A multispectral imaging system is deployed to process image data through noise suppression algorithms, perform spatial segmentation and feature extraction, generate a defect probability distribution map using a pre-trained defect detection neural network, dynamically calculate the defect judgment threshold by combining real-time production parameters, and generate a control command sequence.

Benefits of technology

It achieves expanded detection dimensions through multispectral information, improved detection targeting through regionalized analysis, enhanced system adaptability through dynamic thresholds, ensured quality stability through closed-loop control, and provides high-quality defect location and classification reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121353263A_ABST
    Figure CN121353263A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of industrial quality inspection, and discloses an industrial product quality detection method and system based on machine vision. The method comprises the following steps: deploying a multispectral imaging system to capture a product surface image data stream, and generating a purified image sequence through a noise suppression algorithm; then, carrying out space segmentation on the purified image sequence, identifying a plurality of detection sub-regions, extracting texture features and shape features of each sub-region, and integrating the texture features and the shape features into a comprehensive feature map; inputting the map into a pre-trained encoder-decoder structure defect detection neural network, and outputting a defect probability distribution map; based on the probability distribution diagram, dynamically calculating a defect judgment threshold by combining real-time production parameters, and generating an accurate defect classification report; and finally, generating a control instruction sequence according to the defect classification report, and transmitting to a production execution system to adjust production line equipment in real time. According to the method, the quality detection accuracy and the production efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial quality inspection technology, specifically to a method and system for industrial product quality inspection based on machine vision. Background Technology

[0002] Current industrial product visual inspection primarily employs single-spectral imaging and fixed threshold judgment methods. Existing technologies limit image acquisition of product surfaces to the visible light band, failing to capture the optical characteristics of internal materials and microscopic defects. Image processing typically uses a global analysis approach, neglecting differentiated inspection based on the functional characteristics of different product regions. Feature extraction methods are simplistic, failing to effectively combine texture and shape features, resulting in insufficient defect characterization capabilities. Fixed defect judgment thresholds cannot adapt to the impact of process parameter fluctuations on product quality during production. Existing methods need to address key technical challenges such as multispectral information fusion, regionalized feature extraction, and dynamic threshold judgment.

[0003] Traditional machine vision inspection systems have significant shortcomings in feature analysis and defect identification. Single-spectral imaging has limited information dimensionality, making it difficult to detect defect types related to material properties. Spatial segmentation methods are simplistic, and sub-region division fails to reflect the differences in product functional structure. Texture feature extraction algorithms are sensitive to illumination changes and surface noise, exhibiting poor stability. Shape feature descriptors lack complexity, failing to accurately characterize the geometric properties of defects. Feature fusion methods are linear, failing to uncover the intrinsic relationship between texture and shape. The neural network structure design is unreasonable, resulting in information loss during encoder-decoder transmission. Defect probability output is not correlated with real-time production status, and threshold settings lack dynamic adjustment mechanisms. The control command generation process is rigid, failing to achieve closed-loop linkage between inspection results and production control. Summary of the Invention

[0004] The purpose of this invention is to provide a machine vision-based method and system for industrial product quality inspection, in order to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides a machine vision-based method for industrial product quality inspection, the method comprising: A multispectral imaging system is deployed to capture image data streams of the target product surface, and the image data streams are processed by a noise suppression algorithm to generate a clean image sequence. Spatial segmentation is performed on the cleaned image sequence to identify multiple detection sub-regions, and the texture and shape features of each detection sub-region are extracted and integrated into a comprehensive feature map; The comprehensive feature map is input into a pre-trained defect detection neural network, which includes encoder and decoder structures, and outputs a defect probability distribution map. Based on the defect probability distribution map and combined with real-time production parameters, the defect judgment threshold is dynamically calculated to generate a defect classification report. Based on the defect classification report, a sequence of control instructions is generated and transmitted to the production execution system to adjust the production line equipment.

[0006] Preferably, the deployment of the multispectral imaging system to capture image data streams of the target product surface and the processing of the image data streams using a noise suppression algorithm to generate a cleaned image sequence includes: Configure the camera array in the multispectral imaging system, adjust the spectral band and exposure time of each camera, and synchronously acquire multi-band images of the product surface under different lighting conditions; Pixel-level fusion of multi-band images generates high dynamic range images; Adaptive filtering algorithms are applied to smooth high dynamic range images and reduce environmental noise; Brightness uniformity and contrast distribution in the smoothed image are extracted as image quality assessment parameters. Based on the image quality assessment parameters, the optimal image frame sequence is selected to form a cleaned image sequence.

[0007] Preferably, the step of spatially segmenting the purified image sequence, identifying multiple detection sub-regions, and extracting the texture and shape features of each detection sub-region to integrate them into a comprehensive feature map includes: The watershed algorithm is used to divide the cleaned image sequence into regions and determine the boundary coordinates of each detection sub-region. Calculate the gray-level co-occurrence matrix of pixels in each detection sub-region, and extract the texture feature vector from it; Measure the geometric properties of each detection sub-region, including area, perimeter, and convex hull features, to form a shape feature vector; The texture feature vector and shape feature vector are normalized and then concatenated into a multidimensional feature array. Principal component analysis is used to reduce the dimensionality of the multidimensional feature array, generating a comprehensive feature map.

[0008] Preferably, the step of inputting the comprehensive feature map into a pre-trained defect detection neural network, which includes an encoder and a decoder structure, and outputs a defect probability distribution map including: The encoder part of the defect detection neural network uses convolutional layers to extract local features and pooling layers to compress the feature dimensions. The decoder part of the defect detection neural network uses deconvolutional layers to recover feature resolution and introduces skip connections to fuse shallow features; In the output layer of the defect detection neural network, the softmax function is applied to calculate the defect category probability of each pixel; Based on the defect category probability, a defect probability distribution map is generated, which marks the location and size of the suspected defect area; The defect probability distribution map and the comprehensive feature map are kept in the same size to facilitate subsequent comparison.

[0009] Preferably, the step of dynamically calculating the defect judgment threshold and generating a defect classification report based on the defect probability distribution map and real-time production parameters includes: Extract the probability value sequence of defect regions from the defect probability distribution map and calculate the statistical characteristics of the probability value sequence; Obtain real-time production parameters such as equipment operating speed and material type, and adjust the baseline value of the defect judgment threshold; The sliding window method is used to analyze the changing trend of the probability value sequence and dynamically update the defect judgment threshold. The probability value of the defect region is compared with the defect judgment threshold to generate a binary defect mask; Perform morphological operations on the binarized defect mask to remove noise points and generate a defect classification report.

[0010] Preferably, the step of generating a control command sequence based on the defect classification report and transmitting it to the production execution system to adjust the production line equipment includes: Parse the defect type and severity level in the defect classification report and map them to a predefined control strategy table; Based on the control strategy table, generate a sequence of control instructions for specific devices, including adjusting the robotic arm trajectory or modifying the laser power; The control command sequence is encoded into digital signals and transmitted to the production execution system via industrial Ethernet; The production execution system analyzes digital signals and sends instructions to the production line equipment drivers; Monitor equipment status feedback in real time to ensure that the control command sequence is executed correctly.

[0011] Preferably, the mapping of defect types and severity levels in the parsed defect classification report to a predefined control strategy table includes: Read the geometric attributes and probability score of each defect area from the defect classification report. The geometric attributes include the defect boundary coordinates and area size, and the probability score comes from the defect probability distribution map. The defect severity index is obtained by calculating the weighted composite value of the geometric attributes and probability score of each defect area; Query the predefined control strategy table, which contains the mapping relationship between the defect severity index range and the corresponding control action; Based on the entries in the defect severity index matching control strategy table, determine the adjustment strategy for each defect area.

[0012] Preferably, generating a sequence of control instructions for a specific device based on the control strategy table includes: Based on the adjustment strategy, the equipment control parameter database is searched to obtain control instruction templates that match the defect type; Extract the defect location coordinates and equipment identifiers on the production line, and convert the defect location coordinates into target points in the equipment coordinate system; Based on the target point and device identifier, fill in the parameter fields in the control instruction template to generate a control instruction sequence containing position instructions and action instructions; Verify the logical consistency of the control instruction sequence to ensure there are no conflicts between instructions.

[0013] Preferably, the real-time monitoring device status feedback to ensure the correct execution of the control command sequence includes: Real-time operating data of equipment on the production line is collected through a sensor network, including motor speed, position deviation, and temperature readings; The real-time operating data is compared with the expected state of the control command sequence, and the state error value is calculated. If the state error value continues to exceed the dynamic threshold, the replanning process is initiated to regenerate a portion of the control command sequence. Record status error values ​​and adjustment history, and update the device performance model for subsequent optimization.

[0014] Preferably, the present invention also includes a machine vision-based industrial product quality inspection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor, when executing the computer program, implements the steps of the above-described machine vision-based industrial product quality inspection method.

[0015] Compared with the prior art, the beneficial effects of the present invention are: A multispectral imaging system is deployed to capture product surface image data streams, which are then processed using a noise suppression algorithm to generate a cleaned image sequence. The multispectral imaging system simultaneously acquires product images in different wavelengths, including visible light, infrared, and ultraviolet, obtaining comprehensive optical information about the surface and near-surface. The noise suppression algorithm employs adaptive filtering technology to eliminate noise effects such as uneven illumination and dust interference. The cleaned image sequence retains the detailed features of the original images, providing a high-quality data foundation for subsequent analysis. Spatial segmentation is performed on the cleaned image sequence to identify multiple detection sub-regions. The spatial segmentation algorithm divides the surface into different types, such as critical regions, general regions, and edge regions, based on product structural features and functional requirements. Sub-region segmentation considers defect-prone locations and functional importance, achieving optimal allocation of detection resources. Texture and shape features are extracted for each detection sub-region. Texture features are analyzed using gray-level co-occurrence matrix and wavelet transform to determine surface roughness, directionality, and periodicity. Shape features are characterized using contour descriptors and moment invariants to represent the geometric shape and size distribution of defects. The feature extraction process adaptively selects feature parameters based on the characteristics of different sub-regions, improving the accuracy of feature representation. Texture and shape features are integrated to form a comprehensive feature map, which is represented by a multi-dimensional vector space to preserve the original distribution characteristics of the features.

[0016] The comprehensive feature map is input into a pre-trained defect detection neural network, which employs an encoder-decoder architecture. The encoder progressively extracts high-level semantic features through convolutional and pooling layers, achieving feature dimensionality reduction and abstract representation. The decoder reconstructs the feature space through deconvolution and upsampling operations, restoring detailed information and generating a defect probability distribution map. The probability distribution map displays the probability of defect occurrence at various locations on the product surface in the form of a heatmap, providing intuitive defect location information. Based on the defect probability distribution map and real-time production parameters, a defect judgment threshold is dynamically calculated. Real-time production parameters include key factors affecting quality such as equipment operating speed, ambient temperature and humidity, and material batch characteristics. The dynamic threshold calculation uses a multivariate regression model to establish the correlation between production parameters and defect probability. The threshold is adaptively adjusted according to production status, increasing the detection standard when operating conditions are stable and appropriately relaxing requirements when parameters fluctuate. A defect classification report is generated, recording detailed information such as defect type, location, size, and confidence level. The report format is standardized for easy quality traceability and statistical analysis. A sequence of control instructions is generated based on the defect classification report, including instructions for equipment parameter adjustment, product sorting marking, and process optimization suggestions. Control commands are transmitted to the production execution system via industrial communication protocols, achieving closed-loop control from detection results to production regulation. Through the synergistic effect of multispectral imaging, spatial segmentation, feature fusion, and dynamic thresholds, precise detection and intelligent control of industrial product quality are achieved. Multispectral information expands the detection dimensions, regional analysis improves detection specificity, dynamic thresholds enhance system adaptability, and closed-loop control ensures quality stability. Attached Figure Description

[0017] Figure 1 This is a schematic diagram illustrating the working principle of the machine vision-based industrial product quality inspection method described in this invention. Figure 2 A flowchart for generating a cleaned image sequence; Figure 3 A flowchart for generating the comprehensive feature map; Figure 4 A graph showing the impact of the number of sub-regions on segmentation accuracy and processing time. Figure 5 This is a heatmap showing the probability distribution of defects at the pixel level. Detailed Implementation

[0018] 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 embodiments of the present invention, and not all embodiments. 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.

[0019] Please see Figure 1This invention provides a machine vision-based method and system for industrial product quality inspection. The method includes: deploying a multispectral imaging system to capture image data streams of the target product surface. This system consists of a set of precisely calibrated industrial cameras arranged around the production line to cover the entire surface area of ​​the product. The image data stream is transmitted to a processing unit via a high-speed data interface. The processing unit runs a noise suppression algorithm to preprocess the raw image data. This algorithm combines adaptive median filtering and wavelet transform to effectively eliminate random noise introduced by ambient light fluctuations and electromagnetic interference, generating a clean image sequence with a significantly improved signal-to-noise ratio. Subsequently, spatial segmentation is performed on the clean image sequence. Edge detection and region growing algorithms are used to divide the product surface into multiple detection sub-regions with clear boundaries. For each sub-region, its gray-level co-occurrence matrix is ​​calculated to extract texture features. Simultaneously, its geometric shape features are obtained through contour analysis. These features are standardized and then fused into a comprehensive feature map. The comprehensive feature map is fed into a defect detection neural network pre-trained with a large number of labeled samples. This network employs an encoder-decoder architecture. The encoder extracts abstract features through multiple convolutional layers and downsampling, while the decoder gradually recovers spatial details through upsampling and skip connections, outputting the probability of each pixel belonging to various defect types. This ultimately generates a defect probability distribution map of the same size as the input image. The system reads real-time sensor data from the production line, including real-time production parameters such as conveyor belt speed, material batch number, and equipment operating status. Combining this with the statistical characteristics of the probability values ​​in each region of the defect probability distribution map, a dynamic threshold algorithm is used to calculate the defect judgment threshold under the current production conditions. Based on this threshold, the probability is then classified... Figure 2 The system quantifies and generates a defect classification report that details the location, type, and size of defects. Based on the content of the defect classification report, the system calls a pre-set control logic rule library to generate a series of precise control commands. These commands are encapsulated into standard protocol messages and sent in real time to the production execution system via the industrial network, driving production line equipment such as robotic arms, laser marking machines, or sorting devices to perform corresponding adjustment actions.

[0020] Example 1: See Figure 2In practical implementation, the deployment of camera arrays in a multispectral imaging system needs to be planned according to the actual layout of the industrial site. The camera array typically consists of multiple high-resolution industrial cameras mounted on fixed supports above the production line, ensuring that the optical axis of each camera is perpendicular to the product surface to obtain distortion-free images. The configuration process of the camera array includes determining the number of cameras, their relative positions, and the field of view coverage to completely capture all surface areas of the target product, avoiding blind spots or excessive overlap. Adjusting the spectral band of each camera involves selecting optical filters, which are mounted in front of the camera lens to isolate specific wavelengths of light, such as the red, green, and blue bands in the visible light range or the near-infrared band, to accommodate the reflective properties of different product surfaces. Exposure time adjustments are dynamically set based on the production line speed and ambient lighting conditions. High-speed production lines require shorter exposure times to prevent motion blur, while low-light environments require longer exposure times to ensure sufficient image brightness. The simultaneous acquisition of multi-band images of the product surface under different lighting conditions is achieved through a hardware synchronization signal. All cameras are connected to the same trigger source. When the product reaches a preset position, the trigger signal simultaneously activates all cameras to perform exposure, ensuring that the multi-band images are strictly aligned in time. In some embodiments, the multispectral imaging system also integrates an auxiliary illumination unit. The illumination unit provides a stable and uniform light source, and the spectral characteristics of the light source are matched with the spectral bands of the camera to reduce the impact of external light fluctuations on image quality.

[0021] Pixel-level fusion of multi-band images employs a multi-resolution image fusion algorithm. The algorithm first performs Laplacian pyramid decomposition on each band, breaking the image down into sub-band images at different scales. During fusion, for each pixel location, a fusion weight is calculated based on local region features such as gradient magnitude or entropy. Bands with higher weights contribute more detail to the fusion result. The generated high dynamic range (HDR) image simultaneously preserves both dark and bright details, avoiding overexposed or underexposed areas. The pixel value range of the HDR image is typically compressed to a range acceptable to the display device using tone mapping techniques. When applying adaptive filtering algorithms to smooth HDR images, the filtering algorithm adaptively adjusts the filtering parameters based on the image's local statistical characteristics. For example, a larger filter kernel is used in flat areas to enhance noise reduction, while a smaller filter kernel is used in edge areas to preserve image details. Adaptive filtering algorithms can be Wiener filtering based on local variance or filtering methods based on anisotropic diffusion. These methods effectively suppress Gaussian noise and salt-and-pepper noise while maintaining image edge sharpness. It is understandable that smoothing not only reduces the noise level of the image, but also improves the overall contrast of the image.

[0022] The brightness uniformity index is extracted from the smoothed image by dividing the image into multiple non-overlapping block regions, calculating the average gray value of each block region, and then calculating the standard deviation of the average gray values ​​of all block regions as a uniformity measure. The brightness uniformity index reflects whether the image illumination is uniform; the smaller the index value, the more uniform the illumination, which helps to identify false defects caused by shadows or uneven lighting. Contrast distribution is evaluated by calculating the contrast values ​​of global or local regions of the image. Contrast values ​​can be calculated using the standard deviation, gradient magnitude histogram, or Michelson contrast formula. Contrast distribution information is used to determine whether the image has sufficient detail sharpness; low-contrast images may affect the accuracy of defect detection. These image quality assessment parameters include the brightness uniformity index and contrast distribution, and the parameter values ​​are recorded and used for subsequent image frame selection decisions. In some embodiments, image quality assessment parameters may also include other indicators such as signal-to-noise ratio and sharpness to comprehensively evaluate image quality. The process of selecting the optimal image frame sequence based on the image quality assessment parameters involves continuously monitoring multiple frames of images acquired on the pipeline, calculating the quality parameters for each frame, and setting a threshold range. Optionally, the selection strategy could be to select several consecutive frames with the highest overall quality parameter scores, or to dynamically select the current optimal frame sequence using a sliding window approach. The frames constituting the cleaned image sequence must ensure that all quality parameters are within preset ranges, guaranteeing that each frame in the sequence is suitable for subsequent processing.

[0023] It is understandable that the calibration of a multispectral imaging system includes intrinsic and extrinsic parameter calibration of the camera. Intrinsic parameter calibration determines the camera's focal length, principal point, and distortion coefficients, while extrinsic parameter calibration determines the relative position and attitude between cameras. The calibration process uses a standard calibration board with patterns of known size. Camera parameters are calculated by capturing multiple images of the calibration board. The reliability of synchronous acquisition depends on the accuracy of the hardware triggering circuit, which typically employs a high-precision timing controller to ensure that all cameras are exposed simultaneously within microsecond-level errors. The computational efficiency of the pixel-level fusion algorithm needs to be optimized to meet the requirements of real-time processing, for example, by using GPUs to accelerate parallel computing to reduce processing latency. The parameter settings of the adaptive filtering algorithm need to be adjusted according to the specific application scenario. Parameter adjustment can be achieved by determining the optimal value experimentally or by dynamically optimizing using adaptive learning methods. The threshold setting for image quality assessment parameters is based on historical data or domain knowledge, and the threshold should be able to effectively distinguish between qualified and poor-quality images. The algorithm for selecting the optimal image frame sequence also needs to consider real-time constraints; the algorithm should be able to complete decisions within milliseconds to keep up with the production line pace. Optionally, the system can introduce a feedback mechanism to dynamically adjust the selection criteria for image quality assessment parameters based on subsequent processing results in order to continuously optimize performance.

[0024] Example 2: See Figure 3In its implementation, the watershed algorithm is used to divide the purified image sequence into regions. Based on image gradient information, the watershed algorithm simulates the concept of hydrological ridges, treating image grayscale values ​​as terrain height. Regions with large gradient amplitudes correspond to watershed lines, while regions with small gradient amplitudes correspond to catchment basins. Before processing, the purified image sequence needs to be preprocessed, including Gaussian filtering to reduce the impact of noise on gradient calculation. Then, the gradient amplitude map of the image is calculated, obtained through convolution using the Sobel or Canny operator. The watershed algorithm simulates the flooding process starting from the local minimum point of the gradient amplitude map. When water from different catchment basins is about to converge, a boundary line is formed. These boundary lines are the boundaries of the detection sub-regions, and the boundary coordinates are obtained by tracing the pixel coordinates on the boundary line. After determining the boundary coordinates of each detection sub-region, the system assigns a unique identifier to each region and stores its contour point sequence for subsequent feature extraction. In some embodiments, the watershed algorithm is prone to oversegmentation, which is caused by image noise or texture details. To avoid oversegmentation, a label-controlled watershed process can be performed before applying the watershed algorithm. The label-controlled watershed guides the segmentation process by predefining foreground and background labels.

[0025] The gray-level co-occurrence matrix (GLCM) of pixels within each detection sub-region is calculated. The GLCM is a statistical tool describing image texture features, constructed by calculating the frequency of pixel pairs occurring at specific spatial locations in the image. Constructing the GLCM requires setting two parameters: the distance and direction between pixel pairs. Distance is typically taken in units of 1, 2, or 3 pixels, while direction is taken in four common directions: 0 degrees, 45 degrees, 90 degrees, and 135 degrees. For each detection sub-region, its grayscale image data is extracted, and multiple GLCMs are generated based on the set distance and direction parameters. Then, statistical features are extracted from each GLCM. Commonly used features include contrast, correlation, energy, and homogeneity. Contrast measures the degree of local variation in the image, correlation represents the linear dependence between pixel pairs, energy reflects the uniformity of the image's grayscale distribution, and homogeneity describes the fineness of the texture. These features are combined into a multi-dimensional vector called the texture feature vector, which captures the texture pattern information of the detection sub-region. It is understandable that the computational efficiency of the GLCM is crucial for real-time processing, and can be accelerated by optimizing memory access and parallel computing.

[0026] The geometric properties of each detection sub-region are measured, including area, perimeter, and convex hull feature. The area is obtained by counting the number of pixels within the sub-region, with each pixel representing one unit area. The perimeter is calculated by determining the length of the sub-region's boundary, which consists of a series of consecutive pixels. The perimeter can be calculated using a chain code algorithm or by accumulating Euclidean distances. The convex hull feature is obtained by calculating the convex hull of the sub-region's point set. The convex hull is the smallest convex polygon containing all points, and is typically represented as the ratio of the convex hull area to the area of ​​the original region, reflecting the region's compactness. These geometric properties collectively constitute a shape feature vector, which describes the macroscopic morphological characteristics of the detection sub-region. In some embodiments, other geometric properties such as eccentricity and principal axis orientation can be extracted to enrich the shape description. Optionally, the calculation of geometric properties can use readily available functions from image processing libraries, such as contour analysis tools in OpenCV, to ensure accuracy and efficiency.

[0027] The texture and shape feature vectors are normalized to eliminate dimensional differences and inconsistencies in numerical ranges between different features. The normalization method employs min-max scaling. Min-max scaling linearly transforms each feature value to the [0,1] interval, with the transformation formula based on the minimum and maximum values ​​of the feature. Normalized feature values ​​have the same scale. After normalization, the texture and shape feature vectors are concatenated into a longer multidimensional feature array. The concatenation operation is performed along the feature dimensions; for example, if the texture feature vector is n-dimensional and the shape feature vector is m-dimensional, the concatenated array will be n+m-dimensional. This multidimensional feature array contains all the feature information of the detected sub-region, but its dimensionality may be high, leading to increased computational complexity and storage overhead. Optionally, feature selection can be performed before normalization to remove redundant or irrelevant features and reduce dimensionality.

[0028] Principal Component Analysis (PCA) is a linear dimensionality reduction technique used to reduce the dimensionality of a multidimensional feature array. PCA maps the original features to a new feature space through orthogonal transformations; these new features are called principal components, which are then ordered by variance. PCA calculates the covariance matrix of the multidimensional feature array and then solves for the eigenvalues ​​and eigenvectors. The magnitude of the eigenvalues ​​reflects the variance contribution rate of the corresponding principal component. The eigenvectors corresponding to the k largest eigenvalues ​​are selected as the projection directions, where the value of k is determined by the cumulative variance contribution rate. Typically, principal components with a cumulative variance contribution rate exceeding 95% are retained. The original multidimensional feature array is projected onto the k-dimensional principal component space, resulting in a low-dimensional feature representation called a comprehensive feature map. The comprehensive feature map retains most of the variation information of the original data while significantly reducing the data dimensionality, facilitating subsequent neural network processing. It's important to understand that PCA requires the data to approximately follow a Gaussian distribution; if the feature distribution is severely skewed, data transformation may be necessary first.

[0029] The encoder portion of the defect detection neural network uses convolutional layers to extract local features. Each convolutional layer consists of multiple convolutional kernels that slide across the input image, calculating the dot product within the local receptive field to generate a feature map. Each convolutional layer is typically followed by an activation function, such as ReLU, which introduces a non-linear transformation. ReLU sets negative values ​​to zero and retains positive values. The encoder progressively extracts abstract features by stacking multiple convolutional and pooling layers. Pooling layers are used to downsample the feature map size, reducing the number of parameters. Common pooling operations include max pooling and average pooling. Max pooling selects the maximum value in a local region, while average pooling calculates the average value. Pooling layers enhance the translation invariance of features. The final layer of the encoder outputs a high-level semantic feature map, which has a smaller size but a higher number of channels. Optionally, the encoder can introduce batch normalization layers to accelerate the training process and improve model stability.

[0030] The decoder portion of the defect detection neural network uses deconvolutional layers to restore feature resolution. Deconvolutional layers, also known as transposed convolutional layers, expand the feature map size through interpolation or learned upsampling kernels. The decoder progressively upsamples the feature map by stacking deconvolutional and convolutional layers to restore its spatial resolution. Skip connections connect the feature maps of intermediate layers in the encoder with the feature maps of corresponding layers in the decoder. Skip connections fuse shallow detail features and deep semantic features to improve boundary localization accuracy. Skip connection operations are typically implemented through channel concatenation or element-wise addition. The final output layer of the decoder outputs a feature map of the same size as the input image, with the number of channels equal to the number of defect categories. A softmax function is applied to the output layer to calculate the defect category probability for each pixel. The softmax function normalizes the multi-channel output into a probability distribution, where each channel represents the probability value of a defect category. A defect probability distribution map is generated based on the defect category probabilities. This map is a three-dimensional array with dimensions of height, width, and the number of categories. The probability vector at each pixel position in the map represents the likelihood that the point belongs to any defect category. The defect probability distribution map maintains the same size as the comprehensive feature map for easy comparison and analysis later. Optionally, the cross-entropy loss function can be used when training the defect detection neural network, and the network parameters can be optimized using the gradient descent algorithm.

[0031] See Figure 4 This chart focuses on the spatial segmentation stage of industrial quality inspection. The horizontal axis represents the number of sub-regions to be inspected, the left vertical axis represents the segmentation accuracy, and the right vertical axis represents the processing time. The chart visually presents the trade-off between accuracy and efficiency in the spatial segmentation process: too few sub-regions result in coarse segmentation granularity, making it impossible to accurately identify functional areas of the product, leading to low segmentation accuracy; a moderate number of sub-regions covers key inspection areas of the product while ensuring targeted feature extraction, resulting in optimal segmentation accuracy; however, too many sub-regions introduce redundant computation due to over-segmentation, leading not only to a decrease in accuracy but also a significant increase in processing time, impacting production line inspection efficiency. This data provides direct guidance for optimizing spatial segmentation parameters in industrial scenarios, helping engineers select the optimal number of sub-regions to be inspected in actual production, balancing inspection accuracy and processing efficiency, thereby improving the overall performance of machine vision-based industrial product quality inspection.

[0032] Example 3: In specific implementation, the process of generating a defect classification report based on a defect probability distribution map begins with extracting a sequence of probability values ​​for defect regions from the defect probability distribution map. The defect probability distribution map is a three-dimensional array structure, with its height and width consistent with the input image, and its depth equal to the number of defect categories. Each pixel location stores a probability vector. When extracting the probability value sequence, the system first applies an initial probability threshold to preprocess the defect probability distribution map. The initial probability threshold is set to a low value, such as 0.1, to capture all potential defect regions. Then, a connected component analysis algorithm is used to identify pixel regions with probability values ​​exceeding the initial probability threshold. Each connected region is considered a candidate defect region. For each candidate defect region, the probability values ​​of all pixels within the region are collected to form a probability value sequence. The probability value sequence is a one-dimensional array containing the probability values ​​of all pixels in the region belonging to a specific defect category. The statistical characteristics of the probability value sequence are calculated, including the maximum, minimum, average, standard deviation, and skewness. The maximum value reflects the most likely degree of defect in the region, the average value represents the overall defect probability level, the standard deviation measures the dispersion of the probability values, and the skewness describes the symmetry of the distribution. These statistical characteristics are used to quantify the probabilistic characteristics of defect regions, providing input data for subsequent threshold calculations. In some embodiments, the extraction of probability value sequences can be performed in parallel on multiple candidate defect regions, utilizing multi-core processors to accelerate computation and improve processing efficiency. It is understood that the accuracy of the probability value sequences directly depends on the quality of the defect probability distribution map; therefore, the reliability of the initial image processing and neural network inference is crucial.

[0033] The system acquires real-time production parameters including equipment operating speed and material type. Equipment operating speed is collected in real-time by a rotary encoder installed on the production line conveyor belt; the encoder pulse frequency is converted into a linear velocity value in millimeters per second. Material type information is read from the order database of the production execution system. Each production batch is associated with a material code, which maps to material properties such as metal, plastic, or ceramic. The system maintains a baseline defect judgment threshold table, a two-dimensional lookup table where row indices correspond to material types and column indices correspond to equipment operating speed ranges. Each cell stores a baseline threshold value. Adjusting the baseline defect judgment threshold uses a linear interpolation method. Based on the current equipment operating speed and material type, the nearest neighbor point in the baseline defect judgment threshold table is found. Then, linear interpolation is performed based on the speed value and material code to obtain a baseline threshold suitable for the current production conditions. The adjustment of the baseline threshold considers material characteristics such as surface reflectivity and hardness, as well as the impact of operating speed on image blurring. At high speeds, the baseline threshold is appropriately increased to compensate for motion artifacts. In some embodiments, the baseline defect judgment threshold table can be trained offline using machine learning algorithms, and the threshold settings can be optimized using historical defect data to improve adaptability.

[0034] The sliding window method is used to analyze the changing trends of the probability value sequence. This method divides the probability value sequence into multiple overlapping or non-overlapping windows. The window size is dynamically set according to the production cycle, which is the number of products produced per unit time. The window size typically corresponds to processing probability data for several consecutive products. Within each window, moving statistics of the probability value sequence are calculated, such as the moving average and moving standard deviation. The moving average reflects the central trend of the probability values ​​within the window, while the moving standard deviation represents the degree of fluctuation. The defect judgment threshold is dynamically updated based on trend analysis within the window. Trend analysis detects the direction of change by comparing the moving statistics of consecutive windows, for example, by calculating the first difference of the moving average or fitting the slope using linear regression. The update formula for the defect judgment threshold can be expressed as: in: This indicates the updated defect determination threshold. This is the adjusted baseline threshold. It is the sensitivity coefficient. It is the change in the moving average. It is the moving standard deviation. When When the value is positive and large, it indicates an increase in the probability of defects, and the threshold... Lowering the setting to increase detection sensitivity; when When the value is negative, the threshold is increased to reduce false alarms.

[0035] The probability values ​​of defective regions are compared with dynamically updated defect judgment thresholds. This comparison is performed pixel-by-pixel. For each pixel in the defect probability distribution map, its maximum probability value (i.e., the highest probability among all defect categories) is read and compared with the current defect judgment threshold. If the probability value is greater than or equal to the threshold, the pixel is marked as a defective pixel and assigned a value of 1; otherwise, it is marked as a background pixel and assigned a value of 0. This process generates a binarized defect mask image. The binarized defect mask image is a single-channel image with the same size as the defect probability distribution map, where pixels with a value of 1 represent defective regions, and pixels with a value of 0 represent normal regions. The binarized defect mask image may contain isolated noise points or small regions due to image noise or improper threshold settings, thus requiring further processing. The comparison operation is optimized using parallel computing, applying element-level comparisons to the entire image, and using GPU acceleration to reduce latency. Optionally, a hysteresis thresholding technique can be introduced for threshold comparison, using two thresholds (a high threshold and a low threshold) to reduce uncertainty in edge pixels and improve boundary accuracy.

[0036] Morphological operations are performed on the binarized defect mask. Morphological operations are shape-based operations in image processing, commonly including opening and closing operations. The opening operation first performs erosion followed by dilation. The erosion operation uses a structuring element to slide across the image; if the structuring element is completely contained within the foreground region, the center pixel is retained; otherwise, it is set to zero. Erosion eliminates small noise points and shrinks the region. The dilation operation is the reverse of erosion. If the structuring element intersects with the foreground region, the center pixel is set to one. Dilation restores the region size and connects neighboring regions. The opening operation effectively removes noise points in the binarized defect mask whose area is smaller than the structuring element, while smoothing defect boundaries. The closing operation first performs dilation followed by erosion, filling holes inside the defect region and bridging narrow breaks, making the defect region more complete. The shape and size of the structuring element are selected based on the defect characteristics; rectangular or circular structuring elements are commonly used, with the size set based on the expected defect size. After the morphological operations, the processed binarized defect mask is labeled with connected components. Each defect's connected component is labeled, and attributes such as area, perimeter, bounding rectangle coordinates, and centroid position are calculated. These attributes are combined with probability values ​​from the defect probability distribution map to generate a defect classification report. The defect classification report is in a structured data format, such as JSON or XML, and contains an identifier, type, location coordinates, area, probability score, and severity level for each defect. The defect classification report is output to downstream systems for decision-making and control. In some embodiments, morphological operations can be applied iteratively multiple times to optimize the results, but a balance must be struck between processing time and effectiveness.

[0037] Example 4: In specific implementation, the defect type and severity level in the defect classification report are parsed. The defect classification report is a structured data file, usually in JSON or XML format. It contains a list of defects, with multiple attribute fields stored under each defect entry. The geometric attributes of each defect region are read from the defect classification report. These attributes include the defect boundary coordinates and area size. The defect boundary coordinates are obtained through a contour tracking algorithm, representing the pixel sequence of the outer contour of the defect region. The area size is obtained by counting the number of pixels within the defect region. The probability score comes from the defect probability distribution map. The probability score is the average of the probability values ​​of all pixels within the defect region, representing the overall confidence that a defect exists in that region. A weighted composite value of the geometric attributes and probability score for each defect region is calculated. Before calculating the weighted composite value, the geometric attributes and probability score need to be normalized. The boundary coordinates are converted to normalized coordinates relative to the image size, and the area size is converted to a ratio relative to the total image area. The probability score itself is within the range [0,1]. The weighted composite value is calculated using a linear weighting formula. Geometric attribute weights and probability score weights are preset constants. These weights are set based on the influence of different attributes on defect severity in historical data. The weighted composite value is called the defect severity index. The defect severity index is a scalar value; a higher value indicates a more severe defect. A predefined control strategy table is queried. This table is stored in a relational database and contains multiple entries, each defining a defect severity index range and a corresponding control action instruction code. The entries in the control strategy table are matched against the defect severity index. This matching process uses a database query language to perform a range query, find the range of the defect severity index, and return the corresponding control action parameters. An adjustment strategy is determined for each defect region. This strategy includes the type of control action to be executed and the target parameters. For example, for surface scratch defects, the adjustment strategy might be to control a laser marking machine for repair engraving. In some embodiments, the parsing of the defect classification report can use a streaming processing method, generating and parsing simultaneously to reduce overall processing latency.

[0038] A predefined control strategy table is a mapping table between defect severity indices and control actions. The structure of a control strategy table typically includes columns such as an index field, a lower limit for the severity index, an upper limit for the severity index, a control action code, a target device identifier, and action parameters. The specific content of the control strategy table is customized according to the production line configuration and product requirements. See Table 1, which shows a fragment of a control strategy table: Table 1: Control Strategy Fragment Table Severity Index Lower Limit Severity Index Upper Limit Control Action Code Target device identifier Action parameters describe 0.00 0.30 ACT_IGNORE N / A N / A Ignore minor defects 0.30 0.60 ACT_MARK Laser_Marker_1 power=30, speed=200 Mark the location of defects 0.60 0.85 ACT_REWORK Robot_Arm_2 tool=grinder,path=pattern1 Guided robotic arm repair 0.85 1.00 ACT_REJECT Ejector_3 delay=500ms Triggering rejection by sorting device It is understandable that the control strategy table needs to be maintained and updated regularly to adapt to changes in production processes and optimize control effectiveness. A control instruction sequence is generated based on the control strategy table. This sequence is a set of equipment control commands arranged in a specific order, with each command containing the target equipment address, operation code, and parameter data. The equipment control parameter database is retrieved based on the adjustment strategy. This database stores detailed templates for various control actions, defining the instruction format and parameter placeholders. Defect location coordinates and equipment identifiers on the production line are extracted. Defect location coordinates are two-dimensional coordinates in the image coordinate system, and the equipment identifier is a unique string code identifying the actuator on the production line. The defect location coordinates are converted into target points in the equipment coordinate system. This coordinate transformation is achieved through a hand-eye calibration matrix, which describes the spatial relationship between the camera coordinate system and the equipment coordinate system. The transformation calculation involves homogeneous coordinate transformation, multiplying the image pixel coordinates by the calibration matrix to obtain three-dimensional coordinates in the equipment base coordinate system. The parameter fields in the control instruction template are filled based on the target point and equipment identifier. The control instruction template is a predefined instruction framework containing a fixed header and variable parameter parts. The filling operation involves writing the target point coordinates, action parameters, and other values ​​into the corresponding positions in the template. Generate a sequence of control commands containing position and motion instructions. Position commands control the device to move to the target point, while motion commands control the device to perform specific operations such as activating a laser or gripping a product. Verify the logical consistency of the control command sequence. Logical consistency checks include verifying the order of commands, preventing collisions in the movement trajectory, and ensuring parameters are within the device's allowable range. The verification process is performed using a rule engine or simulation software to ensure the command sequence can be executed safely. Optionally, the control command sequence can be encapsulated into standard industrial communication protocol messages.

[0039] The process parses the defect type and severity level from the defect classification report. Defect type information is read from the category field, which corresponds to a predefined defect classification system, such as scratches, dents, and stains. Severity levels are based on a defect severity index, typically divided into multiple levels like minor, moderate, and severe, with predefined level boundary values. Mapping to a predefined control strategy table is done by combining the defect type and severity level as a composite key. This control strategy table may contain independent sub-tables for different defect types. The geometric attributes and probability scores for each defect area are read from the defect classification report. Geometric attributes include shape descriptors such as minimum bounding rectangle, aspect ratio, and roundness. Probability scores can be the maximum, median, or a custom weighted value. A weighted composite value of the geometric attributes and probability scores for each defect area is calculated. This weighted composite value can be calculated using a non-linear weighting method, such as calculating weights based on decision trees or neural network models, to accommodate complex relationships. Finally, the predefined control strategy table is queried. This table can be distributed across multiple nodes and accessed efficiently through a database connection pool. Based on the defect severity index, the matching algorithm matches entries in the control strategy table. Boundary cases need to be handled, such as using an up or down rounding strategy when the index is exactly equal to the boundary value. An adjustment strategy is determined for each defect region. This strategy may include a combination of multiple control actions, and the execution order and timing relationships of these actions need to be defined. Optionally, for complex defect patterns, the adjustment strategy can be dynamically generated instead of a simple table lookup, employing a rule-based reasoning mechanism.

[0040] Based on the control strategy table, a sequence of control instructions for specific equipment is generated. This generation is a dynamic process, created based on real-time defect information and production status. The equipment control parameter database is retrieved based on the adjustment strategy. This database uses version management, recording different versions of the control template to adapt to equipment upgrades. Defect location coordinates and equipment identifiers on the production line are extracted. The defect location coordinates are filtered and smoothed to eliminate coordinate jitter. The defect location coordinates are converted into target points in the equipment coordinate system. This coordinate transformation must consider the equipment's kinematic model; for multi-axis robots, inverse kinematics is required to obtain the joint angles. The parameter fields in the control instruction template are filled in based on the target points and equipment identifiers. Parameter fields include position coordinates, motion speed, acceleration, and force; the values ​​must be converted to the data format of the equipment driver. A sequence of control instructions containing position and motion instructions is generated. Position instructions may be absolute or relative coordinate instructions, and motion instructions include digital and analog output instructions. The logical consistency of the control instruction sequence is verified, including deadlock detection, resource conflict detection, and timing constraint checks. It is ensured that there are no conflicts between instructions; no conflicts mean that different instructions do not contradict each other in controlling the same equipment, and motion trajectories do not interfere with each other. Optionally, the verification process can incorporate formal verification methods, using temporal logic to prove the system's security.

[0041] See Figure 5 This chart focuses on the defect detection stage of industrial quality inspection, presenting the probability distribution of defects on the product surface in pixels. The horizontal axis represents the X-coordinate of the image, the vertical axis represents the Y-coordinate, and the color bars on the right represent the defect probability. The chart shows three distinct defect areas: the upper left area, dominated by dark red and orange, has a defect probability close to 1, indicating a high-confidence defect area; the lower left area, dominated by light green and yellow, has a low to medium defect probability; and the lower right area, dominated by orange and yellow, has a moderate to high defect probability. This chart intuitively displays the output of the defect detection neural network, clearly showing the probability of defects at different locations on the product surface through pixel-level probability distribution visualization. It provides direct data support for subsequent dynamic calculation of defect judgment thresholds based on probability distribution maps combined with real-time production parameters, making the location, range, and severity of defect areas readily apparent. This helps the system accurately identify high-risk defect areas and lays a visual foundation for the generation of defect classification reports and the issuance of control commands, demonstrating the advantages of machine vision technology in the refined and quantitative aspects of industrial defect detection.

[0042] Example 5: In specific implementation, the system retrieves equipment control parameter databases based on adjustment strategies. These databases are relational database management systems that store equipment control instruction templates corresponding to various defect types. Adjustment strategies originate from the matching results of defect classification reports and predefined control strategy tables. Each adjustment strategy explicitly specifies the type of control action to be taken; for example, for a "surface scratch" defect, the adjustment strategy might instruct "laser repair." The retrieval process is implemented using a structured query language. The system sends a query request to the equipment control parameter database based on the defect type code specified in the adjustment strategy. The query request includes the defect type code as a key condition. The equipment control parameter database returns control instruction templates associated with that defect type. These templates are predefined text format files, typically using XML or JSON structures. The templates contain the basic framework of the instructions and parameter placeholders that need to be dynamically filled. For example, an instruction template for controlling a six-axis industrial robot might contain parameter fields such as joint target angles, motion speed, and acceleration. These fields are marked with specific tags in the template, awaiting the filling of actual values. The defect location coordinates and equipment identifiers on the production line are extracted. The defect location coordinates are obtained from the defect classification report and are two-dimensional data in the image pixel coordinate system. The equipment identifier is a string read from the production execution system configuration file and is used to uniquely identify a specific piece of equipment on the production line. The defect location coordinates are then converted into target points in the equipment coordinate system. Coordinate transformation is the core step and relies on a precise hand-eye calibration system. The hand-eye calibration system calculates the transformation matrix between the camera coordinate system and the robot's base coordinate system by pre-acquiring images of multiple calibration boards and the robot's end effector position. The transformation calculation process involves homogeneous coordinate transformation. The two-dimensional pixel coordinates are first back-projected to the camera's three-dimensional coordinate system through the camera intrinsic parameter matrix, and then transformed to the robot's base coordinate system through the hand-eye calibration matrix, ultimately obtaining the three-dimensional target point coordinates that the robotic arm's end effector needs to reach. Based on the target point and equipment identifier, the parameter fields in the control command template are filled in; this is a data binding process. The system parses the control command template and identifies all parameter placeholders, such as... <x> , <y> , <z> , <speed>Then, the calculated 3D coordinates of the target point and the motion speed parameters obtained from the adjustment strategy are used to replace the corresponding placeholders one by one. A control command sequence containing position and motion commands is generated. Position commands guide the equipment to move to the target point, and motion commands control the equipment to perform specific operations, such as turning on the laser or controlling the pneumatic gripper. The complete control command sequence is an ordered list of commands with strict temporal order logic. The logical consistency of the control command sequence is verified. Logical consistency checks are performed through a separate verification module. This module loads a digital twin model of the production line and simulates the execution of the control command sequence in a virtual environment. The simulation process checks whether the robotic arm's motion trajectory will collide with itself or interfere with the environment, whether the motion parameters of each axis exceed physical limits, and whether there are resource conflicts or timing errors between multiple commands. Ensuring no conflicts between commands is crucial for production safety; any detected conflict will cause the command sequence to be marked as invalid and returned for replanning. Optionally, the verification module can integrate formal verification methods, using temporal logic to mathematically prove the safety properties of the command sequence.

[0043] Real-time operational data of equipment on the production line is collected through a sensor network. This network consists of various sensors distributed across key nodes of the production line, including photoelectric encoders mounted on servo motors to measure motor speed and position, torque sensors mounted on robotic arm joints to measure load, and temperature sensors attached to critical equipment components to monitor temperature rise. These sensors periodically upload real-time operational data to the central monitoring system via a fieldbus network. The real-time operational data is encapsulated into a standard data structure, including a timestamp, equipment identifier, sensor type, and measured value. The real-time operational data is compared with the expected state of the control command sequence, which is predicted based on the control command sequence and the equipment dynamics model. For example, if a control command requires the robotic arm to move linearly from point A to point B within 500 milliseconds, the expected state is that during the execution of the command, the end effector of the robotic arm should be on the straight trajectory from point A to point B, and the speed curve should conform to the preset acceleration and deceleration plan. The comparison process is continuous; the system calculates the error value between the actual operational data and the expected state in real time. For example, the position deviation is the Euclidean distance between the actual and expected positions, and the speed deviation is the difference between the actual and expected speeds. After calculating the state error value, the system compares it with a dynamic threshold. This dynamic threshold is not fixed but adaptively adjusts based on the device's current operating state and historical performance data. For example, during high-speed movement, the allowable position error threshold may be appropriately relaxed, while during precise positioning, the threshold is tightened. If the state error value consistently exceeds the dynamic threshold, a replanning process is initiated. Consistently exceeding the threshold means that the error value has been higher than the threshold for several consecutive sampling periods, indicating a persistent deviation in the system. The replanning process pauses the execution of the current command sequence, reassesses the current environmental and device states, and generates some or all new control command sequences based on the latest information to correct the deviation and bring the system back to the expected trajectory. State error values ​​and adjustment history are recorded. All real-time operating data, state error values, and replanning events are recorded in detail in the historical database. This data forms the historical archive of device operation for subsequent analysis and optimization. The device performance model is updated for further optimization. The device performance model is a mathematical model describing the dynamic characteristics of the device, including parameters such as friction coefficient and inertia. By analyzing recorded historical data, system identification algorithms can be used to update model parameters, enabling the model to more accurately reflect the true characteristics of the device. This allows for more precise predictions and reduces state errors when generating subsequent control command sequences. In some embodiments, sensor data fusion techniques, such as Kalman filtering, can be employed to improve the accuracy and reliability of individual sensor measurements, thereby more accurately calculating state errors.

[0044] It is understandable that real-time monitoring and replanning constitute a closed-loop feedback control system, enabling the entire quality inspection and execution system to adapt to uncertainties and disturbances in the production process. In some embodiments, the adjustment of dynamic thresholds can employ machine learning algorithms to automatically optimize the threshold curve based on historical error data, adapting to slow changes in equipment performance. Optionally, for non-critical minor errors, the system can be designed with a tolerance band, triggering replanning only when the error continuously exceeds the tolerance band, thus avoiding overly frequent interventions. Optionally, the recorded data in the historical database can be further used for predictive maintenance analysis, providing early warnings of potential equipment failures by analyzing long-term degradation trends in equipment performance.

[0045] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.

[0046] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.< / speed> < / z> < / y> < / x>

Claims

1. A machine vision-based industrial product quality detection method, characterized by, The method comprises: Deploying a multispectral imaging system to capture image data streams of the target product surface and processing the image data streams through a noise suppression algorithm to generate a sequence of purified images; Spatially segmenting the sequence of purified images, identifying a plurality of detection sub-regions, and extracting texture features and shape features of each detection sub-region to integrate into a comprehensive feature map; Inputting the comprehensive feature map into a pre-trained defect detection neural network, which includes an encoder and a decoder structure, to output a defect probability distribution map; Based on the defect probability distribution map, combining real-time production parameters to dynamically calculate defect judgment thresholds and generate a defect classification report; According to the defect classification report, a control instruction sequence is generated and transmitted to the production execution system to adjust the production line equipment.

2. The machine vision-based industrial product quality inspection method of claim 1, wherein, The deployment of the multispectral imaging system to capture image data streams of the target product surface and process the image data streams through a noise suppression algorithm to generate a sequence of purified images comprises: Configuring the camera array in the multispectral imaging system, adjusting the spectral band and exposure time of each camera, and synchronously collecting multi-band images of the product surface under different lighting conditions; Pixel-level fusion of multi-band images to generate high dynamic range images; Applying an adaptive filtering algorithm to smooth the high dynamic range images to reduce environmental noise; Extracting the brightness uniformity index and contrast distribution in the smoothed images as image quality evaluation parameters; According to the image quality evaluation parameters, select the optimal image frame sequence to form the purified image sequence.

3. The machine vision-based industrial product quality inspection method according to claim 2, wherein, The spatial segmentation of the purified image sequence, the identification of a plurality of detection sub-regions, and the extraction of texture features and shape features of each detection sub-region to integrate into a comprehensive feature map comprises: Using a watershed algorithm to divide the purified image sequence into regions to determine the boundary coordinates of each detection sub-region; Calculating the gray level co-occurrence matrix of the pixel points in each detection sub-region to extract the texture feature vector; Measuring the geometric properties of each detection sub-region, including area, perimeter, and convex hull features, to form a shape feature vector; Normalizing the texture feature vector and shape feature vector and concatenating them into a multi-dimensional feature array; Performing principal component analysis on the multi-dimensional feature array to reduce the dimension and generate a comprehensive feature map.

4. The machine vision-based industrial product quality inspection method according to claim 3, wherein, The input of the comprehensive feature map into a pre-trained defect detection neural network, which includes an encoder and a decoder structure, to output a defect probability distribution map comprises: The encoder part of the defect detection neural network uses convolutional layers to extract local features and compresses the feature dimensions through pooling layers; The decoder part of the defect detection neural network uses deconvolutional layers to restore the feature resolution and introduces skip connections to fuse shallow features; At the output layer of the defect detection neural network, a softmax function is applied to calculate the defect class probability of each pixel point; According to the defect class probability, a defect probability distribution map is generated, which marks the location and size of suspicious defect regions; The defect probability distribution map and the comprehensive feature map have the same size, which is convenient for subsequent comparison.

5. The machine vision-based industrial product quality inspection method according to claim 4, wherein, The dynamic calculation of defect judgment thresholds based on the defect probability distribution map and the combination of real-time production parameters to generate a defect classification report comprises: Extracting a probability value sequence of the defect region from the defect probability distribution map, and calculating statistical features of the probability value sequence; Obtaining the equipment running speed and material type in the real-time production parameter, and adjusting the benchmark value of the defect judgment threshold; Using a sliding window method to analyze the trend of the probability value sequence, and dynamically updating the defect judgment threshold; Comparing the probability value of the defect region with the defect judgment threshold to generate a binary defect mask; Performing morphological operations on the binary defect mask to remove noise points, and generating a defect classification report.

6. The machine vision-based industrial product quality inspection method according to claim 5, wherein, The control instruction sequence generated according to the defect classification report is transmitted to a production execution system to adjust the production line equipment, and the method comprises the following steps: Analyzing the defect type and severity level in the defect classification report, and mapping to a predefined control strategy table; According to the control strategy table, a control instruction sequence for a specific device is generated, including adjusting the mechanical arm trajectory or modifying the laser power; The control instruction sequence is encoded into a digital signal and transmitted to the production execution system through industrial Ethernet; The production execution system analyzes the digital signal and issues instructions to the production line equipment driver; Real-time monitoring of equipment state feedback ensures correct execution of the control instruction sequence.

7. The machine vision-based industrial product quality inspection method according to claim 6, wherein, The method comprises the following steps: Reading the geometric properties and probability scores of each defect region from the defect classification report, wherein the geometric properties include defect boundary coordinates and area size, and the probability scores come from the defect probability distribution map; Calculating the weighted comprehensive value of the geometric properties and probability scores of each defect region to obtain a defect severity index; Querying the predefined control strategy table, which contains the mapping relationship between the defect severity index range and the corresponding control action; According to the defect severity index matching the entries in the control strategy table, the adjustment strategy for each defect region is determined.

8. The machine vision-based industrial product quality inspection method of claim 6, wherein, The method comprises the following steps: Based on the adjustment strategy, retrieve the device control parameter database to obtain the control instruction template matched with the defect type; Extracting the defect position coordinates and equipment identifier on the production line, and converting the defect position coordinates into target points in the equipment coordinate system; According to the target point and equipment identifier, fill in the parameter field in the control instruction template to generate a control instruction sequence containing position instructions and action instructions; Verify the logical consistency of the control instruction sequence to ensure that there is no conflict between the instructions.

9. The machine vision-based industrial product quality inspection method of claim 7, wherein, The method comprises the following steps: Collecting real-time running data of the equipment on the production line through a sensor network, including motor speed, position deviation and temperature reading; Comparing the real-time running data with the expected state of the control instruction sequence to calculate the state error value; If the state error value continuously exceeds the dynamic threshold, start the re-planning process to regenerate part of the control instruction sequence; Record the state error value and adjustment history, and update the equipment performance model for subsequent optimization. 10.A machine vision-based industrial product quality detection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, The processor, when executing the computer program, implements the steps of the machine vision-based industrial product quality detection method of any one of claims 1 to 9.

Citation Information

Patent Citations

  • Semiconductor spray header hole detection method and device and medium

    CN119090819A

  • Textile fabric product defect detection method and system

    CN119290896A

  • Industrial article appearance detection method and system based on machine vision

    CN119672020A

  • Glue leakage prevention detection method and system based on image recognition

    CN120339206A

  • Display panel defect detection method and system

    CN120510119A

Cited By

  • A pet food particle quality detection method and system based on image recognition

    CN122454563A