Target detection method and device for dark scene, equipment and medium

By performing image enhancement processing on dark scene images and training an improved target detection model, the problems of insufficient accuracy and speed in target detection in dark scenes are solved, achieving more efficient target recognition and improving the safety of autonomous driving systems.

CN120876993APending Publication Date: 2025-10-31THUNDERSOFT (SHENYANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511083644.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-04
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

In the field of autonomous driving, target detection in dark scenes suffers from insufficient accuracy and speed, especially in scenes with poor lighting conditions, where existing technologies struggle to effectively identify targets.

Method used

This paper proposes an image enhancement process combined with a specific neural network model, including an improved structure of image preprocessing, multiple image enhancement modules, and object detection model. It utilizes the K-nearest neighbor algorithm and the Focaler-Siou loss function for sample training to improve the visibility of image details and the accuracy of object detection.

Benefits of technology

It significantly improves the accuracy and inference speed of target detection in dark scenes, enhancing the safety and reliability of autonomous driving systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120876993A_ABST
    Figure CN120876993A_ABST
Patent Text Reader

Abstract

The invention provides a target detection method and device for a dark scene, equipment and a medium, and the method comprises the steps: carrying out the image enhancement processing of a to-be-detected image, so as to obtain a processed image; inputting the processed image into a preset target detection model to obtain a target type identifier and position information of a detection target included in a to-be-detected image output by the target detection model; the target detection model is composed of a Conv module, a C3k2 module, an A2C2f module, a Concat module, an Upsample module, a PfAAM module and a Deect module, so that the accuracy of an obtained target detection result and the reasoning speed are improved when the target detection model is used for carrying out target detection and recognition on an image in a dark scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target recognition, and in particular to a target detection method, apparatus, device, and medium in dark scenes. Background Technology

[0002] In the field of autonomous driving, object detection in dark scenes is an extremely challenging task, but also of paramount importance. Dark scenes typically refer to environments with poor lighting conditions, such as nighttime or inside tunnels. These scenarios are unavoidable in real-world driving; therefore, developing effective object detection methods for dark scenes is crucial for improving the safety and reliability of autonomous driving systems. Summary of the Invention

[0003] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows: According to one aspect of this application, a target detection method for dark scenes is provided, comprising: Image enhancement processing is performed on the image to be detected to obtain the processed image; The processed image is input into a preset target detection model to obtain the target type identifier and location information of the target included in the image to be detected in the target detection model output; The target detection model includes several Conv modules, several C3k2 modules, several A2C2f modules, several Concat modules, several Upsample modules, several PfAAM modules, and several Detect modules, with the input of each Detect module connected to a PfAAM module.

[0004] In one exemplary embodiment of this application, image enhancement processing is performed on the image to be detected to obtain a processed image, including: Acquire the image to be detected; The image to be detected is preprocessed to obtain the first image; The size of the first image is scaled proportionally to obtain a second image with a preset pixel size; the preset pixel size is the pixel size that can be processed by the object detection model. The second image is then subjected to image enhancement processing to obtain the processed image.

[0005] In one exemplary embodiment of this application, image enhancement processing is performed on the second image to obtain a processed image, including: The second image is input into a preset image enhancement module to obtain the processed image output by the image enhancement module.

[0006] In one exemplary embodiment of this application, the image enhancement module is one or more of the following: MSRCP module, SSR module, MSR module, and MSRCR module.

[0007] In one exemplary embodiment of this application, a second image is input into a preset image enhancement module to obtain a processed image output by the image enhancement module, including: Obtain the texture features, color features, edge density features, brightness features of the highlighted areas, and brightness difference features between the central and edge areas corresponding to the first image; Based on the K-nearest neighbor algorithm, the texture features, color features, edge density features, brightness features of the highlighted areas, and brightness difference features between the central and edge areas of the first image are processed to obtain the target scene corresponding to the image to be detected. If the target scene corresponding to the image to be detected is the first scene, the second image is input into the MSRCR module and the MSR module to obtain the processed image output by the image enhancement module. When the target scene corresponding to the image to be detected is the second scene, the second image is input into the SSR module and the MSRCP module to obtain the processed image output by the image enhancement module; The first scenario is a scenario where the number of light sources is greater than a preset threshold and the brightness distribution is uneven; the second scenario is a scenario where the number of light sources is less than or equal to the preset threshold and the brightness distribution is uniform.

[0008] In one exemplary embodiment of this application, the target detection model is determined according to the following steps: Acquire several sample images in a dark scene; each sample image includes at least one sample target; each sample image has a target type identifier for each sample target included in the sample image, as well as the location information of each sample target in the sample image; the target type identifier represents the type to which the corresponding sample target belongs; Perform one or a combination of image processing operations on a number of sample images at a preset ratio, such as flipping, color space transformation, adding noise, or Mosaic data augmentation. A number of sample images are randomly divided into a number of training sample images, a number of validation sample images, and a number of test sample images; Several training sample images are input into a pre-defined neural network model for sample training to obtain an initial network model; Several validation sample images are input into the initial network model to obtain the validation results output by the initial network model; Based on the validation results, the parameters of the initial network model were adjusted. Several test sample images are input into the initial network model to obtain the model test results corresponding to the initial network model; The target detection model is obtained when the model test results indicate that the initial network model meets the recognition accuracy requirements.

[0009] In one exemplary embodiment of this application, the neural network model uses the Focaler-IoU loss function and the SIoU loss function to train a number of training sample images in sequence, and the Focaler-IoU loss function and the SIoU loss function are trained in parallel when training the training sample images.

[0010] According to one aspect of this application, a target detection device for dark scenes is provided, comprising: The image processing module is used to perform image enhancement processing on the image to be detected in order to obtain the processed image; The target detection module is used to input the processed image into a preset target detection model to obtain the target type identifier and location information of the target included in the image to be detected in the target detection model output by the target detection model; The target detection model includes several Conv modules, several C3k2 modules, several A2C2f modules, several Concat modules, several Upsample modules, several PfAAM modules, and several Detect modules, with the input of each Detect module connected to a PfAAM module.

[0011] According to one aspect of this application, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the aforementioned target detection method for dark scenes.

[0012] According to one aspect of this application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0013] The present invention has at least the following beneficial effects: The target detection method for dark scenes of the present invention first performs image enhancement processing on the image to be detected to obtain a processed image, and then inputs the processed image into a preset target detection model to obtain the target type identifier and location information of the target included in the image to be detected in the target detection model output by the target detection model. The target detection model consists of a Conv module, a C3k2 module, an A2C2f module, a Concat module, an Upsample module, a PfAAM module, and a Detect module, so as to improve the accuracy and inference speed of the target detection results when performing target detection and recognition on images in dark scenes (low illumination) through the target detection model. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a flowchart of a target detection method for dark scenes provided in an embodiment of the present invention; Figure 2 A flowchart illustrating the module processing of the target detection model provided in this embodiment of the invention upon receiving a processed image; Figure 3 A block diagram of a target detection device for dark scenes provided in an embodiment of the present invention. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] This application proposes a target detection method for dark scenes, such as Figure 1 As shown, it includes: Step S100: Perform image enhancement processing on the image to be detected to obtain the processed image; Further, in step S100, image enhancement processing is performed on the image to be detected to obtain the processed image, including steps S110-S140: Step S110: Obtain the image to be detected; The image to be detected is the image for which target detection and recognition are required.

[0018] Step S120: Preprocess the image to be detected to obtain the first image; The preprocessing adopts existing image preprocessing operations, such as feature extraction, segmentation, and removal of discrete noise from the image to be detected.

[0019] Step S130: Scale the size of the first image proportionally to obtain a second image with a preset pixel size; The preset pixel size is the pixel size that can be processed by the target detection model. As a preferred embodiment, the preset pixel size is 640×640.

[0020] Step S140: Perform image enhancement processing on the second image to obtain the processed image.

[0021] The second image is enhanced to improve the color of the resulting image, thereby increasing the visibility of details while maintaining natural colors.

[0022] In step S140, an embodiment of performing image enhancement processing on the second image to obtain a processed image is to input the second image into a preset image enhancement module to obtain the processed image output by the image enhancement module.

[0023] Furthermore, as a feasible embodiment, the image enhancement module is an MSRCP module (such as...). Figure 2 It can be one or more of the following modules: MSRCP (Single Scale Retinex), SSR (Multi-Scale Retinex), MSRCR (Multi-Scale Retinex with Color Restoration).

[0024] The MSRCP module combines multi-scale Retinex (an image enhancement algorithm) for enhancement and color restoration, improving the visibility of image details while maintaining natural colors. It is suitable for image enhancement applications, such as color enhancement of low-light images.

[0025] The MSR module is based on the SSR algorithm. It uses multiple different sigma values ​​and weights the different results obtained. The advantage of the MSR module is that it can simultaneously maintain the high fidelity of the image and compress the dynamic range of the image. The MSR module can also realize color enhancement, color constancy, local dynamic range compression, and global dynamic range compression. It can also be used for X-ray image enhancement.

[0026] To further improve the color enhancement effect of the processed image and thus improve the target detection accuracy of subsequent target detection, a preferred embodiment of step S140 is proposed, wherein the method of inputting the second image into a preset image enhancement module to obtain the processed image output by the image enhancement module includes steps S141-S144: Step S141: Obtain the texture features, color features, edge density features, brightness features of the highlighted areas, and brightness difference features between the central and edge areas corresponding to the first image; Texture features, also known as LBP (Local Binary Patterns) texture features, can be extracted using 8-neighborhood LBP histograms. LBP texture features are used to characterize the texture complexity of the first image.

[0027] The color feature, namely HSV (Hue, Saturation, Value), can be obtained by calculating the mean and variance of H, S, and V of the first image (using existing color feature extraction methods). HSV color features are used to characterize the lighting diversity of the first image.

[0028] The edge density feature, also known as the Canny edge density feature, can be obtained by calculating the proportion of Canny edge pixels in the first image (using existing edge density feature extraction methods). The Canny edge density feature is used to characterize the structural complexity of the first image.

[0029] The brightness characteristics of the highlighted area can be determined by comparing it with a preset pixel number threshold (e.g., if the number of bright pixels in a certain area is greater than 180, then the area is determined as a highlighted area, and the number of bright pixels in it is the brightness characteristic of the highlighted area). The brightness characteristics of the highlighted area are used to characterize the number of scene lights in the first image.

[0030] The brightness difference feature between the central region and the edge region can be determined by the brightness difference between the central region and the edge region of the image (e.g., the difference between the number of brightness pixels in the central region and the number of brightness pixels in the edge region of the first image is determined as the brightness difference feature between the central region and the edge region). The brightness difference feature between the central region and the edge region is used to characterize whether the scene in the first image includes building structures.

[0031] Step S142: Based on the K-nearest neighbor algorithm, process the texture features, color features, edge density features, brightness features of the highlighted areas, and brightness difference features between the central and edge areas of the first image to obtain the target scene corresponding to the image to be detected. The K-Nearest Neighbors (KNN) algorithm is used to classify the texture features, color features, edge density features, brightness features of the highlighted areas, and brightness difference features between the central and edge areas of the first image to output the target scene (first scene or second scene) corresponding to the image to be detected.

[0032] The first scenario is a scenario where the number of light sources is greater than the preset threshold and the brightness distribution is uneven (such as urban scenes with many light sources, a large number of lights, complex textures, uneven brightness distribution, and obstacles such as crowds and billboards); the second scenario is a scenario where the number of light sources is less than or equal to the preset threshold and the brightness distribution is uniform (such as highways with fewer light sources, a long field of vision, clear roads, and relatively uniform brightness distribution).

[0033] Step S143: If the target scene corresponding to the image to be detected is the first scene, input the second image into the MSRCR module and the MSR module to obtain the processed image output by the image enhancement module. When the target scene corresponding to the image to be detected is the first scene (i.e., the urban scene), the MSRCR module and the MSR module are selected as the image enhancement modules for the second image. This can enhance the contrast of the second image, restore the color of the target in the second image, and preserve the image details in the second image.

[0034] Step S144: When the target scene corresponding to the image to be detected is the second scene, the second image is input into the SSR module and the MSRCP module to obtain the processed image output by the image enhancement module. When the target scene corresponding to the image to be detected is the second scene (i.e., the highway scene), the SSR module and the MSRCP module are selected as the image enhancement modules for the second image, which can achieve the effects of rapid image enhancement, improving the overall brightness of the image, and removing fog from the image.

[0035] By determining the target scene corresponding to the image to be detected, different image enhancement modules can be selected to perform image enhancement processing on the second image. This is to further distinguish between urban scenes and highway scenes in dark scenes (such as low-light environments at night), and to automatically select appropriate image enhancement schemes (such as combinations of MSR modules, MSRCR modules, SSR modules, and MSRCP modules). Through image feature analysis and classification models, urban scenes and highway scenes can be effectively distinguished. By combining the characteristics of different image enhancement algorithms, an adaptive image enhancement system for dark scenes can be realized to improve the color enhancement effect of the processed image.

[0036] Step S200: Input the processed image into the preset target detection model to obtain the target type identifier and location information of the detected target included in the image to be detected in the target detection model output by the target detection model; Furthermore, the target detection model is determined according to steps S201-S208: Step S201: Obtain several sample images in a dark scene; Each sample image includes at least one sample target (the sample target can be an object or a human body, depending on the recognition and detection task set by the user); each sample image has a target type identifier for each sample target included in the sample image, as well as the location information of each sample target in the sample image; the target type identifier represents the type to which the corresponding sample target belongs, and the target type is determined according to the recognition and detection task. Different recognition and detection tasks have different target types.

[0037] Step S202: Perform one or a combination of image processing operations on several sample images of a preset ratio, such as flipping, color space transformation, adding noise, or Mosaic data augmentation. The preset ratio can be a user-defined ratio, such as 30%. By performing image processing operations such as flipping, color space transformation, adding noise, and Mosaic data augmentation on a certain proportion of sample images, the accuracy of the target detection model in detecting targets in images from different angles can be improved.

[0038] Step S203: Randomly divide a number of sample images into a number of training sample images, a number of validation sample images, and a number of test sample images; Several sample images are randomly divided to obtain training sample images for the training set, validation sample images for the validation set, and test sample images for the test set, in order to ensure that the processing results of the obtained object detection model are more accurate.

[0039] Step S204: Input several training sample images into a preset neural network model for sample training to obtain an initial network model; Training sample images are used to train a pre-defined neural network model.

[0040] Furthermore, the neural network model uses the Focaler-IoU loss function and the SIoU loss function to train on several training sample images. When training on the training sample images, the Focaler-IoU loss function and the SIoU loss function are trained in parallel. The neural network model in this application uses the Focaler-SIoU loss function (i.e., the combination of the Focaler-IoU loss function and the SIoU loss function) for sample training. The Focaler-SIoU loss function is used to calculate the regression loss of the bounding box during the model training process.

[0041] The Focaler-IoU loss function reconstructs the original IoU (Intersection over Union) loss by mapping linear intervals, thereby focusing on both easy and difficult samples and ensuring that the model focuses on targets that are difficult to detect.

[0042] The SIoU loss function comprises four parts: angle cost, distance cost, shape cost, and loU cost. By introducing directionality into the loss function cost, the SIoU loss function achieves faster convergence and better inference performance during training. This improvement effectively reduces the degrees of freedom, resulting in faster and more accurate convergence and contributing to better results. It is suitable for fine-grained object detection and small object detection, improving the positional accuracy of object detection boxes, which is particularly important for object detection in dark environments.

[0043] The formula for the Focaler-SIou loss function is as follows: , Here is the formula for calculating the SIoU loss function. The formula for calculating the Focaler-IoU loss function is provided below. Since the formulas for calculating the Focaler-IoU loss function and the SIoU loss function are existing technologies, they will not be elaborated here.

[0044] The object detection model in this application uses the Focaler-SIou loss function, which combines the Focaler-IoU and SIoU loss functions, during sample training to calculate the regression loss of the bounding box. This accelerates the convergence of the object detection model's training process (the evaluation metrics for judging whether the model has converged are loss, accuracy, recall, and mean average precision mAP). This improves the accuracy and speed of the final object detection model's detection results, enhancing the model's ability to detect difficult targets.

[0045] Step S205: Input several verification sample images into the initial network model to obtain the verification results output by the initial network model; Step S206: Adjust the parameters of the initial network model based on the verification results; The validation sample images are used to validate the processing results of the initial network model, and the parameters of the initial network model are adjusted based on the validation results to improve the image processing accuracy of the initial network model.

[0046] Step S207: Input several test sample images into the initial network model to obtain the model test results corresponding to the initial network model; In step S207, several test sample images are input into the initial network model to obtain the model test results corresponding to the initial network model, including steps S2071-S2073: Step S2071: Input each test sample image into the initial network model to obtain the sample test result of each test sample image output by the initial network model; Step S2072: Traverse the sample test results of several test sample images. If the target type identifier and target location information corresponding to the sample test result of the test sample image are the same as the target type identifier and target location information of the test sample image, then determine the test sample image as the target test sample image. If the target type identifier and target location information corresponding to the test result of the test sample image are the same as those of the test sample image, it means that the result obtained by the initial network model from testing the test sample image is accurate, and the test sample image is then determined as the target test sample image.

[0047] Step S2073: If the ratio of the number of target test sample images to the number of test sample images is greater than the preset accuracy, the initial network model that meets the recognition accuracy requirement is determined as the model test result corresponding to the initial network model.

[0048] Step S208: If the model test results indicate that the initial network model meets the recognition accuracy requirements, the target detection model is obtained.

[0049] Object detection models typically employ a Backbone-Neck-Head network structure. The Backbone network is primarily responsible for extracting high-level features from the input image, usually including multiple convolutional and pooling layers, constructing a deep feature extractor. The Neck network is typically used to further integrate and adjust the features extracted by the Backbone, which helps to fuse features at different levels and thus improve the network's ability to perceive objects. The Head network typically includes bounding box regression layers and classification layers, performing the final regression prediction to obtain the final object detection result.

[0050] This invention improves both the backbone and neck parts of existing target detection models (e.g.) Figure 2 The input terminal in the Backbone section (i.e. Figure 2 The MSRCP module was added to the input of the first Conv module in the first column of the model to improve the image feature extraction capability of the object detection model by enhancing the detail visibility of the processed image; and the PfAAM module was added to the output of the Neck part to improve the accuracy and processing performance of object detection. This adapts to the object detection effect in dark scenes, making the proposed object detection method in dark scenes lightweight and better performing without sacrificing accuracy.

[0051] The target detection model in this application consists of the Conv module, C3k2 module, A2C2f module, Concat module, Upsample module, PfAAM module, and Detect module. Each module constituting the target detection model will be described in detail below: The Conv module (Convolution) is a convolutional module that includes convolutional layers, batch normalization (BN) layers, and the activation function SILU (Sigmoid Linear Unit). The C3k2 module is used to assist in feature extraction. It is an improvement on the traditional C3 module. By combining variable convolution kernels (such as 3x3, 5x5, etc.) and channel separation strategies, it provides more powerful feature extraction capabilities. The A2C2f module is a structure that combines Area Attention (A2) and an improved feature extraction network (C2f), and is mainly used for feature extraction and processing. The Concat module is used to combine feature maps at different levels, which can significantly improve the accuracy and efficiency of object detection. The Upsample module is used to perform upsampling operations; The PfAAM module (Parameter-free Average Attention Module) is a module that applies a parameter-free attention mechanism. It can improve model performance with relatively small computational overhead without affecting the model size. The Detect module is represented as a detection layer, which is used to predict the category and bounding box, and outputs the detection results of the object detection model, including the category and location of the object.

[0052] By connecting a PfAAM module before the input of each Detect module (each Detect module corresponds to a different scale) in the target detection model of this application, the target detection results and robustness of the target detection model output are improved accordingly.

[0053] The Conv module, C3k2 module, A2C2f module, Concat module, Upsample module, PfAAM module, and Detect module mentioned in this application all have the same structure as the existing object detection model YOLO (You Only Look Once). Therefore, the composition architecture of the above modules will not be described in detail here.

[0054] Therefore, it can be seen that the backbone part of the object detection model in this application includes Figure 2 The first column contains all modules except the MSRCP module; the Neck section includes... Figure 2 The second, third, and fourth columns contain numerous modules, with the Head section including... Figure 2 The three Detect modules in the fifth column.

[0055] like Figure 2As shown, the second image, after being scaled proportionally, is input into the MSRCP module to obtain the processed image output by the MSRCP module. This processed image is then input into the object detection model. Upon receiving the processed image, the object detection model inputs it into the Backbone section for feature extraction. The extracted image features at different parameter scales are then transmitted to the Neck section by the second C3k2 module, the first A2C2f module, and the second A2C2f module in the Backbone section, respectively. (The second C3k2 module in the Backbone section is responsible for extracting high-dimensional image features; its extracted features have a larger receptive field, and the first feature map obtained from these features is used to detect large-scale targets. The first A2C2f module in the Backbone section is responsible for extracting moderate-dimensional image features; its extracted features have a moderate receptive field, and the second feature map obtained from these features is used to detect moderate-scale targets. The second A2C2f module in the Backbone section is responsible for extracting low-dimensional image features.) The image features extracted have a small receptive field, and the third feature map obtained from these image features is used to detect targets with small scale. After receiving the three types of image features transmitted by the Backbone, the Neck part performs feature fusion on the three types of image features to obtain three corresponding feature maps. These feature maps are then output by the three PfAAM modules of the Neck part to the corresponding Detect module in the Head part (each PfAAM module corresponds to the output of one feature map). The Detect module performs target detection and outputs the target type identifier and location information of the detected target included in the image to be detected. (Since the target detection model of this application is an improvement on the existing YOLOv12 model, the data processing logic of each module in the Backbone, Neck and Head parts of this application, as well as the data transmission logic between modules, are the same as the data processing method of the corresponding module in the YOLOv12 model. Therefore, the data type of data transmitted between modules will not be described here.)

[0056] The target detection method for dark scenes of the present invention is applied to a vehicle intelligent driving system, specifically a vehicle intelligent cockpit system. When applied to a vehicle intelligent cockpit system, the image to be detected (i.e., the image of the vehicle's surrounding environment in a dark scene acquired by the vehicle intelligent cockpit system) is first subjected to image enhancement processing to obtain a processed image. The processed image is then input into a preset target detection model to obtain the target type identifier and location information of the target included in the image to be detected, which is output by the target detection model. The target detection model consists of a Conv module, a C3k2 module, an A2C2f module, a Concat module, an Upsample module, a PfAAM module, and a Detect module. This improves the accuracy and inference speed of the target detection results (detection results of pedestrians or obstacles, etc.) obtained when performing target detection and recognition on images in dark scenes (low illumination) (i.e., pedestrian or obstacle recognition in the surrounding environment during vehicle driving).

[0057] On the other hand, this application also proposes a target detection device 100 for dark scenes, such as Figure 3 As shown, it includes: Image processing module 110 is used to perform image enhancement processing on the image to be detected in order to obtain a processed image; The image processing module 110 performs image enhancement processing on the image to be detected to obtain a processed image, including the following methods: Acquire the image to be detected; preprocess the image to be detected to obtain a first image; scale the size of the first image proportionally to obtain a second image with a preset pixel size; the preset pixel size is the pixel size that can be processed by the target detection model; input the second image into a preset image enhancement module to obtain the processed image output by the image enhancement module; the image enhancement module is one or more of the following: MSRCP module, SSR module, MSR module, and MSRCR module.

[0058] The target detection module 120 is used to input the processed image into a preset target detection model to obtain the target type identifier and location information of the target included in the image to be detected in the target detection model output by the target detection model; The methods for determining the target detection model include: Acquire several sample images in a dark scene; each sample image includes at least one sample target; each sample image has a target type identifier for each sample target included in the sample image, as well as the location information of each sample target in the sample image; the target type identifier represents the type to which the corresponding sample target belongs; Perform one or a combination of image processing operations on a number of sample images at a preset ratio, such as flipping, color space transformation, adding noise, or Mosaic data augmentation. A number of sample images are randomly divided into a number of training sample images, a number of validation sample images, and a number of test sample images; Several training sample images are input into a pre-defined neural network model for sample training to obtain an initial network model. The neural network model uses the Focaler-IoU loss function and the SIoU loss function to train the several training sample images. When training the training sample images, the Focaler-IoU loss function and the SIoU loss function are trained in parallel. Several validation sample images are input into the initial network model to obtain the validation results output by the initial network model; Based on the validation results, the parameters of the initial network model were adjusted. Several test sample images are input into the initial network model to obtain the model test results corresponding to the initial network model; The target detection model is obtained when the model test results indicate that the initial network model meets the recognition accuracy requirements.

[0059] Furthermore, the target detection model consists of Conv, C3k2, A2C2f, Concat, Upsample, PfAAM, and Detect modules, and the input of each Detect module of the target detection model is connected to a PfAAM module.

[0060] Embodiments of the present invention also provide a computer program product including program code, which, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above in various exemplary embodiments of the present invention.

[0061] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0062] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0063] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.

[0064] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0065] An electronic device according to this embodiment of the invention. The electronic device is merely an example and should not be construed as limiting the functionality or scope of the embodiments of the invention.

[0066] Electronic devices are manifested in the form of general-purpose computing devices. Components of an electronic device may include, but are not limited to: at least one processor, at least one memory, and buses connecting different system components (including memory and processor).

[0067] The storage device stores program code that can be executed by the processor to perform the steps described in the "Exemplary Methods" section above, according to various exemplary embodiments of the present invention.

[0068] The storage may include readable media in the form of volatile storage, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).

[0069] The storage may also include programs / utilities having a set (at least one) of program modules, including but not limited to: an operating system, one or more applications, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0070] A bus can represent one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus that uses any of the various bus architectures.

[0071] Electronic devices can also communicate with one or more external devices (such as keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable users to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (such as routers, modems, etc.). This communication can be performed through input / output (I / O) interfaces. Furthermore, electronic devices can communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapters.

[0072] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section of this specification.

[0073] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0074] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0075] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0076] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0077] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0078] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0079] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A target detection method for dark scenes, characterized in that, The method includes: Image enhancement processing is performed on the image to be detected to obtain the processed image; The processed image is input into a preset target detection model to obtain the target type identifier and location information of the target included in the image to be detected, as output by the target detection model. The target detection model includes several Conv modules, several C3k2 modules, several A2C2f modules, several Concat modules, several Upsample modules, several PfAAM modules, and several Detect modules, and the input of each Detect module is connected to one of the PfAAM modules.

2. The method according to claim 1, characterized in that, The image enhancement processing of the image to be detected to obtain the processed image includes: Acquire the image to be detected; The image to be detected is preprocessed to obtain a first image; The size of the first image is scaled proportionally to obtain a second image with a preset pixel size; the preset pixel size is the pixel size that can be processed by the target detection model. The second image is then subjected to image enhancement processing to obtain the processed image.

3. The method according to claim 2, characterized in that, The step of performing image enhancement processing on the second image to obtain the processed image includes: The second image is input into a preset image enhancement module to obtain the processed image output by the image enhancement module.

4. The method according to claim 3, characterized in that, The image enhancement module is one or more of the following: MSRCP module, SSR module, MSR module, and MSRCR module.

5. The method according to claim 4, characterized in that, The step of inputting the second image into a preset image enhancement module to obtain the processed image output by the image enhancement module includes: Obtain the texture features, color features, edge density features, brightness features of the highlighted areas, and brightness difference features between the central and edge areas corresponding to the first image; Based on the K-nearest neighbor algorithm, the texture features, color features, edge density features, brightness features of the highlighted areas, and brightness difference features between the central and edge areas of the first image are processed to obtain the target scene corresponding to the image to be detected. If the target scene corresponding to the image to be detected is the first scene, the second image is input into the MSRCR module and the MSR module to obtain the processed image output by the image enhancement module; If the target scene corresponding to the image to be detected is the second scene, the second image is input into the SSR module and the MSRCP module to obtain the processed image output by the image enhancement module; The first scenario is a scenario where the number of light sources is greater than a preset threshold and the brightness distribution is uneven; the second scenario is a scenario where the number of light sources is less than or equal to the preset threshold and the brightness distribution is uniform.

6. The method according to claim 1, characterized in that, The target detection model is determined according to the following steps: Acquire several sample images in a dark scene; each sample image includes at least one sample target; each sample image corresponds to a target type identifier for each sample target included in the sample image, and the location information of each sample target in the sample image; the target type identifier represents the type to which the corresponding sample target belongs; Perform one or a combination of image processing operations on a number of sample images at a preset ratio, including flipping, color space transformation, adding noise, and Mosaic data enhancement. The sample images are randomly divided into a number of training sample images, a number of verification sample images, and a number of test sample images. Several training sample images are input into a preset neural network model for sample training to obtain an initial network model; Several of the aforementioned verification sample images are input into the initial network model to obtain the verification results output by the initial network model; Based on the verification results, the parameters of the initial network model are adjusted; Several test sample images are input into the initial network model to obtain the model test results corresponding to the initial network model; The target detection model is obtained when the model test results indicate that the initial network model meets the recognition accuracy requirements.

7. The method according to claim 6, characterized in that, The neural network model uses the Focaler-IoU loss function and the SIoU loss function to train a number of training sample images in sequence.

8. A target detection device for dark scenes, characterized in that, include: The image processing module is used to perform image enhancement processing on the image to be detected in order to obtain the processed image; The target detection module is used to input the processed image into a preset target detection model to obtain the target type identifier and location information of the target included in the image to be detected in the target detection model output by the target detection model; The target detection model includes several Conv modules, several C3k2 modules, several A2C2f modules, several Concat modules, several Upsample modules, several PfAAM modules, and several Detect modules, with the input of each Detect module connected to a PfAAM module.

9. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the method as described in any one of claims 1-7.

10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.