A method for detecting surface defects of LED products

Through technical means such as multi-layer perceptron neural networks, image processing, deep learning and genetic algorithms, the surface defect detection of LED products is optimized, the detection difficulties of different types of LED products are solved, and efficient and accurate defect identification and adaptive optimization of light source parameters are achieved.

CN119417746BActive Publication Date: 2025-09-16IFLYTEK SOUTH CHINA ARTIFICIAL INTELLIGENCE RES INST GUANGZHOU CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing LED product surface defect detection systems have difficulty achieving optimal defect detection results in LED products of different types, sizes and surface characteristics, especially in identifying surface dents and fine scratches, and the detection efficiency is low.

Method used

A multi-layer perceptron neural network is used for preliminary classification, and image processing and deep learning algorithms are combined to extract surface features. A genetic algorithm is used to optimize light source parameters. Multi-scale morphological algorithms and support vector machines are used for defect detection and evaluation. Data mining is used to optimize light source configuration strategies to achieve intelligent detection and closed-loop control.

Benefits of technology

It achieves accurate identification and efficient detection of surface defects in LED products, improves detection accuracy and efficiency, can promptly address the impact of serious defects on optical performance, and continuously optimize the detection model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417746B_ABST
    Figure CN119417746B_ABST
Patent Text Reader

Abstract

The present application provides a method for detecting surface defects in LED products, comprising: extracting defect features from a preprocessed LED surface image using a multi-scale morphological algorithm, performing morphological opening and closing operations on surface depressions and fine scratches by setting structural elements of different sizes and shapes, and obtaining candidate areas for depressions and scratches; constructing defect feature vectors based on the geometric dimensions, morphological features, and spatial distribution detail attributes of the depressions and scratches; classifying and assessing the severity of the defect candidate areas using a support vector machine algorithm to obtain the type, location, and quantitative description parameters of the defects; updating a light source parameter database and a defect feature database based on the quality inspection results of the LED products, analyzing the association between defects and light source parameters using a data mining algorithm, and optimizing the light source parameter configuration strategy and defect detection model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Surface defect detection systems for LED products present a complex technical challenge. The system must dynamically adjust light source and imaging parameters for each LED product type, size, and surface characteristics to achieve optimal defect detection. Surface dents are more noticeable at low brightness, while subtle scratches are more noticeable at high brightness. Finding a balance between these interdependent factors to accurately identify various defect types while maintaining detection efficiency is an urgent technical challenge. This requires the system to possess highly intelligent parameter control capabilities, capable of optimizing light source and imaging parameters in real time based on product characteristics and defect type to accommodate the needs of diverse inspection scenarios. Summary of the Invention

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

[0004] The dimensional characteristics and surface characteristics of the current LED product are obtained according to the parameter range preset in the LED product type database. The LED product is preliminarily classified using a multi-layer perceptron neural network model to obtain the LED product category identifier 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. The LED surface contour features are extracted using an edge detection algorithm. The convolutional neural network model used in deep learning is then used to perform a detailed analysis of the LED surface characteristics, obtaining surface texture and gloss characteristic 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. The light source parameters are optimized and adjusted through the genetic algorithm to obtain the optimal light source configuration parameters that adapt to the characteristics of the current LED product.

[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 minor scratches, respectively, to obtain candidate areas for depressions and scratches.

[0008] Based on the geometric size, morphological characteristics and spatial distribution details of the dents and scratches, a defect feature vector is constructed. The defect candidate areas are classified and the severity is evaluated using the support vector machine algorithm to obtain the defect type, location and quantitative description parameters.

[0009] Correlate the optimal light source configuration parameters with defect analysis results to assess 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. Based on the defect type and distribution characteristics, the light source parameters are dynamically adjusted or a defect compensation algorithm is activated.

[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 through a multi-layer perceptron neural network, achieving accurate classification of LED products and preliminary light source parameter configuration, solving 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, extract surface texture and glossiness characteristic parameters, and improve the analysis accuracy of LED surface characteristics. Then, a genetic algorithm is used to optimize the light source configuration parameters to achieve the optimal light source configuration based on the characteristics of the LED product. At the same time, a multi-scale morphological algorithm and a support vector machine are used to detect and evaluate LED surface defects, making 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 dynamically adjusted to achieve closed-loop control of LED product quality detection and light source optimization. It can promptly 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 LED product surface defects and adaptive optimization of light source parameters, improving 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 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 LED products according to the present invention. DETAILED DESCRIPTION

[0016] The technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts 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 LED products may specifically include:

[0018] S101. Obtain 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 a 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 dimensional 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 LED product is preliminarily classified using a K-nearest neighbor algorithm, and the Euclidean distance between the LED product and 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 a 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, a linear interpolation method is used to compare and analyze the two configurations. Based on the comparison and analysis results of the linear interpolation method and the dimensional 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 closest 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 based on 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 product, calculate the Euclidean distance between the current product and the known products in the database, select the K samples with the closest distance, and determine the category identifier of the LED product by voting. 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. Based on 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. During the adjustment process, for each light source parameter, the linear interpolation formula y = y1 + (x - x1) * (y2 - y1) / (x2 - x1) is used. 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. The adjusted parameter value y is calculated. The preset parameter ranges in the LED product parameter database include dimensional features such as length 10-100 mm, width 5-50 mm, and height 2-20 mm, as well as surface characteristics such as roughness 0.1-10 microns and reflectivity 0.1-0.9. The specific parameters of the current LED product are obtained, such as length 50 mm, width 25 mm, height 10 mm, roughness 2 microns, and reflectivity 0.5. The corresponding initial configuration values ​​for the light source parameters are extracted from the database, such as color temperature 4000K, luminous flux 500 lumens, and power 5 watts. Classification is performed using the K-nearest neighbor algorithm, with a K value of 3. The Euclidean distance between the current product and the known products in the database is calculated. Assume that the three most recent samples belong to categories A, B, and C, respectively. Two of these belong to category A and one belongs to category B. Using voting, the current LED product's category identifier is determined to be A. The initial light source parameter configuration corresponding to category A is extracted from the database, such as a color temperature of 3800K, a luminous flux of 480 lumens, and a power of 4.8 watts. Because these values ​​are inconsistent with the previously obtained initial configuration, linear interpolation is used for comparison and analysis. Taking color temperature as an example, the two closest known products in the database are 45 mm and 55 mm in length, corresponding to color temperatures of 3600K and 4000K, respectively. Using the linear interpolation formula, the adjusted color temperature of the current product is calculated as: 3600K + (50 - 45) * (4000 - 3600) / (55 - 45) = 3800K. Similarly, the adjusted values ​​for luminous flux and power are calculated. The resulting LED product light source parameter configuration is: a color temperature of 3800K, a luminous flux of 490 lumens, and a power of 4.9 watts.

[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 using a convolutional neural network model in deep learning to obtain surface texture and gloss characteristic parameters.

[0022] Acquire an LED surface image, and perform denoising processing on the LED surface image using a median filtering algorithm to obtain a denoised LED surface image; adjust pixel values ​​according to the denoised LED surface image through image normalization processing, and enhance image contrast using a histogram equalization method to obtain a contrast-enhanced LED surface image; apply a Canny edge detection algorithm to the contrast-enhanced LED surface image to extract LED surface contour features and obtain an LED surface contour feature map; extract geometric features from the LED surface contour feature map, including contour perimeter, area, and roundness; convert the LED surface contour feature map into a pixel image block of a fixed size, and perform grayscale processing on the image block; use a pre-trained convolutional neural network model to perform feature extraction on the standardized image block; obtain a feature vector from the last fully connected layer of the convolutional neural network, and map the feature vector to surface texture and gloss parameter values ​​through 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, the acquired LED surface image is denoised using a median filter algorithm to obtain a denoised LED surface image. The denoised LED surface image is then normalized to adjust pixel values ​​to the range of 0-255 to ensure consistency in subsequent processing. Histogram equalization is then used to enhance contrast in the normalized LED surface image, resulting in a contrast-enhanced LED surface image. The Canny edge detection algorithm is then applied to the contrast-enhanced LED surface image to extract LED surface contour features, resulting in an LED surface contour feature map. Geometric features, including contour perimeter, area, and roundness, are extracted from the LED surface contour feature map. The LED surface contour feature map is then converted into a fixed-size 128x128 pixel image block, which is then grayscaled and normalized to the range of 0-1. A pre-trained convolutional neural network model is used to extract and analyze features from the normalized image block. The convolutional neural network consists of five convolutional layers, each using a 3x3 convolution kernel, two max pooling layers, and three fully connected layers. The feature vector is obtained from the last fully connected layer of the convolutional neural network. A regression algorithm is used to map this feature vector to specific parameter values, such as surface texture and gloss. The resulting parameter values ​​are compared with preset thresholds to determine whether the LED surface characteristics meet the requirements. Taking a 300x300 pixel LED surface image as an example, a 3x3 windowed median filter is first used to remove salt and pepper noise from the image. The denoised image is then linearly normalized to map pixel values ​​to a range of 0–255 to ensure uniform brightness distribution. Histogram equalization is then performed on the normalized image to enhance contrast and clarify the LED surface texture. The Canny edge detection algorithm is applied to the enhanced image, with a low threshold of 50 and a high threshold of 150, to generate a contour feature map of the LED surface. Geometric features are extracted from the contour feature map, resulting in a perimeter of 1200 pixels, an area of ​​70,000 square pixels, and a circularity of 0.85. The contour feature map is then resized to 128x128 pixels, converted to grayscale, and normalized to a range of 0–1. A pretrained convolutional neural network model was used to process the standardized images. The model consists of five convolutional layers, each with 16, 32, 64, 64, and 128 3x3 convolution kernels, two 2x2 max 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 mapped to specific parameter values ​​using a linear regression algorithm. The resulting surface texture roughness was 2.5 microns and glossiness was 85%. These values ​​were compared with preset thresholds of 3 microns for roughness and 80% for glossiness to determine if the LED surface characteristics met the requirements.

[0024] S103. Retrieve matching light source brightness, angle, and layout configuration solutions from a light source parameter database based on the LED product category identifier and surface feature parameters, and optimize and adjust the light source parameters through a genetic algorithm to obtain 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 using 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 degree of matching 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 chromosome selection, crossover and mutation operations are terminated; the individual with the highest fitness is selected from the last generation of chromosomes, 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, based on the LED product category identifier and surface feature parameters, the initial light source parameter configuration is retrieved from the light source parameter database with the highest matching light source brightness, angle, and layout configuration. The matching degree is calculated using Euclidean distance. The parameter vector contains attributes such as light source brightness, luminous angle, and layout configuration. A genetic algorithm is used to encode the initial light source parameters. A real-number encoding scheme is used to generate a chromosome population containing light source brightness, luminous angle, and layout configuration. The population size is set to 100, the crossover rate is 0.8, and the mutation rate is 0.1. For each chromosome in the generated chromosome population, a fitness function is calculated. This fitness function considers the degree of match between the LED product surface feature parameters 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. Chromosomes with high fitness are selected for crossover and mutation. This process is repeated until the preset maximum number of iterations, 100, is reached or the optimal fitness has changed by less than 0.1% for 10 consecutive generations. The individuals with the highest fitness are selected from the final generation of chromosomes and decoded to obtain the optimal light source configuration parameters. The optimal light source configuration parameters are verified and evaluated by simulating the light source effect using optical simulation software, calculating indicators such as light source uniformity and color rendering index, and determining whether they meet preset threshold requirements. For example, an LED ceiling lamp with a category identifier of CL001 and surface characteristics including a reflectivity of 0.85 and a roughness of 2 microns is retrieved from the light source parameter database. The initial configuration with the highest matching score is: a light source brightness of 1000 lumens, a beam angle of 120 degrees, and a layout configuration of a 3x3 matrix. The matching score is calculated using Euclidean distance, with a parameter vector distance of 0.15. A genetic algorithm is used for optimization, generating 100 chromosomes with real-number encoding. Each chromosome contains a light source brightness of 800-1200 lumens, a beam angle of 90-150 degrees, and a layout configuration of a 2x2 to 4x4 matrix. The crossover rate was set to 0.8, and the mutation rate 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 light source brightness, A is the beam angle, and C is the number of LEDs in the layout configuration. After 87 iterations of selection, crossover, and mutation, the algorithm converged with a change in the optimal fitness of less than 0.1% for 10 consecutive generations. The optimal individual decoded light source resulted in a light source brightness of 1050 lumens, a beam angle of 125 degrees, and a 3x3 matrix layout configuration. Using optical simulation software to simulate the light source, the calculated uniformity was 0.92 and the color rendering index was 85, meeting the preset threshold requirements of uniformity > 0.9 and color rendering index > 80.

[0027] S104. 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, respectively, to obtain candidate areas for depressions and scratches.

[0028] According to the statistical analysis results of the LED surface features, structural elements of different sizes and shapes are set. The structural elements include circular structural elements and linear structural elements. The circular structural elements are used to perform a multi-scale morphological opening operation on the LED surface image to obtain candidate areas for surface depressions. The optimal depression detection scale is determined by image difference and threshold segmentation. For the LED surface image, a multi-scale morphological closing operation is performed using the linear structural elements to obtain candidate areas for scratches. The rotation angle range of the linear structural elements is 0 to 180 degrees. The depression candidate areas and the scratch candidate areas are merged, and the merged candidate areas are optimized using a region growing algorithm. The seed point selection is based on the local minimum grayscale value, and the growth condition is that the grayscale difference between 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, based on the statistical analysis of LED surface features, structuring elements of varying sizes and shapes, including circular and linear structuring elements, are set on the preprocessed LED surface image. The radius of the circular structuring element ranges from 2 to 8 pixels, while the length of the linear structuring element ranges from 5 to 12 pixels. A multi-scale morphological opening operation is performed on the LED surface image using the circular structuring element to obtain candidate regions for surface dents. Image differencing and threshold segmentation are used to compare the differences in the opening results at different scales and determine the optimal scale for dent detection. For subtle scratches, a multi-scale morphological closing operation is performed on the LED surface image using a linear structuring element to obtain candidate regions for scratches. The linear structuring element is rotated from 0 to 180 degrees with a step size of 15 degrees to detect scratches in different orientations. The dent and scratch candidate regions are then merged and optimized using a region growing algorithm. Seed points are selected based on the local minimum grayscale value. The growing condition is that the grayscale difference between adjacent pixels is less than a preset threshold. The stopping criterion is when the region area reaches a preset upper limit or there are no adjacent pixels that meet the condition. The final LED surface defect region is obtained. Feature extraction is performed on the detected defect areas, and geometric features such as area, perimeter, and roundness are calculated. A support vector machine is then used to classify the defect types. The results are compared with manually annotated real-world defect data to calculate the detection accuracy and recall rate, assessing the reliability of the defect detection results. Taking a 300x300 pixel LED surface image as an example, based on statistical analysis results, the radius of the circular structuring element is set to 2, 4, 6, and 8 pixels, and the length of the linear structuring element is set to 5, 8, 10, and 12 pixels. A multiscale morphological opening operation is performed on the image, using four circular structuring elements to obtain four dent candidate images. Image differencing is performed to calculate the difference between adjacent scale results, and a grayscale threshold of 20 is set. Regions in the difference image with a grayscale threshold greater than the threshold are marked as dent candidate regions. Comparison of the results at the four scales shows that a structuring element with a radius of 6 pixels performs best, resulting in dent candidate image A. A multiscale morphological closing operation is performed on the image, using four linear structuring elements, each rotated every 15 degrees from 0 to 180 degrees, resulting in a total of 48 scratch candidate images. Using the same difference and thresholding method, we obtain the scratch candidate region image B. A logical OR operation is performed on images A and B to obtain the merged candidate region image C. Pixels with grayscale values ​​less than 50 in image C are used as seed points. A region growing algorithm is performed with the growth condition that the grayscale difference between adjacent pixels is less than 10 and the region area is capped at 100 pixels. This yields the final defect region image D. For each connected region in image D, the features area, perimeter, and circularity (4π*area / perimeter^2) are extracted. Using these features as input, a support vector machine with an RBF kernel function is used to classify the defect types into two categories: dents and scratches. Finally, by comparing the algorithm with manually annotated real-world defect data, the detection accuracy was calculated to be 95% and the recall rate was 92%, validating 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 characteristics, and spatial distribution. Use a support vector machine algorithm to classify and evaluate the severity of the defect candidate areas to obtain the defect type, location, and quantitative description parameters.

[0031] Images of candidate areas for dents and scratches are acquired. Based on these candidate area images, the geometric parameters of the defect areas are calculated. These parameters include area, perimeter, major axis length, and minor axis length. Morphological characteristics of the defect areas are determined by calculating roundness, rectangularity, and irregularity, where irregularity is calculated as the ratio of the square of the perimeter to the area. Based on the distribution of the defect areas on the LED surface, the defect density, nearest neighbor distance, and clustering index are calculated. The clustering index is calculated using the Moran's I index, resulting in a spatial feature vector reflecting the overall distribution pattern of the defects. The geometric parameters, morphological characteristics, and spatial feature vector are combined into a multidimensional feature vector, which is then Z-score normalized to obtain a uniformly dimensioned defect feature vector. The defect feature vector is then classified using a support vector machine algorithm. This algorithm uses a radial basis function kernel, and the optimal kernel parameters are determined through grid search. The optimal classification hyperplane is constructed to determine the defect type and location coordinates. A comprehensive score is calculated based on the defect area, depth and location coordinates to obtain the defect severity; the defect location 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, based on images of candidate dents and scratches, the geometric dimensions of each defect region, including area, perimeter, major axis, and minor axis, are calculated. Morphological features such as roundness, rectangularity, and irregularity are also extracted. Irregularity is calculated as the ratio of the square of the perimeter to the area, thus obtaining the basic geometric and morphological properties of the defect. Based on the distribution of the defect regions on the LED surface, the spatial distribution characteristics of the defects, including defect density, nearest neighbor distance, and clustering index, are calculated using the Moran's I index. A spatial feature vector is constructed to reflect the overall distribution pattern of the defects. The geometric dimensions, morphological characteristics, and spatial distribution characteristics of the defects are combined into a multidimensional feature vector, which is then Z-score normalized to obtain a unified dimension of the defect feature vector. A support vector machine algorithm is used to classify and evaluate the defect feature vectors. Using a radial basis function (RBF) kernel, grid search is performed to determine the optimal kernel parameters. The optimal classification hyperplane is constructed to determine the defect type and location coordinates. The defect location coordinates are obtained by calculating the coordinates of the center of mass of the defect region. A comprehensive score is calculated based on the defect area, depth, and location to determine the defect severity. 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, five dents and three scratch candidate regions were detected. For each defect region, the geometric dimensions were calculated: the largest dent area was 200 square pixels, the perimeter was 60 pixels, the major axis was 20 pixels, and the minor axis was 12 pixels. The longest scratch was 50 pixels long and 2 pixels wide. Morphological features were calculated, yielding a circularity (4π area / perimeter^2) of 0.85, a rectangularity (area / (major axis minus axis)) of 0.92, and an irregularity (perimeter^2 / area) of 18. Regarding spatial distribution, the defect density was 8 / (1000*1000)=8e-6, the average nearest neighbor distance was 100 pixels, and the Moran's I index was 0.3, indicating a slight clustering of defects. These features were combined into a 25-dimensional feature vector and normalized using the Z-score, resulting in a mean of 0 and a standard deviation of 1 for each feature. Classification was performed using a support vector machine with an RBF kernel, and the optimal parameters, C = 10 and gamma = 0.1, were determined through a grid search. The classification results revealed five dents and three scratches, with 100% accuracy. Defect location coordinates were calculated using the centroid, with the center of the largest dent located at (500, 500). The severity score was weighted by 0.5 for area, 0.3 for depth, and 0.2 for position, with the maximum dent scored 0.8, with a maximum score of 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. Based on the defect type and distribution characteristics, the light source parameters are dynamically adjusted or the defect compensation algorithm is activated.

[0034] Obtain the defect analysis results and optimal light source configuration parameters of the LED product, and establish a multivariate linear regression model as the optical performance evaluation model; based on the optical performance evaluation model, obtain the optical performance influencing factor of the LED product through Monte Carlo simulation calculation; determine whether the optical performance influencing factor exceeds the preset performance threshold, and if so, generate warning information including the defect type, location and severity; based on 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 for the defective area; verify the adjusted LED performance through optical simulation software, and determine whether the LED performance meets the preset performance standard; 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, a multivariate linear regression model was established as an optical performance evaluation model based on the optimal light source configuration parameters and defect analysis results. Monte Carlo simulations were used to calculate the impact of defects on the LED product's luminous flux, color temperature, and color rendering index, with 1,000 iterations set to determine the optical performance impact factor. The calculated optical performance impact factor was compared with a preset performance threshold determined based on statistical analysis of historical data. If the impact factor exceeded the threshold, an early warning mechanism was triggered, generating a warning message containing the defect type, location, and severity. Based on the defect type and distribution characteristics in the warning message, a genetic algorithm was used to dynamically adjust the light source parameters, with a population size of 100, a crossover rate of 0.8, and a mutation rate of 0.1. The algorithm terminated after 10 consecutive generations of no significant improvement in the optimal solution or after reaching the maximum number of iterations of 500. The brightness, angle, and layout of the light source were then optimized to generate a new light source configuration. If the adjusted light source parameters failed to meet the application requirements, a defect compensation algorithm based on a five-layer convolutional neural network was activated. The network architecture consists of three convolutional layers and two fully connected layers. The network was trained using a backpropagation algorithm to locally compensate for the defective areas and ensure the overall optical performance of the LED product. Use optical simulation software to verify the performance of the adjusted LEDs. Set the maximum number of adjustments to 5 or stop adjusting if the performance improvement is less than 1%. For an LED panel light, the optimal light source configuration is a 3x3 array, with a single LED brightness of 1000 lumens and a beam angle of 120 degrees. Defect analysis reveals a 2mm diameter depression in the center. Build 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 the defect location is offset from the center, and Y is the optical performance impact factor. After 1000 Monte Carlo simulations, the optical performance impact factor was 0.15. This was compared with a preset threshold of 0.1, triggering an early warning mechanism. A genetic algorithm was 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 iterations, a new light source configuration, a 3x3 array, was obtained. The brightness of the center LED increased to 1200 lumens, while the brightness of the eight surrounding LEDs decreased to 950 lumens. Since these adjustments still did not meet the requirements, a five-layer convolutional neural network was used for defect compensation. The network structure consisted of three 3x3 convolutional layers and two fully connected layers. The network was trained using 10,000 images of defective LEDs, with a learning rate of 0.001 and a batch size of 64. The compensation algorithm recommended increasing the drive current of the center LED by 10% and the phosphor coating thickness of the surrounding LEDs by 5%. Using optical simulation software to verify the adjustment results showed a 3% improvement in luminous flux uniformity and a 2% reduction in color temperature deviation. After three iterations of adjustment, the LED performance finally 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 based on 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, the data are subjected to outlier detection and standardization processing 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 convolution 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, based on the quality inspection results of LED products, outlier detection and standardization are performed on the new light source parameter and defect feature data. The processed data is then added to the corresponding database. Incremental learning is achieved using the online gradient descent method, and the database structure is updated to ensure data timeliness and representativeness. Key features are extracted from the updated light source parameter database and defect feature database. The Apriori algorithm is used to analyze the association between defects and light source parameters. The minimum support is set to 0.1 and the minimum confidence is set to 0.7 to generate an association rule set. Based on the generated association rule set, a decision tree algorithm is used to construct a light source parameter configuration decision model. The maximum depth is set to 10 and the minimum number of samples is set to 5. The Gini coefficient is used as the splitting criterion. The defect features are used as input variables and the light source parameters as output variables to optimize the light source parameter configuration strategy. A convolutional neural network (CNN) was used to retrain the defect detection model. The network architecture consisted of five convolutional layers, three pooling layers, and two fully connected layers. New defective sample data was added to the training set. The Adam optimizer and cross-entropy loss function were used, with a learning rate of 0.001, a batch size of 64, and 100 iterations to improve defect detection accuracy and robustness. A feedback mechanism was implemented to automatically adjust model parameters and thresholds when detection accuracy fell below 95%. Five-fold cross-validation was used to evaluate model performance, achieving closed-loop control for LED product quality inspection and light source optimization. For a batch of 1,000 LED products, the quality inspection results showed that 85% passed and 15% were defective. Outlier detection was performed on the new data, and data points outside the 3σ range were removed, resulting in 12 outlier records being deleted. Data normalization was performed using the Z-score method, mapping the eigenvalues ​​to a distribution with a mean of 0 and a standard deviation of 1. The database was updated using online gradient descent with a learning rate of 0.01 and 32 records processed per iteration for 50 iterations. The Apriori algorithm analyzed association rules, setting a minimum support of 0.1 and a minimum confidence of 0.7, generating 87 association rules. A decision tree algorithm was used to construct a light source parameter configuration model with a maximum depth of 10 and a minimum number of samples of 5. The Gini coefficient was used as the splitting criterion, generating 15 leaf nodes. The convolutional neural network architecture consisted of five convolutional layers with 32, 64, 128, 256, and 512 3x3 convolution kernels, three 2x2 max pooling layers, and two fully connected layers with 1024 and 512 neurons, respectively. The Adam optimizer was used with a learning rate of 0.001, a batch size of 64, and 100 iterations. The model achieved an accuracy of 97.5% on the test set. A feedback mechanism was implemented to automatically adjust the learning rate to 0.8 times the current value and increase the threshold by 0.02 when the detection accuracy fell below 95%. Model performance was evaluated using 5-fold cross-validation, resulting in an average accuracy of 96.8% with 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 above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above 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: 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, performing preliminary classification of the LED product through a multi-layer perceptron neural network model, and obtaining the category identifier of the LED product and the corresponding initial configuration of the light source parameters; pre-processing the obtained LED surface image by using an image processing algorithm, including denoising and contrast enhancement operations, extracting the LED surface contour features by using an edge detection algorithm, and performing a refined analysis of the LED surface characteristics in combination with a convolutional neural network model in deep learning to obtain surface texture and gloss characteristic parameters; retrieving matching light source brightness, angle and layout configuration schemes from a light source parameter database according to the LED product category identifier and surface characteristic parameters, optimizing and adjusting the light source parameters through a genetic algorithm, and obtaining the optimal light source configuration parameters that adapt to the characteristics of the current LED product; and performing a multi-scale morphological algorithm on the pre-processed LED surface. Defect features are extracted from surface images. By setting structural elements of different sizes and shapes, morphological opening and closing operations are performed on surface dents and fine scratches to obtain candidate areas for dents and scratches. Defect feature vectors are constructed based on the geometric dimensions, morphological characteristics and spatial distribution details of dents and scratches. The defect candidate areas are classified and the severity is evaluated using the support vector machine algorithm to obtain the type, location and quantitative description parameters of the defects. 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, and the light source parameters are dynamically adjusted or the defect compensation algorithm is started 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, and the correlation between defects and light source parameters is analyzed through data mining algorithms to optimize the light source parameter configuration strategy and defect detection model.

2. The method according to claim 1, wherein The method obtains the size characteristics and surface characteristic information of the current LED product according to the parameter range preset in the LED product type database, performs preliminary classification on the LED product through the multi-layer perceptron neural network model, and obtains the category identifier of the LED product and the corresponding initial configuration of the light source parameters, including: obtaining the size characteristics and surface characteristic information of the LED product, extracting the corresponding initial configuration value of the light source parameters from the LED product parameter database; using the K nearest neighbor algorithm to preliminarily classify the LED product, calculating the Euclidean distance between the LED product and the known products in the database, and selecting the K samples with the closest distance; determining the category identifier of the LED product by the voting method, extracting the corresponding initial configuration value of the light source parameters from the LED product parameter database; Extract the initial configuration of light source parameters corresponding to the category identifier from the database; if the initial configuration of light source parameters is inconsistent with the initial configuration value of light source parameters, use linear interpolation method 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, adjust the initial configuration of light source parameters; for each light source parameter, use the linear interpolation formula y=y1+(x-x1)*(y2-y1) / (x2-x1) to calculate the adjusted parameter value y, where x is the characteristic value of the LED product, x1 and x2 are the characteristic values ​​of the two most recent known products in the database, and y1 and y2 are the corresponding parameter values.

3. The method according to claim 1, wherein The method uses an image processing algorithm to pre-process the acquired LED surface image, including denoising and contrast enhancement operations, extracts LED surface contour features through an edge detection algorithm, and performs a refined analysis of LED surface characteristics in combination with a convolutional neural network model in deep learning to obtain surface texture and gloss feature parameters, including: acquiring an LED surface image, denoising the LED surface image using a median filtering algorithm to obtain a denoised LED surface image; adjusting pixel values ​​according to the denoised LED surface image through image normalization, and enhancing image contrast using a histogram equalization method to obtain a contrast-enhanced LED surface image; and for the contrast-enhanced LED surface image, The method comprises the following steps: first, extracting the surface contour features of the LED from the image, applying the Canny edge detection algorithm to extract the surface contour features of the LED, and obtaining an LED surface contour feature map; extracting geometric features from the LED surface contour feature map, including contour perimeter, area, and roundness; converting the LED surface contour feature map into a pixel image block of a fixed size, graying the image block, and standardizing the grayscale value; using a pre-trained convolutional neural network model to extract features from the standardized image block; 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; and determining that the surface characteristics of the LED do not meet the requirements if the parameter value exceeds a preset threshold.

4. The method according to claim 1, wherein The method comprises: retrieving matching light source brightness, angle, and layout configuration schemes from a light source parameter database based on the LED product category identifier and surface feature parameters, optimizing and adjusting the light source parameters through a genetic algorithm, and obtaining optimal light source configuration parameters that adapt to the current LED product characteristics, including: retrieving the light source configuration scheme with the highest matching degree from the light source parameter database based on the LED product category identifier and surface feature parameters, and obtaining an initial light source parameter configuration; encoding the initial light source parameters using a genetic algorithm to generate a chromosome population including light source brightness, luminous angle, and layout configuration; calculating the fitness function value of each chromosome in the chromosome population, the fitness function value being combined with the degree of matching between the surface feature parameters of the LED product and the light source parameters; terminating the chromosome selection, crossover, and mutation operations if a preset maximum number of iterations is reached or the optimal fitness change for multiple generations is less than a preset threshold; selecting the individual with the highest fitness from the last generation of chromosomes, and decoding to obtain the optimal light source configuration parameters; simulating the light source effect of the optimal light source configuration parameters through optical simulation software, calculating the light source uniformity and color rendering index, and determining whether the preset threshold requirements are met.

5. The method according to claim 1, wherein The method uses a multi-scale morphological algorithm to extract defect features from a preprocessed LED surface image, sets structural elements of different sizes and shapes, and performs morphological opening and closing operations on surface depressions and fine scratches, respectively, to obtain candidate areas for depressions and scratches. The method includes: setting structural elements of different sizes and shapes based on statistical analysis results of LED surface features, the structural elements including circular structural elements and linear structural elements; performing a multi-scale morphological opening operation on the LED surface image using the circular structural elements to obtain candidate areas for surface depressions; and determining an optimal depression detection scale through image difference and threshold segmentation. For the LED surface image, the linear structuring element is used to perform a multi-scale morphological closing operation to obtain a candidate area for scratches, and the rotation angle range of the linear structuring element is 0 to 180 degrees; the candidate area for the depression and the candidate area for the scratch are merged, and the merged candidate area is optimized using a region growing algorithm. The seed point selection is based on the local minimum grayscale value, and the growth condition is that the grayscale difference between 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.

6. The method according to claim 1, wherein The method constructs a defect feature vector based on the geometric dimensions, morphological characteristics, and spatial distribution detail attributes of the dents and scratches, classifies the candidate defect areas and evaluates their severity using a support vector machine algorithm, and obtains the type, location, and quantitative description parameters of the defects, including: obtaining images of candidate areas for dents and scratches, and calculating geometric dimension parameters of the defect areas based on the candidate area images, wherein the geometric dimension parameters include area, perimeter, major axis length, and minor axis length; obtaining morphological characteristics of the defect areas by calculating roundness, rectangularity, and irregularity, wherein the irregularity is calculated by the ratio of the square of the perimeter to the area; and calculating defect density, nearest neighbor distance, and aggregation index based on the distribution of defect areas on the LED surface, wherein the aggregation index is calculated using Moran's The 'sI index is calculated to obtain a spatial feature vector reflecting the overall distribution pattern of the defect; the geometric size parameters, morphological characteristics and spatial feature vectors are combined into a multidimensional feature vector, and the multidimensional feature vector is subjected to Z-score normalization processing to obtain a defect feature vector of unified 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 location coordinates of the defect; a comprehensive score is calculated based on the defect area, depth and location coordinates to obtain the severity of the defect; the defect location coordinates are obtained by calculating the center of mass coordinates of the defect area; and the classification accuracy of the support vector machine algorithm is evaluated using five-fold cross validation.

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. According to the defect type and distribution characteristics, the light source parameters are dynamically adjusted or a defect compensation algorithm is started, including: obtaining the defect analysis results and optimal light source configuration parameters of the LED product, establishing a multivariate linear regression model as an optical performance evaluation model; according to the optical performance evaluation model, obtaining the optical performance influencing factor of the LED product through Monte Carlo simulation calculation; judging whether the optical performance influencing factor exceeds the preset performance threshold, and if the optical performance influencing factor exceeds the preset performance threshold, generating The method comprises the following steps: generating early warning information including defect type, location and severity; dynamically adjusting light source parameters using a genetic algorithm according to the defect type and distribution characteristics in the early warning information to obtain a new light source configuration scheme; judging 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 defective area; verifying the performance of the adjusted LED through optical simulation software to judge whether the LED performance meets the preset performance standard; if the LED performance does not meet the preset performance standard and the number of adjustments does not reach the maximum value, repeating the light source parameter dynamic adjustment process.

8. The method according to claim 1, wherein According to the quality inspection results of LED products, the light source parameter database and the defect feature database are updated, the association between defects and light source parameters is analyzed by data mining algorithm, and the light source parameter configuration strategy and defect detection model are optimized, including: based on the acquired light source parameter data and defect feature data, the data are subjected to outlier detection and standardization processing 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 association between defects and light source parameters is analyzed by Apriori algorithm; if the support of the association rule is greater than a preset first threshold and the confidence is greater than a 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 convolution layer, a pooling layer and a fully connected layer, and uses the newly added defect sample data as a training set; a feedback mechanism is set; 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