Illumination parameter determination method, device and equipment for defect detection of aluminum-based disc
By generating event stream image data on aluminum substrate discs at different lighting positions, filtering using object detection algorithm and false alarm judgment algorithm, and combining pre-training models to evaluate lighting quality, the lighting parameters of aluminum substrate disc defect detection in the existing technology are solved. The problem of low efficiency and high cost is determined, and efficient and accurate lighting parameters are achieved.
Patent Information
- Application Number
- CN202411175553.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-26
AI Technical Summary
In the prior art, defect detection of high-reflective material aluminum-based discs has problems such as inefficiency and high computational cost under lighting conditions. In particular, the lack of intuitive standards has led engineers to repeatedly debug the light source and rely on experience and intuition to determine the optimal. Lighting parameters.
By generating event stream image data on preset aluminum base discs at different lighting positions, using the object detection algorithm to determine the bounding box and center coordinates, filtering the data, defect detection is performed based on the pretrained defect detection model, and errors are performed in combination with the false alarm judgment algorithm Check and false alarm filter, and finally determine the final lighting parameters based on the lighting quality evaluation results.
The efficiency of determining lighting parameters is improved, the calculation cost is reduced, and the problem of excessive data processing caused by the sequential training of each lighting position in the prior art is avoided, ensuring the accuracy and efficiency of the final detection results.
Smart Images

Figure CN119048722A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a method, device and equipment for determining lighting parameters for aluminum-based disc defect detection. Background Art
[0002] In the process of industrial production, defects are inevitable in products due to manufacturing processes, batch differences and other reasons. Therefore, detecting defective products has always been an important step in industrial production. At present, the mainstream industrial defect detection solutions are roughly divided into three types, namely, using traditional cameras to shoot and cooperate with target detection algorithms to detect defects, manual visual inspection and laser detection. However, in some special fields, such as highly reflective aluminum-based discs, it is difficult for traditional cameras to clearly image defects. In recent years, a new method of using dynamic visual sensors (event cameras) to detect surface defects of highly reflective materials has been proposed. Event cameras have the characteristics of low latency, large dynamics, and high temporal resolution, and can clearly image in special scenes such as high reflection. Due to the characteristics of high temporal resolution, event cameras can eliminate motion blur and improve detection efficiency. Event cameras are sensitive to changes in light intensity and can capture small defects more clearly.
[0003] However, in the actual development process, it was found that the event camera is very sensitive to lighting conditions. That is, high-quality lighting conditions can allow the event camera to image defects very clearly, so that the subsequent defect detection algorithm can accurately identify aluminum-based discs with defects and aluminum-based discs without defects. Low-quality lighting conditions will make it impossible to image defects or generate a lot of noise, making it impossible for the defect detection algorithm to distinguish between defective discs and OK discs. High-quality lighting conditions have strict requirements, requiring engineers to repeatedly debug the type and position of the light source. Since there is no intuitive standard, the debugging process is very dependent on the engineer's experience and intuition.
[0004] In the prior art, the process of finding the best lighting usually takes a lot of time and effort. For example, engineers often need to collect data under different lighting settings, annotate the defective data, and then train the target detection algorithm (such as the YOLO algorithm). Finally, the final lighting parameters are determined by evaluating the detection performance of the target detection algorithm trained under each lighting for defective disks. This process requires a lot of computing costs and is very inefficient. Summary of the invention
[0005] In order to solve the above problems existing in the prior art, the present invention provides a method, device and equipment for determining illumination parameters for aluminum-based disc defect detection.
[0006] The technical problem to be solved by the present invention is achieved through the following technical solutions:
[0007] In a first aspect, the present invention provides a method for determining illumination parameters for aluminum-based disc defect detection, comprising:
[0008] Generate corresponding event stream image data for preset aluminum-based discs at different lighting positions; the preset aluminum-based discs include: defective aluminum-based discs and standard aluminum-based discs;
[0009] The target detection algorithm is used to determine the bounding box and center coordinates of the aluminum-based disc in the event stream image data, and the event stream image data is effectively frame filtered through the bounding box to obtain event stream filtered data;
[0010] Perform defect detection on the event stream filtering data according to the pre-trained defect detection model to obtain a first detection result;
[0011] Performing false detection filtering on the first detection result based on the center coordinates to obtain a second detection result;
[0012] Perform false alarm filtering on the second detection result based on a false alarm judgment algorithm for continuous tracking defects to obtain a third detection result;
[0013] A lighting quality assessment is performed based on the third detection result to obtain a lighting assessment result, and a final lighting parameter is determined based on the lighting assessment result; the pre-trained defect detection model is trained based on training event stream data obtained based on multiple lighting positions.
[0014] Optionally, for a preset aluminum-based disc at different lighting positions, corresponding event stream image data is generated, including:
[0015] Initializing a preset number of image matrices that are the same as the resolution of the event camera to obtain an initialization matrix; the preset number is the product of the preset number of aluminum-based discs and the number of lighting positions;
[0016] Recording an event stream of a preset duration for a preset aluminum-based disk under different lighting positions, and storing the event stream in an initialization matrix in chronological order to obtain an aluminum-based disk event stream;
[0017] The event data representation method based on dynamic memory accumulation is used to transform the aluminum-based disk event stream into event stream image data.
[0018] Optionally, a target detection algorithm is used to determine the bounding box and center coordinates of the aluminum-based disc in the event stream image data, and the event stream image data is effectively frame filtered through the bounding box to obtain event stream filtered data, including:
[0019] An object detection algorithm is used to generate an initial bounding box and initial center coordinates of a preset aluminum-based disk in event stream image data;
[0020] According to a preset size of the preset aluminum-based disc, an initial bounding box and a corresponding initial center coordinate that are smaller than the preset size are deleted to obtain a bounding box and a center coordinate;
[0021] The image frames containing the bounding boxes in the event stream image data are retained to obtain the event stream filtering data.
[0022] Optionally, the training process of the pre-trained defect detection model includes:
[0023] Obtain event stream training data of multiple training aluminum-based disks at different lighting positions;
[0024] Input the event stream training data into the initial defect detection model for training;
[0025] Continue to train the initial defect detection model in the direction of decreasing loss function;
[0026] The initial defect detection model whose loss function value satisfies the preset loss threshold is used as the pre-trained defect detection model.
[0027] Optionally, the first detection result includes: defect type, defect type confidence and defect location; and the first detection result is subjected to false detection filtering based on the center coordinates to obtain a second detection result, including:
[0028] Calculate the distance between the center coordinates and the defect position in the first detection result to obtain a first distance;
[0029] The first detection result in which the first distance meets the preset distance condition is retained to obtain a second detection result; the preset distance condition is that the distance is greater than the inner circle radius and less than the preset aluminum-based disc radius; the inner circle radius is the inner circle radius of the preset aluminum-based disc.
[0030] Optionally, a false alarm judgment algorithm based on continuous tracking defects is used to perform false alarm filtering on the second detection result to obtain a third detection result, including:
[0031] S201, initializing a corresponding tracker for a defect bounding box corresponding to an initial frame in a second detection result, and using the center coordinates of the defect bounding box in the initial frame as coordinates of the tracker;
[0032] S202, matching the defect boundary box corresponding to the current frame in the second detection result with all trackers before the current frame to obtain a 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 increased by one as the current detection count;
[0034] S204, when the matching result is a matching failure, initializing a corresponding tracker for the defect bounding box corresponding to the current frame;
[0035] S205, repeating S202-S204 until all image frames in the second detection result have completed matching processing;
[0036] S206: Determine the defect boundary box corresponding to the tracker whose current detection times is greater than 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 a matching result, including:
[0038] Calculate the distance between the center coordinates of the defect bounding box corresponding to the current frame and all trackers before the current frame to obtain the judgment distance;
[0039] If there is a judgment distance less than the preset threshold value in the judgment distance, the matching result is a successful match;
[0040] If there is no judgment distance less than the preset threshold value in the judgment distance, the matching result is a matching failure;
[0041] When the matching result is a successful match, the tracker corresponding to the judgment distance less than the preset threshold is the matched tracker.
[0042] Optionally, performing lighting quality assessment processing according to the third detection result to obtain a lighting assessment result, and determining a final lighting parameter according to the lighting assessment result includes:
[0043] The results of the second detection result other than the third detection result are regarded as false alarm results;
[0044] Correspondingly calculating the ratio of the false alarm result in each event stream filtering data to the number of defect boundary boxes corresponding to the event stream filtering data, to obtain the false alarm rate;
[0045] Calculate the ratio of the number of frames in which the third detection result appears in each event stream filtering data to the total number of frames of the event stream filtering data to obtain the detection rate;
[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 position are averaged to obtain the lighting evaluation mean value at the corresponding lighting position;
[0048] The lighting position corresponding to the maximum value of the lighting evaluation mean is taken as the final lighting parameter.
[0049] In a second aspect, the present invention provides an illumination parameter determination device for aluminum-based disc defect detection, comprising: an event stream shooting 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 shooting unit is used to generate corresponding event stream image data for preset aluminum-based discs at different lighting positions; the preset aluminum-based discs include: defective aluminum-based discs and standard aluminum-based discs;
[0051] The target detection unit is used to: determine the bounding box and center coordinates of the aluminum-based disc in the event stream image data by using the 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 filtering data according to the pre-trained defect detection model to obtain a 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 a second detection result;
[0054] The false alarm filtering unit is used to: perform false alarm filtering processing on the second detection result based on the false alarm judgment algorithm of continuous tracking defects to obtain a third detection result;
[0055] The evaluation unit is used to: perform lighting quality evaluation processing according to the third detection result to obtain a lighting evaluation result, and determine the final lighting parameters according to the lighting evaluation result; the pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting positions.
[0056] In a third aspect, the present invention provides a lighting parameter determination device for aluminum-based disk defect detection, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, when the lighting parameter determination device for aluminum-based disk defect detection is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the lighting parameter determination method for aluminum-based disk defect detection as described in the first aspect above.
[0057] The present invention provides a method, device and equipment for determining lighting parameters for aluminum-based disc defect detection. Among them, a method for determining lighting parameters for aluminum-based disc defect detection includes: generating corresponding event stream image data for preset aluminum-based discs at different lighting positions; the preset aluminum-based discs include: defective aluminum-based discs and standard aluminum-based discs; using a target detection algorithm to determine the bounding box and center coordinates of the aluminum-based disc in the event stream image data, and filtering the event stream image data through the bounding box to obtain event stream filtered data; performing defect detection on the event stream filtered data according to a pre-trained defect detection model to obtain a first detection result; performing false detection filtering processing on the first detection result based on the center coordinate to obtain a second detection result; performing false alarm filtering processing on the second detection result based on a false alarm judgment algorithm for continuously tracking defects to obtain a third detection result; performing lighting quality evaluation processing based on the third detection result to obtain a lighting evaluation result, and determining the final lighting parameters according to the lighting evaluation result; the pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting positions. In an embodiment of the present invention, by performing effective frame filtering on event stream image data, subsequent processing data can be concentrated on the data frame of complete imaging; then, defect detection is performed on the event stream filtered data according to 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 at multiple lighting positions, that is, only one model needs to be trained, thereby avoiding the problem of excessive data processing volume caused by training models at each lighting position in turn in the prior art. Secondly, false detection filtering and false alarm filtering are performed on the first detection result in turn, so that the third detection result finally obtained is as close to a real defect as possible. Finally, the final lighting parameters are determined according to the third detection results. Since the model only needs to be trained once and the final lighting parameters only need to be calculated based on the third detection results, the process of designing verification sets for each model one by one to determine the optimal lighting in the prior art is avoided, thereby improving the efficiency of determining the lighting parameters and reducing the calculation cost.
[0058] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A schematic flow chart of a method for determining illumination parameters for aluminum-based disc defect detection provided by an embodiment of the present invention;
[0060] Figure 2 A schematic diagram of the structure of an illumination parameter determination device for aluminum-based disc defect detection provided by an embodiment of the present invention;
[0061] Figure 3 A schematic diagram of the structure of an illumination parameter determination device for aluminum-based disc defect detection provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0062] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.
[0063] In order to improve the efficiency of determining lighting parameters and reduce the calculation cost, an embodiment of the present invention provides a method for determining lighting parameters for aluminum-based disc defect detection. Figure 1 A flowchart of a method for determining illumination parameters for aluminum-based disc defect detection provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, including:
[0064] S101, generating corresponding event stream image data for a preset aluminum-based disc at different lighting positions.
[0065] The preset aluminum-based discs include: defective aluminum-based discs and standard aluminum-based discs.
[0066] Optionally, S101 may specifically include:
[0067] Initializing a preset number of image matrices that are the same as the resolution of the event camera to obtain an initialization matrix; the preset number is the product of the preset number of aluminum-based discs and the number of lighting positions;
[0068] Recording an event stream of a preset duration for a preset aluminum-based disk under different lighting positions, and storing the event stream in an initialization matrix in chronological order to obtain an aluminum-based disk event stream;
[0069] The event data representation method based on dynamic memory accumulation is used to transform the aluminum-based disk event stream into event stream image data.
[0070] It should be noted that, in the embodiment of the present invention, the recording conditions are:
[0071] An automated mechanical structure is prepared in advance, which includes one or more light sources that can adjust the illumination position or angle, and the light source can move along the slide rail. An event camera is placed directly opposite the preset aluminum-based disk, and the position of the light source is adjusted to collect event stream image data corresponding to the preset aluminum-based disk under different illumination positions.
[0072] Furthermore, the movement of the light source on the slide rail may include: coarse grid adjustment and fine grid adjustment. Coarse grid adjustment is generally for scenes without any prior knowledge. Fine grid adjustment is generally for scenes that already have prior information, that is, the approximate area of the optimal lighting position is already known and needs to be further determined. In addition, in some embodiments, coarse grid adjustment can also be combined with fine grid adjustment to quickly determine the optimal lighting position. When the coarse grid adjustment is combined with the fine grid adjustment, the execution process is to first adjust the coarse grid according to the method of this embodiment, and each time the light source moves a large distance along the slide rail, the angle always keeps irradiating the disk and quickly finds the slide rail area with the best lighting conditions within the moving range of the slide rail according to the method of this embodiment. Then, fine grid adjustment is used, and each time the light source moves a short distance along the slide rail, the light source is kept in the slide rail area with the best lighting conditions found by the coarse grid, and finally the final lighting parameters are obtained.
[0073] S102, using a target detection algorithm to determine the bounding box and center coordinates of the aluminum-based disc in the event stream image data, and performing effective frame filtering on the event stream image data through the bounding box to obtain event stream filtered data.
[0074] Optionally, S102 may specifically include:
[0075] An object detection algorithm is used to generate an initial bounding box and initial center coordinates of a preset aluminum-based disk in event stream image data;
[0076] According to a preset size of the preset aluminum-based disc, an initial bounding box and a corresponding initial center coordinate that are smaller than the preset size are deleted to obtain a bounding box and a center coordinate;
[0077] The image frames containing the bounding boxes in the event stream image data are retained to obtain the event stream filtering data.
[0078] It should be noted that, in an embodiment of the present invention, the target detection algorithm may adopt YOLO-World or ground dino, etc. According to the preset size of the preset aluminum-based disc, the initial bounding box that does not meet the size is filtered out to obtain a bounding box. The frames in which the bounding box appears in the event stream are retained as valid frames, and the frames that do not contain the disc bounding box are removed. In addition, the absolute coordinates of the center of the circle can be calculated according to the position of the disc bounding box in the valid frame, and the absolute coordinates of the center of the circle are taken as the center and the diameter of the aluminum-based disc is taken as the side length to intercept a square picture, that is, after cropping, a picture is obtained that only the aluminum-based disc portion in the picture is retained.
[0079] S103: Perform defect detection on the event stream filtering data according to the pre-trained defect detection model to obtain a first detection result.
[0080] The pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting positions.
[0081] Optionally, the training process of the pre-trained defect detection model includes:
[0082] Obtain event stream training data of multiple training aluminum-based disks at different lighting positions;
[0083] Input the event stream training data into the initial defect detection model for training;
[0084] Continue to train the initial defect detection model in the direction of decreasing loss function;
[0085] The initial defect detection model whose loss function value satisfies the preset loss threshold is used as the pre-trained defect detection model.
[0086] It should be noted that, in the embodiment of the present invention, the training aluminum-based disc may specifically be an aluminum-based disc with defects.
[0087] S104: Perform false detection filtering on the first detection result based on the center coordinates to obtain a second detection result.
[0088] Optionally, the first detection result includes: defect type, defect type confidence and defect location, and S104 may specifically include:
[0089] Calculate the distance between the center coordinates and the defect position in the first detection result to obtain a first distance;
[0090] The first detection result in which the first distance meets the preset distance condition is retained to obtain a second detection result; the preset distance condition is that the distance is greater than the inner circle radius and less than the preset aluminum-based disc radius; the inner circle radius is the inner circle radius of the preset aluminum-based disc.
[0091] When the center coordinate is represented as (x1, y1), the center coordinate of the defect position in the first detection result is represented as (x2, y2), and the distance between the two is represented as d.
[0092]
[0093] Assume that the radius of the preset aluminum-based disc is R, and the inner radius of the preset aluminum-based disc is r, wherein the values of R and r are manually measured in advance.
[0094] If and only if: R>d>r, it is determined that the defect occurs on the aluminum-based disk.
[0095] S105 , performing false alarm filtering processing on the second detection result based on the false alarm judgment algorithm of the continuous tracking defect to obtain a third detection result.
[0096] Optionally, S105 may specifically include:
[0097] S201, initializing a corresponding tracker for a defect bounding box corresponding to an initial frame in a second detection result, and using the center coordinates of the defect bounding box in the initial frame as coordinates of the tracker;
[0098] S202, matching the defect boundary box corresponding to the current frame in the second detection result with all trackers before the current frame to obtain a 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 increased by one as the current detection count;
[0100] S204, when the matching result is a matching failure, initializing a corresponding tracker for the defect bounding box corresponding to the current frame;
[0101] S205, repeating S202-S204 until all image frames in the second detection result have completed matching processing;
[0102] S206: Determine the defect boundary box corresponding to the tracker whose current detection times is greater than 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 distance between the center coordinates of the defect bounding box corresponding to the current frame and all trackers before the current frame to obtain the judgment distance;
[0106] If there is a judgment distance less than the preset threshold value in the judgment distance, the matching result is a successful match;
[0107] If there is no judgment distance less than the preset threshold value in the judgment distance, the matching result is a matching failure;
[0108] When the matching result is a successful match, the tracker corresponding to the judgment distance less than the preset threshold is the matched tracker.
[0109] S106: Perform lighting quality evaluation processing according to the third detection result to obtain a lighting evaluation result, and determine final lighting parameters according to the lighting evaluation result.
[0110] Optionally, S106 may specifically include:
[0111] The results of the second detection result other than the third detection result are regarded as false alarm results;
[0112] Correspondingly calculating the ratio of the false alarm result in each event stream filtering data to the number of defect boundary boxes corresponding to the event stream filtering data, to obtain the false alarm rate;
[0113] Calculate the ratio of the number of frames in which the third detection result appears in each event stream filtering data to the total number of frames of the event stream filtering data to obtain the detection rate;
[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 position are averaged to obtain the lighting evaluation mean value at the corresponding lighting position;
[0116] The lighting position corresponding to the maximum value of the lighting evaluation mean is taken as the final lighting parameter.
[0117] It should be noted that the preset lighting quality score formula is expressed as:
[0118] score=P*n+(1-P)*(1-n)–S;
[0119] Among them, 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 discs, n is 1; when the event stream filtering data of this segment is the event stream of standard aluminum-based discs, n is 0.
[0120] The embodiment of the present invention provides a method for determining lighting parameters for defect detection of aluminum-based discs. By performing effective frame filtering on event stream image data, subsequent processing data can be concentrated on the data frame of complete imaging; then, defect detection is performed on the event stream filtered data according to 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 at multiple lighting positions, that is, only one model needs to be trained, thereby avoiding the problem of excessive data processing caused by training models at each lighting position in turn in the prior art. Secondly, false detection filtering and false alarm filtering are performed on the first detection result in turn, so that the third detection result finally obtained is as close to a real defect as possible. Finally, the final lighting parameters are determined according to the third detection results. Since the model only needs to be trained once and the final lighting parameters only need to be calculated based on the third detection results, the process of designing verification sets for each model one by one to determine the optimal lighting in the prior art is avoided, thereby improving the efficiency of determining the lighting parameters and reducing the calculation cost.
[0121] The method provided in the embodiment of the present invention can be applied to an electronic device. Specifically, the electronic device can be: a desktop computer, a portable computer, an intelligent mobile terminal, a server, etc., which is not limited in the embodiment of the present invention.
[0122] Based on the same inventive concept, an embodiment of the present invention further provides an illumination parameter determination device for aluminum-based disc defect detection. Figure 2 A schematic diagram of the structure of an illumination parameter determination device for aluminum-based disc defect detection provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, it includes: an event stream shooting 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 shooting unit 201 is used to generate corresponding event stream image data for preset aluminum-based discs at different lighting positions; the preset aluminum-based discs include: defective aluminum-based discs and standard aluminum-based discs;
[0124] The target detection unit 202 is used to: determine the bounding box and center coordinates of the aluminum-based disc in the event stream image data by using the target detection algorithm, 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 filtering data according to the pre-trained defect detection model to obtain a 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 a second detection result;
[0127] The false alarm filtering unit 205 is used to: perform false alarm filtering processing on the second detection result based on the false alarm judgment algorithm of continuous tracking defects to obtain a third detection result;
[0128] The evaluation unit 206 is used to: perform lighting quality evaluation processing according to the third detection result to obtain a lighting evaluation result, and determine the final lighting parameters according to the lighting evaluation result; the pre-trained defect detection model is trained based on the training event stream data obtained from multiple lighting positions.
[0129] Figure 3A structural diagram of an illumination parameter determination device for aluminum-based disc defect detection provided by an embodiment of the present invention includes: a processor 310, a storage medium 320 and a bus 330, wherein the storage medium 320 stores machine-readable instructions executable by the processor 310, and when the illumination parameter determination device for aluminum-based disc defect detection 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 execute the steps of the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0130] The storage medium may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the storage medium may also be at least one storage device located away from the aforementioned processor.
[0131] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, 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 the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order 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. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention.
[0133] In the description of this specification, reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features or characteristics described in combination with the embodiment or example are included in at least one embodiment or example of the present invention.
[0134] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art can understand and implement other changes of the above disclosed embodiments by viewing the drawings and the disclosed content. In the description of the present invention, the term "comprising" does not exclude other components or steps, "one" or "an" does not exclude multiple situations, and the meaning of "multiple" is two or more, unless otherwise clearly and specifically limited. In addition, certain measures are recorded in different embodiments, but this does not mean that these measures cannot be combined to produce good results.
[0135] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the scope of protection of the present invention.
Claims
1. A method for determining illumination parameters for aluminum-based disc defect detection, characterized in that: include: Generate corresponding event stream image data for the preset aluminum-based disc at different lighting positions; The preset aluminum-based discs include: defective aluminum-based discs and standard aluminum-based discs; Using a target detection algorithm to determine the bounding box and center coordinates of the aluminum-based disc in the event stream image data, and performing effective frame filtering on the event stream image data through the bounding box to obtain event stream filtered data; Perform defect detection on the event stream filtering data according to a pre-trained defect detection model to obtain a first detection result; Performing false detection filtering on the first detection result based on the center coordinates to obtain a second detection result; Perform false alarm filtering on the second detection result based on a false alarm judgment algorithm for continuous tracking defects to obtain a third detection result; A lighting quality assessment process is performed based on the third detection result to obtain a lighting assessment result, and a final lighting parameter is 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 positions.
2. The method for determining illumination parameters for aluminum-based disc defect detection according to claim 1, characterized in that: The generating corresponding event stream image data for the preset aluminum-based disc at different lighting positions includes: Initialize a preset number of image matrices that are the same as the resolution of the event camera to obtain an initialization matrix; the preset number is the product of the preset number of aluminum-based discs and the number of lighting positions; Recording an event stream of a preset duration for the preset aluminum-based disc under different lighting positions, and storing the event stream in the initialization matrix in chronological order to obtain the aluminum-based disc event stream; The event data characterization method based on dynamic memory accumulation converts the aluminum-based disc event stream into the event stream image data.
3. The method for determining illumination parameters for aluminum-based disc defect detection according to claim 1, characterized in that: The target detection algorithm is used to determine the bounding box and center coordinates of the aluminum-based disc in the event stream image data, and the event stream image data is effectively frame filtered through the bounding box to obtain event stream filtered data, including: Using the target detection algorithm to generate an initial bounding box and initial center coordinates of a preset aluminum-based disc in the event stream image data; According to the preset size of the preset aluminum-based disc, the initial bounding box and the corresponding initial center coordinates that are smaller than the preset size are deleted to obtain the bounding box and the center coordinates; The image frame containing the boundary box in the event stream image data is retained to obtain the event stream filtering data.
4. The method for determining illumination parameters for aluminum-based disc defect detection according to claim 1, characterized in that: The training process of the pre-trained defect detection model includes: Obtain event stream training data of multiple training aluminum-based disks at different lighting positions; Inputting the event stream training data into an initial defect detection model for training; Continuously training the initial defect detection model in a direction in which the loss function decreases; The initial defect detection model whose loss function value satisfies a preset loss threshold is used as the pre-trained defect detection model.
5. The method for determining illumination parameters for aluminum-based disc defect detection according to claim 1, characterized in that: The first detection result includes: defect type, defect type confidence and defect location; the false detection filtering process is performed on the first detection result based on the center coordinate to obtain the second detection result, including: Calculating the distance between the center coordinate and the defect position in the first detection result to obtain a first distance; The first detection result in which the first distance satisfies a 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-based disc radius; the inner circle radius is the inner circle radius of the preset aluminum-based disc.
6. The method for determining illumination parameters for aluminum-based disc defect detection according to claim 1, characterized in that: The false alarm judgment algorithm based on continuous tracking defects performs false alarm filtering processing on the second detection result to obtain a third detection result, including: S201, initializing a corresponding tracker for a defect bounding box corresponding to an initial frame in the second detection result, and using the center coordinates of the defect bounding box in the initial frame as coordinates of the tracker; S202, matching the defect boundary 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 increased by one as the current detection count; S204, when the matching result is a matching failure, initializing a corresponding tracker for the defect boundary box corresponding to the current frame; S205, repeating S202-S204 until all image frames in the second detection result have completed matching processing; S206: Determine the defect boundary box corresponding to the tracker whose current detection times is greater than the set threshold as a real defect, and use the real defect as the third detection result.
7. The method for determining illumination parameters for aluminum-based disc defect detection according to claim 6, characterized in that: The matching process of the defect boundary box corresponding to the current frame in the second detection result with all trackers before the current frame to obtain a matching result includes: Calculate the distance between the center coordinates of the defect bounding box corresponding to the current frame and all trackers before the current frame to obtain a judgment distance; If there is a judgment distance in the judgment distance that is less than a preset threshold, the matching result is a successful match; If there is no judgment distance less than the preset threshold value in the judgment distance, the matching result is a matching failure; When the matching result is a successful match, the tracker corresponding to the judgment distance less than the preset threshold is the matched tracker.
8. The method for determining illumination parameters for aluminum-based disc defect detection according to claim 1, characterized in that: The performing lighting quality assessment processing according to the third detection result to obtain a lighting assessment result, and determining a final lighting parameter according to the lighting assessment result, includes: Using the results of the second detection result other than the third detection result as false alarm results; Correspondingly calculating the ratio of the false alarm result in each event stream filtering data to the number of defect boundary boxes corresponding to the event stream filtering data, to obtain the false alarm rate; Calculate the ratio of the number of frames in which the third detection result appears in each event stream filtering data to the total number of frames of the event stream filtering data to obtain the detection rate; Substituting the false alarm rate and the detection rate of the corresponding event stream filtered data into a preset lighting quality score formula to obtain the lighting evaluation result; Averaging the lighting evaluation results at the same lighting position to obtain a lighting evaluation mean value at the corresponding lighting position; The lighting position corresponding to the maximum value of the lighting evaluation mean value is used as the final lighting parameter.
9. An illumination parameter determination device for aluminum-based disc defect detection, characterized in that: include: Event stream capturing unit, target detection unit, defect detection unit, false detection filtering unit, false alarm filtering unit and evaluation unit; The event stream shooting unit is used to: generate corresponding event stream image data for a preset aluminum-based disc at different lighting positions; The preset aluminum-based discs include: defective aluminum-based discs and standard aluminum-based discs; The target detection unit is used to: determine the bounding box and center coordinates of the aluminum-based disc in the event stream image data by 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 filtering data according to a pre-trained defect detection model to obtain a first detection result; The false detection filtering unit is used to: perform false detection filtering on the first detection result based on the center coordinates to obtain a second detection result; The false alarm filtering unit is used to: perform false alarm filtering processing on the second detection result based on the false alarm judgment algorithm of continuous tracking defects to obtain a third detection result; The evaluation unit is used to: perform lighting quality evaluation processing according to the third detection result to obtain a lighting evaluation result, and determine the final lighting parameters according to the lighting evaluation result; the pre-trained defect detection model is trained based on training event stream data obtained from multiple lighting positions.
10. An illumination parameter determination device for aluminum-based disc defect detection, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the lighting parameter determination device for aluminum-based disc defect detection 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 aluminum-based disc defect detection as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method, device, system and program for setting lighting condition and storage medium
CN111712769A
Deep learning chip packaging crack defect detection method based on YOLO
CN112967243A
Substrate defect detection device and method
CN113218961A
System and method for detecting surface defects of electroplated part with revolution curved surface
CN114755236A
Pipeline defect detecting, positioning and ranging system based on binocular stereoscopic vision
CN115272271A
Cited By
Crucible inner bottom surface defect detection method and device and electronic equipment
CN119444764A
