Online quality inspection and feedback stamping system based on machine vision

By using machine vision technology to perform image preprocessing and feature extraction in the stamping quality detection system, combined with the defect identification and feedback mechanism of the convolutional neural network, the problem of insufficient detection accuracy caused by noise interference is solved, and higher detection accuracy and real-time quality control are achieved.

CN119747468APending Publication Date: 2025-04-04SUZHOU JIEMAO METAL PROD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510090433.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When facing noise interference, existing stamping quality detection systems are difficult to accurately distinguish between noise pixel points and defective pixel points, resulting in insufficient detection accuracy and reliability.

Method used

The online quality detection and feedback system based on machine vision is adopted, and feature extraction and defect recognition are performed through image preprocessing modules (including denoising, smoothing and contrast enhancement) and convolutional neural networks, and stamping process parameters are adjusted in real time in combination with the feedback mechanism.

Benefits of technology

Effectively reduce noise interference, improve the recognition accuracy of defective pixel points, and enhance the system's adaptability and real-time processing quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119747468A_ABST
    Figure CN119747468A_ABST
Patent Text Reader

Abstract

The present invention discloses an online quality inspection and feedback stamping system based on machine vision, comprising: an image acquisition module: responsible for real-time acquisition of image data of the surface of a stamping part; an image preprocessing module: responsible for preprocessing the acquired data; a feature extraction and defect recognition module: extracting features related to defects from the preprocessed image, analyzing the extracted features, and identifying defective pixels; a quality inspection and judgment module: responsible for judging the processing quality of the stamping part according to the result of defect recognition; in the present invention, advanced image preprocessing technology is adopted to reduce noise, smooth and increase contrast, reduce noise interference in the image, effectively reduce the number or intensity of noise pixels, make defective pixels more prominent, and improve the accuracy of subsequent processing. The system can learn the feature differences between noise pixels and defective pixels, thereby realizing automatic distinction between them.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of stamping technology, and in particular to an online quality detection and feedback stamping system based on machine vision. Background Art

[0002] Stamping is a commonly used processing method, which mainly relies on presses and dies to apply external forces to plates, strips, pipes and profiles, so as to produce plastic deformation or separation, thereby obtaining workpieces (i.e. stamping parts) of the required shape and size. Stamping processing is a production technology that uses the power of conventional or special stamping equipment to directly subject the sheet metal to deformation force in the die and deform it, thereby obtaining product parts of a certain shape, size and performance. Sheet metal, die and equipment are the three elements of stamping processing. In the stamping process, quality inspection plays a vital role. Quality inspection can ensure that the quality of stamping parts meets the design requirements. Through strict dimensional measurement, surface quality inspection, strength and hardness testing and other links, non-compliant products can be discovered and corrected in time, and unqualified products can be prevented from flowing into subsequent processes or markets, thereby ensuring the quality and performance of the final product. Machine vision can realize automatic judgment and recognition of workpiece size, shape, color and other characteristics, and is a necessary means to achieve industrial automation and intelligence.

[0003] In the existing technology, visual processing technologies such as image segmentation or enhancement are usually used to extract defects on the surface of stamping parts and then detect their processing quality. However, a common problem is that in the process of collecting stamping surface images, the images will inevitably be disturbed by various noises. These noises cause a large number of noise pixels to appear in the image, which are visually very similar to the pixels representing defects.

[0004] Noise pixels and defective pixels are both presented as highlight areas in the image, and their grayscale values ​​are relatively high and close. Due to this similarity, existing visual processing technologies often find it difficult to accurately distinguish them, which greatly reduces the accuracy of stamping parts processing quality inspection and makes the inspection results unreliable. Therefore, an online quality inspection and feedback stamping system based on machine vision is proposed. Summary of the invention

[0005] The purpose of the present invention is to solve the problem existing in the prior art that traditional systems often show insufficient generalization ability when faced with new or complex emotional expressions. In addition, when faced with environmental changes, manual adjustment of model parameters is often required, and there is a lack of dynamic adjustment capability. An online quality inspection and feedback stamping system based on machine vision is proposed.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] Online quality inspection and feedback stamping system based on machine vision, including:

[0008] Image acquisition module: responsible for real-time acquisition of image data on the surface of stamping parts;

[0009] Image preprocessing module: responsible for preprocessing the collected data;

[0010] Feature extraction and defect recognition module: extracts defect-related features from the preprocessed image, analyzes the extracted features, and identifies defective pixels;

[0011] Quality inspection and judgment module: responsible for judging the processing quality of stamping parts based on the results of defect identification;

[0012] Feedback and control system module: responsible for sending feedback signals and making corresponding adjustments, including adjusting stamping process parameters, equipment status or production line speed, etc.;

[0013] Data management and analysis module: responsible for storing and managing the data generated during the quality inspection process and providing data analysis functions;

[0014] User interface and interaction module: provide a friendly user interface;

[0015] The image acquisition module transmits the collected stamping part surface image data to the image preprocessing module. The preprocessed image data will be used in the feature extraction and defect recognition module. The feature data extracted by the feature extraction and defect recognition module will be passed to the quality inspection and judgment module. The quality inspection and judgment module generates a quality feedback signal based on the inspection result and passes it to the feedback and control system module. The data management and analysis module is responsible for storing and analyzing the data generated during the quality inspection process, and passing the analysis results to the user interface and interaction module.

[0016] The above technical solution further includes:

[0017] The image acquisition module includes a visual sensor unit, an image acquisition unit and a light source control unit. The visual sensor unit is responsible for capturing the image of the target object. The visual sensor unit includes a camera and a lens. The camera is responsible for capturing the image of the target object. The image acquisition unit is responsible for converting the original image signal captured by the visual sensor unit into a digital signal that can be recognized by a computer. The image acquisition unit includes an analog-to-digital converter (ADC) and an image processing unit (ISP). The light source control unit is responsible for controlling the light source system. The image acquisition module adds some additional functions, such as parallel processing capability, high-speed data transmission interface, etc.

[0018] The image preprocessing module includes an image denoising unit, an image smoothing unit and a contrast enhancement unit, wherein the image denoising unit is responsible for eliminating noise in the image, the image smoothing unit is responsible for smoothing the image, and the contrast enhancement unit is responsible for enhancing the contrast of the image;

[0019] The specific steps of the image denoising unit using the convolutional autoencoder for denoising are as follows:

[0020] Data preparation: Prepare noisy input data, which can be real noise data obtained through experimental equipment or artificially added noise data;

[0021] Constructing a convolutional autoencoder: The convolutional autoencoder consists of two parts: the encoder and the decoder. The encoder extracts the features of the input data through the convolution layer and compresses it into a low-dimensional feature representation. The decoder is responsible for recovering the original noise-free data from the compressed features.

[0022] Encoder convolutional layer: The encoder usually contains multiple convolutional layers, each of which extracts local features of the input data through convolution operations and downsamples through pooling layers to reduce the spatial dimension of the data;

[0023] Decoder convolutional layer: The decoder gradually recovers the spatial dimensions of the data through deconvolution or upsampling operations, and restores the details of the original data through the convolutional layer;

[0024] Training model: The convolutional autoencoder is trained using noisy input data and corresponding noise-free data. The training goal is to minimize the reconstruction error, which is the difference between the decoder output data and the noise-free data.

[0025] Adding noise: During the training process, the denoising ability of the model is enhanced by adding noise. This can be achieved by adding random noise to the input data so that the model can learn to handle various noise patterns during training.

[0026] Loss function and optimization: define a suitable loss function to measure the reconstruction error, and use an optimization algorithm to update the model parameters to minimize the loss function;

[0027] Denoising: After training, the trained convolutional autoencoder can be used to denoise new noisy data. The noisy data is input into the encoder to obtain its compressed feature representation, and then the noise-free data is restored through the decoder.

[0028] The specific steps of the image smoothing unit using the autoencoder technology to perform image smoothing are:

[0029] Select the autoencoder structure: Select an autoencoder structure that suits the task requirements. The autoencoder structure includes determining the number of encoder and decoder layers, activation function, optimization algorithm, etc.

[0030] Adding regularization terms: In the loss function of the autoencoder, adding some regularization terms, L1 regularization or L2 regularization can help reduce the complexity of the model and may indirectly lead to smoother encoding to encourage the model to learn smoother encoding representations;

[0031] Use Dropout technology: During training, use Dropout technology to randomly ignore the output of some neurons, which helps prevent overfitting and may make the model produce more stable and smooth encoding;

[0032] Design smoothness constraints: Design constraints related to smoothness, adding a loss that calculates the difference between the encoding vector and its neighboring vectors, thereby encouraging adjacent inputs to produce similar encodings;

[0033] Training the autoencoder: Use a large amount of data to train the autoencoder so that it can learn the encoding representation of the input data and meet the above smoothness requirements;

[0034] Post-processing: During the decoding phase, the decoder output is post-processed by applying smoothing filters or interpolation methods to further improve the smoothness of the output;

[0035] Evaluate and tune: Evaluate the autoencoder’s performance in terms of smoothness and make adjustments as needed, either by observing the decoded output images or calculating relevant smoothness metrics.

[0036] The specific steps of the contrast enhancement unit using the histogram equalization technology are as follows:

[0037] Calculate the grayscale histogram of the image: Count the number of times each grayscale level appears in the image to obtain the grayscale histogram, which shows the distribution of different grayscale levels in the image;

[0038] Normalized histogram distribution: Normalize the histogram and convert the number of occurrences of each gray level into a probability value so that the sum of the probabilities of all gray levels is 1. The processed histogram reflects the probability distribution of the gray levels of the image.

[0039] Calculate the cumulative distribution function: Calculate the cumulative distribution function of the normalized histogram. The cumulative distribution function represents the sum of the probabilities of all pixels from the lowest gray level to the current gray level. This step is to map the gray level of the original image to a new gray level through the cumulative distribution function.

[0040] Determine the new pixel value: According to the cumulative distribution function, the gray value of each pixel of the original image is mapped to a new gray value. In this way, the area with a more concentrated gray level distribution in the original image will be stretched after mapping, thereby improving the contrast of the image.

[0041] The feature extraction and defect recognition module includes a feature extraction unit and a defect recognition unit. The feature extraction unit is responsible for extracting features related to defects from the preprocessed image, and the defect recognition unit is responsible for analyzing and recognizing the extracted features.

[0042] The feature extraction unit uses Prewitt edge detection, and the specific steps are as follows:

[0043] Calculate gradient: Given a grayscale image (I), the Prewitt operator calculates the gradient in the horizontal and vertical directions through the following two 3x3 convolution kernels, horizontal direction G_x = \begin{bmatrix}-1&0&1\-1&0&1\-1&0&1\end{bmatrix}\ast I, vertical direction G_y = \begin{bmatrix}-1&-1&-1\0&0&0\1&1&1\end{bmatrix}\ast I, where \ast represents the convolution operation;

[0044] Determine edge strength and direction: According to the obtained G_x and G_y, calculate the edge strength G and direction θ, the edge strength G is calculated by the formula G = \sqrt{G_x^2+G_y^2}, and the direction θ is calculated by arctan(G_y / G_x);

[0045] Non-maximum suppression: By comparing the gradient strength of the current pixel with the pixels in its 8-neighborhood, if the gradient strength of the current pixel is not the local maximum, its value is set to 0, otherwise it remains unchanged;

[0046] Double threshold processing and hysteresis threshold: set two thresholds: high threshold and low threshold. If the gradient value of a pixel is higher than the high threshold, it is marked as a strong edge point. If the gradient value of a pixel is lower than the low threshold, it is marked as a non-edge point. For pixels with gradient values ​​between the two, if they are connected to a strong edge point, they are marked as a weak edge point, otherwise they are marked as a non-edge point.

[0047] Edge tracking and connection: By analyzing the points marked as edges, edge tracking and connection are performed to form a continuous edge contour;

[0048] Output result: Overlay the detected edge information onto the original image, or output the edge detection result in other ways.

[0049] The defect recognition unit uses a convolutional neural network to analyze and recognize the extracted features:

[0050] Input data representation: Assume that the input data is a multidimensional array, denoted as X, where the dimensions of X are (batch size, number of channels, height, width), representing the number of input samples, number of channels, image height, and image width, respectively;

[0051] Convolution operation: Perform sliding window convolution operation on the input data through the convolution kernel to extract the features in the input data. Assuming that the dimension of the convolution kernel is (number of channels, convolution kernel height, convolution kernel width), denoted as W, the convolution operation can be expressed by the following formula: Z[i,j]=sum(sum(sum(X[:,:,i:i+h,j:j+w]*W)))+b, where Z is the output of the convolution operation, representing the feature map, i and j represent the position of the feature map, h and w represent the height and width of the convolution kernel respectively, and b is the bias term;

[0052] Activation function: After the convolution operation, ReLU is applied to perform nonlinear transformation on the feature map to increase the network’s expressive power;

[0053] Pooling operation: By selecting the average value in the local perception area as the pooling result, the spatial dimension of the feature map is reduced and important feature information is retained;

[0054] Fully connected operation: After multiple convolution and pooling operations, the feature map is expanded into a one-dimensional vector and passed through a fully connected layer for classification or regression tasks. Each neuron in the fully connected layer is connected to all neurons in the previous layer, and the mapping relationship between input and output is established by learning weights and biases.

[0055] Loss function: In convolutional neural networks, the cross entropy loss function is used to measure the gap between the model's prediction results and the true labels;

[0056] Back propagation algorithm: Use the back propagation algorithm to calculate the gradient of the loss function with respect to the model parameters, and use gradient descent to update the model parameters to continuously optimize the performance of the model.

[0057] The quality inspection and judgment module includes a quality inspection unit and a quality judgment unit. The quality inspection unit is responsible for receiving the results output by the defect identification unit and inspecting the processing quality of the stamping parts according to the set rules. The quality judgment unit is responsible for judging whether the quality of the stamping parts is qualified based on the inspection results and using pre-set thresholds and judgment rules. The feedback and control system module includes a feedback signal generation unit and a control system unit. The feedback signal generation unit is responsible for generating corresponding feedback signals based on the results output by the quality inspection unit to indicate whether the stamping process parameters or equipment status need to be adjusted. The control system unit is responsible for receiving feedback signals and making adjustments based on preset control algorithms.

[0058] The feedback and control system module includes a feedback signal generating unit and a control system unit. The feedback signal generating unit is responsible for generating a corresponding feedback signal according to the result output by the quality detection unit. The control system unit is responsible for receiving the feedback signal and adjusting it according to a preset control algorithm. The detection result of the quality detection unit will be transmitted to the feedback signal generating unit, and a corresponding feedback signal will be generated according to the detection result. The feedback signal will be transmitted to the control system unit, and the control system will make corresponding adjustments according to the signal. After the adjustment of the control system unit is completed, the adjusted information will be fed back to the stamping equipment.

[0059] The data management and analysis module includes a data storage unit, a data analysis unit and a report generation unit. The data storage unit is responsible for storing and managing the data generated during the quality inspection process, the data analysis unit is responsible for processing and analyzing the data, and the report generation unit is responsible for generating reports based on the results of the data analysis to provide support for decision-making.

[0060] The present invention has the following beneficial effects:

[0061] 1. In the present invention, advanced image preprocessing technology is used to reduce noise, smooth and increase contrast, reduce noise interference in the image, effectively reduce the number or intensity of noise pixels, make defective pixels more prominent, and improve the accuracy of subsequent processing.

[0062] 2. In the present invention, a convolutional neural network is introduced into the system. By training a large amount of image data, the system can learn the characteristic differences between noise pixels and defective pixels, thereby realizing automatic distinction between them. It has strong adaptability and can handle various complex image situations.

[0063] 3. In the present invention, the system can also be combined with a feedback mechanism to adjust the stamping process parameters or equipment status in real time according to the detection results to eliminate or reduce the occurrence of defects. Through continuous iteration and optimization, the processing quality of stamping parts can be gradually improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 This is a system block diagram of the online quality inspection and feedback stamping system based on machine vision proposed by the present invention;

[0065] Figure 2 It is a detailed system block diagram of the present invention. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] See also Figure 1-2 As shown, the present invention is an online quality detection and feedback stamping system based on machine vision, comprising:

[0068] Image acquisition module: responsible for real-time acquisition of image data on the surface of stamping parts;

[0069] Image preprocessing module: responsible for preprocessing the collected data;

[0070] Feature extraction and defect recognition module: extracts defect-related features from the preprocessed image, analyzes the extracted features, and identifies defective pixels;

[0071] Quality inspection and judgment module: responsible for judging the processing quality of stamping parts based on the results of defect identification;

[0072] Feedback and control system module: responsible for sending feedback signals and making corresponding adjustments, including adjusting stamping process parameters, equipment status or production line speed;

[0073] Data management and analysis module: responsible for storing and managing the data generated during the quality inspection process and providing data analysis functions;

[0074] User interface and interaction module: provide a friendly user interface;

[0075] The image acquisition module transmits the collected stamping part surface image data to the image preprocessing module. The preprocessed image data will be used in the feature extraction and defect recognition module. The feature data extracted by the feature extraction and defect recognition module will be passed to the quality inspection and judgment module. The quality inspection and judgment module generates a quality feedback signal based on the inspection results and passes it to the feedback and control system module. The data management and analysis module is responsible for storing and analyzing the data generated during the quality inspection process, and passing the analysis results to the user interface and interaction module.

[0076] The working principle of the online quality inspection and feedback stamping system based on machine vision proposed in the present invention is that the system collects image data of the surface of the stamping part through the visual sensor unit in the image acquisition module, pre-processes the collected image data using the image pre-processing module, removes noise by the image denoising unit, smoothes the image by the image smoothing unit, and enhances the contrast of the image by the contrast enhancement unit;

[0077] The preprocessed image data is sent to the feature extraction and defect recognition module. The feature extraction unit extracts the features related to the defects from the preprocessed image. The defect recognition unit analyzes and recognizes the extracted features. Based on the results of feature extraction and defect recognition, the quality inspection and judgment module inspects and judges the quality of the stamping parts. The system will judge whether the stamping parts meet the requirements according to the pre-set quality standards.

[0078] After quality inspection and judgment, the system will generate a quality feedback signal and pass it to the feedback and control system module. The feedback and control system module adjusts the stamping process parameters or equipment status according to the feedback signal to achieve real-time quality control and feedback;

[0079] The system will store and analyze the data generated during the quality inspection process for subsequent data management and quality analysis. The data analysis results can provide the system with a reference for improving stamping processes and optimizing quality control. At the same time, the system will display real-time data and generate reports through the user interface and interactive modules to help users make decisions and management.

[0080] In one embodiment, for the above-mentioned image acquisition module, the image acquisition module includes a visual sensor unit, an image acquisition unit and a light source control unit. The visual sensor unit is responsible for capturing the image of the target object. The visual sensor unit includes a camera and a lens. The camera is responsible for capturing the image of the target object. The image acquisition unit is responsible for converting the original image signal captured by the visual sensor unit into a digital signal that can be recognized by a computer. The image acquisition unit includes an analog-to-digital converter (ADC) and an image processing unit (ISP). The light source control unit is responsible for controlling the light source system. The image acquisition module adds some additional functions, such as parallel processing capability, high-speed data transmission interface, etc.

[0081] In one embodiment, for the above-mentioned image preprocessing module, the image preprocessing module includes an image denoising unit, an image smoothing unit and a contrast enhancement unit, the image denoising unit is responsible for eliminating noise in the image, the image smoothing unit is responsible for smoothing the image, and the contrast enhancement unit is responsible for enhancing the contrast of the image;

[0082] The specific steps of the image denoising unit using the convolutional autoencoder for denoising are:

[0083] Data preparation: Prepare noisy input data, which can be real noise data obtained through experimental equipment or artificially added noise data;

[0084] Constructing a convolutional autoencoder: The convolutional autoencoder consists of two parts: the encoder and the decoder. The encoder extracts the features of the input data through the convolution layer and compresses it into a low-dimensional feature representation. The decoder is responsible for recovering the original noise-free data from the compressed features.

[0085] Encoder convolutional layer: The encoder usually contains multiple convolutional layers. Each convolutional layer extracts local features of the input data through convolution operations and downsamples through pooling layers to reduce the spatial dimension of the data.

[0086] Decoder convolutional layer: The decoder gradually recovers the spatial dimensions of the data through deconvolution or upsampling operations, and restores the details of the original data through the convolutional layer;

[0087] Training model: The convolutional autoencoder is trained using noisy input data and corresponding noise-free data. The training goal is to minimize the reconstruction error, which is the difference between the decoder output data and the noise-free data.

[0088] Adding noise: During the training process, the denoising ability of the model is enhanced by adding noise. This can be achieved by adding random noise to the input data so that the model can learn to handle various noise patterns during training.

[0089] Loss function and optimization: define a suitable loss function to measure the reconstruction error, and use an optimization algorithm to update the model parameters to minimize the loss function;

[0090] Denoising: After training, the trained convolutional autoencoder can be used to denoise new noisy data. The noisy data is input into the encoder to obtain its compressed feature representation, and then the noise-free data is restored through the decoder.

[0091] In one embodiment, for the above-mentioned image smoothing unit, the specific steps of the image smoothing unit using the autoencoder technology to perform image smoothing are:

[0092] Select the autoencoder structure: Select an autoencoder structure that suits the task requirements. The autoencoder structure includes determining the number of encoder and decoder layers, activation function, optimization algorithm, etc.

[0093] Adding regularization terms: In the loss function of the autoencoder, adding some regularization terms, L1 regularization or L2 regularization can help reduce the complexity of the model and may indirectly lead to smoother encoding to encourage the model to learn smoother encoding representations;

[0094] Use Dropout technology: During training, use Dropout technology to randomly ignore the output of some neurons, which helps prevent overfitting and may make the model produce more stable and smooth encoding;

[0095] Design smoothness constraints: Design constraints related to smoothness, adding a loss that calculates the difference between the encoding vector and its neighboring vectors, thereby encouraging adjacent inputs to produce similar encodings;

[0096] Training the autoencoder: Use a large amount of data to train the autoencoder so that it can learn the encoding representation of the input data and meet the above smoothness requirements;

[0097] Post-processing: During the decoding phase, the decoder output is post-processed by applying smoothing filters or interpolation methods to further improve the smoothness of the output;

[0098] Evaluate and tune: Evaluate the autoencoder’s performance in terms of smoothness and make adjustments as needed, either by observing the decoded output images or calculating relevant smoothness metrics.

[0099] In one embodiment, for the above contrast enhancement unit, the specific steps of the contrast enhancement unit using the histogram equalization technology are:

[0100] Calculate the grayscale histogram of the image: Count the number of times each grayscale level appears in the image to obtain the grayscale histogram, which shows the distribution of different grayscale levels in the image;

[0101] Normalized histogram distribution: Normalize the histogram and convert the number of occurrences of each gray level into a probability value so that the sum of the probabilities of all gray levels is 1. The processed histogram reflects the probability distribution of the gray levels of the image.

[0102] Calculate the cumulative distribution function: Calculate the cumulative distribution function of the normalized histogram. The cumulative distribution function represents the sum of the probabilities of all pixels from the lowest gray level to the current gray level. This step is to map the gray level of the original image to a new gray level through the cumulative distribution function.

[0103] Determine the new pixel value: According to the cumulative distribution function, the gray value of each pixel of the original image is mapped to a new gray value. In this way, the area with a more concentrated gray level distribution in the original image will be stretched after mapping, thereby improving the contrast of the image.

[0104] In one embodiment, for the above-mentioned feature extraction and defect recognition module, the feature extraction and defect recognition module includes a feature extraction unit and a defect recognition unit, the feature extraction unit is responsible for extracting features related to defects from the preprocessed image, and the defect recognition unit is responsible for analyzing and recognizing the extracted features;

[0105] The feature extraction unit uses Prewitt edge detection, and the specific steps are:

[0106] Calculate gradient: Given a grayscale image (I), the Prewitt operator calculates the gradient in the horizontal and vertical directions through the following two 3x3 convolution kernels, horizontal direction G_x = \begin{bmatrix}-1&0&1\-1&0&1\-1&0&1\end{bmatrix}\ast I, vertical direction G_y = \begin{bmatrix}-1&-1&-1\0&0&0\1&1&1\end{bmatrix}\ast I, where \ast represents the convolution operation;

[0107] Determine edge strength and direction: Based on the obtained G_x and G_y, calculate the edge strength G and direction θ. The edge strength G is calculated by the formula G = \sqrt{G_x^2+G_y^2}, and the direction θ is calculated by arctan(G_y / G_x);

[0108] Non-maximum suppression: By comparing the gradient strength of the current pixel with the pixels in its 8-neighborhood, if the gradient strength of the current pixel is not the local maximum, its value is set to 0, otherwise it remains unchanged;

[0109] Double threshold processing and hysteresis threshold: set two thresholds: high threshold and low threshold. If the gradient value of a pixel is higher than the high threshold, it is marked as a strong edge point. If the gradient value of a pixel is lower than the low threshold, it is marked as a non-edge point. For pixels with gradient values ​​between the two, if they are connected to a strong edge point, they are marked as a weak edge point, otherwise they are marked as a non-edge point.

[0110] Edge tracking and connection: By analyzing the points marked as edges, edge tracking and connection are performed to form a continuous edge contour;

[0111] Output result: Overlay the detected edge information onto the original image, or output the edge detection result in other ways.

[0112] In one embodiment, for the above-mentioned defect recognition unit, the defect recognition unit uses a convolutional neural network to analyze and recognize the extracted features:

[0113] Input data representation: Assume that the input data is a multidimensional array, denoted as X, where the dimensions of X are (batch size, number of channels, height, width), representing the number of input samples, number of channels, image height, and image width, respectively;

[0114] Convolution operation: Perform sliding window convolution operation on the input data through the convolution kernel to extract the features in the input data. Assuming that the dimension of the convolution kernel is (number of channels, convolution kernel height, convolution kernel width), denoted as W, the convolution operation can be expressed by the following formula: Z[i,j]=sum(sum(sum(X[:,:,i:i+h,j:j+w]*W)))+b, where Z is the output of the convolution operation, representing the feature map, i and j represent the position of the feature map, h and w represent the height and width of the convolution kernel respectively, and b is the bias term;

[0115] Activation function: After the convolution operation, ReLU is applied to perform nonlinear transformation on the feature map to increase the network’s expressive power;

[0116] Pooling operation: By selecting the average value in the local perception area as the pooling result, the spatial dimension of the feature map is reduced and important feature information is retained;

[0117] Fully connected operation: After multiple convolution and pooling operations, the feature map is expanded into a one-dimensional vector and passed through a fully connected layer for classification or regression tasks. Each neuron in the fully connected layer is connected to all neurons in the previous layer, and the mapping relationship between input and output is established by learning weights and biases.

[0118] Loss function: In convolutional neural networks, the cross entropy loss function is used to measure the gap between the model's prediction results and the true labels;

[0119] Back propagation algorithm: Use the back propagation algorithm to calculate the gradient of the loss function with respect to the model parameters, and use gradient descent to update the model parameters to continuously optimize the performance of the model.

[0120] In one embodiment, for the above-mentioned quality inspection and judgment module, the quality inspection and judgment module includes a quality inspection unit and a quality judgment unit. The quality inspection unit is responsible for receiving the results output by the defect identification unit and inspecting the processing quality of the stamping parts according to the set rules. The quality judgment unit is responsible for judging whether the quality of the stamping parts is qualified based on the inspection results and using pre-set thresholds and judgment rules. The feedback and control system module includes a feedback signal generation unit and a control system unit. The feedback signal generation unit is responsible for generating a corresponding feedback signal based on the results output by the quality inspection unit to indicate whether the stamping process parameters or equipment status need to be adjusted. The control system unit is responsible for receiving the feedback signal and making adjustments based on a preset control algorithm.

[0121] In one embodiment, for the above-mentioned feedback and control system module, the feedback and control system module includes a feedback signal generating unit and a control system unit. The feedback signal generating unit is responsible for generating a corresponding feedback signal according to the result output by the quality detection unit. The control system unit is responsible for receiving the feedback signal and adjusting it according to a preset control algorithm. The detection result of the quality detection unit will be transmitted to the feedback signal generating unit, and a corresponding feedback signal will be generated according to the detection result. The feedback signal will be transmitted to the control system unit, and the control system will make corresponding adjustments according to the signal. After the control system unit is adjusted, the adjusted information will be fed back to the stamping equipment.

[0122] In one embodiment, for the above-mentioned data management and analysis module, the data management and analysis module includes a data storage unit, a data analysis unit and a report generation unit. The data storage unit is responsible for storing and managing the data generated during the quality inspection process, the data analysis unit is responsible for processing and analyzing the data, and the report generation unit is responsible for generating reports based on the results of the data analysis to provide support for decision-making.

[0123] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. Online quality inspection and feedback stamping system based on machine vision, characterized by: include: Image acquisition module: responsible for real-time acquisition of image data on the surface of stamping parts; Image preprocessing module: responsible for preprocessing the collected data; Feature extraction and defect recognition module: extracts defect-related features from the preprocessed image, analyzes the extracted features, and identifies defective pixels; Quality inspection and judgment module: responsible for judging the processing quality of stamping parts based on the results of defect identification; Feedback and control system module: responsible for sending feedback signals and making corresponding adjustments; Data management and analysis module: responsible for storing and managing the data generated during the quality inspection process and providing data analysis functions; User interface and interaction module: provide a friendly user interface; The image acquisition module transmits the collected stamping part surface image data to the image preprocessing module. The preprocessed image data will be used in the feature extraction and defect recognition module. The feature data extracted by the feature extraction and defect recognition module will be passed to the quality inspection and judgment module. The quality inspection and judgment module generates a quality feedback signal based on the inspection result and passes it to the feedback and control system module. The data management and analysis module is responsible for storing and analyzing the data generated during the quality inspection process, and passing the analysis results to the user interface and interaction module.

2. The online quality inspection and feedback stamping system based on machine vision according to claim 1 is characterized in that: The image acquisition module includes a visual sensor unit, an image acquisition unit and a light source control unit. The visual sensor unit is responsible for capturing the image of the target object. The visual sensor unit includes a camera and a lens. The camera is responsible for capturing the image of the target object. The image acquisition unit is responsible for converting the original image signal captured by the visual sensor unit into a digital signal that can be recognized by a computer. The image acquisition unit includes an analog-to-digital converter (ADC) and an image processing unit (ISP). The light source control unit is responsible for controlling the light source system.

3. The online quality inspection and feedback stamping system based on machine vision according to claim 1 is characterized in that: The image preprocessing module includes an image denoising unit, an image smoothing unit and a contrast enhancement unit, wherein the image denoising unit is responsible for eliminating noise in the image, the image smoothing unit is responsible for smoothing the image, and the contrast enhancement unit is responsible for enhancing the contrast of the image; The specific steps of the image denoising unit using the convolutional autoencoder for denoising are as follows: Data preparation: prepare noisy input data; Constructing a convolutional autoencoder: The convolutional autoencoder consists of two parts: an encoder and a decoder. The encoder extracts the features of the input data through a convolutional layer and compresses it into a low-dimensional feature representation. The decoder is responsible for recovering the original noise-free data from the compressed features. Encoder convolutional layer: The encoder usually contains multiple convolutional layers, each of which extracts local features of the input data through convolution operations and downsamples through pooling layers to reduce the spatial dimension of the data; Decoder convolutional layer: The decoder gradually recovers the spatial dimensions of the data through deconvolution or upsampling operations, and restores the details of the original data through the convolutional layer; Training model: Use noisy input data and corresponding noise-free data to train the convolutional autoencoder; Adding noise: During the training process, noise is added to enhance the denoising ability of the model; Loss function and optimization: define a suitable loss function to measure the reconstruction error, and use an optimization algorithm to update the model parameters to minimize the loss function; Denoising: After training, the trained convolutional autoencoder can be used to denoise new noisy data.

4. The online quality inspection and feedback stamping system based on machine vision according to claim 3 is characterized in that: The specific steps of the image smoothing unit using the autoencoder technology to perform image smoothing are: Choose an autoencoder structure: Choose an autoencoder structure that suits the task requirements; Add regularization terms: Add some regularization terms to the loss function of the autoencoder to encourage the model to learn smoother encoding representations; Use Dropout technology: During the training process, use Dropout technology to randomly ignore the output of some neurons; Design smoothness constraints: Design constraints related to smoothness; Training the autoencoder: Use a large amount of data to train the autoencoder so that it can learn the encoding representation of the input data and meet the above smoothness requirements; Post-processing: During the decoding phase, the decoder output is post-processed; Evaluate and tune: Evaluate the performance of the autoencoder in terms of smoothness and make adjustments if necessary.

5. The online quality inspection and feedback stamping system based on machine vision according to claim 3 is characterized in that: The specific steps of the contrast enhancement unit using the histogram equalization technology are as follows: Calculate the grayscale histogram of the image: count the number of times each gray level appears in the image to obtain the grayscale histogram; Normalized histogram distribution: Normalize the histogram and convert the number of occurrences of each gray level into a probability value so that the sum of the probabilities of all gray levels is 1; Calculate cumulative distribution function: Calculate the cumulative distribution function of the normalized histogram; Determine the new pixel value: According to the cumulative distribution function, the gray value of each pixel of the original image is mapped to a new gray value.

6. The online quality inspection and feedback stamping system based on machine vision according to claim 1 is characterized in that: The feature extraction and defect recognition module includes a feature extraction unit and a defect recognition unit. The feature extraction unit is responsible for extracting features related to defects from the preprocessed image, and the defect recognition unit is responsible for analyzing and recognizing the extracted features. The feature extraction unit uses Prewitt edge detection, and the specific steps are as follows: Calculate gradient: Given a grayscale image (I), the Prewitt operator calculates the gradient in the horizontal and vertical directions through the following two 3x3 convolution kernels, horizontal direction G_x = \begin{bmatrix}-1&0&1\-1&0&1\-1&0&1\end{bmatrix}\astI, vertical direction G_y = \begin{bmatrix}-1&-1&-1\0&0&0\1&1&1\end{bmatrix}\ast I, where \ast represents the convolution operation; Determine edge strength and direction: According to the obtained G_x and G_y, calculate the edge strength G and direction θ, the edge strength G is calculated by the formula G = \sqrt{G_x^2+G_y^2}, and the direction θ is calculated by arctan(G_y / G_x); Non-maximum suppression: By comparing the gradient strength of the current pixel with the pixels in its 8-neighborhood, if the gradient strength of the current pixel is not the local maximum, its value is set to 0, otherwise it remains unchanged; Double threshold processing and hysteresis threshold: set two thresholds: high threshold and low threshold. If the gradient value of a pixel is higher than the high threshold, it is marked as a strong edge point. If the gradient value of a pixel is lower than the low threshold, it is marked as a non-edge point. For pixels with gradient values ​​between the two, if they are connected to a strong edge point, they are marked as a weak edge point, otherwise they are marked as a non-edge point. Edge tracking and connection: By analyzing the points marked as edges, edge tracking and connection are performed to form a continuous edge contour; Output result: Overlay the detected edge information onto the original image, or output the edge detection result in other ways.

7. The online quality inspection and feedback stamping system based on machine vision according to claim 6 is characterized in that: The defect recognition unit uses a convolutional neural network to analyze and recognize the extracted features: Input data representation: Assume that the input data is a multidimensional array, denoted as X, where the dimensions of X are (batch size, number of channels, height, width), representing the number of input samples, number of channels, image height, and image width, respectively; Convolution operation: Perform sliding window convolution operation on the input data through the convolution kernel to extract the features in the input data. Assuming that the dimension of the convolution kernel is (number of channels, convolution kernel height, convolution kernel width), denoted as W, the convolution operation can be expressed by the following formula: Z[i,j]=sum(sum(sum(X[:,:,i:i+h,j:j+w]*W)))+b, where, Z is the output of the convolution operation, representing the feature map, i and j represent the location of the feature map, h and w represent the height and width of the convolution kernel respectively, and b is the bias term; Activation function: After the convolution operation, ReLU is applied to perform nonlinear transformation on the feature map to increase the network’s expressive power; Pooling operation: By selecting the average value in the local perception area as the pooling result, the spatial dimension of the feature map is reduced and important feature information is retained; Fully connected operation: After multiple convolution and pooling operations, the feature map is expanded into a one-dimensional vector and passed through a fully connected layer for classification or regression tasks. Each neuron in the fully connected layer is connected to all neurons in the previous layer, and the mapping relationship between input and output is established by learning weights and biases. Loss function: In convolutional neural networks, the cross entropy loss function is used to measure the gap between the model's prediction results and the true labels; Back propagation algorithm: Use the back propagation algorithm to calculate the gradient of the loss function with respect to the model parameters, and use gradient descent to update the model parameters to continuously optimize the performance of the model.

8. The online quality inspection and feedback stamping system based on machine vision according to claim 7 is characterized in that: The quality inspection and judgment module includes a quality inspection unit and a quality judgment unit. The quality inspection unit is responsible for receiving the results output by the defect identification unit and inspecting the processing quality of the stamping parts according to the set rules. The quality judgment unit is responsible for judging whether the quality of the stamping parts is qualified based on the inspection results and using pre-set thresholds and judgment rules. The feedback and control system module includes a feedback signal generation unit and a control system unit. The feedback signal generation unit is responsible for generating corresponding feedback signals based on the results output by the quality inspection unit to indicate whether the stamping process parameters or equipment status need to be adjusted. The control system unit is responsible for receiving feedback signals and making adjustments based on preset control algorithms.

9. The online quality inspection and feedback stamping system based on machine vision according to claim 8 is characterized in that: The feedback and control system module includes a feedback signal generating unit and a control system unit. The feedback signal generating unit is responsible for generating a corresponding feedback signal according to the result output by the quality detection unit. The control system unit is responsible for receiving the feedback signal and adjusting it according to a preset control algorithm. The detection result of the quality detection unit will be transmitted to the feedback signal generating unit, and a corresponding feedback signal will be generated according to the detection result. The feedback signal will be transmitted to the control system unit, and the control system will make corresponding adjustments according to the signal. After the adjustment of the control system unit is completed, the adjusted information will be fed back to the stamping equipment.

10. The online quality inspection and feedback stamping system based on machine vision according to claim 1 is characterized in that: The data management and analysis module includes a data storage unit, a data analysis unit and a report generation unit. The data storage unit is responsible for storing and managing the data generated during the quality inspection process, the data analysis unit is responsible for processing and analyzing the data, and the report generation unit is responsible for generating reports based on the results of the data analysis to provide support for decision-making.