Self-adaptive PVC plate defect detection system and method based on deep learning regression algorithm
Through the adaptive PVC board defect detection system based on deep learning regression algorithm, the problems of low efficiency, inconsistent results and high cost of traditional detection methods are solved, and efficient, accurate and adaptive defect detection is achieved.
Patent Information
- Application Number
- CN202411892811.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-25
AI Technical Summary
Traditional PVC board defect detection methods are inefficient, inconsistent results, high costs, lack of automation and adaptability, making it difficult to quickly respond to material changes in production.
Adaptive PVC board defect detection system based on deep learning regression algorithm is adopted, including model training module, parameter setting module and defect detection module, and image acquisition and defect detection parameters are trained and optimized through deep learning models to achieve automated and adaptive detection.
It significantly improves the accuracy and robustness of detection, reduces manual intervention, can adaptively handle multiple types of PVC sheets, and reduces production costs.
Smart Images

Figure HDA0005201033190000011 
Figure HDA0005201033190000021
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of plate defect detection, and specifically, relates to an adaptive PVC plate defect detection system and method based on a deep learning regression algorithm. Background Art
[0002] As an important material widely used in construction, decoration, advertising and other fields, the quality of PVC board directly affects the performance and appearance of the final product. Efficient and accurate defect detection can not only improve product quality, but also significantly reduce production costs and enhance corporate competitiveness. Therefore, defect detection of PVC board has always been an important research direction in the field of industrial automation and quality control.
[0003] Traditional PVC board defect detection methods mainly include manual visual inspection and basic machine vision inspection. These methods have a series of technical problems that need to be solved urgently:
[0004] 1. Inefficiency: Manual inspection is slow and difficult to meet the needs of large-scale production;
[0005] 2. Poor consistency - the judgment criteria of different testers may be different, resulting in inconsistent test results;
[0006] 3. Fatigue effect - long-term visual inspection can easily cause worker fatigue and affect the accuracy of inspection;
[0007] 4. High cost - requires a lot of human resources, which increases production costs;
[0008] 5. Parameter adjustment depends on manual work - for different types of PVC boards (such as different colors, textures or surface treatments), the image acquisition parameters (such as exposure time, light source intensity, camera gain, etc.) are manually selected in a few preset ways, or the image acquisition parameters are directly adjusted based on manual experience. This adjustment usually lacks scientific quantitative standards, and the adjustment process is time-consuming and prone to errors, especially when facing new types of PVC boards;
[0009] 6. Lack of automated defect detection parameter adjustment - There is currently no effective automated method to automatically adjust the defect detection parameter settings (such as the threshold and sensitivity of the detection algorithm) according to the characteristics of different PVC boards. This results in the production line either having to stop and adjust the parameters when switching between different types of PVC boards, which affects production efficiency, or not considering adjusting the detection parameters at all;
[0010] 7. Poor adaptability - the preset parameters are often only suitable for specific types of PVC boards. For new or variant PVC boards, the detection effect may be greatly reduced, and it is impossible to quickly respond to changes in the characteristics of PVC boards that may occur in production (such as slight differences caused by changes in raw material batches);
[0011] 8. Limitation of detection accuracy: Fixed detection parameters are difficult to meet the detection requirements of all types of defects. Often, while improving the detection rate of a certain type of defect, it will increase the false detection rate of other types.
[0012] 9. Lack of learning ability - Existing systems usually do not have the ability to learn and optimize from historical data, and cannot automatically improve detection performance over time;
[0013] 10. Difficulty in system upgrades - When it is necessary to adapt to new types of PVC boards or detect new types of defects, it is often necessary to redesign the algorithm or retrain the model, which results in high upgrade costs and a long cycle.
[0014] These problems severely restrict the performance and application scope of PVC board defect detection systems. Especially in the face of the growing demand for diversified and personalized production, the limitations of traditional methods have become increasingly obvious. Therefore, it has become an urgent need for the industry to develop an intelligent system that can automatically adapt to the characteristics of different PVC boards and automatically optimize image acquisition and defect detection parameters. Summary of the invention
[0015] In view of the above problems existing in the prior art, the object of the present invention is to provide an adaptive PVC board defect detection system and method based on a deep learning regression algorithm.
[0016] In order to solve the above problems, the technical solution adopted by the present invention is as follows:
[0017] The adaptive PVC board defect detection system based on deep learning regression algorithm of the present invention comprises a model training module, a parameter setting module and a defect detection module; wherein:
[0018] The model training module is used to:
[0019] Collect sample training data of different types of PVC boards;
[0020] Training a deep learning regression model based on the training data;
[0021] Output the trained deep learning regression model;
[0022] The parameter setting module is connected to the defect detection module by signal, and is used to:
[0023] Load the deep learning regression model;
[0024] Collect image samples of the PVC board to be inspected;
[0025] Analyzing the image sample using the deep learning regression model;
[0026] Outputting optimized image acquisition parameters and defect detection parameters to the defect detection module;
[0027] The defect detection module is signal-connected to the parameter setting module, and is used to:
[0028] Receiving the optimized image acquisition parameters and defect detection parameters output by the parameter setting module;
[0029] Perform image acquisition according to the optimized image acquisition parameters;
[0030] Perform defect detection according to the optimized defect detection parameters;
[0031] Output the detection results.
[0032] Furthermore, the model training module includes:
[0033] Sample data collection unit, parameter space definition unit, data annotation unit, model training unit and model verification and preservation unit, including:
[0034] The sample data acquisition unit is used to acquire images of different types of PVC boards;
[0035] The parameter space definition unit is used to define the value range of image acquisition parameters and defect detection parameters, where:
[0036] The image acquisition parameters include aperture value, exposure time, gain value, contrast, light source brightness and saturation;
[0037] The defect detection parameters include a confidence threshold and an NMS threshold;
[0038] The data annotation unit is used to annotate the acquired PVC board image with optimal image acquisition parameters and defect detection parameters, and form annotation data;
[0039] The model training unit is used to train a deep learning regression model according to the labeled data;
[0040] The model verification and storage unit is used to verify the model performance of the deep learning regression model and save the trained deep learning regression model.
[0041] Furthermore, the parameter setting module includes:
[0042] Pre-collection unit, parameter prediction unit and parameter configuration unit, wherein:
[0043] The pre-collection unit is used to collect a preset number of image samples of the PVC board to be inspected;
[0044] The parameter prediction unit is used for:
[0045] Load the trained deep learning regression model;
[0046] Input the image sample;
[0047] Predict the optimal image acquisition parameters and defect detection parameters, and obtain the optimized image acquisition parameters and defect detection parameters;
[0048] The parameter configuration unit is used to configure the optimized image acquisition parameters and defect detection parameters to the defect detection module.
[0049] Furthermore, the defect detection module includes:
[0050] PVC board feeding unit, image acquisition unit, defect detection unit and result output unit, including:
[0051] The PVC board loading unit is used to load and convey the PVC board;
[0052] The image acquisition unit is used for:
[0053] receiving optimized image acquisition parameters;
[0054] Acquiring an image of the PVC board for defect detection according to the optimized image acquisition parameters;
[0055] The defect detection unit is used for:
[0056] receiving optimized defect detection parameters;
[0057] Performing defect detection on the collected PVC board image for defect detection according to the optimized defect detection parameters;
[0058] The result output unit is used to output the detection result.
[0059] Furthermore, the algorithm of the deep learning regression model uses ResNet18 as the skeleton, removes the last fully connected layer of the original ResNet18, and designs two parallel fully connected layer regression heads for different output parameters, including:
[0060] i) Image acquisition parameter regression head;
[0061] Fully connected layer 1: 512→256 (ReLU);
[0062] Fully connected layer 2: 256→128 (ReLU);
[0063] Fully connected layer 3: 128 → N_acq (linear activation);
[0064] ii) Defect detection model parameter regression head;
[0065] Fully connected layer 1: 512→256 (ReLU);
[0066] Fully connected layer 2: 256→128 (ReLU);
[0067] Fully connected layer 3: 128 → N_det (linear activation);
[0068] Among them, N_acq is the number of image acquisition parameters, and N_det is the number of defect detection model parameters.
[0069] Furthermore, the method for establishing the training set of the deep learning regression model includes the following steps:
[0070] Step 1: Collect the PVC board samples to be tested;
[0071] Step 2: Define the value range of image acquisition parameters and defect detection parameters;
[0072] Step 3: Collect images using different parameter combinations;
[0073] Step 4: Evaluate the quality of images acquired under different parameters, and use the acquisition parameters of the image with the best quality as the label;
[0074] Step 5: Use different detection parameters to perform defect detection on the defect detection model, evaluate the performance, and use the optimal detection parameters as labels.
[0075] Furthermore, the step 4 specifically includes:
[0076] Using the sample data acquisition unit to obtain an image of the PVC board to be detected, and using it as a picture of the current sample of the regression algorithm model;
[0077] According to the histogram distribution and the actual image effect, determine whether the image quality meets the requirements;
[0078] adjusting one or more of the image acquisition parameters according to the determination result;
[0079] The image acquisition parameters include:
[0080] i) Overexposure: reduce exposure time, lower gain value, adjust aperture value and light source brightness;
[0081] ii) Underexposure: increase exposure time, increase gain value, adjust aperture value, and increase light source brightness;
[0082] iii) Insufficient contrast: adjust the gamma value, aperture value, exposure time and gain;
[0083] Then, the image of the PVC board to be inspected is recaptured using the adjusted parameters;
[0084] Repeat the above steps until one of the following conditions is met: a) the image quality reaches a predetermined standard; b) the preset maximum number of iterations is reached; c) parameter adjustment cannot bring improvement;
[0085] Finally, the parameter combination that produces the best image quality is recorded and used as the optimal image acquisition parameter for detecting PVC boards.
[0086] Furthermore, the step five specifically includes:
[0087] First, collect no less than 200 samples of each type of PVC board to be tested;
[0088] Then adjusting the acquisition parameters of the image acquisition unit according to the steps described above;
[0089] Then, the sample data acquisition unit acquires images of the samples as training set images of the deep learning regression model;
[0090] Finally, the detection parameters of the defect detection unit are adjusted, the defect detection effects of all samples of the same type of PVC board are statistically analyzed and compared, and the detection parameters that best meet the predetermined requirements are selected as the label of this type of PVC board.
[0091] A model training method according to the above system comprises the following steps:-
[0092] S1: Use the model backbone network defined above;
[0093] S2: Prepare the total dataset, training set, and validation set using the methods described above, and perform data augmentation;
[0094] S3: using a weighted mean square error loss function for the image acquisition parameter regression head and the defect detection model parameter regression head in the model network respectively;
[0095] S4: Optimize using the Adam optimizer;
[0096] S5: Set the total number of rounds of training loops. In each round, randomly shuffle the training set and traverse the training set according to the batch size, including forward propagation, loss calculation, back propagation, and parameter update. Then evaluate the model performance on the validation set. If the validation result shows that the performance is improved, save the model checkpoint. If there is no improvement in the validation performance after the preset number of rounds, stop training.
[0097] S6: Save the best model parameters and record the loss and performance indicators during training;
[0098] S7: Evaluate the training results, including training set performance, validation set performance, actual application test, and model generalization ability;
[0099] The training set performance and the validation set performance both include the average error of image acquisition parameters and the average error of defect detection parameters, and the actual application test includes the missed detection rate and the passed detection rate.
[0100] An online implementation method of the defect detection method for a PVC board production line according to the above system comprises the following steps:
[0101] S1. Parameter optimization stage:
[0102] When the production line starts to produce a new batch of PVC boards, a sample image of the current batch of PVC boards is acquired using a preconfigured image acquisition unit;
[0103] Input the acquired sample images into the deep learning regression model;
[0104] The deep learning regression model outputs predicted optimal image acquisition parameters and optimal defect detection parameters, wherein the optimal image acquisition parameters include aperture value, exposure time, gain value, contrast, light source brightness, and saturation; the optimal defect detection parameters include confidence threshold and NMS threshold;
[0105] Automatically configure the predicted optimal defect detection parameters and optimal image acquisition parameters to the image acquisition unit and the defect detection unit;
[0106] S2. Online detection stage:
[0107] Use the optimal image acquisition parameters and optimal defect detection parameters to perform real-time image acquisition and defect detection on the PVC boards on the production line.
[0108] Compared with the prior art, the present invention has the following beneficial effects:
[0109] This system achieves full-process quality control through three modules: algorithm model training, parameter setting, and defect detection. It adopts an improved deep learning regression algorithm to achieve dynamic optimization of image acquisition parameters and defect detection parameter thresholds. It significantly improves the accuracy and robustness of image quality and defect recognition. This solution can adaptively process various types of known and unknown PVC sheets, reduce manual intervention, and can be extended to defect detection of other materials. BRIEF DESCRIPTION OF THE DRAWINGS
[0110] Figure 1 It is a schematic diagram of the module structure of the detection system of the present invention;
[0111] Figure 2 This is a schematic diagram of the module structure of the deep learning regression algorithm described in the present invention; DETAILED DESCRIPTION
[0112] The present invention is further described below in conjunction with specific embodiments.
[0113] like Figure 1 As shown, the adaptive PVC board defect detection system based on deep learning regression algorithm described in the present invention includes a model training module, a parameter setting module and a defect detection module.
[0114] Among them, the model training module is used to collect sample training data of different types of PVC boards, and train the deep learning regression model according to the collected training data, and finally output the trained deep learning regression model. The parameter setting module is connected to the defect detection module signal, and is used to load the deep learning regression model, and collect image samples of the PVC board to be detected, and then use the deep learning regression model to analyze the image samples, and output the optimized image acquisition parameters and defect detection parameters to the defect detection module. The defect detection module is used to receive the optimized image acquisition parameters and defect detection parameters output by the parameter setting module, and perform image acquisition according to the optimized image acquisition parameters, perform defect detection according to the optimized defect detection parameters, and finally output the detection results.
[0115] Specifically, the model training module includes a sample data acquisition unit, a parameter space definition unit, a data annotation unit, a model training unit, and a model verification and preservation unit. Among them, the sample data acquisition unit is used to collect images of different types of PVC boards, and the parameter space definition unit is used to define the value range of image acquisition parameters and defect detection parameters. The image acquisition parameters include aperture value, exposure time, gain value, contrast, light source brightness and saturation, etc. The defect detection parameters include confidence threshold and NMS threshold. The data annotation unit is used to annotate the optimal image acquisition parameters and defect detection parameters for the collected PVC board images and form annotated data. The model training unit is used to train the deep learning regression model according to the annotated data. The model verification and preservation unit is used to verify the model performance of the deep learning regression model and save the trained deep learning regression model.
[0116] The parameter setting module includes a pre-collection unit, a parameter prediction unit and a parameter setting unit. The pre-collection unit is used to collect a preset number of image samples of the PVC board to be detected, the parameter prediction unit is used to load the trained deep learning regression model, and predict the optimal image acquisition parameters and defect detection parameters after inputting the image samples to obtain the optimized image acquisition parameters and defect detection parameters, and the parameter configuration unit is used to configure the optimized image acquisition parameters and defect detection parameters to the defect detection module.
[0117] The defect detection module includes a PVC board feeding unit, an image acquisition unit, a defect detection unit and a result output unit. The PVC board feeding unit is used to realize the feeding and conveying of the PVC board, and the image acquisition unit is used to receive the optimized image acquisition parameters and acquire the PVC board image for defect detection according to the optimized image acquisition parameters. The defect detection unit is used to receive the optimized defect detection parameters and perform defect detection on the acquired PVC board image for defect detection according to the optimized defect detection parameters. The result output unit is used to output the detection result.
[0118] The algorithm of the deep learning regression model described in the present invention uses ResNet18 as the skeleton, removes the last fully connected layer of the original ResNet18, and designs two parallel fully connected layer regression heads for different output parameters, including:
[0119] i) Image acquisition parameter regression head;
[0120] Fully connected layer 1: 512→256 (ReLU);
[0121] Fully connected layer 2: 256→128 (ReLU);
[0122] Fully connected layer 3: 128 → N_acq (linear activation);
[0123] ii) Defect detection model parameter regression head;
[0124] Fully connected layer 1: 512→256 (ReLU);
[0125] Fully connected layer 2: 256→128 (ReLU);
[0126] Fully connected layer 3: 128 → N_det (linear activation);
[0127] Among them, N_acq is the number of image acquisition parameters, and N_det is the number of defect detection model parameters.
[0128] Output parameter example:
[0129] A. Image acquisition parameters (N_acq=5): aperture value, exposure time, gain value, contrast, light source brightness, saturation;
[0130] B. Defect detection model parameters (N_det=2): confidence threshold, non-maximum suppression (NMS) threshold.
[0131] The method for establishing a training set of a deep learning regression model described in the present invention mainly includes the following steps:
[0132] Step 1: Collect the PVC board samples to be tested;
[0133] Step 2: Define the value range of image acquisition parameters and defect detection parameters;
[0134] Step 3: Collect images using different parameter combinations;
[0135] Step 4: Evaluate the quality of images acquired under different parameters, and use the acquisition parameters of the image with the best quality as the label;
[0136] Step 5: Use different detection parameters to perform defect detection on the defect detection model, evaluate the performance, and use the optimal detection parameters as labels.
[0137] The above step 4 specifically includes:
[0138] Use the sample data acquisition unit to obtain the image of the PVC board to be tested, and use it as the image of the current sample of the regression algorithm model;
[0139] Professionals judge whether the image quality meets the requirements based on the histogram distribution and the actual image effect;
[0140] adjusting one or more of the image acquisition parameters according to the manual judgment result;
[0141] Image acquisition parameters include:
[0142] i) Overexposure: reduce exposure time, lower gain value, adjust aperture value and light source brightness;
[0143] ii) Underexposure: increase exposure time, increase gain value, adjust aperture value, and increase light source brightness;
[0144] iii) Insufficient contrast: adjust the gamma value, aperture value, exposure time and gain;
[0145] Then, the image of the PVC board to be inspected is recaptured using the adjusted parameters;
[0146] Repeat the above steps until one of the following conditions is met: a) the image quality meets the predetermined standard (the histogram distribution is reasonable and the details are clearly visible); b) the preset maximum number of iterations is reached; c) the adjustment of parameters cannot bring obvious improvement;
[0147] Finally, the parameter combination that produces the best image quality is recorded and used as the optimal image acquisition parameter for detecting PVC boards.
[0148] Furthermore, step five specifically includes:
[0149] First, collect no less than 200 samples of each type of PVC board to be tested;
[0150] Then, adjusting the acquisition parameters of the image acquisition unit according to the content of step 4;
[0151] Then, the sample data acquisition unit collects the sample images as training set images for the deep learning regression model;
[0152] Finally, the acquisition parameters (confidence) of the defect detection unit are adjusted, and the defect detection effects of all samples of the same type of PVC board are statistically analyzed and compared. The detection parameters that best meet the predetermined requirements (such as requiring the pass rate to be less than 5% and the missed detection rate to be less than 10%) are selected as the label for this type of PVC board.
[0153] The present invention provides a model training method according to the above system, comprising the following steps:
[0154] S1: Use the model backbone network defined in the previous article;
[0155] S2: Prepare the total dataset, training set, and validation set using the methods described above, and perform data augmentation;
[0156] S3: The weighted mean square error loss function is used for the image acquisition parameter regression head and the defect detection model parameter regression head in the model backbone network respectively;
[0157] S4: Optimize using the Adam optimizer;
[0158] S5: Set the total number of training cycles (e.g., 500). In each cycle, randomly shuffle the training set and traverse the training set according to the batch size, including forward propagation, loss calculation, backpropagation, and parameter update. Then, evaluate the model performance on the validation set. If the validation result shows that the performance is improved, save the model checkpoint. If there is no improvement in the validation performance after a preset number of consecutive cycles (e.g., 50), stop training.
[0159] S6: Save the best model parameters and record the loss and performance indicators during training;
[0160] S7: Evaluate the training results, including training set performance, validation set performance, actual application tests, and model generalization ability;
[0161] The performance of the training set and the validation set both include the average error of image acquisition parameters and the average error of defect detection parameters. The actual application test includes the missed detection rate and the passed detection rate.
[0162] The present invention discloses an online implementation method for a PVC board production line defect detection method using the above system, comprising the following steps:
[0163] S1. Parameter optimization stage:
[0164] When the production line starts to produce a new batch of PVC boards, a preconfigured image acquisition unit is used to obtain sample images (e.g., 2-3 images) of the current batch of PVC boards;
[0165] Input the acquired sample images into the deep learning regression model;
[0166] The deep learning regression model outputs the predicted optimal image acquisition parameters and optimal defect detection parameters. The optimal image acquisition parameters include aperture value, exposure time, gain value, contrast, light source brightness, saturation, etc. The optimal defect detection parameters include confidence threshold, NMS threshold, etc.
[0167] Automatically configure the predicted optimal defect detection parameters and optimal image acquisition parameters to the image acquisition unit and the defect detection unit;
[0168] S2. Online detection stage:
[0169] Use the optimal image acquisition parameters and optimal defect detection parameters to perform real-time image acquisition and defect detection on the PVC boards on the production line.
[0170] Next, the training set establishment and model training method of the adaptive PVC board defect detection system based on deep learning regression algorithm of the present invention are described in the form of embodiments. Figure 2 As shown, it includes the following main steps:
[0171] S1-Build training set;
[0172] S1.1: Collect 10 different types of PVC boards, 200 samples of each type, a total of 2000 samples; the types collected include: smooth white, textured gray, matte black, wood grain, marble grain, etc.
[0173] S1.2: Define the value ranges of the following parameters:
[0174] A. Image acquisition parameters:
[0175] Aperture value: f2.8-f5.6, step length 0.4;
[0176] Exposure time: 1-20ms, step length 1ms;
[0177] Gain value: 0-20dB, step size 0.5dB;
[0178] Contrast: 0.5-2.0, step size 0.1;
[0179] Light source brightness: 0-100%, step length 5%;
[0180] Saturation: 0.5-1.5, step size 0.1;
[0181] B. Defect detection parameters:
[0182] Confidence threshold: 0.1-0.7, step size 0.05;
[0183] NMS threshold: 0.1-0.5, step size 0.05.
[0184] S1.3: For each block of samples, different parameter combinations are used to collect images. About 100 images are collected for each block of samples, totaling about 200,000 images.
[0185] S1.4: Use the sample data acquisition unit to obtain the initial image of each PVC board. Three experienced quality inspectors will evaluate the image quality based on the following criteria: whether the histogram distribution is uniform, whether the details are clearly visible, and whether there are overexposed or underexposed areas. The acquisition parameters will then be adjusted based on the evaluation results:
[0186] Overexposure: reduce the aperture value (-f0.4), reduce the exposure time (-1ms), reduce the gain value (-0.5dB), and lower the light source brightness (-5%);
[0187] Underexposure: increase the aperture value (+f0.4), increase the exposure time (+1ms), increase the gain value (+0.5dB), and increase the light source brightness (+5%);
[0188] Insufficient contrast: Adjust contrast (+0.1), fine-tune exposure time (±1ms) and gain (±0.5dB).
[0189] The above steps are then repeated until one of the following conditions is met:
[0190] Image quality rating reached 4.5 points (out of 5 points);
[0191] Reached the maximum number of iterations (10 times);
[0192] There was no significant improvement after three consecutive adjustments.
[0193] Finally, the parameter combination that produces the best image quality is recorded as the label.
[0194] S1.5: Use the optimized image acquisition parameters to collect 200 sample images of each type of PVC board, and use the YOLOv5 algorithm for preliminary defect detection. Adjust the confidence threshold (0.1-0.7, step size 0.05) and NMS threshold (0.1-0.5, step size 0.05) and perform multiple tests. Statistic the test results under each set of parameters, including calculating the accuracy, missed detection rate, and pass rate. If the pass rate meets the requirements of <5% and missed detection rate <10%, select the parameter combination that meets the requirements and has the highest accuracy as the label.
[0195] S2-training regression algorithm;
[0196] S2.1: Define the model backbone network as the modified ResNet18, and define two parallel head networks in the model, which are image acquisition parameter regression heads;
[0197] FC1: 512→256 (ReLU);
[0198] FC2: 256→128 (ReLU);
[0199] FC3: 128 → N_acq (linear activation);
[0200] Defect detection model parameter regression head;
[0201] FC1: 512→256 (ReLU);
[0202] FC2: 256→128 (ReLU);
[0203] FC3: 128 → N_det (linear activation).
[0204] S2.2: Prepare a total dataset of 200,000 images, including 160,000 images for training (80%) and 40,000 images for validation (20%). Perform data augmentation including random flipping, rotation, and brightness adjustment.
[0205] S2.3: Weighted mean square error (MSE) loss is used to calculate the image acquisition parameters and defect detection parameters respectively.
[0206] S2.4: Use the Adam optimizer with the following parameters:
[0207] Learning rate: 0.001;
[0208] Betas: (0.9, 0.999);
[0209] Eps: 1e-08;
[0210] Weight_decay: 0.0001.
[0211] S2.5: Set the total number of epochs to 100. In each epoch, randomly shuffle the training set and traverse the training set according to the batch size (set to 64), including forward propagation, loss calculation, backpropagation and parameter update. Then evaluate the model performance on the validation set. If the validation set performance improves, save the model checkpoint. If the validation set performance does not improve for 10 consecutive epochs, stop training early.
[0212] S2.6: Save the best model parameters and record the loss and performance indicators during training.
[0213] S3-training results evaluation;
[0214] After the above training process, we obtained the following results:
[0215] 1. Training set performance:
[0216] Average error of image acquisition parameters: <5%
[0217] Average error of defect detection parameters: <3%
[0218] 2. Validation set performance:
[0219] Average error of image acquisition parameters: <7%
[0220] Average error of defect detection parameters: <5%
[0221] 3. Actual application test (using 100 new PVC board samples):
[0222] Improved detection accuracy: from 85% to 94%
[0223] Reduced missed detection rate: from 8% to 3%
[0224] The inspection rate has been reduced from 7% to 3%.
[0225] 4. Model generalization ability:
[0226] For new types of PVC boards (such as special textures) that did not appear in the training set, the model can still give reasonable parameter predictions, with a detection accuracy of 89%.
Claims
1. An adaptive PVC board defect detection system based on deep learning regression algorithm, characterized in that: include: Model training module, parameter setting module and defect detection module; among which: The model training module is used to: Collect sample training data of different types of PVC boards; Training a deep learning regression model based on the training data; Output the trained deep learning regression model; The parameter setting module is connected to the defect detection module by signal, and is used to: Load the deep learning regression model; Collect image samples of the PVC board to be inspected; Analyzing the image sample using the deep learning regression model; Outputting optimized image acquisition parameters and defect detection parameters to the defect detection module; The defect detection module is signal-connected to the parameter setting module, and is used to: Receiving the optimized image acquisition parameters and defect detection parameters output by the parameter setting module; Perform image acquisition according to the optimized image acquisition parameters; Perform defect detection according to the optimized defect detection parameters; Output the detection results.
2. The system according to claim 1, characterized in that The model training module includes: Sample data collection unit, parameter space definition unit, data annotation unit, model training unit and model verification and preservation unit, including: The sample data acquisition unit is used to acquire images of different types of PVC boards; The parameter space definition unit is used to define the value range of image acquisition parameters and defect detection parameters, where: The image acquisition parameters include aperture value, exposure time, gain value, contrast, light source brightness and saturation; The defect detection parameters include a confidence threshold and an NMS threshold; The data annotation unit is used to annotate the acquired PVC board image with optimal image acquisition parameters and defect detection parameters, and form annotation data; The model training unit is used to train a deep learning regression model according to the labeled data; The model verification and storage unit is used to verify the model performance of the deep learning regression model and save the trained deep learning regression model.
3. The system according to claim 1, characterized in that The parameter setting module includes: Pre-collection unit, parameter prediction unit and parameter configuration unit, wherein: The pre-collection unit is used to collect a preset number of image samples of the PVC board to be inspected; The parameter prediction unit is used for: Load the trained deep learning regression model; Input the image sample; Predict the optimal image acquisition parameters and defect detection parameters, and obtain the optimized image acquisition parameters and defect detection parameters; The parameter configuration unit is used to configure the optimized image acquisition parameters and defect detection parameters to the defect detection module.
4. The system according to claim 1, characterized in that The defect detection module comprises: PVC board feeding unit, image acquisition unit, defect detection unit and result output unit, including: The PVC board loading unit is used to load and convey the PVC board; The image acquisition unit is used for: receiving optimized image acquisition parameters; Acquiring an image of the PVC board for defect detection according to the optimized image acquisition parameters; The defect detection unit is used for: receiving optimized defect detection parameters; Performing defect detection on the collected PVC board image for defect detection according to the optimized defect detection parameters; The result output unit is used to output the detection result.
5. The system according to claim 2, characterized in that Define the model backbone network, that is, the algorithm of the deep learning regression model uses ResNet18 as the skeleton, removes the last fully connected layer of the original ResNet18, and designs two parallel fully connected layer regression heads for different output parameters, including: i) Image acquisition parameter regression head; Fully connected layer 1: 512→256 (ReLU); Fully connected layer 2: 256→128 (ReLU); Fully connected layer 3: 128 → N_acq (linear activation); ii) Defect detection model parameter regression head; Fully connected layer 1: 512→256 (ReLU); Fully connected layer 2: 256→128 (ReLU); Fully connected layer 3: 128 → N_det (linear activation); Among them, N_acq is the number of image acquisition parameters, and N_det is the number of defect detection model parameters.
6. The system according to claim 5, characterized in that The method for establishing a training set of the deep learning regression model comprises the following steps: Step 1: Collect the PVC board samples to be tested; Step 2: Define the value range of image acquisition parameters and defect detection parameters; Step 3: Collect images using different parameter combinations; Step 4: Evaluate the quality of images acquired under different parameters, and use the acquisition parameters of the image with the best quality as the label; Step 5: Use different detection parameters to perform defect detection on the defect detection model, evaluate the performance, and use the optimal detection parameters as labels.
7. The system according to claim 6, characterized in that The step 4 specifically includes: Using the sample data acquisition unit to obtain an image of the PVC board to be detected, and using it as a picture of the current sample of the regression algorithm model; According to the histogram distribution and the actual image effect, determine whether the image quality meets the requirements; adjusting one or more of the image acquisition parameters according to the determination result; The image acquisition parameters include: i) Overexposure: reduce exposure time, lower gain value, adjust aperture value and light source brightness; ii) Underexposure: increase exposure time, increase gain value, adjust aperture value, and increase light source brightness; iii) Insufficient contrast: adjust the gamma value, aperture value, exposure time and gain; Then, the image of the PVC board to be inspected is recaptured using the adjusted parameters; Repeat the above steps until one of the following conditions is met: a) the image quality reaches a predetermined standard; b) the preset maximum number of iterations is reached; c) parameter adjustment cannot bring improvement; Finally, the parameter combination that produces the best image quality is recorded and used as the optimal image acquisition parameter for detecting PVC boards.
8. The system according to claim 7, characterized in that The step five specifically includes: First, collect no less than 200 samples of each type of PVC board to be tested; Then, adjusting the acquisition parameters of the image acquisition unit according to the content of step 4; Then, the sample data acquisition unit acquires images of the samples as training set images of the deep learning regression model; Finally, the detection parameters of the defect detection unit are adjusted, the defect detection effects of all samples of the same type of PVC board are statistically analyzed and compared, and the detection parameters that best meet the predetermined requirements are selected as the label of this type of PVC board.
9. A model training method for the system according to claim 8, characterized in that: The following steps are involved: S1: Using the model backbone network defined in claim 5; S2: Prepare a total data set, a training set, and a validation set using the methods described in claim 6, claim 7, and claim 8, and perform data enhancement processing; S3: using a weighted mean square error loss function for the image acquisition parameter regression head and the defect detection model parameter regression head in the model backbone network respectively; S4: Optimize using the Adam optimizer; S5: Set the total number of rounds of training loops. In each round, randomly shuffle the training set and traverse the training set according to the batch size, including forward propagation, loss calculation, back propagation, and parameter update. Then evaluate the model performance on the validation set, and save the model checkpoint if the validation result performance improves; If there is no improvement in performance after a preset number of rounds of verification, training is stopped; S6: Save the best model parameters and record the loss and performance indicators during training; S7: Evaluate the training results, including training set performance, validation set performance, actual application test, and model generalization ability; The training set performance and the validation set performance both include the average error of image acquisition parameters and the average error of defect detection parameters, and the actual application test includes the missed detection rate and the passed detection rate.
10. An online implementation method of a PVC board production line defect detection method using the system according to any one of claims 1 to 9, characterized in that: The following steps are involved: S1. Parameter optimization stage: When the production line starts to produce a new batch of PVC boards, a sample image of the current batch of PVC boards is acquired using a preconfigured image acquisition unit; Input the acquired sample images into the deep learning regression model; The deep learning regression model outputs predicted optimal image acquisition parameters and optimal defect detection parameters, wherein the optimal image acquisition parameters include aperture value, exposure time, gain value, contrast, light source brightness, and saturation; the optimal defect detection parameters include confidence threshold and NMS threshold; Automatically configure the predicted optimal defect detection parameters and optimal image acquisition parameters to the image acquisition unit and the defect detection unit; S2. Online detection stage: Use the optimal image acquisition parameters and optimal defect detection parameters to perform real-time image acquisition and defect detection on the PVC boards on the production line.
Citation Information
Cited By
Method and system for detecting quality of plastic pipe irradiated by multi-angle light source
CN120629007A