LED product surface defect detection method

Through technical means such as multi-layer perceptrons, convolutional neural networks, genetic algorithms and multi-scale morphological algorithms, intelligent detection and light source parameter optimization of LED product surface defect detection system are realized, and the existing system is dynamically adjusting the light source and The lack of imaging parameters improves detection accuracy and efficiency.

CN119417746AActive Publication Date: 2025-02-11IFLYTEK SOUTH CHINA ARTIFICIAL INTELLIGENCE RES INST GUANGZHOU CO LTD

Patent Information

Application Number
CN202411222563.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-02-11
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

The existing LED product surface defect detection system is difficult to dynamically adjust the light source and imaging parameters, resulting in poor detection of defect detection of LED products of different types, sizes and surface characteristics.

Method used

The LED products are initially classified through multi-layer perceptron neural network to obtain the initial configuration of light source parameters; the convolutional neural network is used to analyze the LED surface characteristics and extract the surface texture and gloss characteristic parameters; the light source configuration parameters are optimized by genetic algorithm; combined with multi-scale Morphological algorithm and support vector machine to detect and evaluate LED surface defects.

Benefits of technology

It realizes intelligent detection of surface defects of LED products and adaptive optimization of light source parameters, improves detection accuracy and efficiency, can promptly deal with the impact of serious defects on optical performance, and achieves continuous real-time improvement of the detection model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417746A_ABST
    Figure CN119417746A_ABST
Patent Text Reader

Abstract

The invention provides an LED product surface defect detection method, which comprises the following steps: carrying out defect feature extraction on a preprocessed LED surface image by adopting a multi-scale morphological algorithm, and respectively carrying out morphological opening operation and closing operation on surface recesses and fine scratches by setting structural elements with different sizes and shapes to obtain candidate regions of the recesses and the scratches; according to the geometric dimensions, morphological characteristics and spatial distribution detail attributes of the recesses and scratches, constructing defect feature vectors, and performing classification and severity evaluation on defect candidate areas through a support vector machine algorithm to obtain the types, positions and quantitative description parameters of defects; and updating the light source parameter database and the defect feature database according to a quality detection result of the LED product, analyzing an association rule between defects and light source parameters through a data mining algorithm, and optimizing a light source parameter configuration strategy and a defect detection model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of information technology, and in particular to a method for detecting surface defects of LED products. Background Art

[0002] There is a complex technical problem in the surface defect detection system of LED products. The system needs to dynamically adjust the light source and imaging parameters for LED products of different types, sizes and surface characteristics to achieve the best defect detection effect. Surface depressions are more easily detected at low brightness, while subtle scratches are more obvious at high brightness. How the system can find a balance among these mutually restrictive factors to achieve accurate identification of various defect types while ensuring detection efficiency is a technical challenge that needs to be solved urgently. This requires the system to have highly intelligent parameter control capabilities, and be able to optimize the light source and imaging parameters in real time according to product characteristics and defect types to meet the needs of different detection scenarios. Summary of the invention

[0003] The present invention provides a method for detecting surface defects of LED products, which mainly includes:

[0004] According to the parameter range preset in the LED product type database, the size characteristics and surface characteristics of the current LED product are obtained, and the LED product is preliminarily classified through the multi-layer perceptron neural network model to obtain the category identifier of the LED product and the corresponding initial configuration of the light source parameters;

[0005] The acquired LED surface images are preprocessed using image processing algorithms, including denoising and contrast enhancement operations. The LED surface contour features are extracted using edge detection algorithms. The LED surface characteristics are refined and analyzed using the convolutional neural network model in deep learning to obtain surface texture and gloss feature parameters.

[0006] According to the LED product category identifier and surface feature parameters, the matching light source brightness, angle and layout configuration scheme is retrieved from the light source parameter database, and the light source parameters are optimized and adjusted through the genetic algorithm to obtain the optimal light source configuration parameters that adapt to the current LED product characteristics;

[0007] A multi-scale morphological algorithm is used to extract defect features from the preprocessed LED surface image. By setting structural elements of different sizes and shapes, morphological opening and closing operations are performed on surface depressions and fine scratches to obtain candidate areas for depressions and scratches.

[0008] According to the geometric size, morphological characteristics and spatial distribution details of the dents and scratches, the defect feature vector is constructed, and the defect candidate area is classified and the severity is evaluated through the support vector machine algorithm to obtain the defect type, location and quantitative description parameters;

[0009] The optimal light source configuration parameters are associated with the defect analysis results to evaluate the impact of defects on the optical performance of LED products. If the severity of the defect exceeds the preset threshold, the early warning mechanism is triggered to dynamically adjust the light source parameters or start the defect compensation algorithm according to the defect type and distribution characteristics;

[0010] According to the quality inspection results of LED products, the light source parameter database and defect feature database are updated, the correlation between defects and light source parameters is analyzed through data mining algorithms, and the light source parameter configuration strategy and defect detection model are optimized.

[0011] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:

[0012] The present invention discloses a method for detecting surface defects of LED products. First, LED products are preliminarily classified by a multi-layer perceptron neural network, so as to achieve accurate classification of LED products and preliminary configuration of light source parameters, and solve the problems of inaccurate classification and unreasonable light source configuration in the past. Then, a convolutional neural network is used to analyze the surface characteristics of LEDs, and surface texture and glossiness characteristic parameters are extracted, so as to improve the analysis accuracy of the surface characteristics of LEDs. Then, a genetic algorithm is used to optimize the light source configuration parameters, so as to achieve the best light source configuration according to the characteristics of LED products. At the same time, a multi-scale morphological algorithm and a support vector machine are used to detect and evaluate the surface defects of LEDs, so as to make the detection and evaluation more comprehensive and accurate. Finally, the light source configuration is associated with the defect analysis results, the defect impact is evaluated and the parameters are adjusted dynamically, so as to achieve closed-loop control of LED product quality detection and light source optimization, so as to timely handle the impact of serious defects on optical performance, and achieve continuous real-time improvement of the detection model. In summary, the present invention realizes intelligent detection of surface defects of LED products and adaptive optimization of light source parameters, so as to improve detection accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 The present invention is a flow chart of a method for detecting surface defects of LED products.

[0014] Figure 2 It is a schematic diagram of a method for detecting surface defects of LED products according to the present invention.

[0015] Figure 3 This is another schematic diagram of a method for detecting surface defects of an LED product according to the present invention. DETAILED DESCRIPTION

[0016] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than 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.

[0017] like Figure 1 -3. In this embodiment, a method for detecting surface defects of an LED product may specifically include:

[0018] S101. Acquire the size characteristics and surface characteristic information of the current LED product according to the parameter range preset in the LED product type database, perform preliminary classification of the LED product through a multi-layer perceptron neural network model, and obtain the category identifier of the LED product and the corresponding initial configuration of the light source parameters.

[0019] The size characteristics and surface characteristic information of the LED product are obtained, and the corresponding initial configuration values ​​of the light source parameters are extracted from the LED product parameter database. The K nearest neighbor algorithm is used to preliminarily classify the LED product, the Euclidean distance between the LED product and the known products in the database is calculated, and the K samples with the closest distance are selected. The category identifier of the LED product is determined by the voting method, and the initial configuration of the light source parameters corresponding to the category identifier is extracted from the LED product parameter database. If the initial configuration of the light source parameters is inconsistent with the initial configuration value of the light source parameters, the linear interpolation method is used to compare and analyze the two groups of configurations. According to the comparison and analysis results of the linear interpolation method, combined with the size characteristics and surface characteristic information of the LED product, the initial configuration of the light source parameters is adjusted. For each light source parameter, the adjusted parameter value y is calculated using the linear interpolation formula y=y1+(x-x1)*(y2-y1) / (x2-x1), where x is the characteristic value of the LED product, x1 and x2 are the characteristic values ​​of the two nearest known products in the database, and y1 and y2 are the corresponding parameter values.

[0020] Specifically, the size characteristics and surface characteristic information of the current LED product are obtained according to the parameter range preset in the LED product parameter database, and the corresponding initial configuration values ​​of the light source parameters are extracted from the LED product parameter database. Based on the obtained size characteristics and surface characteristic information of the LED product, the K nearest neighbor algorithm is used to preliminarily classify the LED products, the Euclidean distance between the current product and the known products in the database is calculated, the K samples with the closest distance are selected, and the category identifier of the LED product is determined by the voting method. The initial configuration of the light source parameters corresponding to the category identifier is extracted from the LED product parameter database. If the extracted initial configuration of the light source parameters is inconsistent with the initial configuration value obtained previously, the linear interpolation method is used to compare and analyze the two groups of configurations. According to the comparison and analysis results of the linear interpolation method, combined with the size characteristics and surface characteristic information of the LED product, the initial configuration of the light source parameters is adjusted to calculate the final configuration value of the light source parameters of the LED product. In the specific adjustment process, for each light source parameter, the linear interpolation formula y=y1+(x-x1)*(y2-y1) / (x2-x1) is used, where x is the characteristic value of the current product, x1 and x2 are the characteristic values ​​of the two closest known products in the database, and y1 and y2 are the corresponding parameter values, to calculate the adjusted parameter value y. The preset parameter range in the LED product parameter database includes dimensional features such as length 10-100 mm, width 5-50 mm, height 2-20 mm, and surface characteristics such as roughness 0.1-10 microns and reflectivity 0.1-0.9. Obtain the specific parameters of the current LED product, such as length 50 mm, width 25 mm, height 10 mm, roughness 2 microns, and reflectivity 0.5. Extract the corresponding initial configuration values ​​of the light source parameters from the database, such as color temperature 4000K, luminous flux 500 lumens, and power 5 watts. Use the K nearest neighbor algorithm for classification, set the K value to 3, and calculate the Euclidean distance between the current product and the known products in the database. Assume that the three most recent samples belong to categories A, B, and C, two of which belong to category A and one belongs to category B. The category identifier of the current LED product is determined to be A through voting. The initial configuration of the light source parameters corresponding to category A is extracted from the database, such as color temperature 3800K, luminous flux 480 lumens, and power 4.8 watts. Since it is inconsistent with the initial configuration values ​​obtained previously, the linear interpolation method is used for comparison and analysis. Taking color temperature as an example, the two closest known products in the database are taken, whose lengths are 45 mm and 55 mm, respectively, and the corresponding color temperatures are 3600K and 4000K. The adjusted color temperature of the current product is calculated using the linear interpolation formula: 3600+(50-45)*(4000-3600) / (55-45)=3800K. Similarly, the adjusted values ​​of luminous flux and power are calculated. Finally, the LED product light source parameter configuration color temperature 3800K, luminous flux 490 lumens, and power 4.9 watts are obtained.

[0021] S102. Preprocess the acquired LED surface image using an image processing algorithm, including denoising and contrast enhancement operations, extract the LED surface contour features using an edge detection algorithm, and perform a detailed analysis of the LED surface characteristics in combination with a convolutional neural network model in deep learning to obtain surface texture and gloss feature parameters.

[0022] The LED surface image is obtained, and the LED surface image is denoised by using a median filtering algorithm to obtain a denoised LED surface image; according to the denoised LED surface image, the pixel value is adjusted by image normalization processing, and the image contrast is enhanced by using a histogram equalization method to obtain a contrast-enhanced LED surface image; for the contrast-enhanced LED surface image, a Canny edge detection algorithm is applied to extract the LED surface contour features to obtain an LED surface contour feature map; geometric features are extracted from the LED surface contour feature map, including contour perimeter, area and roundness; the LED surface contour feature map is converted into a pixel image block of a fixed size, and the image block is grayed; a pre-trained convolutional neural network model is used to extract features from the standardized image block; a feature vector is obtained from the last fully connected layer of the convolutional neural network, and the feature vector is mapped to a surface texture and gloss parameter value by a regression algorithm; if the parameter value exceeds a preset threshold, it is determined that the LED surface characteristics do not meet the requirements.

[0023] Specifically, according to the acquired LED surface image, the median filtering algorithm is used to denoise the image to obtain the denoised LED surface image. For the denoised LED surface image, the pixel value is adjusted to the range of 0-255 by image normalization to ensure the consistency of subsequent processing. For the normalized LED surface image, the image contrast is enhanced by the histogram equalization method to obtain the contrast-enhanced LED surface image. The Canny edge detection algorithm is applied to the contrast-enhanced LED surface image to extract the LED surface contour features and obtain the LED surface contour feature map. Geometric features are extracted from the LED surface contour feature map, including contour perimeter, area, roundness and other parameters. The LED surface contour feature map is converted into a fixed-size 128x128 pixel image block, the image block is grayed, and the gray value is standardized to the range of 0-1. The pre-trained convolutional neural network model is used to extract and analyze the features of the standardized image block. The convolutional neural network includes 5 convolutional layers, each layer uses a 3x3 convolution kernel, 2 maximum pooling layers, and 3 fully connected layers. The feature vector is obtained from the last fully connected layer of the convolutional neural network, and the feature vector is mapped to specific parameter values ​​such as surface texture and glossiness through the regression algorithm. The obtained parameter value is compared with the preset threshold to determine whether the surface characteristics of the LED meet the requirements. Taking a 300x300 pixel LED surface image as an example, the median filter algorithm with a 3x3 window is first used for denoising to filter out the salt and pepper noise in the image. The pixel values ​​of the denoised image are mapped to the range of 0-255 through linear normalization to ensure uniform distribution of image brightness. The normalized image is histogram equalized to enhance the image contrast and make the LED surface texture clearer. The Canny edge detection algorithm is applied to the enhanced image, and the low threshold is set to 50 and the high threshold is set to 150 to obtain the LED surface contour feature map. The geometric features are extracted from the contour feature map, and the contour perimeter is calculated to be 1200 pixels, the area is 70,000 square pixels, and the roundness is 0.85. The contour feature map is scaled to 128x128 pixels, converted to a grayscale image, and the grayscale value is standardized to the range of 0-1. The standardized images were processed using a pre-trained convolutional neural network model, which contained five convolutional layers, each with 16, 32, 64, 64, and 128 3x3 convolution kernels, two 2x2 maximum pooling layers, and three fully connected layers with 512, 256, and 128 nodes, respectively. A 128-dimensional feature vector was obtained from the last fully connected layer, and the feature vector was mapped to a specific parameter value through a linear regression algorithm, resulting in a surface texture roughness of 2.5 microns and a glossiness of 85%. These parameter values ​​were compared with the preset roughness threshold of 3 microns and the glossiness threshold of 80%, and it was determined that the surface characteristics of the LED met the requirements.

[0024] S103, according to the LED product category identifier and surface feature parameters, retrieve matching light source brightness, angle and layout configuration schemes from the light source parameter database, optimize and adjust the light source parameters through genetic algorithm, and obtain the optimal light source configuration parameters that adapt to the current LED product characteristics.

[0025] According to the LED product category identifier and surface feature parameters, the light source configuration scheme with the highest matching degree is retrieved from the light source parameter database to obtain the initial light source parameter configuration; the initial light source parameters are encoded by a genetic algorithm to generate a chromosome population including light source brightness, luminous angle and layout configuration; for the chromosome population, the fitness function value of each chromosome is calculated, and the fitness function value is combined with the matching degree between the surface feature parameters of the LED product and the light source parameters; if the preset maximum number of iterations is reached or the change in the optimal fitness for multiple consecutive generations is less than a preset threshold, the selection, crossover and mutation operations of the chromosome are terminated; the individual with the highest fitness is selected from the chromosomes of the last generation, and the optimal light source configuration parameters are obtained by decoding; the light source effect of the optimal light source configuration parameters is simulated by optical simulation software, the light source uniformity and color rendering index are calculated, and it is determined whether the preset threshold requirements are met.

[0026] Specifically, according to the LED product category identifier and surface feature parameters, the light source brightness, angle and layout configuration scheme with the highest matching degree is retrieved from the light source parameter database to obtain the initial light source parameter configuration. The matching degree is calculated by Euclidean distance, and the parameter vector contains properties such as light source brightness, luminous angle, and layout configuration. The genetic algorithm is used to encode the initial light source parameters, and the chromosome population containing light source brightness, luminous angle and layout configuration is generated using real number encoding. The population size is set to 100, the crossover rate is 0.8, and the mutation rate is 0.1. For the generated chromosome population, the fitness function value of each chromosome is calculated. The fitness function considers the matching degree between the surface feature parameters of the LED product and the light source parameters. The specific expression is f=w1*(1-|L-L0| / L0)+w2*(1-|A-A0| / A0)+w3*(1-|C-C0| / C0), where L, A, and C represent light source brightness, luminous angle, and layout configuration, respectively, L0, A0, and C0 are target values, and w1, w2, and w3 are weight coefficients. Select chromosomes with high fitness for crossover and mutation operations, and repeat the selection, crossover and mutation operations of chromosomes until the preset maximum number of iterations of 100 is reached or the optimal fitness changes for 10 consecutive generations are less than 0.1%. Select the individual with the highest fitness from the last generation of chromosomes and decode to obtain the optimal light source configuration parameters. Verify and evaluate the obtained optimal light source configuration parameters, simulate the light source effect through optical simulation software, calculate indicators such as light source uniformity and color rendering index, and judge whether the preset threshold requirements are met. Take an LED ceiling lamp product as an example, its category identifier is CL001, and the surface feature parameters include reflectivity 0.85 and roughness 2 microns. Retrieve the initial configuration with the highest matching degree from the light source parameter database, with a light source brightness of 1000 lumens, a light emitting angle of 120 degrees, and a layout configuration of 3x3 matrix. Use Euclidean distance to calculate the matching degree, and the parameter vector distance is 0.15. Genetic algorithm is used for optimization, and real number coding generates 100 chromosomes, each of which contains a light source brightness such as 800-1200 lumens, a light emitting angle such as 90-150 degrees, and a layout configuration such as 2x2 to 4x4 matrix. The crossover rate is set to 0.8 and the mutation rate is set to 0.1. The fitness function f = 0.5 * (1 - | L - 1000 | / 1000) + 0.3 * (1 - | A - 120 | / 120) + 0.2 * (1 - | C - 9 | / 9), where L is the brightness of the light source, A is the luminous angle, and C is the number of LEDs in the layout configuration. After performing selection, crossover and mutation operations, after 87 generations of iterations, the optimal fitness change for 10 consecutive generations is less than 0.1%, and the algorithm converges. The optimal individual decoding obtains a light source brightness of 1050 lumens, a luminous angle of 125 degrees, and a layout configuration of 3x3 matrix. Using optical simulation software to simulate the light source effect, the light source uniformity is calculated to be 0.92, and the color rendering index is 85, which meets the preset threshold requirements, uniformity> 0.9, and color rendering index> 80.

[0027] S104, using a multi-scale morphological algorithm to extract defect features from the preprocessed LED surface image, and by setting structural elements of different sizes and shapes, performing morphological opening and closing operations on the surface dents and fine scratches, respectively, to obtain candidate areas for dents and scratches.

[0028] According to the statistical analysis results of the LED surface features, structural elements of different sizes and shapes are set, and the structural elements include circular structural elements and linear structural elements. The circular structural element is used to perform a multi-scale morphological opening operation on the LED surface image to obtain a candidate area of ​​surface depression, and the optimal depression detection scale is determined by image difference and threshold segmentation. For the LED surface image, the linear structural element is used to perform a multi-scale morphological closing operation to obtain a candidate area of ​​scratches, and the rotation angle range of the linear structural element is 0 to 180 degrees. The depression candidate area and the scratch candidate area are merged, and the merged candidate area is optimized using a regional growing algorithm. The seed point selection is based on the local minimum grayscale value, and the growth condition is that the grayscale difference of adjacent pixels is less than a preset threshold. Feature extraction is performed on the detected defect area, and the area, perimeter and roundness geometric features are calculated. The defect type is classified using a support vector machine to obtain the LED surface defect detection result.

[0029] Specifically, according to the preprocessed LED surface image, based on the statistical analysis results of the LED surface features, structural elements of different sizes and shapes are set, including circular structural elements and linear structural elements. The radius of the circular structural element ranges from 2 pixels to 8 pixels, and the length of the linear structural element ranges from 5 pixels to 12 pixels. The circular structural element is used to perform multi-scale morphological opening operations on the LED surface image to obtain the candidate area of ​​the surface depression. The differences in the results of opening operations at different scales are compared through image difference and threshold segmentation to determine the optimal depression detection scale. For the subtle scratch features, the linear structural element is used to perform multi-scale morphological closing operations on the LED surface image to obtain the candidate area of ​​the scratch. The rotation angle range of the linear structural element is 0 to 180 degrees, and the step length is 15 degrees to detect scratches in different directions. The depression candidate area and the scratch candidate area are merged, and the merged candidate area is optimized using the regional growing algorithm. The seed point selection is based on the local minimum grayscale value. The growth condition is that the grayscale difference of adjacent pixels is less than the preset threshold. The stopping criterion is that the area of ​​the region reaches the preset upper limit or there are no adjacent pixels that meet the conditions, and the final LED surface defect area is obtained. The detected defective area is feature extracted, and geometric features such as area, perimeter, and roundness are calculated. The defect type is classified using a support vector machine. The defect is compared with the real defect data annotated manually, and the detection accuracy and recall rate are calculated to evaluate the reliability of the defect detection results. Taking a 300x300 pixel LED surface image as an example, the radius of the circular structure element is set to 2, 4, 6, and 8 pixels based on the statistical analysis results, and the length of the linear structure element is set to 5, 8, 10, and 12 pixels. The image is opened by multi-scale morphology, and four concave candidate images are obtained using four circular structure elements. The difference of adjacent scale results is calculated by image difference, and the grayscale threshold is set to 20. The area in the difference image that is greater than the threshold is marked as a concave candidate area. By comparing the results of the four scales, it is found that the detection effect of the structure element with a radius of 6 pixels is the best, and the concave candidate area image A is obtained. The image is closed by multi-scale morphology, and four linear structure elements are used. Each element is rotated every 15 degrees in the range of 0 to 180 degrees, and a total of 48 scratch candidate images are obtained. The same difference and threshold method is used to obtain the scratch candidate area image B. Images A and B are logically ORed to obtain the merged candidate area image C. The pixels with grayscale values ​​less than 50 in image C are used as seed points, and the region growing algorithm is executed. The growth condition is that the grayscale difference of adjacent pixels is less than 10, and the upper limit of the region area is 100 pixels, and the final defect area image D is obtained. The feature area, perimeter, and roundness 4π*area / perimeter^2 are extracted for each connected region in image D. Using these features as input, the support vector machine with RBF kernel function is used to classify the defect type, and the defects are divided into two categories: dents and scratches. Finally, compared with the real defect data annotated by humans, the detection accuracy rate is calculated to be 95% and the recall rate is 92%, which verifies the effectiveness of the algorithm.

[0030] S105. Construct a defect feature vector based on the detailed attributes of the dents and scratches, such as geometric dimensions, morphological features, and spatial distribution. Classify and evaluate the severity of the defect candidate areas using a support vector machine algorithm to obtain the defect type, location, and quantitative description parameters.

[0031] The candidate area images of dents and scratches are obtained, and the geometric size parameters of the defect area are calculated according to the candidate area images, wherein the geometric size parameters include area, perimeter, major axis length and minor axis length; the morphological characteristics of the defect area are obtained by calculating the roundness, rectangularity and irregularity, wherein the irregularity is calculated by the ratio of the square of the perimeter to the area. According to the distribution of the defect area on the LED surface, the defect density, nearest neighbor distance and aggregation index are calculated, and the aggregation index is calculated using the Moran's I index to obtain a spatial feature vector reflecting the overall distribution pattern of the defect. The geometric size parameters, morphological characteristics and spatial feature vector are combined into a multidimensional feature vector, and the multidimensional feature vector is subjected to Z-score normalization to obtain a defect feature vector of uniform dimension. The defect feature vector is classified using a support vector machine algorithm, and the support vector machine algorithm uses a radial basis function kernel, determines the optimal kernel parameters through grid search, constructs an optimal classification hyperplane, and obtains the type and position coordinates of the defect. A comprehensive score is calculated based on the defect area, depth and position coordinates to obtain the defect severity; the defect position coordinates are obtained by calculating the centroid coordinates of the defect area; and the classification accuracy of the support vector machine algorithm is evaluated using five-fold cross validation.

[0032] Specifically, according to the candidate area images of dents and scratches, the geometric dimensions of each defect area are calculated, including area, perimeter, major axis length and minor axis length. At the same time, morphological features such as roundness, rectangularity and irregularity are extracted. The irregularity is calculated by the ratio of the square of the perimeter to the area to obtain the basic geometric and morphological properties of the defect. According to the distribution of defect areas on the LED surface, the spatial distribution characteristics of the defects are calculated, including defect density, nearest neighbor distance and aggregation index. The aggregation index is calculated using the Moran's I index to construct a spatial feature vector that reflects the overall distribution pattern of the defect. The geometric dimensions, morphological characteristics and spatial distribution characteristics of the defect are combined into a multidimensional feature vector, and the feature vector is normalized by Z-score to obtain a defect feature vector with unified dimension. The support vector machine algorithm is used to classify and evaluate the defect feature vector. The radial basis function RBF kernel is used to determine the optimal kernel parameters through grid search, and the optimal classification hyperplane is constructed to obtain the type and location coordinates of the defect. The defect location coordinates are obtained by calculating the centroid coordinates of the defect area. The comprehensive score is calculated based on the defect area, depth and location to obtain the defect severity. The classification accuracy was evaluated using 5-fold cross validation to verify the performance of the support vector machine model. Taking a 1000x1000 pixel LED surface image as an example, 5 dents and 3 scratch candidate areas were detected. For each defect area, the geometric dimensions of the maximum dent area were calculated to be 200 square pixels, the perimeter was 60 pixels, the major axis length was 20 pixels, and the minor axis length was 12 pixels; the longest scratch length was 50 pixels and the width was 2 pixels. The morphological features were calculated to have a roundness (4π area / perimeter ^2) of 0.85, a rectangularity (area / (major axis minor axis)) of 0.92, and an irregularity (perimeter ^2 / area) of 18. In the spatial distribution characteristics, the defect density was 8 / (1000*1000)=8e-6, the average nearest neighbor distance was 100 pixels, and the Moran's I index was calculated to be 0.3, indicating that the defects showed a slight aggregation trend. These features were combined into a 25-dimensional feature vector and normalized by Z-score so that the mean of each feature was 0 and the standard deviation was 1. The support vector machine with RBF kernel was used for classification, and the optimal parameters C=10 and gamma=0.1 were determined by grid search. The classification results showed 5 dents and 3 scratches with an accuracy of 100%. The coordinates of the defect location were calculated by the centroid, and the center of the maximum dent was located at (500, 500). The severity score considered the area weight of 0.5, the depth weight of 0.3, and the position weight of 0.2. The maximum dent score was 0.8 and the full score was 1. Using 5-fold cross validation, the average classification accuracy reached 95%, verifying the stability of the model.

[0033] S106. Associate the optimal light source configuration parameters with the defect analysis results to evaluate the impact of the defects on the optical performance of the LED product. If the severity of the defect exceeds a preset threshold, the early warning mechanism is triggered to dynamically adjust the light source parameters or start the defect compensation algorithm based on the defect type and distribution characteristics.

[0034] Obtain defect analysis results and optimal light source configuration parameters of LED products, and establish a multivariate linear regression model as the optical performance evaluation model; obtain the optical performance influencing factor of the LED product through Monte Carlo simulation calculation based on the optical performance evaluation model; determine whether the optical performance influencing factor exceeds a preset performance threshold, and if the optical performance influencing factor exceeds the preset performance threshold, generate warning information including defect type, location and severity; according to the defect type and distribution characteristics in the warning information, use a genetic algorithm to dynamically adjust the light source parameters to obtain a new light source configuration scheme; determine whether the new light source configuration scheme meets the application requirements, and if the new light source configuration scheme does not meet the application requirements, start a defect compensation algorithm based on a convolutional neural network to locally compensate the defective area; verify the adjusted LED performance through optical simulation software, determine whether the LED performance meets the preset performance standard, and if the LED performance does not meet the preset performance standard and the number of adjustments does not reach the maximum value, repeat the light source parameter dynamic adjustment process.

[0035] Specifically, according to the optimal light source configuration parameters and defect analysis results, a multivariate linear regression model is established as an optical performance evaluation model. The impact of defects on the luminous flux, color temperature and color rendering index of LED products is calculated through Monte Carlo simulation. 1000 iterations are set to obtain the optical performance influencing factors. The calculated optical performance influencing factors are compared with the preset performance thresholds determined based on historical data statistical analysis. If the influencing factors exceed the threshold, the early warning mechanism is triggered to generate early warning information including defect type, location and severity. According to the defect type and distribution characteristics in the early warning information, the genetic algorithm is used to dynamically adjust the light source parameters, setting the population size to 100, the crossover rate to 0.8, and the mutation rate to 0.1. When there is no significant improvement in the optimal solution for 10 consecutive generations or the maximum number of iterations is reached, the brightness, angle and layout of the light source are optimized to generate a new light source configuration scheme. If the adjustment of the light source parameters cannot meet the application requirements, the defect compensation algorithm based on the 5-layer convolutional neural network is started. The network structure contains 3 convolutional layers and 2 fully connected layers. The network is trained by the back propagation algorithm to locally compensate for the defect area to ensure the overall optical performance of the LED product. Use optical simulation software to verify the performance of the adjusted LED, set the maximum number of adjustments to 5 or stop adjusting when the performance improvement is less than 1%. Taking an LED panel light as an example, the optimal light source configuration is a 3x3 array, a single LED brightness of 1000 lumens, and a light angle of 120 degrees. Defect analysis shows that there is a 2mm diameter depression in the center. Establish a multivariate linear regression model

[0036] Y=0.8X1+0.5X2+0.3X3, where X1 is the defect area, X2 is the defect depth, X3 is the distance of the defect position from the center, and Y is the optical performance influencing factor. After 1000 Monte Carlo simulations, the optical performance influencing factor is 0.15. Compared with the preset threshold of 0.1, the early warning mechanism is triggered. The genetic algorithm is used to adjust the light source parameters, with a population size of 100, a crossover rate of 0.8, and a mutation rate of 0.1. After 300 generations of iterations, a new light source configuration of 3x3 array is obtained, the brightness of the central LED is increased to 1200 lumens, and the brightness of the surrounding 8 LEDs is reduced to 950 lumens. Since the requirements are still not met after adjustment, a 5-layer convolutional neural network is started for defect compensation, and the network structure is 3 3x3 convolutional layers and 2 fully connected layers. 10,000 defective LED images are used to train the network, with a learning rate of 0.001 and a batch size of 64. The compensation algorithm recommends increasing the driving current of the central LED by 10% and the thickness of the surrounding LED phosphor coating by 5%. The adjustment results were verified using optical simulation software, showing that the luminous flux uniformity was improved by 3% and the color temperature deviation was reduced by 2%. After three iterations of adjustment, the final LED performance met the application requirements, with luminous flux fluctuation less than 5% and color temperature deviation less than 100K.

[0037] S107. Update the light source parameter database and defect feature database according to the quality inspection results of LED products, analyze the correlation between defects and light source parameters through data mining algorithms, and optimize the light source parameter configuration strategy and defect detection model.

[0038] According to the acquired light source parameter data and defect feature data, outlier detection and standardization are performed on the data to obtain processed light source parameter data and defect feature data; the processed light source parameter data and defect feature data are added to the corresponding database. Key features are extracted from the database, and the Apriori algorithm is used to analyze the association between defects and light source parameters; if the support of the association rule is greater than the preset first threshold and the confidence is greater than the preset second threshold, an association rule set is generated. For the association rule set, a decision tree algorithm is used to construct a light source parameter configuration decision model; the decision model uses defect features as input variables and light source parameters as output variables. The defect detection model is retrained using a convolutional neural network; the convolutional neural network includes a convolutional layer, a pooling layer, and a fully connected layer, and the newly added defect sample data is used as a training set. A feedback mechanism is set; if the detection accuracy is lower than the preset third threshold, the parameters and thresholds of the defect detection model are automatically adjusted.

[0039] Specifically, according to the quality inspection results of LED products, outlier detection and standardization are performed on the new light source parameters and defect feature data, and the processed data are added to the corresponding database. The online gradient descent method is used to achieve incremental learning, update the database structure, and ensure the timeliness and representativeness of the data. Key features are extracted from the updated light source parameter database and defect feature database, and the association between defects and light source parameters is analyzed by the Apriori algorithm. The minimum support is set to 0.1 and the minimum confidence is set to 0.7 to generate an association rule set. For the generated association rule set, the decision tree algorithm is used to construct a light source parameter configuration decision model, setting the maximum depth to 10 and the minimum number of samples to 5. The Gini coefficient is used as the splitting criterion, the defect features are used as input variables, and the light source parameters are used as output variables to optimize the light source parameter configuration strategy. The defect detection model was retrained using a convolutional neural network. The network structure included 5 convolutional layers, 3 pooling layers, and 2 fully connected layers. The newly added defect sample data was added to the training set. The Adam optimizer and cross entropy loss function were used. The learning rate was set to 0.001, the batch size was 64, and the number of iterations was 100 to improve the accuracy and robustness of defect detection. A feedback mechanism was set to automatically adjust the model parameters and thresholds when the detection accuracy was lower than 95%. The model performance was evaluated using 5-fold cross validation to achieve closed-loop control of LED product quality inspection and light source optimization. Taking a batch of 1000 LED products as an example, the quality inspection results showed that 85% were qualified and 15% were defective. Outlier detection was performed on the newly added data, and data points outside 3σ were removed, and a total of 12 abnormal records were deleted. The Z-score method was used for data standardization processing to map the eigenvalues ​​to a distribution with a mean of 0 and a standard deviation of 1. The database was updated using the online gradient descent method, with a learning rate set to 0.01. 32 records were processed each time for a total of 50 iterations. The Apriori algorithm analyzes the association rules, sets the minimum support to 0.1, the minimum confidence to 0.7, and generates 87 association rules. The decision tree algorithm constructs the light source parameter configuration model, with a maximum depth of 10 and a minimum number of samples of 5. The Gini coefficient is used as the splitting criterion to generate 15 leaf nodes. The convolutional neural network structure contains 5 convolutional layers with 32, 64, 128, 256, and 512 3x3 convolution kernels, 3 2x2 maximum pooling layers, and 2 fully connected layers with 1024 and 512 neurons. The Adam optimizer is used with a learning rate of 0.001, a batch size of 64, and 100 iterations. The model achieves an accuracy of 97.5% on the test set. A feedback mechanism is set. When the detection accuracy is lower than 95%, the learning rate is automatically adjusted to 0.8 times the current value, and the threshold is increased by 0.02. The model performance is evaluated using 5-fold cross validation, with an average accuracy of 96.8% and a standard deviation of 0.5%.

[0040] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for detecting surface defects of LED products, characterized in that: The method comprises: According to the parameter range preset in the LED product type database, the size characteristics and surface characteristics of the current LED product are obtained, and the LED product is preliminarily classified through the multi-layer perceptron neural network model to obtain the category identifier of the LED product and the corresponding initial configuration of the light source parameters; The acquired LED surface images are preprocessed using image processing algorithms, including denoising and contrast enhancement operations. The LED surface contour features are extracted using edge detection algorithms. The LED surface characteristics are refined and analyzed using the convolutional neural network model in deep learning to obtain surface texture and gloss feature parameters. According to the LED product category identifier and surface feature parameters, the matching light source brightness, angle and layout configuration scheme is retrieved from the light source parameter database, and the light source parameters are optimized and adjusted through the genetic algorithm to obtain the optimal light source configuration parameters that adapt to the current LED product characteristics; A multi-scale morphological algorithm is used to extract defect features from the preprocessed LED surface image. By setting structural elements of different sizes and shapes, morphological opening and closing operations are performed on surface depressions and fine scratches to obtain candidate areas for depressions and scratches. According to the geometric size, morphological characteristics and spatial distribution details of the dents and scratches, the defect feature vector is constructed, and the defect candidate area is classified and the severity is evaluated through the support vector machine algorithm to obtain the defect type, location and quantitative description parameters; The optimal light source configuration parameters are associated with the defect analysis results to evaluate the impact of defects on the optical performance of LED products. If the severity of the defect exceeds the preset threshold, the early warning mechanism is triggered to dynamically adjust the light source parameters or start the defect compensation algorithm according to the defect type and distribution characteristics; According to the quality inspection results of LED products, the light source parameter database and defect feature database are updated, the correlation between defects and light source parameters is analyzed through data mining algorithms, and the light source parameter configuration strategy and defect detection model are optimized.

2. The method according to claim 1, wherein: The method of obtaining the size characteristics and surface characteristic information of the current LED product according to the parameter range preset in the LED product type database, and preliminarily classifying the LED product through the multi-layer perceptron neural network model to obtain the category identifier of the LED product and the corresponding initial configuration of the light source parameters includes: Acquire the size characteristics and surface characteristic information of the LED product, and extract the corresponding initial configuration values ​​of the light source parameters from the LED product parameter database; Using a K nearest neighbor algorithm to preliminarily classify the LED products, calculating the Euclidean distance between the LED products and the known products in the database, and selecting K samples with the closest distance; Determine the category identifier of the LED product by voting, and extract the initial configuration of light source parameters corresponding to the category identifier from the LED product parameter database; If the initial configuration of the light source parameters is inconsistent with the initial configuration value of the light source parameters, a linear interpolation method is used to compare and analyze the two sets of configurations; According to the comparison and analysis results of the linear interpolation method, combined with the size characteristics and surface characteristic information of the LED product, the initial configuration of the light source parameters is adjusted; For each light source parameter, the adjusted parameter value y is calculated using the linear interpolation formula y=y1+(x-x1)*(y2-y1) / (x2-x1), where x is the characteristic value of the LED product, x1 and x2 are the characteristic values ​​of the two nearest known products in the database, and y1 and y2 are the corresponding parameter values.

3. The method according to claim 1, wherein: The image processing algorithm is used to pre-process the acquired LED surface image, including denoising and contrast enhancement operations, and the LED surface contour features are extracted by edge detection algorithm. The LED surface characteristics are refined and analyzed in combination with the convolutional neural network model in deep learning to obtain surface texture and gloss feature parameters, including: Acquire an LED surface image, and perform denoising on the LED surface image using a median filter algorithm to obtain a denoised LED surface image; According to the denoised LED surface image, pixel values ​​are adjusted by image normalization processing, and image contrast is enhanced by using a histogram equalization method to obtain a contrast-enhanced LED surface image; For the contrast-enhanced LED surface image, applying the Canny edge detection algorithm to extract the LED surface contour features to obtain an LED surface contour feature map; Extracting geometric features from the LED surface profile feature map, including profile perimeter, area and roundness; Convert the LED surface profile feature map into a pixel image block of a fixed size, and perform grayscale processing on the image block; Using a pre-trained convolutional neural network model to extract features from the standardized image blocks; Obtaining a feature vector from the last fully connected layer of the convolutional neural network, and mapping the feature vector to surface texture and gloss parameter values ​​through a regression algorithm; If the parameter value exceeds the preset threshold, it is determined that the surface characteristics of the LED do not meet the requirements.

4. The method according to claim 1, wherein: The method retrieves matching light source brightness, angle and layout configuration schemes from a light source parameter database according to the LED product category identifier and surface feature parameters, optimizes and adjusts the light source parameters through a genetic algorithm, and obtains the optimal light source configuration parameters that are adapted to the characteristics of the current LED product, including: According to the LED product category identifier and the surface feature parameters, the light source configuration scheme with the highest matching degree is retrieved from the light source parameter database to obtain an initial light source parameter configuration; Using a genetic algorithm to encode the initial light source parameters to generate a chromosome population including light source brightness, light emitting angle and layout configuration; For the chromosome population, the fitness function value of each chromosome is calculated, and the fitness function value is combined with the matching degree between the surface characteristic parameters of the LED product and the light source parameters; If the preset maximum number of iterations is reached or the change in the optimal fitness for multiple consecutive generations is less than a preset threshold, the selection, crossover and mutation operations of the chromosome are terminated; Select the individual with the highest fitness from the last generation of chromosomes and decode to obtain the optimal light source configuration parameters; The light source effect of the optimal light source configuration parameters is simulated by optical simulation software, the light source uniformity and color rendering index are calculated, and it is determined whether the preset threshold requirements are met.

5. The method according to claim 1, wherein: The multi-scale morphological algorithm is used to extract defect features from the pre-processed LED surface image. By setting structural elements of different sizes and shapes, morphological opening and closing operations are performed on surface depressions and fine scratches, respectively, to obtain candidate areas for depressions and scratches, including: According to the statistical analysis results of the LED surface characteristics, structural elements of different sizes and shapes are set, wherein the structural elements include circular structural elements and linear structural elements; The circular structure element is used to perform a multi-scale morphological opening operation on the LED surface image to obtain a candidate area of ​​surface depression, and the optimal depression detection scale is determined by image difference and threshold segmentation; For the LED surface image, use the linear structure element to perform a multi-scale morphological closing operation to obtain a candidate area of ​​scratches, and the rotation angle range of the linear structure element is 0 to 180 degrees; The concave candidate region and the scratch candidate region are merged, and the merged candidate region is optimized by using a region growing algorithm, the seed point is selected based on the local minimum gray value, and the growing condition is that the gray difference of adjacent pixels is less than a preset threshold; The features of the detected defective area are extracted, the area, perimeter and roundness geometric features are calculated, and the defect types are classified using a support vector machine to obtain the LED surface defect detection results.

6. The method according to claim 1, wherein: According to the geometric size, morphological characteristics and spatial distribution details of the dents and scratches, a defect feature vector is constructed, and the defect candidate area is classified and the severity is evaluated by the support vector machine algorithm to obtain the type, location and quantitative description parameters of the defect, including: Acquire candidate region images of dents and scratches, and calculate geometric dimension parameters of the defect region according to the candidate region images, wherein the geometric dimension parameters include area, perimeter, major axis length, and minor axis length; The morphological characteristics of the defect area are obtained by calculating the roundness, rectangularity and irregularity, wherein the irregularity is calculated by the ratio of the square of the perimeter to the area; According to the distribution of defect areas on the LED surface, the defect density, nearest neighbor distance and aggregation index are calculated. The aggregation index is calculated using the Moran's I index to obtain a spatial feature vector reflecting the overall distribution pattern of the defects. The geometric dimension parameters, morphological features and spatial feature vectors are combined into a multidimensional feature vector, and the multidimensional feature vector is subjected to Z-score standardization processing to obtain a defect feature vector of uniform dimension; A support vector machine algorithm is used to classify the defect feature vector. The support vector machine algorithm uses a radial basis function kernel, determines the optimal kernel parameters through grid search, constructs an optimal classification hyperplane, and obtains the type and location coordinates of the defect; Calculate a comprehensive score based on the defect area, depth and location coordinates to obtain the severity of the defect; Obtaining defect position coordinates by calculating the centroid coordinates of the defect area; Five-fold cross validation was used to evaluate the classification accuracy of the support vector machine algorithm.

7. The method according to claim 1, wherein: The optimal light source configuration parameters are associated with the defect analysis results to evaluate the impact of defects on the optical performance of LED products. If the severity of the defect exceeds a preset threshold, an early warning mechanism is triggered to dynamically adjust the light source parameters or start a defect compensation algorithm based on the defect type and distribution characteristics, including: Obtain defect analysis results and optimal light source configuration parameters of LED products, and establish a multivariate linear regression model as the optical performance evaluation model; According to the optical performance evaluation model, the optical performance influencing factor of the LED product is obtained by Monte Carlo simulation calculation; Determining whether the optical performance impact factor exceeds a preset performance threshold, and if the optical performance impact factor exceeds the preset performance threshold, generating early warning information including defect type, location and severity; According to the defect type and distribution characteristics in the warning information, a genetic algorithm is used to dynamically adjust the light source parameters to obtain a new light source configuration scheme; Determining whether the new light source configuration scheme meets the application requirements, if the new light source configuration scheme does not meet the application requirements, starting a defect compensation algorithm based on a convolutional neural network to perform local compensation on the defect area; The adjusted LED performance is verified by optical simulation software to determine whether the LED performance reaches the preset performance standard. If the LED performance does not reach the preset performance standard and the number of adjustments does not reach the maximum value, the light source parameter dynamic adjustment process is repeated.

8. The method according to claim 1, wherein: The method of updating the light source parameter database and defect feature database according to the quality inspection results of LED products, analyzing the correlation between defects and light source parameters through data mining algorithms, and optimizing the light source parameter configuration strategy and defect detection model includes: According to the acquired light source parameter data and defect characteristic data, outlier detection and standardization processing are performed on the data to obtain processed light source parameter data and defect characteristic data; Adding the processed light source parameter data and defect feature data to a corresponding database; Extract key features from the database and use Apriori algorithm to analyze the correlation between defects and light source parameters; If the support of the association rule is greater than a preset first threshold and the confidence is greater than a preset second threshold, then an association rule set is generated; According to the association rule set, the decision tree algorithm is used to build a light source parameter configuration decision model; The decision model uses defect characteristics as input variables and light source parameters as output variables; Retraining defect detection models using convolutional neural networks; The convolutional neural network includes a convolutional layer, a pooling layer and a fully connected layer, and uses the newly added defect sample data as a training set; Set up feedback mechanisms; If the detection accuracy is lower than a preset third threshold, the parameters and thresholds of the defect detection model are automatically adjusted.

Citation Information

Patent Citations

  • Surface defect detection method and system based on multi-light-source cooperation

    CN115272175A

  • System and method for determining whether a camera component is damaged

    US20220222855A1

Cited By

  • Urban drainage pipe network functional defect automatic identification and maintenance grading method and system

    CN119693859A

  • Door and window surface tiny flaw detection method and device, electronic equipment and storage medium

    CN120070831A

  • Transistor linear change AI detection method based on hybrid model

    CN120451147A

  • AI detection method for transistor linear variation based on hybrid model

    CN120451147B

  • Operation system and method of full-automatic coating machine

    CN120560097A