Improved low-light target detection method and device based on YOLOv7-tiny

By introducing multiple branch blocks, attention mechanisms and coordinated coordinate convolutions into the YOLOv7-tiny detection model, a low-illumination object detection model is generated, which solves the problem of low object detection accuracy under low-illumination conditions and achieves higher detection performance and accuracy.

CN119169267BActive Publication Date: 2025-08-12湖南工商大学
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411224148.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-08-12
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

The prior art has low target detection accuracy under low illumination conditions, and the details of the target objects in the image are not clear.

Method used

In the YOLOv7-tiny detection model, the efficient layer aggregation network module that fuses multivariate branch blocks, the cross-level network module of attention mechanism and coordinated coordinate convolution are introduced to generate a low-illumination object detection model, and the model is trained through the training set and the verification set to obtain the detection results.

Benefits of technology

It improves the performance and accuracy of object detection under low illumination conditions, enhances the ability to capture target details, and reduces the impact of insufficient light.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169267B_ABST
    Figure CN119169267B_ABST
Patent Text Reader

Abstract

The present invention provides an improved low-light target detection method and device based on YOLOv7‑tiny, relating to the field of image detection technology. A preset data set is obtained and preprocessed to determine a training set, a validation set, and a test set; a preset backbone network part, a preset neck structure, and a coordinated coordinate convolution are introduced into a preset YOLOv7‑tiny detection model to generate a low-light target detection model; the low-light target detection model is trained to generate a target detection model; and the image information to be detected is detected and the detection results are obtained. Detection is performed using the low-light target detection model to improve the low-light target detection model's ability to capture target details under low-light conditions, thereby alleviating problems caused by insufficient lighting. By improving the preset YOLOv7‑tiny detection model structure, the performance and accuracy of target detection in low-light environments are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image detection technology, and in particular to a low-light target detection method and device based on an improvement of YOLOv7-tiny. Background Art

[0002] The low-light target detection task refers to the task of detecting and identifying target objects in an environment with dim or insufficient lighting conditions.

[0003] In the prior art, target detectors are usually used to detect images under low illumination. However, due to insufficient lighting during shooting, the details of the target objects in the image may not be clear. For the above problem, the detection accuracy of existing target detectors is low.

[0004] Therefore, how to effectively improve the detection accuracy of images under low illumination has become a technical problem that needs to be solved urgently. Summary of the Invention

[0005] In order to effectively improve the detection accuracy of images under low illumination, the present application provides a low illumination target detection method, system, device and storage medium improved based on YOLOv7-tiny.

[0006] In the first aspect, the present application provides an improved low-light target detection method based on YOLOv7-tiny, which adopts the following technical solutions:

[0007] An improved low-light target detection method based on YOLOv7-tiny, including:

[0008] Obtaining a preset data set, and preprocessing the preset data set to determine a training set, a validation set, and a test set;

[0009] Introducing the preset backbone network part, preset neck structure, and coordinated coordinate convolution into the preset YOLOv7-tiny detection model to generate a low-light target detection model;

[0010] Training the low-light target detection model based on the training set and the validation set to generate a target detection model;

[0011] Acquire image information to be detected, detect the image information to be detected according to the target detection model and obtain a detection result.

[0012] Optionally, the step of obtaining a preset data set and preprocessing the preset data set to determine a training set, a validation set, and a test set includes:

[0013] Acquire a preset data set, and determine a target low-light image set and a target bounding box in the preset data set;

[0014] Converting the target low-light image set and the target bounding box into a YOLO training format to obtain a conversion result;

[0015] A preset division ratio is obtained, and the conversion result is divided according to the preset division ratio to determine a training set, a validation set, and a test set.

[0016] Optionally, before the step of introducing a preset backbone network part, a preset neck structure, and coordinated coordinate convolution into the preset YOLOv7-tiny detection model to generate a low-light target detection model, the step further includes:

[0017] Introducing an efficient layer aggregation network module integrating multiple branch blocks, and generating a preset backbone network part according to the efficient layer aggregation network module integrating multiple branch blocks;

[0018] Introducing a cross-level network module of the attention mechanism, and constructing a preset neck structure according to the cross-level network module of the attention mechanism, wherein the cross-level network module of the attention mechanism includes a deformable convolution DCNv2 module and a CBAM attention mechanism module;

[0019] Coordinated coordinate convolution is introduced, wherein the structure of the coordinated coordinate convolution includes coordinate definition, coordinate transformation, coordinate and feature map splicing and convolution operation.

[0020] Optionally, the step of introducing a preset backbone network part, a preset neck structure, and coordinated coordinate convolution into a preset YOLOv7-tiny detection model to generate a low-light target detection model includes:

[0021] The efficient layer aggregation network module integrating the multi-branch blocks is adopted in the preset YOLOv7-tiny detection model to generate an improved efficient feature extraction network with multi-branch blocks;

[0022] Obtaining a feature fusion module for the neck portion corresponding to the improved efficient feature extraction network with a multi-branch block, and replacing the cross-level network module of the attention mechanism to obtain an improved Neck network;

[0023] The convolution layer before the upsampling layer in the improved Neck network is replaced by the coordinated coordinate convolution to construct the low-illumination target detection model.

[0024] Optionally, the step of adopting the efficient layer aggregation network module integrating the multi-branch block in the preset YOLOv7-tiny detection model to generate an improved efficient feature extraction network with the multi-branch block includes:

[0025] Obtain the network structure of the backbone network in the preset YOLOv7-tiny detection model;

[0026] The network structure is replaced by the efficient layer aggregation network module of the fused multi-branch block, so as to obtain output feature maps of different layers through the efficient layer aggregation network module of the fused multi-branch block during the forward propagation process;

[0027] Get the current replaced network structure and generate an efficient feature extraction network with multi-branch blocks.

[0028] Optionally, the step of obtaining a feature fusion module for the neck portion corresponding to the improved efficient feature extraction network with a multi-branch block, and replacing the cross-level network module of the attention mechanism to obtain an improved Neck network includes:

[0029] Obtaining a feature fusion module for the neck portion corresponding to the improved efficient feature extraction network with a multi-branch block;

[0030] Replace the cross-level network module of the attention mechanism with the feature fusion module of the neck portion corresponding to the improved efficient feature extraction network with multi-branch blocks;

[0031] Performing a convolution operation on the acquired input information through the first convolution layer to obtain a first result;

[0032] Using the first result as input to a second convolutional layer, and performing a convolution operation on the first result through the second convolutional layer to obtain a second result;

[0033] Pass the first result through the GS bottleneck module and the depth-wise separable convolutional layer respectively to obtain a third result;

[0034] splicing the second result and the third result to obtain a splicing feature;

[0035] An improved Neck network is obtained based on the splicing features and the CBAM attention mechanism module.

[0036] Optionally, the step of replacing the convolution layer before the upsampling layer in the improved Neck network with the coordinated coordinate convolution to construct the low-illumination target detection model includes:

[0037] Before the upsampling operation in the improved Neck network, obtaining an input feature map;

[0038] Defining each pixel position of the input feature map as a coordinate vector;

[0039] Splicing the converted coordinate vector with the input feature map to obtain a spliced feature map;

[0040] The convolution kernel of the coordinated coordinate convolution is used to perform a convolution operation on the spliced feature map to construct the low-illumination target detection model.

[0041] In a second aspect, the present application provides an improved low-light target detection system based on YOLOv7-tiny, comprising:

[0042] A preset data set acquisition module is used to acquire a preset data set and preprocess the preset data set to determine a training set, a validation set, and a test set;

[0043] A low-light target detection model generation module is used to introduce a preset backbone network part, a preset neck structure, and coordinated coordinate convolution into the preset YOLOv7-tiny detection model to generate a low-light target detection model;

[0044] A target detection model generation module is used to train the low-light target detection model based on the training set and the validation set to generate a target detection model;

[0045] The detection result generation module is used to obtain the image information to be detected, detect the image information to be detected according to the target detection model and obtain the detection result.

[0046] In a third aspect, the present application provides a computer device, comprising: a memory and a processor, wherein the processor executes the method described above when running computer instructions stored in the memory.

[0047] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on a computer, enable the computer to execute the method described above.

[0048] In summary, this application has the following beneficial technical effects:

[0049] This application obtains a preset data set and pre-processes the preset data set to determine the training set, validation set, and test set; introduces a preset backbone network part, a preset neck structure, and coordinated coordinate convolution into the preset YOLOv7-tiny detection model to generate a low-light target detection model; trains the low-light target detection model based on the training set and validation set to generate a target detection model; obtains image information to be detected, detects the image information to be detected according to the target detection model, and obtains the detection results. Detection using the low-light target detection model improves the low-light target detection model's ability to capture target details under low-light conditions, thereby alleviating problems caused by insufficient lighting. In addition, by improving the preset YOLOv7-tiny detection model structure, the performance and accuracy of target detection in low-light environments are effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present application.

[0051] Figure 2 This is a flowchart of the first embodiment of the low-light target detection method improved based on YOLOv7-tiny in this application.

[0052] Figure 3 This is a structural diagram of an efficient layer aggregation network module that integrates multiple branch blocks in the first embodiment of the low-light target detection method improved based on YOLOv7-tiny in this application;

[0053] Figure 4 This is the DiverseBranchBlock structure diagram of the first embodiment of the low-light target detection method improved based on YOLOv7-tiny in this application;

[0054] Figure 5 This is a structural diagram of the VoVGSCSP-DCN-CBAM module improved in the first embodiment of the low-light target detection method improved based on YOLOv7-tiny in this application;

[0055] Figure 6 This is a structural diagram of the CBAM attention mechanism module introduced in the first embodiment of the low-light target detection method improved based on YOLOv7-tiny in this application;

[0056] Figure 7 This is a structural diagram of the CoordConv module of the first embodiment of the low-light target detection method improved based on YOLOv7-tiny in this application;

[0057] Figure 8 This is the overall network structure diagram of the improved model of the first embodiment of the low-light target detection method improved based on YOLOv7-tiny in this application;

[0058] Figure 9 This is a structural block diagram of the first embodiment of the low-light target detection system improved based on YOLOv7-tiny in this application. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below through the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0060] Reference Figure 1 , Figure 1 This is a schematic diagram of the computer device structure of the hardware operating environment involved in the embodiment of the present application.

[0061] like Figure 1 As shown, the computer device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0062] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0063] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a low-light target detection program improved based on YOLOv7-tiny.

[0064] exist Figure 1In the computer device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in this application can be set in the computer device, and the computer device calls the low-light target detection program based on the YOLOv7-tiny improvement stored in the memory 1005 through the processor 1001, and executes the low-light target detection method based on the YOLOv7-tiny improvement provided in the embodiment of the present application.

[0065] The present invention provides a low-light target detection method based on YOLOv7-tiny. Figure 2 , Figure 2 This is a flow chart of the first embodiment of the low-light target detection method improved based on YOLOv7-tiny in this application.

[0066] In this embodiment, the low-light target detection method improved based on YOLOv7-tiny includes the following steps:

[0067] Step S10: Obtain a preset data set, and preprocess the preset data set to determine a training set, a validation set, and a test set.

[0068] It should be noted that the preset data set in this embodiment is a sample data set, including the public sample data ExDark data set, and its labels are converted into the YOLO training format. Specifically, the YOLO training format usually requires that the label of each sample contain the category identifier of the target and the location information of the bounding box. Specifically, the label format commonly used by YOLO is "category ID×center point coordinates×bounding box width×bounding box height". During the conversion process, the label information of the original sample data set needs to be parsed and reorganized and saved according to the YOLO label format.

[0069] Furthermore, in order to improve the practicality of the low-light target detection process, a preset data set is obtained, and the preset data set is preprocessed to determine the training set, verification set and test set, including: obtaining the preset data set, determining the target low-light image set and the target bounding box in the preset data set; converting the target low-light image set and the target bounding box into the YOLO training format to obtain the conversion result; obtaining a preset division ratio, and dividing the conversion result according to the preset division ratio to determine the training set, verification set and test set.

[0070] In specific implementations, the training set is used for model training, the validation set is used to evaluate model performance during training, and the test set is used to evaluate model performance when the model processes unseen data. The training, validation, and test sets can be split in a ratio of 7:1:2. A sample dataset can include 7,363 low-light images in 10 different conditions, ranging from very low-light environments to dusk, as well as object bounding boxes for 12 object classes, both at the image class level and locally annotated.

[0071] Step S20: Introduce a preset backbone network part, a preset neck structure, and coordinated coordinate convolution into the preset YOLOv7-tiny detection model to generate a low-light target detection model.

[0072] It should be noted that the multi-scale context aggregation backbone network is a backbone network structure that aims to improve the performance of target detection tasks through multi-scale feature information and context information. However, due to the presence of noise and blurred details in low-light scenes, the performance of the multi-scale context aggregation backbone network is poor. In order to improve the low-light target detection model's ability to capture target details under low-light conditions, thereby alleviating the problems caused by insufficient lighting, this embodiment is based on and improved upon the YOLOv7-tiny target detection model.

[0073] In a specific implementation, before the step of introducing a preset backbone network part, a preset neck structure and coordinated coordinate convolution into the preset YOLOv7-tiny detection model to generate a low-light target detection model, it also includes: introducing an efficient layer aggregation network module that integrates multiple branch blocks, and generating a preset backbone network part based on the efficient layer aggregation network module that integrates multiple branch blocks; introducing a cross-level network module of an attention mechanism, and constructing a preset neck structure based on the cross-level network module of the attention mechanism, wherein the cross-level network module of the attention mechanism includes a deformable convolution DCNv2 module and a CBAM attention mechanism module; introducing coordinated coordinate convolution, wherein the structure of the coordinated coordinate convolution includes coordinate definition, coordinate transformation, coordinate and feature map splicing and convolution operation.

[0074] Furthermore, in order to realize the generation of a low-light target detection model, a preset backbone network part, a preset neck structure and a coordinated coordinate convolution are introduced into the preset YOLOv7-tiny detection model to generate a low-light target detection model, including: using an efficient layer aggregation network module that integrates multi-branch blocks in the preset YOLOv7-tiny detection model to generate an improved efficient feature extraction network with multi-branch blocks; obtaining the feature fusion module of the neck part corresponding to the improved efficient feature extraction network with multi-branch blocks, and replacing the cross-level network module of the attention mechanism to obtain an improved Neck network; replacing the convolution layer of the previous layer of upsampling in the improved Neck network with a coordinated coordinate convolution to construct a low-light target detection model.

[0075] It should be noted that the steps of using an efficient layer aggregation network module that integrates multi-branch blocks in the preset YOLOv7-tiny detection model to generate an improved efficient feature extraction network with multi-branch blocks include: obtaining the network structure of the backbone network in the preset YOLOv7-tiny detection model; replacing the network structure with the efficient layer aggregation network module that integrates multi-branch blocks, so as to obtain the output feature maps of different layers through the efficient layer aggregation network module that integrates multi-branch blocks during the forward propagation process; obtaining the current replaced network structure and generating an efficient feature extraction network with multi-branch blocks.

[0076] It should be noted that the current replaced network structure is obtained and an efficient feature extraction network with a multi-branch block is generated, wherein the generated efficient feature extraction network is composed of 4 efficient layer aggregation networks that fuse multi-branch blocks and some other structures.

[0077] It is understandable that the backbone network of the single-stage target detection model YOLOv7-tiny is improved by using the ELAN-DBB (Efficient Layer Aggregation Network with Multi-branch Blocks) module to replace the original MCB structure of the backbone network. Figure 3 As shown. ELAN-DBB introduces a multi-branch structure with different receptive fields and different complexities, thereby enriching the feature space and extracting more low-light image information. The DBB (DiverseBranchBlock) module adopts multiple branch structures, each branch has a different receptive field and feature extraction capability, capturing feature information of different scales and levels, and can better adapt to the diversity of low-light target detection. The multi-branch structure can capture richer feature information, and feature fusion can improve the representation ability of features, enabling the model to detect more accurately. At the same time, it can also increase the complexity and expression ability of the network, thereby reducing the risk of overfitting and improving the generalization ability of the model. The DiverseBranchBlock structure diagram is shown as follows Figure 4As shown in the figure, during the forward propagation of the ELAN-DBB model, the outputs of different layers are connected to form a feature fusion process. In this model, the x1 layer processed by the DiverseBranchBlock module is connected to the other x2, x4, and x6 layers to create a feature fusion input. This feature fusion helps the model integrate features from different layers and receptive fields, thereby improving the accuracy and robustness of low-light object detection.

[0078] It is understood that in deep learning, forward propagation refers to the process of passing input data from the input layer to the output layer of the neural network model and performing calculations. In object detection tasks, forward propagation refers to the process of passing the input image through the object detection model to obtain the location and category information of the object.

[0079] It should be noted that the steps of obtaining the feature fusion module of the neck part corresponding to the improved efficient feature extraction network with multi-branch blocks, and replacing the cross-level network module of the attention mechanism to obtain the improved Neck network include: obtaining the feature fusion module of the neck part corresponding to the improved efficient feature extraction network with multi-branch blocks; replacing the cross-level network module of the attention mechanism with the feature fusion module of the neck part corresponding to the improved efficient feature extraction network with multi-branch blocks; performing a convolution operation on the obtained input information through the first convolution layer to obtain a first result; using the first result as the input of the second convolution layer, and performing a convolution operation on the first result through the second convolution layer to obtain a second result; passing the first result through the GS bottleneck module and the depth-separable convolution layer respectively to obtain a third result; splicing the second result and the third result to obtain splicing features; and obtaining the improved Neck network based on the splicing features and the CBAM attention mechanism module.

[0080] In practice, a new neck structure is introduced in the model's feature fusion module. The original feature fusion module is replaced with the VoVGSCSP-DCN-CBAM module. This module combines the VoVGSCSP with the deformable convolution DCNv2 module and the CBAM attention mechanism module. The module's input first passes through a convolutional layer, then through the GSBottleneck module and the DCNv2 module. The DCNv2 output is concatenated with the output after the first convolutional layer, reducing the channel dimension. Finally, the input passes through the CBAM attention mechanism module.

[0081] It should be noted that for the single-stage target detection model YOLOv7-tiny's neck feature fusion network PANet structure, a new neck structure is designed based on the improved design paradigm SlimNeck, such as Figure 8 As shown in Figure 1. To accelerate prediction computation, the input image in a CNN typically undergoes a similar transformation process, where spatial information is gradually transferred to the channels. However, each spatial compression and channel expansion of the feature map results in the loss of some semantic information. Sparse convolution completely severs the hidden connections between channels, while dense convolution maximizes the preservation of these connections. GSConv attempts to preserve these connections as much as possible, but using it in all stages of the model results in deeper layers, increasing data flow and significantly increasing inference time. However, by the time feature maps reach the neck, they have become elongated, with their channel dimension maximized and their width and height dimensions minimized, making further transformations unnecessary. Therefore, using GSConv exclusively in the neck is the best option. At this stage, GSConv processes feature maps with less redundant and repetitive information, and compression is not necessary. The MCB module is replaced with a cross-level partial network (GSCSP) module (VoVGSCSP) designed using a one-shot aggregation method. This module reduces computational complexity and network structure complexity while maintaining sufficient accuracy. The VoVGSCSP-DCN-CBAM module combines the deformable convolution DCNv2 module and the CBAM attention mechanism module on its basis. Its structure is as follows: Figure 5 shown.

[0082] Standard convolutional units sample the input feature map at fixed locations; pooling layers reduce the spatial resolution at a fixed ratio; RoI (Region of Interest) pooling layers divide the RoI into fixed spatial bins, etc., so they lack internal mechanisms to handle geometric transformations. Deformable convolution adds a regular grid sampling position offset and deformable RoI pooling to standard convolution. First, a regular grid R is used to sample the input feature map x; then the sampled values are summed weighted by w. R can be expressed as:

[0083] R={(-1,-1),(-1,0),...,(0,1),(1,1)}

[0084] After the convolution kernel operation, for each position p0 on the output feature map y (where p0 enumerates the position in R):

[0085] y(p0)=∑w(p0)*x(p0+p n )

[0086] In deformable convolution, the regular grid R is increased by an offset Δp n ;

[0087] y(p0)=∑w(p0)*x(p0+p n +Δp n )

[0088] Deformable convolutions add an offset to each bin position in the regular bin partitioning of the previous RoI pooling. The offset is learned from the previous feature map and RoI, enabling adaptive part localization for objects of varying shapes. To further enhance the Deformable Convolutional Network's ability to manipulate its spatial support region, DCNv2 introduces a modulation mechanism. Each sample not only undergoes a learned offset but is also modulated by a learned feature amplitude. With this mechanism, the Deformable Convolutional Network module can not only adjust the offset of the perceived input features but also modulate the amplitude of the input features from different spatial bins. In extreme cases, the module can decide not to perceive the signal from a specific bin by setting its feature amplitude to zero. This significantly reduces or eliminates the influence of the image content from that spatial location on the module output. Thus, the modulation mechanism provides the network module with another dimension of freedom to adjust its spatial support region.

[0089] y(p0)=∑w(p0)*x(p0+p n +Δp k )*Δm k

[0090] where Δp k and Δm k are the learnable offset and modulation scalar of the kth position, respectively. Δp k and Δm k are all obtained by separate convolutional layers applied to the same input feature map x.

[0091] The depthwise separable convolutional layer (DCNv2) can better capture local details and texture information in images without being affected by low illumination. This helps improve the model's perception of details such as object edges and textures. DCNv2's strong nonlinear feature extraction capabilities can adapt to the complex changes in low-light images. Therefore, when combined with the VoVGSCSP module, DCNv2 can better process low-light images and extract more representative features.

[0092] The CBAM attention module can help the model focus on important features in the image and suppress noise and irrelevant information. Its structure is as follows Figure 6 As shown in the figure. In low-light conditions, images often contain a large amount of noise. The CBAM module, by introducing channel and spatial attention mechanisms, extracts key information from low-light images and highlights their features, making targets easier to detect and identify. Furthermore, the CBAM module can adaptively adjust attention weights to accommodate different scales and complexities, improving detection robustness and generalization capabilities.

[0093] The design of the VoVGSCSP-DCN-CBAM module structure fully considers the characteristics and challenges of images under low-light conditions. By introducing technical means such as global sparse convolutional spatial path, depthwise separable convolutional layer and CBAM attention module, the model can more effectively process low-light images, extract more representative features, and focus on important target areas, thereby improving the accuracy of low-light target detection.

[0094] It should be noted that the convolution layer before the upsampling in the improved Neck network is replaced by the coordinated coordinate convolution to construct the low-illumination target detection model, including: obtaining the input feature map before the upsampling operation in the improved Neck network; defining each pixel position of the input feature map as a coordinate vector; splicing the converted coordinate vector with the input feature map to obtain a spliced feature map; and performing a convolution operation on the spliced feature map using the convolution kernel of the coordinated coordinate convolution to construct the low-illumination target detection model.

[0095] In the specific implementation, the convolution of the previous layer of upsampling is replaced by the coordinated coordinate convolution CoordConv, whose structure is as follows Figure 7 As shown in Figure 1. Compared to traditional convolution, the structure of coordinated coordinate convolution includes coordinate definition, coordinate transformation, concatenation of coordinates with feature maps, and convolution operations. First, in this structure, each position in the input feature map is defined as a coordinate vector. Then, the horizontal and vertical coordinates of each input feature point are converted to coordinate vectors and concatenated with the input feature map. This incorporates coordinate information into the feature map as an additional channel. Finally, a convolution operation is applied to the concatenated feature map. At each position, the convolution kernel not only perceives local features but also accesses the coordinate information of that position. This design enables coordinated coordinate convolution to better perceive and utilize the spatial position information of the input features, thereby improving the performance and accuracy of the model in position-dependent tasks. CoordConv inherits only the first two properties of traditional convolution. The running network structure will automatically maintain or discard translation invariance based on learning. This may appear to impair the model's generalization ability, but in fact, allocating some network capacity to model non-translation invariance and perceive spatial position information in the feature map actually improves the model's generalization ability.

[0096] It should be noted that the coordinated coordinate convolution is used to replace the previous convolution operation in the convolution layer before the upsampling operation. The coordinated coordinate convolution introduces the coordinate information of the input feature map during the convolution process. By adding coordinate information to the convolution kernel, the coordinated coordinate convolution can help the low-light target detection model better understand the spatial structure and positional relationship in the feature map. In this case, the convolution layer before the upsampling is replaced by the coordinated coordinate convolution to improve the detection accuracy of the low-light target detection model for targets in low-light environments. Therefore, the low-light target detection model in this embodiment is as follows Figure 8 shown.

[0097] In the specific implementation, by improving the network structure and feature fusion module of the backbone network of the preset YOLOv7-tiny detection model, and replacing the convolution layer before the upsampling operation of the second low-light target detection model with coordinated coordinate convolution, the low-light target detection model constructed can effectively improve the detection accuracy of the low-light target detection model for targets in low-light environments, and increase the complexity and expression ability of the low-light target detection model, thereby reducing the risk of overfitting.

[0098] Step S30: training the low-illumination target detection model based on the training set and the validation set to generate a target detection model.

[0099] In the specific implementation, when using the training set to train the low-light target detection model, the low-light target detection model will continuously optimize the parameters according to the training results to minimize the error of target detection.

[0100] As you can understand, the optimized low-light object detection model was trained on the training set to obtain the optimal low-light object detection model. The input image size was set to 640*640, the batch size was 16, the number of training iterations was 500, the initial learning rate was 0.01, the learning rate momentum was 0.937, and the weight decay coefficient was 0.0005. Pre-trained weights were not used in the entire process. After training, the model saves the best training weights file, best.pt.

[0101] During the training process, various model evaluation indicators are used to determine the superiority of the optimized low-light detection network. Specific indicators for evaluating superiority include: Precision (precision), Recall (recall), and AF (average precision). With recall as the horizontal axis and precision as the vertical axis, a PR curve can be drawn. The area under the PR curve is defined as AP, mAP (the average AP of each category). FPS (frames per second). The calculation formulas for each evaluation indicator are as follows:

[0102]

[0103]

[0104]

[0105]

[0106] Where TP represents the correct detection box, FP represents the false detection box, FN represents the missed detection box, len(GTs) represents the number of all label boxes, AP represents the detection accuracy of a target, N represents the number of detection categories, Frames represents the number of frames, and Time represents the detection time.

[0107] Step S40: Obtain the image information to be detected, detect the image information to be detected according to the target detection model and obtain the detection result.

[0108] After the low-light target detection model is trained, the low-light target detection model can be used to detect images under low light conditions.

[0109] In the specific implementation, the comparison of the detection results of this embodiment and YOLOv7-tiny is shown in Table 1:

[0110]

[0111] Table 1 Comparative experimental results

[0112] To verify the effectiveness of the improved modules in this embodiment on the model, under the same parameter conditions, this embodiment conducted ablation experiments on three innovative points. Whether it was the replacement of the ELAN-DBB module, the use of the VoVGSCSP-DCN-CBAM module, or the introduction of the coordinated coordinate convolution structure, all achieved good experimental results in the experiments, but the combination of the three achieved the best effect. The ablation experiment results are shown in Table 2:

[0113]

[0114] Table 2 Ablation experiment

[0115] The effective improvement of the algorithm can be clearly seen from the data in the two tables in the above comparative experiment and the ablation experiment.

[0116] This embodiment obtains a preset data set and preprocesses the preset data set to determine a training set, a validation set, and a test set; introduces a preset backbone network part, a preset neck structure, and a coordinated coordinate convolution into a preset YOLOv7-tiny detection model to generate a low-light target detection model; trains the low-light target detection model based on the training set and the validation set to generate a target detection model; obtains image information to be detected, detects the image information to be detected according to the target detection model, and obtains the detection results. Using the low-light target detection model for detection improves the low-light target detection model's ability to capture target details under low-light conditions, thereby alleviating problems caused by insufficient lighting. In addition, by improving the preset YOLOv7-tiny detection model structure, the performance and accuracy of target detection in low-light environments are effectively improved.

[0117] In addition, an embodiment of the present application also proposes a computer-readable storage medium, which stores a low-light target detection program improved based on YOLOv7-tiny. When the low-light target detection program improved based on YOLOv7-tiny is executed by a processor, the steps of the low-light target detection method improved based on YOLOv7-tiny as described above are implemented.

[0118] Reference Figure 9 , Figure 9 This is a structural block diagram of the first embodiment of the low-light target detection system improved based on YOLOv7-tiny in this application.

[0119] like Figure 9 As shown, the low-light target detection system based on the improved YOLOv7-tiny proposed in the embodiment of the present application includes:

[0120] The preset data set acquisition module 10 is used to acquire the preset data set and pre-process the preset data set to determine the training set, the validation set and the test set;

[0121] A low-light target detection model generation module 20 is used to introduce a preset backbone network part, a preset neck structure, and a coordinated coordinate convolution into a preset YOLOv7-tiny detection model to generate a low-light target detection model;

[0122] The target detection model generation module 30 is used to train the low-light target detection model based on the training set and the validation set to generate a target detection model;

[0123] The detection result generating module 40 is used to obtain the image information to be detected, detect the image information to be detected according to the target detection model and obtain the detection result.

[0124] It should be understood that the above is only an example and does not constitute any limitation to the technical solution of the present application. In specific applications, technicians in this field can make settings as needed, and the present application does not impose any restrictions on this.

[0125] This embodiment obtains a preset data set and preprocesses the preset data set to determine a training set, a validation set, and a test set; introduces a preset backbone network part, a preset neck structure, and a coordinated coordinate convolution into a preset YOLOv7-tiny detection model to generate a low-light target detection model; trains the low-light target detection model based on the training set and the validation set to generate a target detection model; obtains image information to be detected, detects the image information to be detected according to the target detection model, and obtains the detection results. Using the low-light target detection model for detection improves the low-light target detection model's ability to capture target details under low-light conditions, thereby alleviating problems caused by insufficient lighting. In addition, by improving the preset YOLOv7-tiny detection model structure, the performance and accuracy of target detection in low-light environments are effectively improved.

[0126] In one embodiment, the preset data set acquisition module 10 is further used to acquire a preset data set, determine a target low-light image set and a target bounding box in the preset data set; obtain a conversion result after converting the target low-light image set and the target bounding box into the YOLO training format; obtain a preset division ratio, and divide the conversion result according to the preset division ratio to determine a training set, a validation set, and a test set.

[0127] In one embodiment, the target detection model generation module 30 is also used to introduce an efficient layer aggregation network module that integrates multiple branch blocks, and generate a preset backbone network part based on the efficient layer aggregation network module that integrates multiple branch blocks; introduce a cross-level network module of the attention mechanism, and construct a preset neck structure based on the cross-level network module of the attention mechanism, wherein the cross-level network module of the attention mechanism includes a deformable convolution DCNv2 module and a CBAM attention mechanism module; introduce coordinated coordinate convolution, wherein the structure of the coordinated coordinate convolution includes coordinate definition, coordinate transformation, coordinate and feature map splicing and convolution operation.

[0128] In one embodiment, the target detection model generation module 30 is also used to adopt an efficient layer aggregation network module that integrates multi-branch blocks in the preset YOLOv7-tiny detection model to generate an improved efficient feature extraction network with multi-branch blocks; obtain the feature fusion module of the neck part corresponding to the improved efficient feature extraction network with multi-branch blocks, and replace the cross-level network module of the attention mechanism to obtain an improved Neck network; replace the convolution layer of the previous layer of upsampling in the improved Neck network with a coordinated coordinate convolution to construct a low-light target detection model.

[0129] In one embodiment, the target detection model generation module 30 is also used to obtain the network structure of the backbone network in the preset YOLOv7-tiny detection model; replace the network structure with the efficient layer aggregation network module that integrates the multi-branch blocks, and obtain the output feature maps of different layers by integrating the efficient layer aggregation network module that integrates the multi-branch blocks during the forward propagation process; link the output feature maps of different layers to generate an improved efficient feature extraction network with multi-branch blocks.

[0130] In one embodiment, the target detection model generation module 30 is also used to obtain neck structure information in an improved efficient feature extraction network with a multi-branch block; replace the preset neck structure with the neck structure information; perform a convolution operation on the obtained input information through a first convolution layer to obtain a first result; use the first result as the input of the second convolution layer, and perform a convolution operation on the first result through the second convolution layer to obtain a second result; pass the first result through a GS bottleneck module and a depth-separable convolution layer respectively to obtain a third result; splice the second result and the third result to obtain a splicing feature; and obtain an improved Neck network based on the splicing feature and the CBAM attention mechanism module.

[0131] In one embodiment, the target detection model generation module 30 is also used to obtain an input feature map before the upsampling operation in the improved Neck network; define each pixel position of the input feature map as a coordinate vector; splice the converted coordinate vector with the input feature map to obtain a spliced feature map; use the convolution kernel of the coordinated coordinate convolution to perform a convolution operation on the spliced feature map to construct a low-light target detection model.

[0132] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this application. In actual applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of this embodiment scheme, and no restrictions are imposed here.

[0133] In addition, for technical details not fully described in this embodiment, please refer to the method for low-light target detection provided in any embodiment of the present application, and will not be repeated here.

[0134] In addition, it should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0135] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk), including several instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application. The above is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly applied in other related technical fields, is also included in the patent protection scope of the present application.

Claims

1. A low-light target detection method based on YOLOv7-tiny, characterized in that: include: Obtaining a preset data set, and preprocessing the preset data set to determine a training set, a validation set, and a test set; Introducing the preset backbone network part, preset neck structure, and coordinated coordinate convolution into the preset YOLOv7-tiny detection model to generate a low-light target detection model; Training the low-light target detection model based on the training set and the validation set to generate a target detection model; Acquire image information to be detected, detect the image information to be detected according to the target detection model and obtain a detection result; Before the step of introducing a preset backbone network part, a preset neck structure, and coordinated coordinate convolution into the preset YOLOv7-tiny detection model to generate a low-light target detection model, the method further includes: Introducing an efficient layer aggregation network module integrating multiple branch blocks, and generating a preset backbone network part according to the efficient layer aggregation network module integrating multiple branch blocks; Introducing a cross-level network module of the attention mechanism, and constructing a preset neck structure according to the cross-level network module of the attention mechanism, wherein the cross-level network module of the attention mechanism includes a deformable convolution DCNv2 module and a CBAM attention mechanism module; Introducing coordinated coordinate convolution, where the structure of the coordinated coordinate convolution includes coordinate definition, coordinate transformation, coordinate and feature map splicing, and convolution operation; The step of introducing a preset backbone network part, a preset neck structure, and coordinated coordinate convolution into the preset YOLOv7-tiny detection model to generate a low-light target detection model includes: The efficient layer aggregation network module integrating the multi-branch blocks is adopted in the preset YOLOv7-tiny detection model to generate an improved efficient feature extraction network with multi-branch blocks; Obtaining a feature fusion module for the neck portion corresponding to the improved efficient feature extraction network with a multi-branch block, and replacing the cross-level network module of the attention mechanism to obtain an improved Neck network; The convolution layer before the upsampling layer in the improved Neck network is replaced by the coordinated coordinate convolution to construct the low-illumination target detection model.

2. The improved low-light target detection method based on YOLOv7-tiny according to claim 1, characterized in that: The step of obtaining a preset data set and preprocessing the preset data set to determine a training set, a validation set, and a test set includes: Acquire a preset data set, and determine a target low-light image set and a target bounding box in the preset data set; Converting the target low-light image set and the target bounding box into a YOLO training format to obtain a conversion result; A preset division ratio is obtained, and the conversion result is divided according to the preset division ratio to determine a training set, a validation set, and a test set.

3. The improved low-light target detection method based on YOLOv7-tiny according to claim 1, characterized in that: The step of adopting the efficient layer aggregation network module integrating the multi-branch block in the preset YOLOv7-tiny detection model to generate an improved efficient feature extraction network with the multi-branch block includes: Obtain the network structure of the backbone network in the preset YOLOv7-tiny detection model; The network structure is replaced by the efficient layer aggregation network module of the fused multi-branch block, so as to obtain output feature maps of different layers through the efficient layer aggregation network module of the fused multi-branch block during the forward propagation process; Get the current replaced network structure and generate an efficient feature extraction network with multi-branch blocks.

4. The improved low-light target detection method based on YOLOv7-tiny according to claim 1, characterized in that The step of obtaining a feature fusion module for the neck portion corresponding to the improved efficient feature extraction network with a multi-branch block, and replacing the cross-level network module of the attention mechanism to obtain an improved Neck network includes: Obtaining a feature fusion module for the neck portion corresponding to the improved efficient feature extraction network with a multi-branch block; Replace the cross-level network module of the attention mechanism with the feature fusion module of the neck portion corresponding to the improved efficient feature extraction network with multi-branch blocks; Performing a convolution operation on the acquired input information through the first convolution layer to obtain a first result; Using the first result as input to a second convolutional layer, and performing a convolution operation on the first result through the second convolutional layer to obtain a second result; Pass the first result through the GS bottleneck module and the depth-wise separable convolutional layer respectively to obtain a third result; splicing the second result and the third result to obtain a splicing feature; An improved Neck network is obtained based on the splicing features and the CBAM attention mechanism module.

5. The improved low-light target detection method based on YOLOv7-tiny according to claim 1, characterized in that: The step of replacing the convolution layer before upsampling in the improved Neck network with the coordinated coordinate convolution to construct the low-illumination target detection model includes: Before the upsampling operation in the improved Neck network, obtaining an input feature map; Defining each pixel position of the input feature map as a coordinate vector; Splicing the converted coordinate vector with the input feature map to obtain a spliced feature map; The convolution kernel of the coordinated coordinate convolution is used to perform a convolution operation on the spliced feature map to construct the low-illumination target detection model.

6. A low-light target detection system based on YOLOv7-tiny, characterized in that: Executing the method according to claim 1, comprising: A preset data set acquisition module is used to acquire a preset data set and preprocess the preset data set to determine a training set, a validation set, and a test set; A low-light target detection model generation module is used to introduce a preset backbone network part, a preset neck structure, and coordinated coordinate convolution into the preset YOLOv7-tiny detection model to generate a low-light target detection model; A target detection model generation module is used to train the low-light target detection model based on the training set and the validation set to generate a target detection model; The detection result generation module is used to obtain the image information to be detected, detect the image information to be detected according to the target detection model and obtain the detection result.

7. A computer device, characterized in that: The device comprises: a memory and a processor, wherein the processor executes the method according to any one of claims 1 to 5 when running computer instructions stored in the memory.

8. A computer-readable storage medium, characterized in that The method comprises instructions which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Improved YOLOv5 target detection method suitable for low-illumination environment

    CN115512206A

  • Lightweight low-illumination target detection method

    CN118365864A