Full-automatic production line LED lamp defect detection method and system
Through the fully automatic production line LED lamp defect detection method, the neural network model is used to quickly detect and report generation of LED lamps, which solves the problems of slow speed and low convenience of traditional detection methods, and realizes efficient defect detection and convenient report generation.
Patent Information
- Application Number
- CN202510143769.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-06-17
AI Technical Summary
The traditional LED lamp defect detection method has low detection speed and low convenience, so it cannot allow users to intuitively view the detection data in a timely and effective manner.
The fully automatic production line LED lamp defect detection method is adopted to acquire and mark defective LED lamp images of different production batches and specifications, an image defect training database is established, and an LED defect model based on neural network is constructed. The model includes a convolutional layer, a pooling layer and a fully connected layer. The model is trained through the Adam algorithm to achieve rapid template matching, cutting, denoising and image enhancement of the image of LED lamps to be detected, and finally generates a defective LED lamp report.
It realizes rapid defect detection of LED lamps, improves detection speed, and facilitates users to analyze causes or repair them through detailed defect reports, improving the convenience of detection.
Smart Images

Figure CN120163765A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of LED detection, and more specifically, particularly relates to a method and system for defect detection of LED lamps on a full-automatic production line. Background Art
[0002] In today's lighting industry, LED lamps have rapidly gained popularity in the market due to advantages such as energy conservation, long lifespan, and high brightness. Their production scale has been continuously expanding, and production efficiency has also been continuously improving. The introduction of a full-automatic production line has greatly increased the manufacturing speed of LED lamps. However, this has brought challenges in product quality control, making the defect detection of LED lamps a crucial part of the production process. When traditional methods for defect detection of LED lamps are used to detect defects in LED lamps, they are often slow, and it is often impossible to allow users to intuitively view the detection data in a timely and effective manner, resulting in low convenience. Summary of the Invention
[0003] To solve the above technical problems, the present invention provides a method and system for defect detection of LED lamps on a full-automatic production line to solve the technical problems in the prior art that traditional methods for detecting LED lamps often have a low detection speed and low convenience.
[0004] The purpose and efficacy of a method and system for defect detection of LED lamps on a full-automatic production line of the present invention are achieved by the following specific technical means:
[0005] A method for defect detection of LED lamps on a full-automatic production line includes the following steps:
[0006] S101: Obtain images of defective LED lamps of multiple different production batches and different specifications, mark the defects for the appearance defects of various defective LED lamps. The defect marking includes the specific position, defect type, and defect size of the appearance defects of the LED lamps, establish an image defect training database, and import the images of various defective LED lamps that have been defect-marked into the image defect training database. The image defect training database is used to train the model;
[0007] S102: Construct an LED defect model framework. The LED defect model framework uses a neural network model. The LED defect model includes a convolutional layer, a pooling layer, and a fully connected layer, and construct an LED defect training model based on the LED defect model framework;
[0008] S103: Link the image defect training database with the LED defect training model, copy the image data based on the image data in the image defect training database, and the copied image data is the training image sample. Import the training image sample into the LED defect training model, so that the LED defect training model performs model training based on the training image sample. The Adam algorithm is used in the training process. When the LED defect training model is trained to the maximum number of iterations, stop the training and output the target LED defect model;
[0009] S104: Obtain the images of the LED lamps on the production line to be detected based on the LED lamps to be detected. Mark the same number for each group of LED lamps on the production line to be detected and the corresponding images of the LED lamps on the production line to be detected. Perform template matching on the images of the LED lamps on the production line to be detected based on the target LED defect model. For the areas with a similarity lower than 90%, determine them as suspected defect area images, and record the same number marking of this group of LED lamps on the production line to be detected. Use the U-Net network to cut the suspected defect area images, and crop and scale the cut suspected defect area images to match the input requirements of the target LED defect training model;
[0010] S105: Denoise the cropped and scaled suspected defect area images. Use the Gaussian filtering algorithm, set the Gaussian kernel to 5×5, and remove the Gaussian noise in the images through the Gaussian filtering algorithm. Then perform image enhancement operations on the suspected defect area images through histogram equalization. The image enhancement operation is to adjust the gray scale of the images to improve the contrast of the images and perform contrast stretching at the same time, so as to highlight the characteristics of the defects;
[0011] S106: Identify the defects in the suspected defect area images, and generate a report for each group of defective LED lamps based on the recorded same number marking.
[0012] As a further solution of the present invention, it is characterized in that defect identification is performed on the suspected defect area images, and the defect identification includes the following steps:
[0013] S1061: Import the suspected defect area images into the target LED defect model. The target LED defect model calculates based on forward propagation, outputs the probability distribution of each possible defect type, and identifies the defect types;
[0014] S1062: Obtain the mapping relationship based on the target LED defect model and the identified defect types. Based on the mapping relationship and through the method of reverse calculation, determine the pixel coordinates of the defects in the original images;
[0015] S1063: Based on the target LED defect model, obtain the relevant parameters of the defect size through the method of reverse calculation.
[0016] As a further solution of the present invention, the probability distribution of each possible defect type is output, and the defect type is identified, including:
[0017] The probability threshold is set to 0.65, and based on the probability threshold, the probability distribution of the possible defect types output by the target LED defect model is judged, and the defect category is output.
[0018] As a further solution of the present invention, each group of defective LED lamp reports includes records of defective size, defective position, same number marking record and defect type record.
[0019] As a further solution of the present invention, template matching is performed on the LED lamp images of the production line to be detected based on the LED defect training model, including:
[0020] If the template matching is successful, the LED lamp image to be detected continues to execute the subsequent steps;
[0021] If the template matching is unsuccessful, the LED lamp image to be detected does not continue to execute the subsequent steps, and the LED lamp image to be detected and the LED lamp to be detected are normally marked.
[0022] As a further solution of the present invention, the image enhancement operation is to adjust the gray scale of the image to improve the contrast of the image, and at the same time perform contrast stretching to highlight the features of the defect, including:
[0023] The image subjected to gray scale adjustment and contrast stretching is normalized, and the pixel values of the image are scaled to the range of [0, 1] or [0, -1].
[0024] As a further solution of the present invention, the defect marking includes the specific position, defect type and defect size of the appearance defect of the LED lamp. The specific position of the appearance defect of the LED lamp is recorded in the form of pixel coordinates and is accurate to ±1 pixel; the defect type is divided in the form of classification labels and is divided into: scratch, crack, missing part, damaged lamp bead and surface stain; the defect size is determined by measuring the length, width and area, and is converted through the actual size of the appearance defect of the LED lamp and the image pixels.
[0025] A full-automatic production line LED lamp defect detection system includes:
[0026] An acquisition module for acquiring defective LED lamp images and LED lamp images of the production line to be detected with multiple different production batches and different specifications;
[0027] A database module for establishing an image defect training database;
[0028] A model module for constructing an LED defect model framework. The LED defect model includes a convolutional layer, a pooling layer, and a fully connected layer. Based on the LED defect model framework, an LED defect training model is constructed. The LED defect training model is trained using training image samples. During the training process, the Adam algorithm is adopted, and when the maximum number of iterations is reached, the training stops and the target LED defect model is output;
[0029] A processing module that can perform template matching on the LED lamp images of the production line to be detected based on the target LED defect model. For areas with a similarity lower than 90%, they are determined as suspected defect area images, and the number markings of this group of LED lamps on the production line to be detected are recorded. The U-Net network is used to cut the suspected defect area images, and the cut suspected defect area images are cropped and scaled to match the input requirements of the target LED defect training model. The cropped and scaled suspected defect area images are denoised using the Gaussian filtering algorithm. The Gaussian kernel is set to 5×5, and the Gaussian noise in the image is removed through the Gaussian filtering algorithm. Then, histogram equalization is used to perform image enhancement on the suspected defect area images. The image enhancement operation is to adjust the gray scale of the image to improve the contrast of the image and simultaneously perform contrast stretching to highlight the characteristics of the defects;
[0030] A detection module for performing defect identification;
[0031] A marking module for marking the same number for each group of LED lamps on the production line to be detected and the LED lamp images of the same group on the production line to be detected, and marking the appearance defects of various defective LED lamps;
[0032] A reporting module for generating a report on LED lamps with defects. The report on LED lamps with defects includes records of defect size, defect location, same number marking record, and defect type record.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] First, obtain multiple groups of defective LED lamp images with different production batches and different specifications. Mark the appearance defects of various defective LED lamps, establish an image defect training database, and import the defective LED lamp images with various defect markings into the image defect training database. Then, construct an LED defect model framework. The LED defect model framework adopts a neural network model. At the same time, based on the LED defect model framework, construct an LED defect training model. Generate training image samples through the image defect training database. The LED defect training model performs training iterations based on the training image samples and outputs a target LED defect model. Subsequently, obtain the LED lamp images of the production line to be detected based on the LED lamps to be detected. Mark the same number for each group of LED lamps on the production line to be detected and the corresponding LED lamp images of the production line to be detected. Determine the suspected defect area image through template matching. Cut, denoise, and enhance the suspected defect area image, so that the model can better identify the defects in the suspected defect area image. Finally, identify the defects in the suspected defect area image and generate a report on the defective LED lamps. When detecting the LED lamps, this method can quickly detect the defects of the LED lamps through the trained target LED defect model, improving the detection speed. After the detection is completed, the user can directly view the defect category, defect location, and defect size of the LED lamps through the LED lamp report, which is convenient for the user to analyze the reasons or repair them, improving the convenience. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a flowchart of the steps of a method for detecting defects in LED lamps on a fully automatic production line according to the present invention;
[0036] Figure 2 is a flowchart of the steps of defect identification in step S106 of a method for detecting defects in LED lamps on a fully automatic production line according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0037] The following further describes in detail the embodiments of the present invention in conjunction with the drawings and embodiments. The following embodiments are used to illustrate the technical solutions of the present invention, but cannot be used to limit the protection scope of the present invention.
[0038] Embodiment 1:
[0039] As shown in the appended Figure 1 to the appended Figure 2 figures:
[0040] The present invention provides a method for detecting defects in LED lamps on a fully automatic production line, including the following steps:
[0041] S101: Obtain images of defective LED lamps of multiple different production batches and different specifications, collect images of defective LED lamps of different production batches and different specifications, which can increase the number of samples, ensure the diversity of samples, and enhance the robustness during subsequent model training. Perform defect marking on the appearance defects of various defective LED lamps. The defect marking includes the specific location, defect type, and defect size of the appearance defects of the LED lamps. Establish an image defect training database, and import the images of defective LED lamps with various defect markings into the image defect training database. The image defect training database is used to train the model;
[0042] Specifically, the defect marking includes the specific location, defect type, and defect size of the appearance defects of the LED lamps. The specific location of the appearance defects of the LED lamps is recorded in the form of pixel coordinates, accurate to ±1 pixel; the defect type is divided in the form of classification labels, divided into: scratch, crack, missing part, damaged lamp bead, and surface stain; the defect size is determined by measuring the length, width, and area, and is converted through the actual size of the appearance defect of the LED lamp and the image pixels.
[0043] S102: Construct an LED defect model framework. The LED defect model framework uses a neural network model. The LED defect model includes a convolutional layer, a pooling layer, and a fully connected layer, and construct an LED defect training model based on the LED defect model framework;
[0044] Specifically, construct multiple convolutional layers, each convolutional layer is equipped with a convolutional kernel of different sizes. The convolutional kernel can be 3×3. By sliding the convolutional kernel on the image, local features of the image, such as edges, textures, shapes, etc., are extracted. The number of convolutional layers can be set to 4 layers. After each convolution layer, use the ReLU activation function to enhance the non-linear expression ability of the model and relieve the gradient vanishing problem at the same time; insert a pooling layer after some convolutional layers, and use 2×2 max pooling or average pooling operations. Max pooling is used to highlight the maximum value of the features and enhance the significant features; average pooling smooths the feature map and retains the overall feature trend. The role of the pooling layer is to reduce the spatial resolution of the feature map, reduce the computational amount, and improve the translational invariance of the model at the same time. The number of pooling layers is set to 3 layers and is reasonably distributed among the convolutional layers; flatten the feature map after convolution and pooling processing into a one-dimensional vector and input it into the fully connected layer. The number of neurons in the fully connected layer is set to 512. Through the combination of multiple fully connected layers, deep fusion and classification judgment of the extracted features are performed, and finally the probability distribution of various defects is output.
[0045] S103: Link the image defect training database with the LED defect training model, copy the image data based on the image data in the image defect training database, and the copied image data is the training image sample. Import the training image sample into the LED defect training model, so that the LED defect training model performs model training based on the training image sample. The Adam algorithm is used during the training process. When the LED defect training model is trained to the maximum number of iterations, stop the training and output the target LED defect model;
[0046] It can be understood that when using the Adam algorithm to train the model, the initial learning rate can be set to 0.001. After setting, the cross-entropy loss function can be selected as the optimization objective of the model to measure the difference between the model prediction result and the true label. Through the backpropagation algorithm, the loss value is propagated backward from the output layer to the input layer to update the weight parameters of the model, making the prediction result of the model gradually approach the true value.
[0047] S104: Obtain the images of the LED lamps on the production line to be detected based on the LED lamps to be detected, mark each group of LED lamps on the production line to be detected and the images of the LED lamps on the production line to be detected in the same group with the same number. Based on the target LED defect model, perform template matching on the images of the LED lamps on the production line to be detected. For the areas with a similarity lower than 90%, determine them as suspected defect area images, and record the same number marking of this group of LED lamps on the production line to be detected. Use the U-Net network to cut the suspected defect area images, and crop and scale the cut suspected defect area images to make their sizes match the input requirements of the target LED defect training model;
[0048] It can be understood that if the template matching is successful, the image of the LED lamp to be detected continues to execute the subsequent steps; if the template matching is unsuccessful, the image of the LED lamp to be detected does not continue to execute the subsequent steps, and the image of the LED lamp to be detected and the LED lamp to be detected are normally marked. When the template matching is successful, it means that the image of the LED lamp to be detected has a suspected defect area, so it needs to enter the subsequent steps for further detection. When the template matching is unsuccessful, it means that the image of the LED lamp to be detected does not have a suspected defect area, so the image of the LED lamp to be detected does not need to continue the detection.
[0049] It can be understood that through the encoder-decoder structure, the U-Net network can effectively extract the context information of the image, achieve accurate segmentation of the defect area, crop and scale the segmented suspected defect area images to make their sizes match the input requirements of the target LED defect model, ensure that the extracted area completely contains the possible defects, and at the same time minimize the interference of background information.
[0050] S105: Denoise the cropped and scaled suspected defect area image using the Gaussian filter algorithm. Set the Gaussian kernel to 5×5. Remove the Gaussian noise in the image through the Gaussian filter algorithm, and then perform image enhancement on the suspected defect area image through histogram equalization. The image enhancement operation is to adjust the gray scale of the image to improve the contrast of the image and simultaneously perform contrast stretching to highlight the characteristics of the defect.
[0051] Specifically, Gaussian noise in the image can be removed through Gaussian filtering, smoothing the image and improving the image quality.
[0052] Furthermore, normalize the image after adjusting the gray scale and contrast stretching, and scale the pixel values of the image to the range of [0,1] or [0,-1]. Normalization can make the model converge faster and improve the efficiency of model detection.
[0053] S106: Identify the defects in the suspected defect area image and generate a report for each group of defective LED lamps based on the same numbered label recorded.
[0054] Among them, defect identification includes the following steps:
[0055] S1061: Import the suspected defect area image into the target LED defect model. The target LED defect model calculates based on forward propagation, outputs the probability distribution of each possible defect type, and identifies the defect type.
[0056] It can be understood that set the probability threshold to 0.65, judge the probability distribution of the possible defect types output by the target LED defect model based on the probability threshold, and output the defect category.
[0057] For example, if the probability of a certain defect type is greater than 0.6, it is determined that the suspected defect area is a defect of this type. For example, if the probability of a scratch is 0.7, which is greater than 0.6, it is determined that there is a scratch defect in this area.
[0058] S1062: Obtain the mapping relationship based on the target LED defect model and the identified defect type, and determine the pixel coordinates of the defect in the original image through reverse calculation. For example, if the upper left coordinate of the defect obtained by model calculation is (x1,x1) and the lower right coordinate is (x2,y2), the position of the defect can be determined, and the position accuracy reaches ±
[30] pixels, ensuring that the position of the defect in the LED lamp image can be accurately located.
[0059] S1063: Based on the target LED defect model, obtain the relevant parameters of the defect size through reverse calculation.
[0060] Specifically, each group of defective LED lamp reports includes records of defective size, defective location, same number marking, and defect type. Users can directly view the defect category, defect location, and defect size of the LED lamps through the LED lamp reports, which facilitates users to analyze the reasons or repair them, improving convenience.
[0061] An automatic production line LED lamp defect detection system, comprising:
[0062] An acquisition module for acquiring images of defective LED lamps of multiple different production batches and different specifications and images of LED lamps on the production line to be detected;
[0063] A database module for establishing an image defect training database;
[0064] A model module that can construct an LED defect training model based on convolutional layers, pooling layers, and fully connected layers, and train the LED defect training model with training image samples. During the training process, the Adam algorithm is adopted, and when the maximum number of iterations is reached, the training is stopped, and the target LED defect model is output;
[0065] A processing module that can perform template matching on the images of LED lamps on the production line to be detected based on the target LED defect model. For areas with a similarity lower than 90%, they are determined as suspected defect area images, and the number markings of this group of LED lamps on the production line to be detected are recorded. The U-Net network is used to cut the suspected defect area images, and the cut suspected defect area images are cropped and scaled to match the input requirements of the target LED defect training model. The cropped and scaled suspected defect area images are denoised. The Gaussian filter algorithm is adopted, and the Gaussian kernel is set to 5×5. The Gaussian noise in the image is removed through the Gaussian filter algorithm, and then the suspected defect area images are subjected to image enhancement operations through histogram equalization. The image enhancement operation is to adjust the gray scale of the image to enhance the contrast of the image and simultaneously perform contrast stretching to highlight the characteristics of the defects;
[0066] A detection module for performing defect identification;
[0067] A marking module for making the same number markings for each group of LED lamps on the production line to be detected and the images of the LED lamps on the production line to be detected in the same group, and making defect markings for the appearance defects of various defective LED lamps;
[0068] A report module for generating LED lamp reports with defects. The LED lamp reports with defects include records of defective size, defective location, same number marking, and defect type.
[0069] A method and system for defect detection of LED lamps in a fully automatic production line proposed in Embodiment 1 of the present invention. First, obtain images of defective LED lamps of multiple different production batches and different specifications, mark the appearance defects of various defective LED lamps, establish an image defect training database, and import the images of defective LED lamps with various defect marks into the image defect training database. Then, construct an LED defect model framework, and the LED defect model framework adopts a neural network model. At the same time, construct an LED defect training model based on the LED defect model framework, generate training image samples through the image defect training database, and the LED defect training model performs training iterations based on the training image samples and outputs a target LED defect model. Subsequently, obtain images of LED lamps on the production line to be detected based on the LED lamps to be detected, mark the same number for each group of LED lamps on the production line to be detected and the images of LED lamps on the production line to be detected in the same group, and determine the suspected defect area image through template matching. Cut, denoise, and enhance the suspected defect area image, so that the model can better identify defects in the suspected defect area image. Finally, identify defects in the suspected defect area image and generate a report on the defective LED lamps. When detecting LED lamps, this method can quickly detect defects of LED lamps through the trained target LED defect model, improving the detection speed. After the detection is completed, users can directly view the defect category, defect location, and defect size of the LED lamps through the report on the defective LED lamps, which is convenient for users to analyze the reasons or repair them, improving the convenience.
[0070] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware, or any other arbitrary combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When loading or executing the computer instructions or computer programs on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center through wired (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that contains a set of one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.
[0071] It should be understood that the term "and / or" in this text is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. Here, A and B can be singular or plural. Additionally, the character " / " in this text generally represents an "or" relationship between the associated objects before and after, but it may also represent an "and / or" relationship, and the specific meaning can be understood by referring to the context before and after.
[0072] It should be understood that in the embodiments of the present invention, the magnitudes of the serial numbers of the above processes do not imply the sequence of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0073] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for detecting defects of LED lamps in a fully automatic production line, characterized in that: The following steps are included: S101: Acquire multiple groups of defective LED lamp images of different production batches and different specifications, mark the appearance defects of various defective LED lamps, the defect marking includes the specific location, defect type and defect size of the appearance defect of the LED lamp, establish an image defect training database, import various defective LED lamp images with defect marking into the image defect training database, and the image defect training database is used to train the model; S102: constructing an LED defect model framework, the LED defect model framework adopts a neural network model, the LED defect model includes a convolution layer, a pooling layer and a fully connected layer, and constructing an LED defect training model based on the LED defect model framework; S103: linking the image defect training database with the LED defect training model, copying the image data based on the image data in the image defect training database, the copied image data is the training image sample, the training image sample is imported into the LED defect training model, so that the LED defect training model is trained based on the training image sample, the training process adopts the Adam algorithm, when the LED defect training model is trained to the maximum number of iterations, the training is stopped, and the target LED defect model is output; S104: based on the LED lamps to be detected, images of the LED lamps of the production line to be detected are obtained, and the same number is marked on each group of LED lamps of the production line to be detected and the images of the LED lamps of the production line to be detected in the same group, and template matching is performed on the images of the LED lamps of the production line to be detected based on the target LED defect model. For areas with a similarity lower than 90%, the images are determined to be suspected defect area images, and the same number marks of the LED lamps of the production line to be detected in the group are recorded, and the suspected defect area images are cut by using the U-Net network, and the cut suspected defect area images are cropped and scaled to make their sizes match the input requirements of the target LED defect training model; S105: performing denoising on the cropped and scaled suspected defect area image, using a Gaussian filtering algorithm, setting the Gaussian kernel to 5×5, removing Gaussian noise in the image through the Gaussian filtering algorithm, and then performing image enhancement operation on the suspected defect area image through histogram equalization. The image enhancement operation is to adjust the grayscale division of the image to improve the contrast of the image, and at the same time perform contrast stretching, so as to highlight the characteristics of the defect; S106: Defect identification is performed on the suspected defect area image, and a report of each group of defective LED lamps is generated based on the recorded same number mark.
2. The method for detecting defects of LED lamps in a fully automatic production line according to claim 1, characterized in that ,Defect recognition is performed on the suspected defect area image. Defect recognition includes the following steps: S1061: Importing the suspected defect area image into the target LED defect model, the target LED defect model outputs the probability distribution of each possible defect type based on forward propagation calculation, and identifies the defect type; S1062: Acquire a mapping relationship based on the target LED defect model and the identified defect type, and determine the pixel coordinates of the defect in the original image based on the mapping relationship and by reverse calculation; S1063: Based on the target LED defect model, relevant parameters of the defect size are obtained by reverse calculation.
3. The method for detecting defects of LED lamps in a fully automatic production line according to claim 2, characterized in that: Output the probability distribution of each possible defect type and identify the defect type, including: The probability threshold is set to 0.65, and the probability distribution of the possible defect types output by the target LED defect model is judged based on the probability threshold, and the defect category is output.
4. The method for detecting defects of LED lamps in a fully automatic production line according to claim 2, characterized in that: Each set of defective LED lamp reports includes defect size record, defect location record, same number mark record and defect type record.
5. The method for detecting defects of LED lamps in a fully automatic production line according to claim 1, characterized in that: Based on the LED defect training model, template matching is performed on the LED lamp images of the production line to be inspected, including: If the template matching is successful, the LED lamp image to be detected will continue to execute the subsequent steps; If the template matching is unsuccessful, the LED lamp image to be detected does not continue to execute subsequent steps, and the LED lamp image to be detected and the LED lamp to be detected are marked normally.
6. The method for detecting defects of LED lamps in a fully automatic production line according to claim 1, characterized in that: Image enhancement is to adjust the grayscale of the image to improve the contrast of the image and perform contrast stretching at the same time to highlight the characteristics of the defects, including: Normalize the image after adjusting the grayscale and contrast stretching, and scale the pixel values of the image to the range of [0, 1] or [0, -1].
7. According to the fully automatic production line LED lamp defect detection method of claim 1, the defect mark includes the specific location, defect type and defect size of the LED lamp appearance defect, characterized in that: The specific location of the LED lamp appearance defects is recorded in the form of pixel coordinates, with an accuracy of ±1 pixel; the defect types are divided into classification labels, which are divided into: scratches, cracks, missing parts, lamp bead damage and surface stains; the defect size is determined by measuring the length, width and area, and converted by the actual size of the LED lamp appearance defect and the image pixels.
8. A fully automatic production line LED lamp defect detection system, characterized in that: include: An acquisition module, used to acquire multiple groups of defective LED lamp images of different production batches and different specifications and images of LED lamps of the production line to be inspected; Database module, used to establish image defect training database; The model module is used to build an LED defect model framework. The LED defect model includes a convolution layer, a pooling layer, and a fully connected layer. The LED defect training model is built based on the LED defect model framework. The LED defect training model is trained through training image samples. During the training process, the Adam algorithm is used. When the maximum number of iterations is reached, the training is stopped and the target LED defect model is output; The processing module can perform template matching on the image of the LED lamps of the production line to be inspected based on the target LED defect model, determine the area with a similarity lower than 90% as the suspected defect area image, record the number marks of the group of LED lamps of the production line to be inspected, cut the suspected defect area image using the U-Net network, crop and scale the suspected defect area image after cutting so that its size matches the input requirement of the target LED defect training model, perform denoising on the cropped and scaled suspected defect area image, use the Gaussian filtering algorithm, set the Gaussian kernel to 5×5, remove the Gaussian noise in the image through the Gaussian filtering algorithm, and then perform image enhancement operation on the suspected defect area image through histogram equalization. The image enhancement operation is to adjust the grayscale division of the image so that the contrast of the image is improved, and at the same time perform contrast stretching, so as to highlight the characteristics of the defect; A detection module for performing defect identification; A marking module is used to mark each group of LED lamps of the production line to be inspected with the same number as the images of the LED lamps of the production line to be inspected in the same group, and to mark the appearance defects of various defective LED lamps; The report module is used to generate a defective LED lamp report, wherein the defective LED lamp report includes a defect size record, a defect location record, a same number mark record and a defect type record.
Citation Information
Cited By
Lamp holder production process quality inspection method and system based on machine vision
CN121353191A