Detection method of image acquisition equipment, electronic equipment and storage medium
By introducing a coordinate attention mechanism module into the neck network of the YOLOv5s model, the target stray light detection model is used to detect the vehicle image acquisition equipment, the rapid and accurate problem of anti-strange light capability detection of the vehicle image acquisition equipment is solved, and the rapid and accurate detection of the anti-strange light capability of the vehicle image acquisition equipment is improved. Safety of vehicle path planning and control decisions.
Patent Information
- Application Number
- CN202411362317.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-10
AI Technical Summary
The prior art is difficult to quickly and accurately detect whether the vehicle image acquisition equipment has strong anti-stitch light interference capabilities, which affects the safety of vehicle path planning and control decisions.
The target stray light detection model is adopted, and the coordinate attention mechanism module is added to the neck network of the YOLOv5s model to perform stray light detection on the images to be detected at various light angles, and the target detection results are used to determine whether the equipment is qualified.
Accurate evaluation and rapid detection of the anti-strange light interference capability of the vehicle image acquisition equipment is realized, ensuring the performance of the equipment under complex lighting conditions and improving vehicle driving safety.
Smart Images

Figure CN119295398A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision, and in particular to a detection method for an image acquisition device, an electronic device, and a storage medium. Background Art
[0002] With the rapid development of autonomous driving technology, the role of vehicle-mounted modules in vehicle driving is becoming increasingly prominent. During vehicle driving, the vehicle-mounted module will collect information about the vehicle in real time through the vehicle-mounted sensors, and will use the information about the vehicle to plan the vehicle path and make vehicle control decisions. For example, the vehicle-mounted module will collect obstacle and distance information through the vehicle-mounted laser radar, and collect images around the vehicle through the vehicle-mounted image acquisition device to support vehicle path planning and vehicle control decisions.
[0003] However, if the on-board image acquisition device is interfered by stray light and collects images interfered by stray light, the images interfered by stray light will often not be correctly recognized and processed due to their low image quality, or even cannot be recognized and processed at all, which will affect the vehicle path planning and vehicle control decisions, and may pose a threat to the vehicle's driving safety.
[0004] In order to avoid the vehicle-mounted image acquisition equipment from capturing images interfered by stray light as much as possible, it is necessary to ensure that the vehicle-mounted image acquisition equipment has a strong ability to resist stray light interference. To this end, strict quality control measures must be taken in the process of manufacturing vehicle-mounted image acquisition equipment. For example, during the production process, the anti-stray light ability of some vehicle-mounted image acquisition equipment can be tested by sampling inspection. Only when the sample vehicle-mounted image acquisition equipment passes the inspection and is determined to be a qualified product with strong anti-stray light interference ability, can the vehicle-mounted image acquisition equipment produced in the same batch be put into use as a qualified product. In this case, how to quickly and accurately detect whether the vehicle-mounted image acquisition equipment is a qualified product with a strong ability to resist stray light interference has become a problem that relevant technical personnel have to face.
[0005] In addition, in other cases, relevant technicians may also face the problem of how to quickly and accurately detect whether the vehicle-mounted image acquisition equipment is a qualified product with strong resistance to stray light interference. Summary of the invention
[0006] The embodiments of the present application provide a detection method, an apparatus, an electronic device and a storage medium for an image acquisition device to solve one or more of the above-mentioned technical problems.
[0007] In a first aspect, an embodiment of the present application provides a detection method for an image acquisition device, comprising:
[0008] Obtaining images to be detected collected by the image acquisition device to be detected in the vehicle-mounted module under various illumination angles;
[0009] The target stray light detection model is used to perform stray light detection on multiple images to be detected, and the corresponding target detection results are obtained; the target stray light detection model is obtained by optimizing the stray light detection model to be trained; the stray light detection model to be trained is obtained by adding a coordinate attention mechanism module to the neck network of the YOLOv5s model; the coordinate attention mechanism module is used to perform spatial and channel weighted processing on the feature map output by the backbone network of the YOLOv5s model;
[0010] Based on the target detection results, determine whether the image acquisition device to be detected is qualified.
[0011] In a possible implementation, an attention mechanism module is added before the splicing module in the neck network; the attention mechanism module includes a first attention mechanism module, a second attention mechanism module and a third attention mechanism module; the first attention mechanism module, the second attention mechanism module and the third attention mechanism module are respectively used to perform spatial and channel weighted processing on one of the three feature maps output by the backbone network.
[0012] In a possible implementation, the steps of performing model optimization training on the stray light detection model to be trained to obtain the target stray light detection model are as follows:
[0013] Obtain a training set, a validation set, and a test set; the training set, the validation set, and the test set each include a plurality of sample images and the annotation results corresponding to each sample image;
[0014] The stray light detection model to be trained is trained for multiple rounds of iterations using the training set until a set iteration stop condition is met, and during the multiple rounds of iterative training, the stray light detection model to be trained is verified using the verification set, and when the verification result indicates that the stray light detection model to be trained is overfitted, the hyperparameters of the stray light detection model to be trained are adjusted;
[0015] When the iteration stop condition is met, the stray light detection model to be trained is tested using the test set, and when the test result meets the preset standard, the stray light detection model to be trained is used as the target stray light detection model.
[0016] In one possible implementation, the steps of each round of iterative training are as follows:
[0017] Select target sample images in the training set;
[0018] Input the target sample image into the stray light detection model to be trained to obtain the corresponding sample detection result;
[0019] Calculate the target loss value between the sample detection result and the annotation result corresponding to the target sample image;
[0020] The target loss value is used to update the internal model parameters in the stray light detection model to be trained.
[0021] In a possible implementation, the sample detection result includes a predicted box corresponding to the area affected by stray light in the target sample image; the annotation result corresponding to the target sample image includes a real box corresponding to the area affected by stray light in the target sample image; the target loss value includes a bounding box loss value between the predicted box and the real box; and the bounding box loss value is calculated based on the EIOU loss function.
[0022] In one possible implementation, the test results include the precision corresponding to the stray light detection model to be trained, the recall rate corresponding to the stray light detection model to be trained, and the average precision mean corresponding to the stray light detection model to be trained; the preset standards include the precision threshold, the recall threshold and the average precision mean threshold.
[0023] In a possible implementation, the multiple sample images included in the training set are obtained in the following manner:
[0024] Acquire multiple initial images respectively captured by a qualified image acquisition device under multiple illumination angles;
[0025] Perform image enhancement processing on the initial image to obtain a sample image.
[0026] In a possible implementation, determining whether the image acquisition device to be detected is qualified according to the target detection result includes:
[0027] When the target detection result indicates that there is an image to be detected containing an area affected by stray light among the multiple images to be detected, the image acquisition device to be detected is deemed unqualified.
[0028] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, and the processor implements the method provided in any embodiment of the present application when executing the computer program.
[0029] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method provided in any embodiment of the present application is implemented.
[0030] Compared with the prior art, this application has the following advantages:
[0031] The technical solution of the present application utilizes a target stray light detection model to perform stray light detection on the images to be detected that are collected at various lighting angles, obtain corresponding target detection results, and determine whether the image acquisition device to be detected is qualified based on the target detection results. By performing stray light detection on the images to be detected that are collected at various lighting angles, the ability of the image acquisition device to be detected to resist stray light interference at different lighting angles can be comprehensively evaluated. Through this detection method, the ability of the image acquisition device to be detected to resist stray light interference when facing complex lighting conditions in a real road environment can be detected as much as possible. Therefore, the technical solution of the present application can accurately detect whether the image acquisition device to be detected is a qualified product with strong ability to resist stray light interference.
[0032] In addition, the target stray light detection model is constructed by introducing a coordinate attention mechanism module into the neck network of the YOLOv5s model. By performing spatial and channel weighted processing on the feature map output by the backbone network through the coordinate attention mechanism module, the target stray light detection model can pay more attention to the key area features related to stray light interference in the image to be detected, and accurately focus on the part affected by stray light, so that the target stray light detection model can more accurately identify whether the image to be detected contains the area affected by stray light, and the specific location of the area affected by stray light in the image to be detected. In this case, the target stray light detection model is used to perform stray light detection on the images to be detected collected at various lighting angles, obtain the corresponding target detection results, and determine whether the image acquisition device to be detected is qualified based on the target detection results, so as to accurately determine whether the image acquisition device to be detected is a qualified product with strong anti-stray light interference capabilities.
[0033] At the same time, since the YOLOv5s model has a high detection speed, the target stray light detection model can be used to quickly obtain the target detection result. In this case, the technical solution of the present application can quickly determine whether the image acquisition device to be detected is a qualified product with strong anti-stray light interference capability. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.
[0035] Figure 1 A schematic diagram of a target stray light detection model provided in an embodiment of the present application is shown;
[0036] Figure 2A schematic diagram of a coordinate attention mechanism module provided in an embodiment of the present application is shown;
[0037] Figure 3 A flow chart showing a detection method of an image acquisition device provided in an embodiment of the present application is shown;
[0038] Figure 4 A schematic diagram showing a detection device of an image acquisition device provided in an embodiment of the present application; and
[0039] Figure 5 A block diagram of an electronic device used to implement an embodiment of the present application is shown. DETAILED DESCRIPTION
[0040] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other forms different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited to the specific implementation disclosed below.
[0041] To facilitate understanding of the technical solutions of the embodiments of the present application, the following describes the related technologies of the embodiments of the present application. The following related technologies can be combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application.
[0042] This application involves a detection scheme for image acquisition devices, which first obtains the images to be detected collected by the image acquisition device to be detected in the vehicle-mounted module under various lighting angles. Then, the target stray light detection model is used to perform stray light detection on multiple images to be detected to obtain corresponding target detection results. After that, it is determined whether the image acquisition device to be detected is qualified based on the target detection results.
[0043] In this scheme, the target stray light detection model is obtained by optimizing the stray light detection model to be trained. The stray light detection model to be trained is obtained by adding a coordinate attention mechanism module (CA, Coordinate Attention) to the neck network of the YOLOv5s (You Only Look Once version5Small) model. The coordinate attention mechanism module is used to perform spatial and channel weighted processing on the feature map output by the backbone network of the YOLOv5s model.
[0044] In this solution, the vehicle-mounted module refers to a series of equipment combinations installed on the vehicle to achieve specific functions. The vehicle-mounted module usually includes a variety of vehicle-mounted sensors, a vehicle-mounted control unit, a data processing module, and a communication module. The various vehicle-mounted sensors generally include vehicle-mounted image acquisition devices, vehicle-mounted radars, and vehicle-mounted infrared sensors. Among them, the vehicle-mounted image acquisition device can refer to one or more of a vehicle-mounted front-view camera, a vehicle-mounted rear-view camera, a vehicle-mounted side-view camera, and a vehicle-mounted panoramic camera.
[0045] Stray light refers to unexpected or unwanted interfering light in an optical system. It may come from direct, reflected or scattered light from an external light source, or it may be caused by reflection, scattering, or diffraction between components within the optical system. In addition, surface flaws, coating defects, and undesirable factors in the design of optical components (such as scattering at the edges of components) can significantly increase the generation of stray light. Stray light can interfere with the normal imaging of the optical system and cause a significant decrease in the quality of the output image. Specific manifestations may include: reduced contrast and clarity in the area of the image affected by stray light, and ghost images, bright spots, or dark spots in the area of the image affected by stray light.
[0046] In this scheme, the illumination angle refers to the relative position and angle between the light source and the image acquisition device. The various illumination angles generally include: Directly in front: the light source is located directly in front of the image acquisition device and directly illuminates the image acquisition device. Directly above: the light source is located directly above the image acquisition device and illuminates the image acquisition device from above. Directly below: the light source is located directly below the image acquisition device and illuminates the image acquisition device from below. Directly to the left: the light source is located directly to the left of the image acquisition device and illuminates the image acquisition device from the left. Directly to the right: the light source is located directly to the right of the image acquisition device and illuminates the image acquisition device from the right. Upper left: the light source is located at the upper left of the image acquisition device, forming oblique illumination. Upper right: the light source is located at the upper right of the image acquisition device, forming oblique illumination. Lower left: the light source is located at the lower left of the image acquisition device, forming oblique illumination. Lower right: the light source is located at the lower right of the image acquisition device, forming oblique illumination.
[0047] In this scheme, the structure of the target stray light detection model can be as follows: Figure 1 As shown, the YOLOv5s model includes a backbone network (Backbone), a neck network (Neck) and a head network (Head).
[0048] The input of the backbone network is: an image that has been preprocessed, generally a 640*640 RGB three-channel image. The output of the backbone network is: three feature maps with different scales and channels, for example: a first feature map with a scale of 80*80 and 128 channels, a second feature map with a scale of 40*40 and 256 channels, and a third feature map with a scale of 20*20 and 512 channels. Image preprocessing can include image denoising, image enhancement, geometric transformation, color space conversion, and normalization.
[0049] Specifically, the lower structure of the backbone network is: FOCUS (Focus Layer, focusing layer) layer, the first CBS (Convolution + Batch Normalization + SiLU Swish Activation, convolution + batch normalization + activation layer), CSP1_1 (Cross Stage Partial Layer 1_1, cross-stage partial network 1_1 layer) layer, the second CBS, the first CSP1_3 (Cross Stage Partial Layer 1_3, cross-stage partial network 1_3 layer) layer, the third CBS, the second CSP1_3 layer, the fourth CBS, the SPP (Spatial Pyramid Pooling Layer, spatial pyramid pooling layer) layer.
[0050] The input of the neck network is: three feature maps with different scales and channels output by the backbone network. The output of the neck network is: three feature maps with different scales and channels after multi-scale feature fusion, including: large-scale feature maps, medium-scale feature maps and small-scale feature maps. Among them, large-scale feature maps are used to detect smaller targets, medium-scale feature maps are used to detect medium-sized targets, and small-scale feature maps are used to detect larger targets. The large-scale feature map has a scale of 80*80 and a number of channels of 128, the medium-scale feature map has a scale of 40*40 and a number of channels of 256, and the small-scale feature map has a scale of 20*20 and a number of channels of 512.
[0051] Specifically, the lower structure of the neck network is: the first CSP2_1 (Cross Stage Partial Layer2_1, cross-stage partial network 2_1 layer) layer, the first CBS, the first UPsample (Upsample Layer, upsampling layer) layer, the first Concat (Concatenate Layer, concatenation layer) layer, the second CSP2_1 layer, the second CBS, the second UPsample layer, the second Concat layer, the third CSP2_1 layer, the third CBS, the third Concat layer, the fourth CSP2_1 layer, the fourth CBS or CBL layer, the fourth Concat layer, and the fifth CSP2_1 layer.
[0052] The input of the head network is: the large-scale feature map, medium-scale feature map and small-scale feature map output by the neck network, and the output of the head network is: one or more prediction boxes (Bounding Boxes), the class probability (Class Probabilities) corresponding to each prediction box, and the confidence score (Confidence Scores) corresponding to each prediction box.
[0053] The lower layers of the head network are: CBL layer, Anchor mechanism layer, convolution layer, object classification layer, and bounding box regression layer. Among them, both the predicted box and the true box are bounding boxes.
[0054] For this solution, each prediction box is identified by the coordinates of the rectangular box, usually the coordinates of the upper left corner (x, y) and the width (width) and height (height), which are used to locate the area affected by stray light detected in the image. The category probability corresponding to each prediction box is used to indicate the probability that the target (the area affected by stray light) exists in each prediction box. The confidence score corresponding to each prediction box is used to indicate the degree of confidence that the target (i.e., the area affected by stray light) exists in the prediction box.
[0055] In one example, the output of the head network is as follows: Prediction box 1: x:320, y:240, width (Width):160, height (Height):110; category probability (the probability of there being an area affected by stray light in the prediction box): 0.92; confidence score: 0.95. Prediction box 2: x:200, y:180, width (Width):80, height (Height):60; category probability (the probability of there being an area affected by stray light in the prediction box): 0.80; confidence score: 0.85.
[0056] In this solution, the attention mechanism module is generally added before the splicing module in the neck network, and is used to perform spatial and channel weighted processing on the three feature maps with different scales and channels output by the backbone network. In one example, the attention mechanism module includes a first attention mechanism module, a second attention mechanism module, and a third attention mechanism module; the first attention mechanism module, the second attention mechanism module, and the third attention mechanism module are respectively used to perform spatial and channel weighted processing on one of the three feature maps output by the backbone network.
[0057] By using the attention mechanism module to perform spatial weighted processing on the feature map output by the backbone network, the stray light detection model can more accurately focus on the key areas in the image, especially the areas affected by stray light. Spatial weighted processing can improve the sensitivity of the stray light detection model to the areas affected by stray light, so that it can better identify and locate the areas affected by stray light in the image in complex scenes.
[0058] By performing channel weighting on the feature map output by the backbone network through the attention mechanism module, the stray light detection model can assign different weights to the features of different channels, emphasize the channel features related to the area affected by stray light, and reduce the impact of noise and interference. This channel weighting processing can improve the model's utilization of multi-dimensional feature information and enhance the ability to distinguish areas affected by stray light.
[0059] By performing spatial and channel weighted processing on the feature map output by the backbone network through the attention mechanism module, the stray light detection model can effectively enhance the attention of the stray light detection model to the area affected by the stray light, while suppressing the interference of irrelevant areas, thereby enhancing the detection accuracy of the stray light detection model for the area affected by the stray light.
[0060] The input of the attention mechanism module is: three feature maps with different scales and number of channels output by the backbone network, and the output of the attention mechanism module is: three feature maps with different scales and number of channels after spatial and channel weighting processing. Spatial and channel weighting processing of feature maps by the attention mechanism module does not change the scale and number of channels of feature maps.
[0061] The structure of the attention mechanism module can be as follows Figure 2As shown in the figure, the lower structure of the attention mechanism module is as follows: Residual Layer, which is used to provide direct feature connection. GAP (Global Average Pooling Layer, global average pooling layer) layer, including X-direction average pooling layer (X AVG POOL) and Y-direction average pooling layer (Y AVGPOOL), which are used to extract global information in the pooling operation in the X direction and Y direction respectively, and generate a feature vector. Feature concatenation and the first Conv2d (2D Convolution Layer, two-dimensional convolution layer) layer, that is, Concat+first Conv2d layer, are used to concatenate the global average pooling results from the X direction and the Y direction to form a new feature map, and then perform convolution operation on the new feature map. Batch normalization and non-linear activation layer, that is, Batchnorm+Non-linear layer, are used to batch normalize the output of the convolution layer and then apply a non-linear activation function. The second Conv2d layer and the third Conv2d layer are used to perform further convolution operation on the feature map. The first sigmoid (S-type activation function) layer and the second sigmoid layer, the first sigmoid layer is used to generate attention weights for spatial weighting, and the second sigmoid layer is used to generate attention weights for channel weighting. The FRL (Feature Reweighting Layer) layer is used to weight the feature maps output by the backbone network using the generated attention weights.
[0062] In one example, if Figure 1 As shown, the first attention mechanism module is added directly before the second splicing layer to perform weighted processing on large-scale feature maps. The second attention mechanism module is added directly before the first splicing layer to perform weighted processing on medium-scale feature maps. The third attention mechanism module is added directly before the fourth splicing layer to perform weighted processing on small-scale feature maps.
[0063] It should be noted that this solution does not specifically limit the position where the attention mechanism module is added in the neck network. In addition to adding the attention mechanism module directly before the splicing module in the neck network, the attention mechanism module can also be added to other positions in the neck network while ensuring that the attention mechanism module can effectively enhance the attention of the stray light detection model to the area affected by stray light and suppress the interference of irrelevant areas. For example, after the splicing module or other positions in the neck network.
[0064] In addition, except for Figure 2In addition to the attention mechanism module shown, the structure of the attention mechanism module can also be personalized according to specific needs while ensuring that the feature map output by the backbone network is spatially and channel-weighted through the attention mechanism module to effectively enhance the stray light detection model's attention to the area affected by the stray light while suppressing the interference of irrelevant areas.
[0065] The target detection result includes the detection results output by the target stray light detection model for multiple images to be detected. Each detection result includes: one or more prediction boxes, the category probability corresponding to each prediction box, and the confidence score corresponding to each prediction box. Among them, each is identified by the coordinates of the rectangular box, usually the upper left corner coordinates (x, y) and the width (width) and height (height), which are used to locate the stray light affected area detected in the image. The category probability corresponding to each prediction box is used to indicate the probability that there is a target (stray light affected area) in each prediction box. The confidence score corresponding to each prediction box is used to indicate the degree of confidence in the existence of the target (i.e., the stray light affected area) in the prediction box. When the confidence score threshold and the category probability threshold are set, according to each detection result, it can be intuitively determined whether there is a stray light affected area in the image to be detected, and the stray light affected area in the image to be detected. It can be seen that each detection result can identify whether there is a stray light affected area in the corresponding image to be detected, and the stray light affected area in the image to be detected.
[0066] It should be noted that the detection method of the image acquisition device involved in this solution may also be executed by an application, service, instance, functional module in the form of software, virtual machine (VM) or cloud server, or hardware equipment with the detection function of the image acquisition device (such as a server, terminal device).
[0067] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following related technologies can be combined arbitrarily with the technical solution of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application. The same or similar concepts or processes may not be repeated in some embodiments.
[0068] Figure 3 A flowchart of a detection method 300 for an image acquisition device provided in an embodiment of the present application is shown. The method may include steps S301-S303.
[0069] In step S301, images to be detected captured by the image acquisition device to be detected in the vehicle-mounted module under various lighting angles are obtained.
[0070] The vehicle-mounted module refers to a series of equipment combinations installed on the vehicle to achieve specific functions. The vehicle-mounted module usually includes a variety of vehicle-mounted sensors, a vehicle-mounted control unit, a data processing module, and a communication module. The various vehicle-mounted sensors generally include vehicle-mounted image acquisition devices, vehicle-mounted radars, and vehicle-mounted infrared sensors. Among them, the vehicle-mounted image acquisition device can refer to one or more of the vehicle-mounted front-view camera, vehicle-mounted rear-view camera, vehicle-mounted side-view camera, and vehicle-mounted panoramic camera.
[0071] The illumination angle refers to the relative position and angle between the light source and the image acquisition device. The various illumination angles generally include: Directly in front: the light source is located directly in front of the image acquisition device and directly illuminates the image acquisition device. Directly above: the light source is located directly above the image acquisition device and illuminates the image acquisition device from above. Directly below: the light source is located directly below the image acquisition device and illuminates the image acquisition device from below. Directly to the left: the light source is located directly to the left of the image acquisition device and illuminates the image acquisition device from the left. Directly to the right: the light source is located directly to the right of the image acquisition device and illuminates the image acquisition device from the right. Upper left: the light source is located at the upper left of the image acquisition device, forming oblique illumination. Upper right: the light source is located at the upper right of the image acquisition device, forming oblique illumination. Lower left: the light source is located at the lower left of the image acquisition device, forming oblique illumination. Lower right: the light source is located at the lower right of the image acquisition device, forming oblique illumination.
[0072] After acquiring multiple images to be detected, step S302 may be further performed. In step S302, the target stray light detection model is used to perform stray light detection on the multiple images to be detected respectively to obtain corresponding target detection results; the target stray light detection model is obtained based on model optimization training of the stray light detection model to be trained; the stray light detection model to be trained is obtained by adding a coordinate attention mechanism module to the neck network of the YOLOv5s model; the coordinate attention mechanism module is used to perform spatial and channel weighted processing on the feature map output by the backbone network of the YOLOv5s model.
[0073] Before using the target stray light detection model to perform stray light detection on multiple images to be detected and obtain the corresponding target detection results, it is necessary to first obtain the target stray light detection model. The acquisition process of the target stray light detection model is as follows: First, add a coordinate attention mechanism module to the neck network of the YOLOv5s model to construct the stray light detection model to be trained. Then, perform model optimization training on the stray light detection model to be trained to obtain the target stray light detection model.
[0074] When the stray light detection model to be trained is subjected to model optimization training to obtain the target stray light detection model, a training set, a validation set and a test set may be obtained first. Then, the stray light detection model to be trained is subjected to multiple rounds of iterative training using the training set until the set iteration stop condition is met, and during the multiple rounds of iterative training, the stray light detection model to be trained is verified using the validation set, and when the verification result indicates that the stray light detection model to be trained is overfitted, the hyperparameters of the stray light detection model to be trained are adjusted. Afterwards, when the iteration stop condition is met, the stray light detection model to be trained is tested using the test set, and when the test result meets the preset standard, the stray light detection model to be trained is used as the target stray light detection model.
[0075] When constructing a training set, a validation set, and a test set, a large number of sample images can be collected first. Then, a large number of sample images are divided according to a certain ratio, and a training set, a validation set, and a test set are constructed respectively. In one example, a large number of sample images are divided according to a ratio of 7:2:1, and a training set, a validation set, and a test set are constructed respectively. That is, 70% of a large number of sample images are used to construct a training set, 20% are used to construct a validation set, and 10% are used to construct a test set. Dividing a large number of sample images according to a certain ratio (such as 7:2:1) to construct a training set, a validation set, and a test set respectively can not only ensure that there is enough data for training during the iterative training of the model, but also ensure that the model can be evaluated and optimized in real time through the validation set during multiple rounds of iterative training, thereby effectively preventing the model from overfitting. At the same time, the test set is used to evaluate the final performance of the model on unseen data after the model training is completed, which can ensure the generalization ability of the model. Therefore, dividing a large number of sample images according to a certain ratio (such as 7:2:1) can effectively improve the training quality and evaluation accuracy of the model, and ensure that the model has better generalization ability and stability.
[0076] In an embodiment of the present application, after collecting a large number of sample images, or dividing a large number of sample images according to a certain ratio, and constructing a training set, a validation set, and a test set respectively, each sample image can be annotated with results. In one example, the image annotation tool LabelImg (image annotation tool) can be used to annotate the results and generate annotation results in TXT (text file) format. It can be seen that the training set, the validation set, and the test set respectively include multiple sample images and the annotation results corresponding to each sample image.
[0077] In order to ensure the diversity of a large number of sample images and the adaptability of the model under different conditions, when collecting a large number of sample images, multiple qualified image acquisition devices can be used, and multiple initial images can be collected for each device under multiple lighting angles to obtain a large number of rich initial images.
[0078] At the same time, in order to enhance the robustness of the model, a large number of initial images can be enhanced respectively, and the enhanced images can be used as sample images. In order to improve the efficiency of model optimization training, the initial images are enhanced only when multiple sample images included in the training set are obtained, and the processed images are used as training set sample images. When constructing the validation set, the original initial images can be directly used as sample images to truly reflect the performance of the model on images that have not been enhanced.
[0079] Specifically, the multiple sample images included in the training set can be obtained in the following manner: first, multiple initial images captured by a qualified image acquisition device under multiple illumination angles are obtained, and then the initial images are enhanced to obtain sample images.
[0080] In an embodiment of the present application, the image enhancement processing includes at least one of the following operations: Random rotation: randomly adjust the angle of the image to enhance the adaptability of the model to different directions. Random flipping: flip the image horizontally or vertically to enhance the model's recognition ability for symmetry and flip invariance. Scaling processing: zoom in or out the image to simulate different shooting distances or scenes, and enhance the model's detection ability for targets of different sizes. Color jittering: randomly change the brightness, contrast, saturation, etc. of the image to enhance the model's recognition ability for images under different lighting conditions.
[0081] In an embodiment of the present application, in the process of performing multiple rounds of iterative training on the stray light detection model to be trained using the training set until the set iteration stop condition is met, the steps of each round of iterative training are as follows: First, a target sample image is selected from the training set. Secondly, the target sample image is input into the stray light detection model to be trained to obtain the corresponding sample detection result. Thirdly, the target loss value between the sample detection result and the annotation result corresponding to the target sample image is calculated. Finally, the internal model parameters in the stray light detection model to be trained are updated using the target loss value.
[0082] In addition, in order to avoid overfitting of the trained stray light detection model, during multiple rounds of iterative training, the validation set can be used to verify the stray light detection model to be trained, and when the validation result indicates that the stray light detection model to be trained is overfitting, the hyperparameters of the stray light detection model to be trained are adjusted.
[0083] In the embodiment of the present application, the iteration stop condition may be: the model target loss value converges, or may be: the verification result indicates that the stray light detection model to be trained does not have overfitting, or may be: the set maximum number of iterations is reached. When the verification result shows that the precision rate and recall rate are significantly reduced or the target loss value is significantly increased, the verification result indicates that the stray light detection model to be trained has overfitting. Correspondingly, when the verification result indicates that the target loss value tends to be stable and the precision rate and recall rate also remain stable or improve, the verification result indicates that the stray light detection model to be trained does not have overfitting.
[0084] In the embodiment of the present application, the internal model parameters in the stray light detection model include: convolution layer weights, bias parameters, and fully connected layer weights, etc. The hyperparameters of the stray light detection model generally include: learning rate, regularization parameter, batch size, etc.
[0085] In the embodiment of the present application, the verification results include: target loss value, precision (Precision, P), recall (Recall, R) and mean average precision (mean Average Precision, mAP) and the like.
[0086] The test results include: target loss value, precision, recall rate, average precision, etc.
[0087] Specifically, the calculation formulas for precision (Precision, P), recall (Recall, R) and mean average precision (meanAverage Precision, mAP) are as follows:
[0088]
[0089] Among them, TP (True Positives) is the number of true positive samples correctly predicted by the model, and FP (False Positives) is the number of false positive samples.
[0090]
[0091] Among them, TP (True Positives) is the number of true positive samples correctly predicted by the model, FP (False Positives) is the number of false positive samples incorrectly predicted by the model, and FN is the number of false negative samples that are actually positive samples but predicted by the model as negative samples.
[0092]
[0093] Where N is the total number of categories and P(R) is the precision at the recall rate R.
[0094] In one example, the test result includes the precision corresponding to the stray light detection model to be trained, the recall rate corresponding to the stray light detection model to be trained, and the average precision mean corresponding to the stray light detection model to be trained. The preset standard includes a precision threshold, a recall threshold, and an average precision mean threshold. In this case, the test result meets the preset standard means that: the precision corresponding to the stray light detection model to be trained reaches the precision threshold, the recall rate corresponding to the stray light detection model to be trained reaches the recall threshold, and the average precision mean corresponding to the stray light detection model to be trained reaches the average precision mean threshold.
[0095] In an embodiment of the present application, the sample detection result includes a predicted box corresponding to the area affected by stray light in the target sample image. The annotation result corresponding to the target sample image includes a real box corresponding to the area affected by stray light in the target sample image. The target loss value includes a bounding box loss value between the predicted box and the real box. The bounding box loss value is calculated based on the EIOU (Extended Intersection over Union Loss) loss function. Specifically, the calculation formula of the EIOU loss function is as follows:
[0096]
[0097] Among them, IoU (Intersection over Union) represents the ratio of the overlapping area of the predicted box and the true box to the union area; L dis Indicates distance loss; L asp Indicates direction loss; w, w gt Respectively represent the width of the prediction box and the real box; h, h gt They represent the height of the predicted box and the real box respectively; c represents the diagonal length of the minimum circumscribed rectangle containing the predicted box and the real box; c w Indicates the width of the minimum bounding rectangle containing the predicted box and the true box; c h represents the height of the minimum bounding rectangle containing the predicted box and the true box; ρ(b,b gt ) represents the Euclidean distance between the center points of the predicted box and the true box; ρ(w,w gt )、ρ(h,h gt ) represent the difference between the predicted box and the true box in width and height respectively.
[0098] The EIOU loss function introduces width and height error penalties, making the model more sensitive to the width and height differences of the box, thereby improving the accurate fitting of the target size. At the same time, due to the introduction of width and height error penalties, the model can provide better positioning effects in the case of small targets or irregular bounding boxes, and can better handle targets with large aspect ratio changes. In addition, the center point distance metric introduced in the EIOU loss function is more detailed than the center point distance penalty in CIoU (Complete Intersection over Union), and can more accurately optimize the position of the box.
[0099] It should be noted that in addition to the bounding box loss value, the target loss value can also include confidence loss, classification loss, etc.
[0100] In the embodiment of the present application, when obtaining the target stray light detection model, multiple images to be detected can be respectively input into the target stray light detection model, and the detection results output by the target stray light detection model for each image to be detected can be obtained. The target detection results include the detection results output by the target stray light detection model for the multiple images to be detected.
[0101] After obtaining the target detection result, step S303 may be further performed. In step S303, whether the image acquisition device to be detected is qualified is determined according to the target detection result.
[0102] Each detection result includes: one or more prediction boxes, the category probability corresponding to each prediction box, and the confidence score corresponding to each prediction box. Among them, each is identified by the coordinates of the rectangular box, usually the upper left corner coordinates (x, y) and the width (width) and height (height), which are used to locate the area affected by stray light detected in the image. The category probability corresponding to each prediction box is used to indicate the probability that a target (area affected by stray light) exists in each prediction box. The confidence score corresponding to each prediction box is used to indicate the degree of confidence in the existence of a target (i.e., area affected by stray light) in the prediction box.
[0103] When the confidence score threshold and the category probability threshold are set, it is possible to intuitively determine whether there is an area affected by stray light in the image to be detected, and the area affected by stray light in the image to be detected based on each detection result. It can be seen that each detection result can identify whether there is an area affected by stray light in the corresponding image to be detected, and the area affected by stray light in the image to be detected. In this case, it is possible to intuitively determine whether there is an image to be detected containing an area affected by stray light in multiple images to be detected, and the area affected by stray light contained in the image to be detected, through the target detection result.
[0104] In one example, determining whether the image acquisition device to be detected is qualified based on the target detection result means: when the target detection result indicates that there is an image to be detected containing an area affected by stray light among multiple images to be detected, the image acquisition device to be detected is deemed unqualified.
[0105] It should be noted that, based on the target detection result, determining whether the image acquisition device to be detected is qualified can also be: when the target detection result indicates that the proportion of images to be detected containing areas affected by stray light among multiple images to be detected exceeds a preset proportion threshold, the image acquisition device to be detected is deemed to be unqualified.
[0106] The detection method of the image acquisition device provided in the embodiment of the present application utilizes the target stray light detection model to perform stray light detection on the images to be detected respectively collected under various illumination angles, obtain the corresponding target detection results, and determine whether the image acquisition device to be detected is qualified based on the target detection results. By performing stray light detection on the images to be detected respectively collected under various illumination angles, the ability of the image acquisition device to be detected to resist stray light interference under different illumination angles can be comprehensively evaluated. Through this detection method, the ability of the image acquisition device to be detected to resist stray light interference when facing complex illumination conditions in a real road environment can be detected as much as possible. Therefore, the detection method of the image acquisition device provided in the embodiment of the present application can accurately detect whether the image acquisition device to be detected is a qualified product with strong ability to resist stray light interference.
[0107] In addition, the target stray light detection model is constructed by introducing a coordinate attention mechanism module into the neck network of the YOLOv5s model. By performing spatial and channel weighted processing on the feature map output by the backbone network through the coordinate attention mechanism module, the target stray light detection model can pay more attention to the key area features related to stray light interference in the image to be detected, and accurately focus on the part affected by stray light, so that the target stray light detection model can more accurately identify whether the image to be detected contains the area affected by stray light, and the specific location of the area affected by stray light in the image to be detected. In this case, the target stray light detection model is used to perform stray light detection on the images to be detected collected at various lighting angles, obtain the corresponding target detection results, and determine whether the image acquisition device to be detected is qualified based on the target detection results, so as to accurately determine whether the image acquisition device to be detected is a qualified product with strong anti-stray light interference capabilities.
[0108] At the same time, since the YOLOv5s model has a high detection speed, the target stray light detection model can be used to quickly obtain the target detection result. In this case, the detection method of the image acquisition device provided in the embodiment of the present application can quickly determine whether the image acquisition device to be detected is a qualified product with strong anti-stray light interference capability.
[0109] Corresponding to the application example of the method provided in the embodiment of the present application and the detection method of the image acquisition device provided in the embodiment of the present application, the embodiment of the present application also provides a detection device for an image acquisition device. Figure 4 As shown, it is a structural block diagram of a detection device 400 of an image acquisition device according to an embodiment of the present application. The device 400 may include:
[0110] The image acquisition module 401 is used to acquire the images to be detected acquired by the image acquisition device to be detected in the vehicle-mounted module under various illumination angles;
[0111] The stray light detection module 402 is used to perform stray light detection on multiple images to be detected respectively using a target stray light detection model to obtain corresponding target detection results; the target stray light detection model is obtained by performing model optimization training on the stray light detection model to be trained; the stray light detection model to be trained is obtained by adding a coordinate attention mechanism module to the neck network of the YOLOv5s model; the coordinate attention mechanism module is used to perform spatial and channel weighted processing on the feature map output by the backbone network of the YOLOv5s model;
[0112] The product detection module 403 is used to determine whether the image acquisition device to be detected is qualified according to the target detection result.
[0113] In a possible implementation, an attention mechanism module is added before the splicing module in the neck network; the attention mechanism module includes a first attention mechanism module, a second attention mechanism module and a third attention mechanism module; the first attention mechanism module, the second attention mechanism module and the third attention mechanism module are respectively used to perform spatial and channel weighted processing on one of the three feature maps output by the backbone network.
[0114] In a possible implementation, the device also includes a model optimization training module, which is used to obtain a training set, a verification set and a test set; the training set, the verification set and the test set respectively include multiple sample images and the annotation results corresponding to each sample image; the stray light detection model to be trained is trained for multiple rounds using the training set until the set iteration stop condition is met, and in the process of multiple rounds of iterative training, the stray light detection model to be trained is verified using the verification set, and when the verification result indicates that the stray light detection model to be trained is overfitted, the hyperparameters of the stray light detection model to be trained are adjusted; when the iteration stop condition is met, the stray light detection model to be trained is tested using the test set, and when the test result meets the preset standard, the stray light detection model to be trained is used as the target stray light detection model.
[0115] In one possible implementation, the model optimization training module is specifically used to select a target sample image in a training set during each round of iterative training; input the target sample image into the stray light detection model to be trained to obtain a corresponding sample detection result; calculate a target loss value between the sample detection result and the annotation result corresponding to the target sample image; and use the target loss value to update the internal model parameters in the stray light detection model to be trained.
[0116] In a possible implementation, the sample detection result includes a predicted box corresponding to the area affected by stray light in the target sample image; the annotation result corresponding to the target sample image includes a real box corresponding to the area affected by stray light in the target sample image; the target loss value includes a bounding box loss value between the predicted box and the real box; and the bounding box loss value is calculated based on the EIOU loss function.
[0117] In one possible implementation, the test results include the precision corresponding to the stray light detection model to be trained, the recall rate corresponding to the stray light detection model to be trained, and the average precision mean corresponding to the stray light detection model to be trained; the preset standards include the precision threshold, the recall threshold and the average precision mean threshold.
[0118] In one possible implementation, the model optimization training module is specifically used to obtain multiple sample images included in the training set in the following manner: obtain multiple initial images captured by a qualified image acquisition device under multiple lighting angles; perform image enhancement processing on the initial images to obtain sample images.
[0119] In a possible implementation, the product detection module 403 is specifically configured to determine that the image acquisition device to be detected is unqualified when the target detection result indicates that there is an image to be detected containing an area affected by stray light among the multiple images to be detected.
[0120] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.
[0121] An embodiment of the present application further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the method provided in any embodiment of the present application is implemented.
[0122] Figure 5 FIG. 1 is a block diagram of an electronic device used to implement an embodiment of the present application. Figure 5 As shown, the electronic device includes: a memory 501 and a processor 502. The memory 501 stores a computer program that can be run on the processor 502. When the processor 502 executes the computer program, the method in the above embodiment is implemented. The number of the memory 501 and the processor 502 can be one or more.
[0123] The electronic device also includes:
[0124] The communication interface 503 is used to communicate with external devices and perform data exchange transmission.
[0125] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the memory 501, the processor 502 and the communication interface 503 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0126] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.
[0127] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the method provided in the embodiment of the present application when the program is executed by a processor.
[0128] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.
[0129] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.
[0130] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the Advanced RISC Machines (ARM) architecture.
[0131] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of exemplary but not limiting description, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).
[0132] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0133] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0134] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0135] Any process or method description in the flow chart or otherwise described herein can be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.
[0136] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0137] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0138] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.
[0139] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A detection method for an image acquisition device, comprising: Obtaining images to be detected collected by the image acquisition device to be detected in the vehicle-mounted module under various illumination angles; Using a target stray light detection model to perform stray light detection on multiple images to be detected, respectively, to obtain corresponding target detection results; the target stray light detection model is obtained by performing model optimization training on the stray light detection model to be trained; The stray light detection model to be trained is obtained by adding a coordinate attention mechanism module to the neck network of the YOLOv5s model; the coordinate attention mechanism module is used to perform spatial and channel weighted processing on the feature map output by the backbone network of the YOLOv5s model; Determine whether the image acquisition device to be detected is qualified based on the target detection result.
2. The method according to claim 1, wherein: The attention mechanism module is added before the splicing module in the neck network; the attention mechanism module includes a first attention mechanism module, a second attention mechanism module and a third attention mechanism module; the first attention mechanism module, the second attention mechanism module and the third attention mechanism module are respectively used to perform spatial and channel weighted processing on one of the three feature maps output by the backbone network.
3. The method according to claim 1, wherein: The steps of performing model optimization training on the stray light detection model to be trained to obtain the target stray light detection model are as follows: Obtaining a training set, a validation set, and a test set; the training set, the validation set, and the test set respectively include a plurality of sample images and a labeling result corresponding to each sample image; Using the training set to perform multiple rounds of iterative training on the stray light detection model to be trained until a set iteration stop condition is met, and in the process of multiple rounds of iterative training, using the verification set to verify the stray light detection model to be trained, and when the verification result indicates that the stray light detection model to be trained is overfitted, adjusting the hyperparameters of the stray light detection model to be trained; When the iteration stop condition is met, the stray light detection model to be trained is tested using the test set, and when the test result meets a preset standard, the stray light detection model to be trained is used as the target stray light detection model.
4. The method according to claim 3, wherein: The steps for each round of iterative training are as follows: Selecting a target sample image from the training set; Inputting the target sample image into the stray light detection model to be trained to obtain a corresponding sample detection result; Calculating a target loss value between the sample detection result and the annotation result corresponding to the target sample image; The target loss value is used to update internal model parameters in the stray light detection model to be trained.
5. The method according to claim 4, wherein: The sample detection result includes a predicted box corresponding to the area affected by stray light in the target sample image; the annotation result corresponding to the target sample image includes a real box corresponding to the area affected by stray light in the target sample image; the target loss value includes a bounding box loss value between the predicted box and the real box; the bounding box loss value is calculated based on the EIOU loss function.
6. The method according to claim 3, wherein: The test result includes the precision rate corresponding to the stray light detection model to be trained, the recall rate corresponding to the stray light detection model to be trained, and the average precision mean value corresponding to the stray light detection model to be trained; The preset standards include a precision threshold, a recall threshold, and an average precision mean threshold.
7. The method according to claim 3, wherein: The multiple sample images included in the training set are obtained in the following manner: Acquire a plurality of initial images respectively captured by a qualified image acquisition device under the plurality of illumination angles; Perform image enhancement processing on the initial image to obtain a sample image.
8. The method according to claim 1, wherein: Determining whether the image acquisition device to be detected is qualified according to the target detection result includes: When the target detection result indicates that there is an image to be detected containing an area affected by stray light among the multiple images to be detected, the image acquisition device to be detected is deemed unqualified.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory, wherein the processor implements the method according to any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.