Lighting parameter determination method, device and equipment for aluminum-based disc defect detection
By generating event stream image data and filtering bounding boxes and center coordinates, combined with a pre-trained model and filtering algorithm, the problem of low efficiency in determining lighting parameters in aluminum-based disk defect detection is solved, achieving efficient and low-cost determination of lighting parameters.
Patent Information
- Application Number
- CN202411175553.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2044-08-26
AI Technical Summary
In existing technologies, the process of detecting defects in aluminum-based discs involves a significant amount of time and computational costs in finding optimal lighting parameters, and it relies heavily on engineers' experience, resulting in low efficiency.
By generating event stream image data, a target detection algorithm is used to determine the bounding box and center coordinates, valid frames are filtered, a pre-trained defect detection model is used to detect defects, and false detections and false alarms are filtered. Finally, the final lighting parameters are determined based on the lighting evaluation results.
It improves the efficiency of determining lighting parameters, reduces computational costs, decreases data processing volume, simplifies the model training process, and improves detection accuracy.
Smart Images

Figure CN119048722B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and specifically to a method, apparatus, and equipment for determining lighting parameters for defect detection of aluminum-based disks. Background Technology
[0002] In industrial production, defects are inevitable due to manufacturing processes and batch variations. Therefore, detecting defective products has always been a crucial step in industrial production. Currently, mainstream industrial defect detection solutions can be broadly categorized into three types: using traditional cameras to capture images combined with target detection algorithms, manual visual inspection, and laser detection. However, in some specialized fields, such as highly reflective aluminum-based discs, traditional cameras struggle to clearly image defects. In recent years, a novel method utilizing dynamic vision sensors (event cameras) to detect surface defects in highly reflective materials has been proposed. Event cameras feature low latency, high dynamic range, and high temporal resolution, enabling clear imaging even in highly reflective environments. Due to their high temporal resolution, event cameras can eliminate motion blur, improving detection efficiency. Event cameras are also sensitive to changes in light intensity, allowing for clearer capture of even small defects.
[0003] However, during actual development, it was discovered that the event camera is highly sensitive to lighting conditions. High-quality lighting allows the event camera to clearly image defects, enabling subsequent defect detection algorithms to accurately distinguish between defective and undefective aluminum-based disks. Conversely, low-quality lighting prevents defects from being imaged or generates excessive noise, making it impossible for the defect detection algorithm to differentiate between defective and undefective disks. High-quality lighting requires strict adherence to specifications, necessitating engineers to repeatedly adjust the type and placement of light sources. Since there are no intuitive standards, the adjustment process heavily relies on the engineers' experience and intuition.
[0004] In existing technologies, the process of finding optimal lighting typically consumes a significant amount of time and effort. For example, engineers often need to collect data under different lighting settings, label the defect data, train object detection algorithms (such as the YOLO algorithm), and finally determine the final lighting parameters by evaluating the detection performance of the trained object detection algorithms for defective disks under various lighting conditions. This process requires substantial computational resources and is extremely inefficient. Summary of the Invention
[0005] To address the aforementioned problems in the prior art, this invention provides a method, apparatus, and device for determining lighting parameters for detecting defects in aluminum-based disks.
[0006] The technical problem to be solved by this invention is achieved through the following technical solution:
[0007] In a first aspect, the present invention provides a method for determining lighting parameters for detecting defects in aluminum-based disks, comprising:
[0008] For preset aluminum-based disks at different lighting positions, corresponding event stream image data is generated; the preset aluminum-based disks include: defective aluminum-based disks and standard aluminum-based disks;
[0009] An object detection algorithm is used to determine the bounding box and center coordinates of the aluminum base disk in the event stream image data. The event stream image data is then filtered for effective frames using the bounding boxes to obtain filtered event stream data.
[0010] Defect detection is performed on the event stream filtered data based on the pre-trained defect detection model to obtain the first detection result;
[0011] The first detection result is filtered for false positives based on the center coordinates to obtain the second detection result;
[0012] The false alarm detection algorithm based on continuous defect tracking performs false alarm filtering on the second detection result to obtain the third detection result;
[0013] The lighting quality assessment is performed based on the third detection result to obtain the lighting assessment result, and the final lighting parameters are determined based on the lighting assessment result; the pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting locations.
[0014] Optionally, for a preset aluminum-based disk at different lighting positions, corresponding event stream image data is generated, including:
[0015] Initialize a preset number of image matrices with the same resolution as the event camera to obtain the initialization matrix; the preset number is the product of the preset number of aluminum base disks and the number of illumination positions;
[0016] Record event streams of a preset duration for a preset aluminum-based disk under different lighting positions, and store them into an initialization matrix in chronological order to obtain the aluminum-based disk event stream;
[0017] An event data representation method based on dynamic memory accumulation is used to transform the event stream of an aluminum-based disk into event stream image data.
[0018] Optionally, an object detection algorithm is used to determine the bounding box and center coordinates of the aluminum-based disk in the event stream image data. The event stream image data is then filtered using these bounding boxes to obtain filtered event stream data, including:
[0019] An object detection algorithm is used to generate the initial bounding box and initial center coordinates of the preset aluminum base disk in the event stream image data;
[0020] Based on the preset size of the preset aluminum base disk, delete the initial bounding box and corresponding initial center coordinates that are smaller than the preset size to obtain the bounding box and center coordinates;
[0021] Image frames containing bounding boxes are retained from the event stream image data to obtain event stream filtered data.
[0022] Optionally, the training process of the pre-trained defect detection model includes:
[0023] Acquire event stream training data for multiple training aluminum-based disks at different lighting positions;
[0024] The event stream training data is input into the initial defect detection model for training;
[0025] The initial defect detection model is continuously trained in the direction of decreasing loss function;
[0026] An initial defect detection model whose loss function value satisfies a preset loss threshold is used as a pre-trained defect detection model.
[0027] Optionally, the first detection result includes: defect type, defect type confidence level, and defect location; the first detection result is then subjected to false positive filtering based on the center coordinates to obtain the second detection result, which includes:
[0028] Calculate the distance between the center coordinates and the defect location in the first detection result to obtain the first distance;
[0029] The first detection result that meets the preset distance condition is retained to obtain the second detection result; the preset distance condition is that the distance is greater than the inner circle radius and less than the preset aluminum base disk radius; the inner circle radius is the preset inner circle radius of the aluminum base disk.
[0030] Optionally, a false alarm detection algorithm based on continuous defect tracking is used to filter the second detection result to obtain a third detection result, including:
[0031] S201. Initialize the tracker for the defect bounding box corresponding to the initial frame in the second detection result, and use the center coordinates of the defect bounding box in the initial frame as the coordinates of the tracker.
[0032] S202. Match the defect bounding box corresponding to the current frame in the second detection result with all trackers before the current frame to obtain the matching result;
[0033] S203. When the matching result is a successful match, the coordinates of the matched tracker are updated, and the detection count of the matched tracker is incremented by one, which is used as the current detection count.
[0034] S204. When the matching result is a failure, the corresponding tracker is initialized for the defect bounding box of the current frame.
[0035] S205. Repeat S202-S204 until all image frames in the second detection result are matched.
[0036] S206. Determine the defect bounding box corresponding to the tracker whose current detection count exceeds the set threshold as a real defect, and use the real defect as the third detection result.
[0037] Optionally, the defect bounding box corresponding to the current frame in the second detection result is matched with all trackers before the current frame to obtain the matching result, including:
[0038] Calculate the center coordinates of the defect bounding box corresponding to the current frame and the distances between them and all trackers before the current frame to obtain the judgment distance;
[0039] If there is a judgment distance smaller than the preset threshold, the matching result is a successful match;
[0040] If there is no judgment distance less than the preset threshold in the judgment distance, the matching result is a matching failure;
[0041] When the matching result is successful, the tracker corresponding to the judgment distance less than the preset threshold is the matched tracker.
[0042] Optionally, a lighting quality assessment is performed based on the third test results to obtain lighting assessment results, and the final lighting parameters are determined based on the lighting assessment results, including:
[0043] All results in the second test, excluding the third test, will be considered false alarm results.
[0044] The false alarm rate is obtained by calculating the ratio of the number of false alarm results in each event stream filtered data to the number of defect bounding boxes corresponding to that event stream filtered data.
[0045] The detection rate is obtained by calculating the ratio of the number of frames with a third detection result to the total number of frames in the filtered data of each event stream.
[0046] Substitute the false alarm rate and the detection rate of the corresponding event stream filtered data into the preset lighting quality score formula to obtain the lighting evaluation result;
[0047] The lighting evaluation results at the same lighting location are averaged to obtain the mean lighting evaluation value at the corresponding lighting location.
[0048] The lighting location corresponding to the maximum value among the lighting assessment averages is used as the final lighting parameter.
[0049] In a second aspect, the present invention provides an illumination parameter determination device for aluminum-based disk defect detection, comprising: an event stream imaging unit, a target detection unit, a defect detection unit, a false detection filtering unit, a false alarm filtering unit, and an evaluation unit;
[0050] The event stream imaging unit is used to generate corresponding event stream image data for a preset aluminum base plate at different lighting positions; the preset aluminum base plate includes: defective aluminum base plate and standard aluminum base plate;
[0051] The target detection unit is used to: determine the bounding box and center coordinates of the aluminum base disk in the event stream image data using a target detection algorithm, and perform effective frame filtering on the event stream image data through the bounding box to obtain event stream filtered data;
[0052] The defect detection unit is used to: perform defect detection on the event stream filtered data according to the pre-trained defect detection model, and obtain the first detection result;
[0053] The false detection filtering unit is used to: perform false detection filtering on the first detection result based on the center coordinates to obtain the second detection result;
[0054] The false alarm filtering unit is used to: perform false alarm filtering on the second detection result based on the false alarm judgment algorithm of continuous defect tracking to obtain the third detection result;
[0055] The evaluation unit is used to: perform lighting quality evaluation processing based on the third detection result, obtain the lighting evaluation result, and determine the final lighting parameters based on the lighting evaluation result; the pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting locations.
[0056] Thirdly, the present invention provides a lighting parameter determination device for detecting defects in aluminum-based disks, comprising: a processor, a storage medium, and a bus. The storage medium stores machine-readable instructions executable by the processor. When the lighting parameter determination device for detecting defects in aluminum-based disks is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the lighting parameter determination method for detecting defects in aluminum-based disks as described in the first aspect above.
[0057] This invention provides a method, apparatus, and device for determining lighting parameters for aluminum-based disk defect detection. The method includes: generating corresponding event stream image data for a preset aluminum-based disk at different lighting positions; the preset aluminum-based disk includes a defective aluminum-based disk and a standard aluminum-based disk; using a target detection algorithm to determine the bounding box and center coordinates of the aluminum-based disk in the event stream image data; filtering the event stream image data using the bounding box to obtain filtered event stream data; performing defect detection on the filtered event stream data according to a pre-trained defect detection model to obtain a first detection result; performing false alarm filtering on the first detection result based on the center coordinates to obtain a second detection result; performing false alarm filtering on the second detection result based on a continuous defect tracking false alarm judgment algorithm to obtain a third detection result; performing lighting quality assessment based on the third detection result to obtain a lighting assessment result; and determining the final lighting parameters based on the lighting assessment result; the pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting positions. In this embodiment of the invention, effective frame filtering of the event stream image data ensures that subsequent processing data is concentrated on complete imaging data frames. Then, defect detection is performed on the filtered event stream data based on a pre-trained defect detection model to obtain a first detection result. Since the pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting locations, only one model needs to be trained, avoiding the problem of excessive data processing caused by sequentially training models at each lighting location in existing technologies. Secondly, false detection filtering and false alarm filtering are sequentially applied to the first detection result to ensure that the final third detection result is as close as possible to a real defect. Finally, the final lighting parameters are determined based on the third detection result. Since only one model needs to be trained and the final lighting parameters can be determined solely based on the third detection result, the process of designing validation sets for each model to determine the optimal lighting, as required by existing technologies, is avoided. This improves the efficiency of determining lighting parameters and reduces computational costs.
[0058] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0059] Figure 1 This is a flowchart illustrating a method for determining lighting parameters for detecting defects in aluminum-based disks, provided by an embodiment of the present invention.
[0060] Figure 2 This is a schematic diagram of a lighting parameter determination device for detecting defects in aluminum-based disks, provided in an embodiment of the present invention.
[0061] Figure 3 This is a schematic diagram of a lighting parameter determination device for detecting defects in aluminum-based disks, provided in an embodiment of the present invention. Detailed Implementation
[0062] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.
[0063] To improve the efficiency of determining lighting parameters and reduce computational costs, this invention provides a method for determining lighting parameters for detecting defects in aluminum-based disks. Figure 1 This is a flowchart illustrating a method for determining lighting parameters for detecting defects in aluminum-based disks, as provided in an embodiment of the present invention. Figure 1 As shown, it includes:
[0064] S101. Generate corresponding event stream image data for the preset aluminum base plate at different lighting positions.
[0065] The preset aluminum-based disks include: defective aluminum-based disks and standard aluminum-based disks.
[0066] Optionally, S101 may specifically include:
[0067] Initialize a preset number of image matrices with the same resolution as the event camera to obtain the initialization matrix; the preset number is the product of the preset number of aluminum base disks and the number of illumination positions;
[0068] Record event streams of a preset duration for a preset aluminum-based disk under different lighting positions, and store them into an initialization matrix in chronological order to obtain the aluminum-based disk event stream;
[0069] An event data representation method based on dynamic memory accumulation is used to transform the event stream of an aluminum-based disk into event stream image data.
[0070] It should be noted that, in this embodiment of the invention, the recording conditions are as follows:
[0071] Prepare an automated mechanical structure containing one or more light sources whose illumination position or angle can be adjusted, and these light sources can move along a slide rail. Place an event camera directly opposite a preset aluminum base plate, adjust the position of the light source, and collect event stream image data corresponding to the preset aluminum base plate under different illumination positions.
[0072] Furthermore, the movement of the light source on the slide rail can include coarse grid adjustment and fine grid adjustment. Coarse grid adjustment is generally used for scenarios without any prior knowledge. Fine grid adjustment is generally used for scenarios with existing prior information, i.e., the approximate area of the optimal lighting position is already known, and further determination is needed. In addition, in some embodiments, coarse grid adjustment and fine grid adjustment can be combined to quickly determine the optimal lighting position. When using a combination of coarse and fine grid adjustment, the execution process is as follows: First, according to coarse grid adjustment, the light source moves a large distance along the slide rail each time, maintaining the angle of illumination on the disk, and according to the method of this embodiment, quickly finds the slide rail area with the best lighting conditions within the slide rail movement range. Then, fine grid adjustment is used, where the light source moves a small distance along the slide rail each time, keeping the light source within the slide rail area with the best lighting conditions found by the coarse grid. Finally, the final lighting parameters are obtained.
[0073] S102. The bounding box and center coordinates of the aluminum base disk in the event stream image data are determined by the target detection algorithm. The event stream image data is then filtered by the bounding box to obtain the event stream filtered data.
[0074] Optionally, S102 may specifically include:
[0075] An object detection algorithm is used to generate the initial bounding box and initial center coordinates of the preset aluminum base disk in the event stream image data;
[0076] Based on the preset size of the preset aluminum base disk, delete the initial bounding box and corresponding initial center coordinates that are smaller than the preset size to obtain the bounding box and center coordinates;
[0077] Image frames containing bounding boxes are retained from the event stream image data to obtain event stream filtered data.
[0078] It should be noted that in this embodiment of the invention, the target detection algorithm can be YOLO-World or Ground Dino, etc. Based on a pre-set size of the aluminum base disk, initial bounding boxes that do not conform to the size are filtered out to obtain the bounding boxes. Frames containing bounding boxes in the event stream are retained as valid frames, while frames without disk bounding boxes are discarded. Additionally, the absolute coordinates of the center can be calculated based on the position of the disk bounding boxes in the valid frames. Using the absolute coordinates of the center as the center and the diameter of the aluminum base disk as the side length, a square image is cropped, i.e., after cropping, only the portion of the image containing the aluminum base disk is obtained.
[0079] S103. Perform defect detection on the event stream filtered data according to the pre-trained defect detection model to obtain the first detection result.
[0080] The pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting locations.
[0081] Optionally, the training process of the pre-trained defect detection model includes:
[0082] Acquire event stream training data for multiple training aluminum-based disks at different lighting positions;
[0083] The event stream training data is input into the initial defect detection model for training;
[0084] The initial defect detection model is continuously trained in the direction of decreasing loss function;
[0085] An initial defect detection model whose loss function value satisfies a preset loss threshold is used as a pre-trained defect detection model.
[0086] It should be noted that, in the embodiments of the present invention, the training aluminum-based disk can specifically be a defective aluminum-based disk.
[0087] S104. Based on the center coordinates, perform false detection filtering on the first detection result to obtain the second detection result.
[0088] Optionally, the first detection result includes: defect type, defect type confidence level, and defect location, and S104 may specifically include:
[0089] Calculate the distance between the center coordinates and the defect location in the first detection result to obtain the first distance;
[0090] The first detection result that meets the preset distance condition is retained to obtain the second detection result; the preset distance condition is that the distance is greater than the inner circle radius and less than the preset aluminum base disk radius; the inner circle radius is the preset inner circle radius of the aluminum base disk.
[0091] When the center coordinates are represented as (x1, y1) and the center coordinates of the defect location in the first detection result are represented as (x2, y2), the distance between the two is represented as d.
[0092]
[0093] Let the preset radius of the aluminum base disk be R, and the preset inner radius of the aluminum base disk be r, where the values of R and r are measured manually in advance.
[0094] The defect is determined to occur on the aluminum-based disk if and only if R > d > r. 。
[0095] S105. The false alarm judgment algorithm based on continuous defect tracking performs false alarm filtering on the second detection result to obtain the third detection result.
[0096] Optionally, S105 may specifically include:
[0097] S201. Initialize the tracker for the defect bounding box corresponding to the initial frame in the second detection result, and use the center coordinates of the defect bounding box in the initial frame as the coordinates of the tracker.
[0098] S202. Match the defect bounding box corresponding to the current frame in the second detection result with all trackers before the current frame to obtain the matching result;
[0099] S203. When the matching result is a successful match, the coordinates of the matched tracker are updated, and the detection count of the matched tracker is incremented by one, which is used as the current detection count.
[0100] S204. When the matching result is a failure, the corresponding tracker is initialized for the defect bounding box of the current frame.
[0101] S205. Repeat S202-S204 until all image frames in the second detection result are matched.
[0102] S206. Determine the defect bounding box corresponding to the tracker whose current detection count exceeds the set threshold as a real defect, and use the real defect as the third detection result.
[0103] It should be noted that when the matching result is a successful match, the coordinates of the matched tracker are updated. Specifically, the coordinates of the matched tracker are updated to the center coordinates of the defect bounding box corresponding to the current frame.
[0104] Optionally, S202 may specifically include:
[0105] Calculate the center coordinates of the defect bounding box corresponding to the current frame and the distances between them and all trackers before the current frame to obtain the judgment distance;
[0106] If there is a judgment distance smaller than the preset threshold, the matching result is a successful match;
[0107] If there is no judgment distance less than the preset threshold in the judgment distance, the matching result is a matching failure;
[0108] When the matching result is successful, the tracker corresponding to the judgment distance less than the preset threshold is the matched tracker.
[0109] S106. Based on the third test results, conduct a lighting quality assessment to obtain the lighting assessment results, and determine the final lighting parameters based on the lighting assessment results.
[0110] Optionally, S106 may specifically include:
[0111] All results in the second test, excluding the third test, will be considered false alarm results.
[0112] The false alarm rate is obtained by calculating the ratio of the number of false alarm results in each event stream filtered data to the number of defect bounding boxes corresponding to that event stream filtered data.
[0113] The detection rate is obtained by calculating the ratio of the number of frames with a third detection result to the total number of frames in the filtered data of each event stream.
[0114] Substitute the false alarm rate and the detection rate of the corresponding event stream filtered data into the preset lighting quality score formula to obtain the lighting evaluation result;
[0115] The lighting evaluation results at the same lighting location are averaged to obtain the mean lighting evaluation value at the corresponding lighting location.
[0116] The lighting location corresponding to the maximum value among the lighting assessment averages is used as the final lighting parameter.
[0117] It should be noted that the preset lighting quality score formula is expressed as follows:
[0118] score=P*n+(1-P)*(1-n)–S;
[0119] Wherein, score represents the lighting evaluation result, P represents the detection rate, S represents the false alarm rate, and n represents the judgment coefficient. The value of n is 0 or 1. When the event stream filtering data of this segment is the event stream of defective aluminum-based disks, n is 1; when the event stream filtering data of this segment is the event stream of standard aluminum-based disks, n is 0.
[0120] This invention provides a method for determining lighting parameters for defect detection on aluminum-based disks. By effectively filtering event stream image data, subsequent processing data is concentrated on complete imaging frames. Then, a pre-trained defect detection model is used to detect defects in the filtered event stream data, yielding a first detection result. Since the pre-trained defect detection model is trained on training event stream data acquired from multiple lighting locations, only one model needs to be trained, avoiding the excessive data processing volume caused by sequentially training models at each lighting location in existing technologies. Secondly, the first detection result is sequentially processed with false alarm filtering and false detection filtering to ensure that the final third detection result is as close as possible to a true defect. Finally, the final lighting parameters are determined based on the third detection result. Because the model only needs to be trained once, and the final lighting parameters are determined solely based on the third detection result, the process of designing validation sets for each model to determine optimal lighting, as required by existing technologies, is avoided. This improves the efficiency of lighting parameter determination and reduces computational costs.
[0121] The method provided in this embodiment of the invention can be applied to electronic devices. Specifically, the electronic device can be a desktop computer, a portable computer, a smart mobile terminal, a server, etc., and this embodiment of the invention does not limit the application to such devices.
[0122] Based on the same inventive concept, embodiments of the present invention also provide an illumination parameter determination device for detecting defects in aluminum-based disks. Figure 2 This is a schematic diagram of a lighting parameter determination device for detecting defects in aluminum-based disks, provided in an embodiment of the present invention. Figure 2 As shown, it includes: an event stream capture unit 201, a target detection unit 202, a defect detection unit 203, a false detection filtering unit 204, a false alarm filtering unit 205, and an evaluation unit 206.
[0123] The event stream imaging unit 201 is used to generate corresponding event stream image data for a preset aluminum base plate at different lighting positions; the preset aluminum base plate includes: a defective aluminum base plate and a standard aluminum base plate;
[0124] The target detection unit 202 is used to: use a target detection algorithm to determine the bounding box and center coordinates of the aluminum base disk in the event stream image data, and perform effective frame filtering on the event stream image data through the bounding box to obtain event stream filtered data;
[0125] The defect detection unit 203 is used to: perform defect detection on the event stream filtered data according to the pre-trained defect detection model, and obtain the first detection result;
[0126] The false detection filtering unit 204 is used to: perform false detection filtering on the first detection result based on the center coordinates to obtain the second detection result;
[0127] The false alarm filtering unit 205 is used to: perform false alarm filtering on the second detection result based on the false alarm judgment algorithm of continuous defect tracking to obtain the third detection result;
[0128] The evaluation unit 206 is used to: perform lighting quality evaluation processing based on the third detection result, obtain lighting evaluation result, and determine the final lighting parameters based on the lighting evaluation result; the pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting locations.
[0129] Figure 3This invention provides a schematic diagram of a lighting parameter determination device for detecting defects in aluminum-based disks, comprising: a processor 310, a storage medium 320, and a bus 330. The storage medium 320 stores machine-readable instructions executable by the processor 310. When the lighting parameter determination device for detecting defects in aluminum-based disks is running, the processor 310 communicates with the storage medium 320 via the bus 330, and the processor 310 executes the machine-readable instructions to perform the steps of the above-described method embodiment. Specific implementation methods and technical effects are similar and will not be repeated here.
[0130] The storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the storage medium may also be at least one storage device located remotely from the aforementioned processor.
[0131] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0132] It should be noted that the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention.
[0133] In the description of this specification, references to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to a specific feature or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the present invention.
[0134] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings and the disclosure, will understand and implement other variations of the disclosed embodiments in carrying out the claimed invention. In the description of the invention, the word "comprising" does not exclude other components or steps, "a" or "an" does not exclude a plurality, and "a plurality" means two or more, unless otherwise explicitly specified. Furthermore, while different embodiments may describe certain measures, this does not mean that these measures cannot be combined to produce good results.
[0135] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the inventive concept, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A method for determining lighting parameters for defect detection on aluminum-based disks, characterized in that, include: Generate corresponding event stream image data for a preset aluminum base disk at different lighting positions; The preset aluminum-based disk includes: defective aluminum-based disks and standard aluminum-based disks; A target detection algorithm is used to determine the bounding box and center coordinates of the aluminum base disk in the event stream image data. The event stream image data is then filtered for effective frames using the bounding box to obtain event stream filtered data. Defect detection is performed on the event stream filtered data according to the pre-trained defect detection model to obtain the first detection result; A second detection result is obtained by performing false detection filtering on the first detection result based on the center coordinates; wherein, the false detection filtering on the first detection result based on the center coordinates to obtain the second detection result includes: Calculate the distance between the center coordinates and the defect location in the first detection result to obtain the first distance; The first detection result that satisfies the preset distance condition is retained to obtain the second detection result; the preset distance condition is that the distance is greater than the inner circle radius and less than the preset aluminum base disk radius; the inner circle radius is the inner circle radius of the preset aluminum base disk. The false alarm detection algorithm based on continuous defect tracking performs false alarm filtering on the second detection result to obtain a third detection result; wherein, the false alarm detection algorithm based on continuous defect tracking performs false alarm filtering on the second detection result to obtain a third detection result, including: S201. Initialize the corresponding tracker for the defect bounding box corresponding to the initial frame in the second detection result, and use the center coordinates of the defect bounding box in the initial frame as the coordinates of the tracker. S202. Match the defect bounding box corresponding to the current frame in the second detection result with all trackers before the current frame to obtain a matching result; S203. When the matching result is a successful match, the coordinates of the matched tracker are updated, and the detection count of the matched tracker is incremented by one as the current detection count. S204. When the matching result is a failure, the corresponding tracker is initialized for the defect bounding box corresponding to the current frame. S205. Repeat S202-S204 until all image frames in the second detection result are matched. S206. Determine the defect bounding box corresponding to the tracker whose current detection count is greater than a set threshold as a real defect, and use the real defect as the third detection result; The lighting quality assessment is performed based on the third detection result to obtain the lighting assessment result, and the final lighting parameters are determined based on the lighting assessment result; the pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting locations.
2. The method for determining lighting parameters for defect detection of aluminum-based disks according to claim 1, characterized in that, The process of generating corresponding event stream image data for a preset aluminum base disk at different lighting positions includes: Initialize a preset number of image matrices with the same resolution as the event camera to obtain an initialization matrix; the preset number is the product of the preset number of aluminum base disks and the number of illumination positions; Record event streams of a preset duration for the preset aluminum-based disk under different lighting positions, and store them in the initialization matrix in chronological order to obtain the event stream of the aluminum-based disk; An event data representation method based on dynamic memory accumulation is used to convert the event stream of the aluminum-based disk into event stream image data.
3. The method for determining lighting parameters for defect detection of aluminum-based disks according to claim 1, characterized in that, The method employs a target detection algorithm to determine the bounding box and center coordinates of the aluminum-based disk in the event stream image data. Then, it performs effective frame filtering on the event stream image data using the bounding box to obtain event stream filtered data, including: The target detection algorithm is used to generate the initial bounding box and initial center coordinates of the preset aluminum base disk in the event stream image data; Based on the preset size of the preset aluminum base disk, delete the initial bounding box and the corresponding initial center coordinates that are smaller than the preset size to obtain the bounding box and the center coordinates; The event stream image data containing the bounding box is retained to obtain the event stream filtered data.
4. The method for determining lighting parameters for defect detection of aluminum-based disks according to claim 1, characterized in that, The training process of the pre-trained defect detection model includes: Acquire event stream training data for multiple training aluminum-based disks at different lighting positions; The event stream training data is input into the initial defect detection model for training. The initial defect detection model is continuously trained in the direction of decreasing loss function; The initial defect detection model whose loss function value satisfies the preset loss threshold is used as the pre-trained defect detection model.
5. The method for determining lighting parameters for defect detection of aluminum-based disks according to claim 1, characterized in that, The first detection result includes: defect type, defect type confidence level, and defect location.
6. The method for determining lighting parameters for defect detection of aluminum-based disks according to claim 1, characterized in that, The step of matching the defect bounding box corresponding to the current frame in the second detection result with all trackers before the current frame to obtain the matching result includes: Calculate the distance between the center coordinates of the defect bounding box corresponding to the current frame and the distances of all trackers before the current frame to obtain the judgment distance; If any of the judgment distances is less than a preset threshold, then the matching result is a successful match; If there is no judgment distance less than a preset threshold among the judgment distances, the matching result is a matching failure; Wherein, when the matching result is a successful match, the tracker corresponding to the judgment distance less than the preset threshold is the matched tracker.
7. The method for determining lighting parameters for defect detection of aluminum-based disks according to claim 1, characterized in that, The process of performing a lighting quality assessment based on the third detection result to obtain a lighting assessment result, and determining the final lighting parameters based on the lighting assessment result, includes: The results in the second detection result other than the third detection result shall be regarded as false alarm results; The false alarm rate is obtained by calculating the ratio of the number of false alarm results in each event stream filtered data to the number of defect bounding boxes corresponding to that event stream filtered data. The detection rate is obtained by calculating the ratio of the number of frames with a third detection result to the total number of frames in the filtered data of each event stream. The false alarm rate and the detection rate of the corresponding event stream filtering data are substituted into the preset lighting quality score formula to obtain the lighting evaluation result; The lighting evaluation results at the same lighting location are averaged to obtain the average lighting evaluation value at the corresponding lighting location. The lighting location corresponding to the maximum value among the average lighting evaluation values is taken as the final lighting parameter.
8. A device for determining lighting parameters for detecting defects in aluminum-based disks, characterized in that, include: Event stream imaging unit, target detection unit, defect detection unit, false alarm filtering unit, false alarm filtering unit, and evaluation unit; The event stream imaging unit is used to generate corresponding event stream image data for a preset aluminum base plate at different lighting positions; The preset aluminum-based disk includes: defective aluminum-based disks and standard aluminum-based disks; The target detection unit is used to: determine the bounding box and center coordinates of the aluminum base disk in the event stream image data using a target detection algorithm, and perform effective frame filtering on the event stream image data through the bounding box to obtain event stream filtered data; The defect detection unit is used to: perform defect detection on the event stream filtered data according to the pre-trained defect detection model to obtain a first detection result; The false detection filtering unit is used to: perform false detection filtering processing on the first detection result based on the center coordinates to obtain a second detection result; wherein, the false detection filtering processing on the first detection result based on the center coordinates to obtain the second detection result includes: Calculate the distance between the center coordinates and the defect location in the first detection result to obtain the first distance; The first detection result that satisfies the preset distance condition is retained to obtain the second detection result; the preset distance condition is that the distance is greater than the inner circle radius and less than the preset aluminum base disk radius; the inner circle radius is the inner circle radius of the preset aluminum base disk. The false alarm filtering unit is used to: perform false alarm filtering processing on the second detection result based on a false alarm judgment algorithm for continuous defect tracking to obtain a third detection result; wherein, the false alarm judgment algorithm based on continuous defect tracking to perform false alarm filtering processing on the second detection result to obtain a third detection result includes: S201. Initialize the corresponding tracker for the defect bounding box corresponding to the initial frame in the second detection result, and use the center coordinates of the defect bounding box in the initial frame as the coordinates of the tracker. S202. Match the defect bounding box corresponding to the current frame in the second detection result with all trackers before the current frame to obtain a matching result; S203. When the matching result is a successful match, the coordinates of the matched tracker are updated, and the detection count of the matched tracker is incremented by one as the current detection count. S204. When the matching result is a failure, the corresponding tracker is initialized for the defect bounding box corresponding to the current frame. S205. Repeat S202-S204 until all image frames in the second detection result are matched. S206. Determine the defect bounding box corresponding to the tracker whose current detection count is greater than a set threshold as a real defect, and use the real defect as the third detection result; The evaluation unit is used to: perform lighting quality evaluation processing based on the third detection result to obtain lighting evaluation results, and determine the final lighting parameters based on the lighting evaluation results; the pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting locations.
9. A device for determining lighting parameters for detecting defects in aluminum-based disks, characterized in that, include: The device includes a processor, a storage medium, and a bus. The storage medium stores machine-readable instructions executable by the processor. When the device for determining lighting parameters for aluminum-based disk defect detection is in operation, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for determining lighting parameters for aluminum-based disk defect detection as described in any one of claims 1-8.
Citation Information
Patent Citations
System and method for detecting surface defects of electroplated part with revolution curved surface
CN114755236A
Workpiece defect detection method and device based on event camera
CN116363065A