Training method, device, equipment and medium for low-light vehicle image detection model

By training the vehicle detection model in a low-illumination environment, using semantic segmentation, feature fusion and contextual attention network, combined with the adaptive moment estimation algorithm optimizer and the intersection ratio loss function, the problem of low low-illumination vehicle detection accuracy is solved and achieved Provides higher detection accuracy and more precise vehicle location identification.

CN118397403BActive Publication Date: 2024-09-17ZENMORN (HEFEI) TECH CO LTD
View PDF 16 Cites 0 Cited by

Patent Information

Application Number
CN202410864682.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-09-17
Estimated Expiration
2044-07-01

AI Technical Summary

Technical Problem

In a low-illumination environment, the detection accuracy of existing vehicle detection models is reduced, and due to the angle of the camera's field of view, the target is easily blocked, resulting in uncertain vehicle boundary contours and inability to achieve accurate detection.

Method used

A training method for low-illumination vehicle image detection model is adopted, including obtaining a vehicle image data set in a preset environment for preprocessing, constructing an initial vehicle image detection model, and passing the adaptive moment estimation algorithm optimizer and binary cross-entropy loss Functions and other technical means are used to generate target vehicle image detection models, and semantic segmentation, feature fusion and contextual attention networks are used to extract and classify vehicle location information.

Benefits of technology

It improves the accuracy of vehicle detection in low-illumination environments, solves the problem of poor detection results of conventional vehicle detection algorithms in specific scenes, and achieves higher detection accuracy by enhancing the positional relationship of multiple camera devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397403B
    Figure CN118397403B
Patent Text Reader

Abstract

The present invention provides a training method, device, equipment and medium for a low-light vehicle image detection model, wherein the training method comprises: obtaining an image data set of vehicles under a preset environment; preprocessing the image data set to generate a training data set; constructing an initial vehicle image detection model, and configuring an optimizer and a loss function of the initial vehicle image detection model; using the training data set as an input variable of the initial vehicle image detection model, training the initial vehicle image detection model, and generating a target vehicle image detection model. The present invention improves the accuracy of vehicle detection in a low-light environment, and solves the problem of poor detection effect of conventional vehicle detection algorithms when applied to specific scene images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a training method, device, equipment and medium for a low-illuminance vehicle image detection model. Background Art

[0002] With the continuous development of computer vision technology, monitoring and capturing vehicle images at various road stations and performing a series of detection and recognition technologies on vehicles have been widely used. However, in low-light environments, such as at night or in areas with poor lighting, the background color in the captured images is dark and the outline of the vehicle is difficult to distinguish, which greatly reduces the accuracy of conventional deep learning model detection. It is difficult for existing detection methods to accurately identify the location of the vehicle. At the same time, due to the camera's field of view angle, the target is easily blocked by other objects, resulting in uncertainty in the boundary outlines of different targets, making it impossible to accurately detect the vehicle. Therefore, there is room for improvement. Summary of the invention

[0003] In view of the above shortcomings of the prior art, the present invention provides a training method, device, equipment and medium for a low-light vehicle image detection model to solve the above technical problems.

[0004] The present invention provides a method for training a lane line recognition model, comprising:

[0005] Obtain an image dataset of vehicles in a preset environment;

[0006] Preprocessing the image data set to generate a training data set;

[0007] Constructing an initial vehicle image detection model, and configuring an optimizer and a loss function of the initial vehicle image detection model;

[0008] The training data set is used as an input variable of the initial vehicle image detection model, the initial vehicle image detection model is trained, and a target vehicle image detection model is generated.

[0009] In one embodiment of the present invention, the step of acquiring an image dataset of a vehicle in a preset environment comprises:

[0010] Acquire a vehicle image in a preset environment, wherein the environment is at night or in an environment with poor lighting conditions;

[0011] Performing labeling processing on the vehicle image to generate the image data set, wherein the image data set includes a plurality of image data;

[0012] The image data set is divided into a training image set, a verification image set and a test image set according to a preset ratio.

[0013] In one embodiment of the present invention, the step of using the training data set as an input variable of the initial vehicle image detection model, training the initial vehicle image detection model, and generating a target vehicle image detection model comprises:

[0014] Setting a model training strategy and inputting the training data set into the initial vehicle image detection model;

[0015] Performing feature extraction processing on vehicle images in a training data set through an encoder of the initial vehicle image detection model to generate a multi-scale feature image;

[0016] Refining the multi-scale feature image to generate multi-scale refined features, wherein the multi-scale refined features represent the position information of the vehicle;

[0017] The multi-scale refined features are fused and classified to generate a vehicle segmentation map.

[0018] In one embodiment of the present invention, the step of performing a thinning process on the multi-scale feature image to generate a multi-scale thin feature, wherein the multi-scale thin feature represents the position information of the vehicle comprises:

[0019] The multi-scale feature images are fused through a decoder of the initial vehicle image detection model to generate boundary information of the vehicle;

[0020] The multi-scale feature map and the boundary information are fused to generate the multi-scale refined features.

[0021] In one embodiment of the present invention, the step of fusing and classifying the multi-scale refined features to generate a vehicle segmentation map includes:

[0022] Through the contextual attention network, multi-scale refined features are fused layer by layer in a preset order to generate a fused feature map;

[0023] Each pixel of the fused feature map is classified through a convolutional layer to generate the vehicle segmentation map.

[0024] In one embodiment of the present invention, the step of configuring the optimizer and loss function of the initial vehicle image detection model comprises:

[0025] Setting the optimizer of the initial vehicle image detection model to an adaptive moment estimation algorithm optimizer;

[0026] The loss function of the initial vehicle image detection model is set according to a binary cross entropy loss function, an intersection-over-union loss function, and a boundary loss function.

[0027] In one embodiment of the present invention, the loss function of the initial vehicle image detection model is Satisfies the following formula:

[0028]

[0029] in, represents the binary cross entropy loss function, represents the intersection-over-union loss function, represents the boundary loss function, Represents the ratio of boundary loss.

[0030] The present invention also provides a training system for a low-light vehicle image detection model, comprising:

[0031] An image acquisition module, used to acquire an image dataset of a vehicle under a preset environment;

[0032] A data processing module, used for preprocessing the image data set to generate a training data set;

[0033] A model building module, used to build an initial vehicle image detection model and configure an optimizer and a loss function of the initial vehicle image detection model;

[0034] The model training module is used to use the training data set as an input variable of the initial vehicle image detection model, train the initial vehicle image detection model, and generate a target vehicle image detection model.

[0035] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the training method for the low-light vehicle image detection model as described in any one of the above items when executing the computer program.

[0036] The present invention also provides a computer-readable storage medium, which stores a computer program, characterized in that when the computer program is executed by a processor, the steps of the training method of the low-light vehicle image detection model as described in any of the above items are implemented.

[0037] In summary, the training method, device, equipment and medium of a low-light vehicle image detection model of the present invention have the following beneficial effects: the present invention improves the accuracy of vehicle detection in low-light environments and solves the problem of poor detection effect when conventional vehicle detection algorithms are applied to specific scene images. In addition, the present invention also utilizes the positional relationship of multiple camera devices to implement enhanced operations during testing, perform more accurate predictions, and achieve higher detection accuracy.

[0038] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings herein are incorporated into and constitute a part of the specification, showing embodiments consistent with the present invention, and together with the specification, are used to explain the principles of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, further understanding of the present invention can be obtained based on these drawings without creative work. In the drawings:

[0040] Figure 1 Shown is a flow chart of a training method for a low-illumination vehicle image detection model provided by the present invention.

[0041] Figure 2 Display as Figure 1 A flowchart of a specific implementation of step S100 is shown in FIG.

[0042] Figure 3 Display as Figure 1 A flowchart of a specific implementation of step S300 is shown in FIG.

[0043] Figure 4 Display as Figure 1 A flowchart of a specific implementation of step S400 is shown in FIG.

[0044] Figure 5 Display as Figure 4 A flowchart of a specific implementation of step S430 in FIG.

[0045] Figure 6 Shown is a schematic diagram of a network encoder and feature fusion in one embodiment of the present invention.

[0046] Figure 7 Shown is a schematic diagram of feature fusion guided by boundary information in one embodiment of the present invention.

[0047] Figure 8 Display as Figure 4 A flowchart of a specific implementation of step S440 in FIG.

[0048] Fig. 9 Shown is a schematic diagram of a contextual attention fusion module in one embodiment of the present invention.

[0049] Fig.10 Shown is a structural schematic diagram of a training system for a low-illumination vehicle image detection model provided by the present invention.

[0050] Fig.11A schematic diagram of a computer device according to the present invention is shown.

[0051] Fig.12 A schematic diagram of another computer device according to the present invention is shown. DETAILED DESCRIPTION

[0052] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents described in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0053] The illustrations provided in the following embodiments are only used to schematically illustrate the basic concept of the present invention. Therefore, the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout type may also be more complicated.

[0054] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present invention. It is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0055] See also Figure 1 As shown, Figure 1 Shown is a flow chart of a training method for a low-light vehicle image detection model provided by the present invention. The present invention provides a training method for a low-light vehicle image detection model, which uses technical means such as semantic segmentation, feature fusion, attention mechanism, and test-time enhancement to achieve accurate detection of vehicles passing through roads and bridges under low-light conditions. The present invention improves the accuracy of vehicle detection under low-light conditions and solves the problem of poor detection effect of conventional vehicle detection algorithms when applied to specific scene images. The training method for a low-light vehicle image detection model provided by the present invention may include the following steps:

[0056] Step S100, obtaining an image dataset of a vehicle under a preset environment;

[0057] Step S200, preprocessing the image data set to generate a training data set;

[0058] Step S300: construct an initial vehicle image detection model, and configure an optimizer and a loss function of the initial vehicle image detection model;

[0059] Step S400: Using the training data set as an input variable of the initial vehicle image detection model, training the initial vehicle image detection model to generate a target vehicle image detection model.

[0060] See also Figure 2 As shown, Figure 2 Display as Figure 1 In one embodiment of the present invention, when step S100 is executed, an image data set of a vehicle under a preset environment is obtained. Specifically, it may include steps S110 to S130, which are described in detail as follows:

[0061] Step S110, acquiring a vehicle image in a preset environment, wherein the environment is nighttime or an environment with poor lighting conditions;

[0062] Step S120, performing label marking processing on the vehicle image to generate the image data set, wherein the image data set includes a plurality of image data;

[0063] Step S130: dividing the image data set into a training image set, a verification image set and a test image set according to a preset ratio.

[0064] In one embodiment of the present invention, when executing steps S110 to S130. Specifically, firstly, a plurality of intelligent traffic camera devices are used to collect vehicle images. For example, vehicles passing by the road bridge can be photographed by cameras installed on the road bridge, traffic lights or mobile monitoring vehicles, so as to generate vehicle images under a preset environment. In this embodiment, the preset environment is a low-light environment such as nighttime or poor lighting conditions. Then, a picture annotation tool is used to perform label annotation processing on the obtained vehicle images in the low-light environment to generate corresponding image data. In this embodiment, the picture annotation tool can use the open source image annotation tool Labelme. The image data may include vehicle images and label images corresponding to the vehicle images. Multiple image data are integrated to generate an image data set.

[0065] Furthermore, since there are a large number of images in the image data, it is necessary to allocate them and divide them into a training image set, a verification image set, and a test image set according to a preset ratio. For example, the preset ratio may be 4:1:1, that is, the ratio of the number of image data in the training image set, the number of image data in the verification image set, and the number of image data in the test image set may be 4:1:1. The specific size of the preset ratio may not be limited, as long as it can meet the requirements for training the vehicle image detection model. The m vehicle images in the training image set can be expressed as , the corresponding m label images can be expressed as ,in, Indicates the first vehicle images, Indicates the first The label image of the vehicle image, The n vehicle images in the validation image set can be represented as , the corresponding n label images can be expressed as ,in Indicates the first vehicle images, Indicates the first The label image of the vehicle image, The test image set may include a plurality of vehicle images for testing. In this embodiment, the test image samples may be randomly selected from most scenes by average sampling.

[0066] In one embodiment of the present invention, when executing step S200, the image data set is preprocessed to generate a training data set. Specifically, all image data in the image data set can be resized and normalized so that each vehicle image and its corresponding label image are unified into a preset size. In this embodiment, the preset size can be set to 352 352, so as to facilitate the convergence of the model.

[0067] In one embodiment of the present invention, when executing step S300, an initial vehicle image detection model is constructed based on the self-attention mechanism, and an optimizer and a loss function of the initial vehicle image detection model are configured. Specifically, an encoder-decoder is constructed to construct the initial vehicle image detection model. In this embodiment, the encoder adopts a transformer encoder. Then, the optimizer and the loss function of the initial vehicle image detection model are configured.

[0068] See also Figure 3 As shown, Figure 3 Display as Figure 1In one embodiment of the present invention, step S300 may include steps S310 to S320, which are described in detail as follows:

[0069] Step S310, setting the optimizer of the initial vehicle image detection model to an adaptive moment estimation algorithm optimizer;

[0070] Step S320, setting the loss function of the initial vehicle image detection model according to the binary cross entropy loss function, the intersection-over-union loss function and the boundary loss function.

[0071] In one embodiment of the present invention, when executing step S310 to step S320. Specifically, first, the optimizer of the initial vehicle image detection model can be set to an adaptive moment estimation algorithm (Adam) optimizer. The Adam optimizer combines the ideas of the RMSProp and Momentum optimization algorithms, and normalizes the update of the parameters so that each parameter update has a similar magnitude. The learning rate can be adjusted according to the historical gradient information, thereby improving the training effect. Among them, the initial learning rate is set to Then, the final loss function can be calculated and set according to the binary cross entropy loss function, the intersection-over-union loss function and the boundary loss function. In this embodiment, the binary cross entropy loss function The following formula can be satisfied:

[0072]

[0073] in, Indicates the vehicle image The true value of each pixel, Indicates the vehicle image The predicted value of each pixel.

[0074] In this embodiment, the intersection-over-union loss function The following formula can be satisfied:

[0075]

[0076] in, Represents the true value area in a vehicle image With prediction area The intersection of Represents the true value area in a vehicle image With prediction area The union of .

[0077] In this embodiment, the boundary loss function The following formula can be satisfied:

[0078]

[0079] in, and Represent the true value and predicted value of the boundary respectively.

[0080] In this embodiment, the final loss function is The following formula can be satisfied:

[0081]

[0082] in, Represents the number of all pixels in the input vehicle image, , and Respectively represent the width and height of the input vehicle image, represents the ratio of boundary loss. In this embodiment, The value of can be 3.

[0083] See also Figure 4 As shown, Figure 4 Display as Figure 1 In one embodiment of the present invention, when executing step S400, the training data set is used as the input variable of the initial vehicle image detection model, the initial vehicle image detection model is trained, and the target vehicle image detection model is generated. Specifically, step S400 may include steps S410 to S440, which are described in detail as follows:

[0084] Step S410, setting a model training strategy, and inputting the training data set into the initial vehicle image detection model;

[0085] Step S420: performing feature extraction processing on the vehicle images in the training data set through the encoder of the initial vehicle image detection model to generate a multi-scale feature image;

[0086] Step S430: performing a thinning process on the multi-scale feature image to generate a multi-scale thinning feature, wherein the multi-scale thinning feature represents the position information of the vehicle;

[0087] Step S440: fusing and classifying the multi-scale refined features to generate a vehicle segmentation map.

[0088] In one embodiment of the present invention, when step S410 is executed, the model training strategy is set, and the training data set is input into the initial vehicle image detection model. Specifically, first, a model training strategy can be formulated according to the preset ratio of 4:1 between the training image set and the verification image set. In this embodiment, it is set to start from the 10th epoch, and the current model accuracy is calculated on the verification image set after each epoch and the model accuracy is retained. Among them, epoch represents the process of training once using all the samples in the training image set. After each epoch, the current model accuracy is calculated and compared with the previous model accuracy. If the accuracy of the latter model exceeds the progress of the previous model, the previous model is replaced, otherwise the previous model is retained. Model accuracy is expressed in , , as well as As the evaluation criteria, in this embodiment, the model training is set for a total of 60 epochs, and the learning rate decay is set at the 40th epoch, and the decay factor is 5.0. Then, the training data set is used as the input variable of the initial vehicle image detection model, and the initial vehicle image detection model is trained and optimized according to the above model training strategy, so that the model is suitable for detecting vehicle images in low-light environments. In this embodiment, the model training is performed based on the training image set, and the model accuracy is verified based on the verification image set. At the same time, the model saves the optimal weights and records the accuracy of the training image set and the verification set, which is convenient for parameter adjustment, and finally obtains the target vehicle image detection model that meets the preset accuracy requirements.

[0089] In one embodiment of the present invention, when step S420 is executed, the encoder of the initial vehicle image detection model performs feature extraction processing on the vehicle images in the training data set to generate a multi-scale feature image. Specifically, the network encoder of the initial vehicle image detection model adopts a transformer encoder, and the network encoder performs feature extraction processing on the images in the training data set. The transformer encoder extracts features based on the PVT v2 network, and can downsample the images in the training data set a total of 4 times to obtain a multi-scale feature image. The multi-scale feature image can be recorded as ,in, The size is In this embodiment, it is defined as ( , ) is a low-level feature map, and ( , ) is a high-level feature map.

[0090] See also Figure 5 , Figure 5 Display as Figure 4In one embodiment of the present invention, when executing step S430, the multi-scale feature image is refined to generate multi-scale refined features, and the multi-scale refined features represent the position information of the vehicle. Specifically, step S430 may include steps S431 to S432, which are described in detail as follows:

[0091] Step S431: fusing the multi-scale feature map through the decoder of the initial vehicle image detection model to generate boundary information of the vehicle;

[0092] Step S432: fusing the multi-scale feature map and the boundary information to generate the multi-scale refined feature.

[0093] See also Figure 6 , Figure 6 The diagram shows a schematic diagram of a network encoder and feature fusion in one embodiment of the present invention. In one embodiment of the present invention, when step S431 is executed, the multi-scale feature map is fused to generate the boundary information of the vehicle. Specifically, the multi-scale feature maps 101 with different sizes are fused to obtain the boundary information 102 of the vehicle. First, for the low-level feature map ( , ), two 1×1 convolutional layers are used to compress the channels to 64 channels, and then the high-level feature map ( , ) is compressed to 256 channels. This results in two 64-channel feature maps ( , ) and two 256-channel feature maps ( , Then, all feature maps ( , , , ) upsampled to , and the four feature maps ( , , , ) are concatenated to integrate multi-scale features. Figure 6 In , C represents the channel connection operation and U represents the upsampling operation. Finally, two 3×3 convolutional layers and one 1×1 convolutional layer are used to obtain boundary information. In this embodiment, the fusion process of the multi-scale feature map can satisfy the following formula:

[0094]

[0095] in, Multi-scale feature maps extracted for the network encoder, represents a convolutional layer, represents the upsampling operation, express , thus the boundary information of the vehicle can be obtained, and the boundary information of the vehicle can be used as a priori information for the subsequent vehicle detection.

[0096] See also Figure 7 , Figure 7 The diagram is a schematic diagram of the boundary information guiding feature fusion in one embodiment of the present invention. In one embodiment of the present invention, when executing step S432, the multi-scale feature map 101 and the boundary information 102 are fused to generate the multi-scale refined feature 103. Specifically, first, the multi-scale feature map 101 and the boundary information 102 are fused to generate the multi-scale refined feature 103. The multi-scale features in the encoding stage are combined with the vehicle boundary information in the decoding stage by using the jump connection method. (Feature addition) operation to obtain fusion features . Then, the receptive field of the feature map is enhanced by the convolution module. In this embodiment, the convolution module is composed of a series of parallel hole convolutions. The convolution module can use three hole convolution layers with different rates, for example, 6, 12, and 18 respectively. In addition, the maximum pooling layer can be used to obtain local separation features. After connecting all features in the channel dimension, a 1×1 convolution can be used to obtain multi-scale refined features with a clearer receptive field, that is, to generate the location information of the vehicle. In this embodiment, the multi-scale feature map and the vehicle boundary information are fused to generate multi-scale refined features, which can satisfy the following formula:

[0097]

[0098]

[0099] in, represents the input features, Represents the communication strategy, is the convolutional layer. With different expansion rates The dilated convolutional layer, represents the maximum pooling layer, which can output multi-scale refined features with a higher receptive field, thereby obtaining the vehicle's location information.

[0100] See also Figure 8 , Figure 8 Display as Figure 4 In one embodiment of the present invention, when executing step S440, the multi-scale refined features are fused and classified to generate a vehicle segmentation map. Specifically, step S440 may include steps S441 to S442, which are described in detail as follows:

[0101] Step S441: Through the context attention network, multi-scale refinement features are fused layer by layer in a preset order to generate a fused feature map;

[0102] Step S442: classify each pixel of the fused feature map through a convolutional layer to generate the vehicle segmentation map.

[0103] See also Fig. 9 , Fig. 9 Shown is a schematic diagram of a contextual attention fusion module in one embodiment of the present invention. In one embodiment of the present invention, when step S441 is executed, the multi-scale refined features are fused layer by layer in a preset order through the contextual attention network to generate a fused feature map. Specifically, a strategy of layer-by-layer fusion from high to low can be adopted for multi-scale refined features. In this embodiment, feature fusion is performed through a contextual attention network, and a two-stage fusion method is adopted. Among them, in the first stage, the high-level features are first upsampled to the same size as the low-level features, and then fused through a contextual attention module. The output of the first stage is The following formula can be satisfied:

[0104]

[0105] in, represents the contextual attention module, and is the input feature, represents two upsampling operations, and They refer to element-wise addition and element-wise multiplication, respectively.

[0106] In the second stage, the output of the first stage is used as the input of the context attention module. The same operation as the first stage is first applied. Then, the output feature is input into a 3×3 convolution layer. Finally, batch normalization is performed and the ReLU (Rectified linear unit) activation function is used to obtain the cross-level fusion feature of the second stage. , that is, generating a fusion feature map. The second stage of cross-level fusion feature The following formula can be satisfied:

[0107]

[0108] in, represents convolution, batch normalization and ReLU activation functions, is the output of the first stage.

[0109] In one embodiment of the present invention, when step S442 is executed, each pixel of the fused feature map is classified through the convolution layer to generate the vehicle segmentation map. Specifically, the final convolution layer of the deep neural network is mapped to the original image, and each pixel of the fused feature map is classified to obtain the final vehicle segmentation map.

[0110] Furthermore, in one embodiment of the present invention, a trained target vehicle image detection model can be used to determine whether a pixel in an input image belongs to a target to be extracted. Specifically, the target vehicle image detection model is embedded in a detection device to perform real-time vehicle detection, and a test enhancement operation is performed on the overlapping area to obtain a more accurate detection result. In this embodiment, first, after the last layer of the decoder of the target vehicle image detection model, a Function, calculates the confidence of the pixel and limits it to between 0 and 1:

[0111]

[0112] in, Indicates the first Pixels The target confidence is calculated to obtain the probability value of a positive sample, and a threshold is set to define the target and the non-target.

[0113] Then, different real-time vehicle detection inferences are performed based on the relationship between the camera position and the actual image load area. If overlapping areas are generated , while performing the test to enhance the operation:

[0114]

[0115] Among them, for the overlapping area in the feature map One-to-one corresponding pixels The target confidence is calculated to obtain the probability value of a positive sample. Finally, through the overlapping area The pixel points are calculated multiple times to obtain the average confidence level, which improves the final detection accuracy and obtains more accurate detection results.

[0116] See also Fig.10 , Fig.10 The structure diagram of the training system of a low-light vehicle image detection model provided by the present invention is shown. The present invention also provides a training device for a low-light vehicle image detection model, and the training device corresponds to the training method in the above embodiment. The training device may include an image acquisition module 201, a data processing module 202, a model construction module 203, and a model training module 204. The functional modules are described in detail as follows:

[0117] The image acquisition module 201 can be used to acquire an image dataset of a vehicle in a preset environment. Further, the image acquisition module 201 can be specifically used to acquire vehicle images in a preset environment, wherein the environment is nighttime or an environment with poor lighting conditions; perform labeling processing on the vehicle images to generate the image dataset, wherein the image dataset includes multiple image data; and divide the image dataset into a training image set, a verification image set, and a test image set according to a preset ratio.

[0118] The data processing module 202 may be used to preprocess the image data set to generate a training data set. Specifically, the data processing module 202 may resize and normalize all image data in the image data set so that each vehicle image and its corresponding label image are unified into a preset size. In this embodiment, the preset size may be set to 352×352 to facilitate the convergence of the model.

[0119] The model building module 203 can be used to build an initial vehicle image detection model and configure the optimizer and loss function of the initial vehicle image detection model. Further, the model building module 203 can be specifically used to set the optimizer of the initial vehicle image detection model to an adaptive moment estimation algorithm optimizer; and set the loss function of the initial vehicle image detection model according to a binary cross entropy loss function, an intersection-over-union loss function, and a boundary loss function.

[0120] The model training module 204 can be used to use the training data set as an input variable of the initial vehicle image detection model, train the initial vehicle image detection model, and generate a target vehicle image detection model. Further, the model training module 204 can be specifically used to set a model training strategy, and input the training data set into the initial vehicle image detection model; perform feature extraction processing on the vehicle image in the training data set through the encoder of the initial vehicle image detection model to generate a multi-scale feature image; perform refinement processing on the multi-scale feature image to generate multi-scale refinement features, and the multi-scale refinement features represent the location information of the vehicle; perform fusion classification processing on the multi-scale refinement features to generate a vehicle segmentation map.

[0121] For the specific definition of the training device, please refer to the definition of the training method above, which will not be repeated here. Each module in the above training device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0122] See also Fig.11As shown, the present invention also provides a computer device, which can be a server. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes non-volatile and / or volatile storage media, and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client through a network connection. When the computer program is executed by the processor, it implements the functions or steps of a training method for a low-light vehicle image detection model.

[0123] See also Fig.12 As shown, the present invention also provides another computer device, which can be a client. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a training method for a low-light vehicle image detection model.

[0124] In one embodiment of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0125] Obtain an image dataset of vehicles in a preset environment;

[0126] Preprocessing the image data set to generate a training data set;

[0127] Constructing an initial vehicle image detection model, and configuring an optimizer and a loss function of the initial vehicle image detection model;

[0128] The training data set is used as an input variable of the initial vehicle image detection model, the initial vehicle image detection model is trained, and a target vehicle image detection model is generated.

[0129] In one embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0130] Obtain an image dataset of vehicles in a preset environment;

[0131] Preprocessing the image data set to generate a training data set;

[0132] Constructing an initial vehicle image detection model, and configuring an optimizer and a loss function of the initial vehicle image detection model;

[0133] The training data set is used as an input variable of the initial vehicle image detection model, the initial vehicle image detection model is trained, and a target vehicle image detection model is generated.

[0134] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device can be found in the aforementioned method embodiments. To avoid repetition, they will not be described one by one here.

[0135] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0136] In summary, the present invention provides a training method, device, equipment and medium for a low-light vehicle image detection model, which can be applied to the field of image processing technology. The present invention uses technical means such as semantic segmentation, feature fusion, attention mechanism and test-time enhancement to realize low-light road and bridge vehicle detection, improve the accuracy of vehicle detection under low illumination, and solve the problem of poor detection effect of conventional vehicle detection algorithms applied to specific scene images. Based on the encoder-decoder model based on deep learning, the category of each pixel is automatically obtained according to the image captured by the camera device. By fusing different deep features, more representative image features are obtained. By setting different weights on the binary cross entropy loss function, the intersection-over-union loss function and the boundary loss to obtain a set loss function, the training effect of the model is more stable and the effect is better. At the same time, the positional relationship of multiple camera devices is used to realize the test-time enhancement operation, make more accurate predictions, and achieve higher detection accuracy.

[0137] In the description of this specification, the description with reference to the terms "this embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0138] The embodiments of the present invention disclosed above are only used to help illustrate the present invention. The embodiments do not describe all the details in detail, nor do they limit the invention to specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A training method for a low-light vehicle image detection model, characterized in that: include: Acquire an image dataset of vehicles in a preset environment, wherein the environment is at night or in an environment with poor lighting conditions; Preprocessing the image data set to generate a training data set; Constructing an initial vehicle image detection model, and configuring an optimizer and a loss function of the initial vehicle image detection model; Using the training data set as an input variable of the initial vehicle image detection model, training the initial vehicle image detection model, and generating a target vehicle image detection model; The step of using the training data set as an input variable of the initial vehicle image detection model, training the initial vehicle image detection model, and generating a target vehicle image detection model comprises: Setting a model training strategy and inputting the training data set into the initial vehicle image detection model; Performing feature extraction processing on vehicle images in a training data set through an encoder of the initial vehicle image detection model to generate a multi-scale feature image; Refining the multi-scale feature image to generate multi-scale refined features, wherein the multi-scale refined features represent the position information of the vehicle; The multi-scale refined features are fused and classified to generate a vehicle segmentation map; The step of performing a thinning process on the multi-scale feature image to generate a multi-scale thinning feature, wherein the multi-scale thinning feature represents the position information of the vehicle comprises: The multi-scale feature images are fused through a decoder of the initial vehicle image detection model to generate boundary information of the vehicle; Fusing the multi-scale feature map and the boundary information to generate the multi-scale refined features; The step of fusing and classifying the multi-scale refined features to generate a vehicle segmentation map comprises: Through the contextual attention network, multi-scale refined features are fused layer by layer in a preset order to generate a fused feature map; Classifying each pixel of the fused feature map through a convolutional layer to generate the vehicle segmentation map; The steps of constructing an initial vehicle image detection model and configuring an optimizer and a loss function of the initial vehicle image detection model include: Setting the optimizer of the initial vehicle image detection model to an adaptive moment estimation algorithm optimizer; Setting the loss function of the initial vehicle image detection model according to a binary cross entropy loss function, an intersection-over-union loss function, and a boundary loss function; The loss function of the initial vehicle image detection model Satisfies the following formula: Where N represents the number of all pixels in the input vehicle image, N=W×H, W and H represent the width and height of the input vehicle image respectively, and λ represents the ratio of the boundary loss. Represents the binary cross entropy loss function, satisfying the following formula: in, Indicates the vehicle image The true value of each pixel, Indicates the vehicle image The predicted value of each pixel, Represents the intersection-over-union loss function, which satisfies the following formula: Among them, A∩B represents the intersection of the true value area A and the predicted area B in a vehicle image, and A∪B represents the union of the true value area A and the predicted area B in a vehicle image. Represents the boundary loss function, which satisfies the following formula: in, and represent the true value and predicted value of the boundary respectively.

2. The training method for the low-light vehicle image detection model according to claim 1, characterized in that: The step of obtaining an image dataset of a vehicle under a preset environment comprises: Acquire vehicle images in a preset environment; Performing labeling processing on the vehicle image to generate the image data set, wherein the image data set includes a plurality of image data; The image data set is divided into a training image set, a verification image set and a test image set according to a preset ratio.

3. A training system for a low-light vehicle image detection model, characterized in that: include: An image acquisition module is used to acquire an image data set of a vehicle in a preset environment, wherein the environment is nighttime or an environment with poor lighting conditions; A data processing module, used for preprocessing the image data set to generate a training data set; A model building module, used to build an initial vehicle image detection model and configure an optimizer and a loss function of the initial vehicle image detection model; A model training module, used to use the training data set as an input variable of the initial vehicle image detection model, train the initial vehicle image detection model, and generate a target vehicle image detection model; Wherein, the model training module is also used to set a model training strategy and input the training data set into the initial vehicle image detection model; Performing feature extraction processing on vehicle images in a training data set through an encoder of the initial vehicle image detection model to generate a multi-scale feature image; Refining the multi-scale feature image to generate multi-scale refined features, wherein the multi-scale refined features represent the position information of the vehicle; The multi-scale refined features are fused and classified to generate a vehicle segmentation map The model training module is also used to fuse the multi-scale feature images through the decoder of the initial vehicle image detection model to generate boundary information of the vehicle; Fusing the multi-scale feature map and the boundary information to generate the multi-scale refined features; The model training module is also used to fuse multi-scale refined features layer by layer in a preset order through a context attention network to generate a fused feature map; Classifying each pixel of the fused feature map through a convolutional layer to generate the vehicle segmentation map; The model building module is also used to set the optimizer of the initial vehicle image detection model to an adaptive moment estimation algorithm optimizer; Setting the loss function of the initial vehicle image detection model according to a binary cross entropy loss function, an intersection-over-union loss function, and a boundary loss function; The loss function of the initial vehicle image detection model Satisfies the following formula: Where N represents the number of all pixels in the input vehicle image, N=W×H, W and H represent the width and height of the input vehicle image respectively, and λ represents the ratio of the boundary loss. Represents the binary cross entropy loss function, satisfying the following formula: in, Indicates the vehicle image The true value of each pixel, Indicates the vehicle image The predicted value of each pixel, Represents the intersection-over-union loss function, which satisfies the following formula: Among them, A∩B represents the intersection of the true value area A and the predicted area B in a vehicle image, and A∪B represents the union of the true value area A and the predicted area B in a vehicle image. Represents the boundary loss function, which satisfies the following formula: in, and represent the true value and predicted value of the boundary respectively.

4. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the training method of the low-light vehicle image detection model as described in any one of claims 1 to 2 are implemented.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the training method of the low-light vehicle image detection model as described in any one of claims 1 to 2 are implemented.

Citation Information

Patent Citations

  • Rapid vehicle detection method based on deep learning

    CN111461083A

  • Image visual semantic segmentation method based on two-way region attention coding and decoding

    CN113065578A

  • Improved vehicle type identification method based on Faster RCNN deep learning network

    CN113205026A

  • Multi-scale parallel feature fusion road sign detection method based on YOLO

    CN113762209A

  • Aerial photography vehicle target detection method and system and storage medium

    CN114005094A