A target detection system and method under special environment
By introducing the teacher-student network principle into the target detection system, and using the joint training of the teacher network and the student network, the challenge of target detection under special weather conditions is solved, and the accuracy and applicability of target detection is improved without increasing the reasoning time.
Patent Information
- Application Number
- CN202410533635.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-04-30
AI Technical Summary
Under special weather conditions, such as haze and rainy and snow environments, traditional object detection algorithms are difficult to detect targets from low-quality images, and existing solutions have problems of difficult balance between image enhancement and object detection tasks, resulting in increased inference time.
The principle of teacher-student network is adopted, and the clear image features in normal environments are learned through teacher networks, and the blurred image features in special environments of student network learning are realized end-to-end training, and the initial object detection model is generated, and the teacher network is removed in the inference stage, only the student network and detection network are retained, and object detection is performed.
This method increases the training time of the model during the training stage, but does not require a teacher network during the inference stage, so it does not increase the inference time of the object detection network. It is suitable for any object detection network and has a wide range of applications.
Smart Images

Figure CN118314420B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of target detection, and in particular to a target detection system and method under special conditions. Background Art
[0002] In recent years, deep learning-based object detection algorithms have become very popular, such as the YOLO series, SSD, and CenterNet. They not only achieve good performance on conventional datasets (benchmark datasets), but have also been deployed in actual scenarios such as autonomous driving. However, the images in conventional datasets are basically high-quality images under good lighting, while the quality of camera sensors is limited under special weather conditions, and sensor noise increases in areas with sparse lighting and at night. Therefore, under special weather conditions such as darkness, haze, rain and snow, traditional object detection algorithms find it difficult to detect targets from low-quality images taken under special environments. Therefore, object detection based on deep learning is still challenging.
[0003] In order to solve this challenging problem, many algorithms have been proposed. There are generally two types of existing target detection algorithms suitable for special environments. One is to preprocess the image first, and then use the enhanced image to train the target detection algorithm; this method preprocesses the image before target detection to reduce the impact of special weather conditions. For example, the invention patent "Enhancement and refinement network and method for target detection in special weather conditions" (202310639454.2) proposes to use digital image processing technology to enhance the image before target detection. In order to retain more detailed features of the image during image enhancement, a feature refinement module based on Unet is used to enhance the fuzzy detail features. This method will have the problem that some potential information that is beneficial to target detection is ignored during the image restoration process.
[0004] The other is a joint image enhancement and target detection method, which trains the two sub-networks of image enhancement and target detection end-to-end at the same time. The two sub-networks are used to achieve visual effect enhancement and target detection respectively. This method reduces the feature degradation caused by image enhancement by sharing the feature extraction layer. However, the joint enhancement and target detection method has the problem of finding a balance between image enhancement tasks and target detection tasks during training. For example, in the DSNet model proposed in 2020, it is difficult to balance the weights of detection and restoration during training.
[0005] In summary, it is still challenging to locate targets in low-quality images taken under special weather conditions (such as haze, rain, and snow). Both existing solutions have certain problems. The first method cannot achieve end-to-end training using existing deep learning algorithms. Although the second method can achieve end-to-end training, it only achieves a simple combination of noise reduction and target detection, which will increase the inference time of the original target detection network. Summary of the invention
[0006] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a target detection system and method under a special environment. The system utilizes the principle of teacher-student network. At the same time, the student network is part of the target detection network. The target detection system will only increase the model training time, but no longer requires a teacher network in the reasoning stage, so it will not increase the reasoning time of the target detection network. It can be applied to any target detection network and has a wide range of applications.
[0007] In a first aspect, the present application provides a target detection system in a special environment, including a teacher network and a target detection network, wherein the target detection network includes a student network and a detection network;
[0008] The teacher network is used to learn the feature expressions of each layer of the deep neural network in a clear image under a normal environment;
[0009] The target detection network is used to identify targets in the image;
[0010] The student network is the backbone of the target detection network and is used to learn the feature mapping relationship between the blurred image in a special environment and the clear image in a normal environment;
[0011] The detection network is the remaining part of the target detection network, which is used to output the position and category of the target in the image;
[0012] The teacher network and the target detection network are trained end-to-end to obtain a trained initial target detection model;
[0013] When performing target detection in an image, the teacher network of the target detection initial model is removed to obtain a general target detection model, which includes a student network and a detection network. The target in the image is identified through the general target detection model.
[0014] Preferably, the teacher network is an autoencoder network, including an encoder and a decoder, and the encoder of the teacher network includes n residual feature extraction modules, Res ti represents the i-th residual feature extraction module of the teacher network, wherein i=1, 2, 3, ..., n, and n is a positive integer;
[0015] The student network is the encoder part of the teacher network. The encoder of the student network corresponds to the encoder of the teacher network one by one. The encoder of the student network includes n residual feature extraction modules. si represents the i-th residual feature extraction module of the student network.
[0016] Preferably, the target detection network can be any deep learning-based target detection network, including a single-stage target detection network and a two-stage target detection network.
[0017] Preferably, the teacher network and the target detection network adopt the specific training steps of end-to-end training as follows:
[0018] Step S1: constructing a clear image set, where the clear image set is a clear image under normal environment;
[0019] Step S2: using the clear image set to train the teacher network to obtain a teacher network model;
[0020] Step S3: constructing a paired data set of clear images and blurred images, wherein the paired data set of clear images and blurred images includes a clear image set and a blurred image set, and obtaining the blurred image set by synthesizing a corresponding blurred image under a special environment using each clear image with a target annotation in the clear image set;
[0021] Step S4: Based on the teacher network model, the object detection network is trained using the paired data set of clear images and blurred images.
[0022] Preferably, the clear image set is clear images in the open source dataset ImageNet or coco.
[0023] Preferably, in step S2, the training error function of the teacher network is L1, and the teacher network is trained until convergence to obtain the teacher network model.
[0024] Preferably, the step S4 specifically includes:
[0025] Step S41: inputting a clear image into the teacher network model, and the encoder of the teacher network outputs n clear image feature maps;
[0026] Step S42: inputting the blurred image corresponding to the clear image into the student network, and the encoder of the student network outputs n blurred image feature maps;
[0027] Step S43: calculating the error between the teacher network and the student network according to the n clear image feature maps output by the encoder of the teacher network and the n blurred image feature maps output by the encoder of the student network;
[0028] Step S44: inputting the n blurred image feature maps output by the encoder of the student network into the detection network, and calculating the target detection error of the blurred image according to the loss function of the target detection network;
[0029] Step S45: inputting the clear image into the student network, and the encoder of the student network outputs n clear image feature maps;
[0030] Step S46: inputting the n clear image feature maps output by the encoder of the student network into the detection network, and calculating the target detection error of the clear image according to the loss function of the target detection network;
[0031] Step S47: Calculate the overall error of the target detection network, the calculation formula is:
[0032] Loss total =αLoss st +(1-α)(Loss obj +Loss obj )
[0033] Among them: Loss total is the overall error of the target detection network; Loss st is the error between the teacher network and the student network; Loss obj is the target detection error of the blurred image; Loss obj_ is the target detection error of the clear image; α∈(0,1), which is used to balance the weight between image enhancement and target detection.
[0034] Step S48: using the overall error of the target detection network to update the model parameters of the student network and the detection network, the model parameters of the teacher network remain unchanged;
[0035] S49: Repeat steps S41 to S48 until the teacher network and the target detection network converge.
[0036] Preferably, the calculation formula for the error between the teacher network and the student network is:
[0037]
[0038] Where: i = 1, 2, 3, ..., n; c i 、w i 、h iRespectively represent the number of channels, width and height of the feature map obtained by the i-th residual feature extraction module; Feat ti Feat represents the clear image feature map output by the i-th residual feature extraction module of the encoder of the teacher network; si Represents the blurred image feature map output by the i-th residual feature extraction module of the encoder of the student network.
[0039] Preferably, the calculation formula for the error between the teacher network and the student network is:
[0040]
[0041] Where: i = 1, 2, 3, ..., n; c i 、w i 、h i Respectively represent the number of channels, width and height of the feature map obtained by the i-th residual feature extraction module; Feat ti Feat represents the clear image feature map output by the i-th residual feature extraction module of the encoder of the teacher network; si represents the blurred image feature map output by the i-th residual feature extraction module of the encoder of the student network; It means that only keep hard The value of the quantile, τ hard ∈[0, 1].
[0042] In a second aspect, the present application provides a method for detecting an object in a special environment, using any one of the target detection systems in a special environment, comprising the following steps:
[0043] Step 1: Training the target detection network to obtain the initial target detection model;
[0044] The target detection network includes a teacher network and a target detection network, and the target detection network includes a student network and a detection network;
[0045] The teacher network is used to learn the feature expressions of each layer of the deep neural network in a clear image under a normal environment;
[0046] The target detection network is used to identify targets in the image;
[0047] The student network is the backbone of the target detection network and is used to learn the feature mapping relationship between the blurred image in a special environment and the clear image in a normal environment;
[0048] The detection network is the remaining part of the target detection network, which is used to output the position and category of the target in the image;
[0049] The teacher network and the target detection network are trained end-to-end to obtain a trained initial target detection model;
[0050] Step 2: Modify the target detection model to obtain a general target detection model;
[0051] Removing the teacher network of the target detection model to obtain the target detection general model, wherein the target detection general model includes a student network and a detection network;
[0052] Step 3: Collect the image to be detected;
[0053] Step 4: Input the image to be detected into the general target detection model, and identify the target in the image through the general target detection model.
[0054] It can be seen from the above technical solutions that, compared with the prior art, the present invention provides a target detection system and method under special environment, and the beneficial effects include:
[0055] (1) In order to achieve end-to-end training of the image enhancement network and the target detection network, the present invention first trains the teacher network, and then uses the trained teacher network to train the student network of the target detection network and the detection network. During the entire model training process, the teacher network is trained separately and only needs to be trained once, which can be used for the training of target detection models in any vertical field, achieving a once-and-for-all effect.
[0056] (2) At the same time, in order to improve the progress of model training, the present invention sets a quantile in the error calculation process between the teacher network and the student network to make the model focus only on difficult samples, forcing the model to learn more difficult samples. This improves the training efficiency of the model and improves the accuracy of the model.
[0057] (3) The system uses the principle of teacher-student network, and the student network is part of the target detection network. This system only increases the training time of the system, but no longer requires the teacher network in the inference stage, so it does not increase the inference time of the target detection network. It can be applied to any target detection network and has a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0059] Figure 1A schematic diagram of a teacher network structure provided in an embodiment of the present invention.
[0060] Figure 2 A schematic diagram of the end-to-end training process provided by an embodiment of the present invention.
[0061] Figure 3 A schematic diagram of the process of S4 provided in an embodiment of the present invention.
[0062] Figure 4 A schematic diagram of training of S4 provided in an embodiment of the present invention.
[0063] Figure 5 A flowchart of a target detection method under a special environment provided by the present invention. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] As can be seen from the background technology, it is still challenging to locate targets in low-quality images taken under special weather conditions (such as haze, rain and snow). Both existing solutions have certain problems. The first method cannot achieve end-to-end training using existing deep learning algorithms. Although the second method can achieve end-to-end training, it only achieves a simple combination of noise reduction and target detection, which will increase the inference time of the original target detection network.
[0066] Therefore, the embodiment of the present invention provides a target detection system under special environment, such as Figure 1 As shown, it includes a teacher network and a target detection network. The target detection network includes a student network and a detection network.
[0067] The teacher network is used to learn the feature expressions of clear images in normal environments at each layer in the deep neural network;
[0068] The target detection network is used to identify the target in the image;
[0069] The student network is the backbone of the target detection network, which is used to learn the feature mapping relationship between blurry images in special environments and clear images in normal environments.
[0070] The detection network is the rest of the object detection network, which is used to output the location and category of the object in the image;
[0071] The teacher network and the target detection network are trained end-to-end to obtain a trained initial target detection model;
[0072] When performing target detection in an image, the teacher network of the initial target detection model is removed to obtain a general target detection model. The general target detection model includes a student network and a detection network. The target in the image is identified through the general target detection model.
[0073] The system uses the principle of teacher-student network. At the same time, the student network is part of the target detection network. The target detection system will only increase the model training time, but the teacher network is no longer required in the reasoning stage, so it will not increase the reasoning time of the target detection network. It can be applied to any target detection network and has a wide range of applications.
[0074] In this embodiment, the structural diagram of the teacher network is as follows: Figure 1 As shown in the figure, the teacher network is a self-encoding network, including an encoder and a decoder. The encoder of the teacher network contains n residual feature extraction modules, Res ti represents the i-th residual feature extraction module of the teacher network, where i=1, 2, 3,…, n, and n is a positive integer.
[0075] like Figure 1 As shown in the figure, the image is input into the encoder of the teacher network and compressed features are obtained through three convolutions. The compressed features are then input into the decoder and the output image is obtained through three convolution operations.
[0076] The student network structure can be referenced Figure 4 As shown in the figure, the student network is the encoder part of the teacher network. The encoder of the student network corresponds to the encoder of the teacher network one by one. The encoder of the student network contains n residual feature extraction modules. si represents the i-th residual feature extraction module of the student network.
[0077] In this embodiment, the number of residual feature extractions contained in the student network is consistent with that of the teacher network, and the feature dimensions of the output of each residual feature extraction module must be consistent. The internal network of each residual feature extraction module may be different from that of the teacher network.
[0078] The target detection network is used to identify targets in images. The target detection network can be any deep learning-based target detection network, including a single-stage target detection network and a two-stage target detection network.
[0079] In this embodiment, the target detection network includes a student network and a detection network. The student network is the backbone part of the target detection network, which is used to learn the feature mapping relationship between blurred images in special environments and clear images in normal environments. The detection network is the rest of the target detection network, which is used to output the position and category of the target in the image. The target detection network in this embodiment is a general solution that can be used for any target detection network. The target detection network is basically a convolutional neural network. The backbone part (student network) of the target detection network is consistent, but different target detection networks may adopt different solutions.
[0080] For example, in a two-stage target detection network, the target network system consists of a backbone network (student network), an RPN network (used to generate candidate boxes for the target), and a measurement network (used to output the position and category of the target in the image). In this embodiment, the detection network consists of an RPN network and a measurement network.
[0081] For example, in a single-stage target detection method, there is no RPN network. The target network system is composed of a backbone network (student network) and a measurement network (used to output the position and category of the target in the image). In this embodiment, the detection network is composed of the measurement network.
[0082] In order to realize the training of the teacher network and the target detection network, the specific training process of the teacher network and the target detection network in this embodiment using end-to-end training is as follows Figure 2 As shown, the specific steps are:
[0083] Step S1: construct a clear image set, where the clear image set is clear images under normal conditions.
[0084] In order to improve the diversity of samples in the clear image set, the clear image set is the clear images in the open source dataset ImageNet or coco.
[0085] Step S2: using a clear image set to train the teacher network to obtain a teacher network model;
[0086] Step S3: constructing a paired data set of clear images and blurred images, wherein the paired data set of clear images and blurred images includes a clear image set and a blurred image set, and synthesizing a blurred image under a corresponding special environment by using each clear image with target annotation in the clear image set to obtain a blurred image set;
[0087] Step S4: Based on the teacher network model, the object detection network is trained using a paired dataset of clear images and blurred images.
[0088] In order to achieve end-to-end training of the image enhancement network and the target detection network, this embodiment first trains the teacher network, and then uses the trained teacher network to train the student network of the target detection network and the detection network. During the entire model training process, the teacher network is trained separately and only needs to be trained once, which can be used for the training of target detection models in any vertical field to achieve a once-and-for-all effect.
[0089] Furthermore, in step S2, the training error function of the teacher network is L1, and the teacher network is trained until convergence to obtain a teacher network model.
[0090] Step S4 uses a paired dataset of clear images and blurred images to train the target detection network based on the teacher network model. The flow chart of S4 is as follows: Figure 3 As shown, step S4 specifically includes:
[0091] Step S41: inputting the clear image into the teacher network model, and the encoder of the teacher network outputs n clear image feature maps;
[0092] Step S42: inputting the blurred image corresponding to the clear image into the student network, and the encoder of the student network outputs n blurred image feature maps;
[0093] Step S43: Calculate the error between the teacher network and the student network according to the n clear image feature maps output by the encoder of the teacher network and the n blurred image feature maps output by the encoder of the student network;
[0094] Step S44: inputting the n blurred image feature maps output by the encoder of the student network into the detection network, and calculating the target detection error of the blurred image according to the loss function of the target detection network;
[0095] Step S45: inputting the clear image into the student network, and the encoder of the student network outputs n clear image feature maps;
[0096] Step S46: input the n clear image feature maps output by the encoder of the student network into the detection network, and calculate the target detection error of the clear image according to the loss function of the target detection network.
[0097] When calculating the target detection error of a blurred image and the target detection error of a clear image, the calculation is performed according to the loss function of the target detection network. In this embodiment, any target detection convolutional neural network can be used according to the needs of the actual application. The loss functions corresponding to different target detection network structures are different.
[0098] Step S47: Calculate the overall error of the target detection network, the calculation formula is:
[0099] Losstotal =αLoss st +(1-α)(Loss obj +Loss obj- )
[0100] Among them: Loss total is the overall error of the target detection network; Loss st is the error between the teacher network and the student network; Loss obj is the target detection error of the blurred image; Losso bj_ is the target detection error of the clear image; α∈(0,1), which is used to balance the weight between image enhancement and target detection.
[0101] Step S48: using the overall error of the target detection network to update the model parameters of the student network and the detection network, the model parameters of the teacher network remain unchanged;
[0102] S49: Repeat steps S41 to S48 until the teacher network and the target detection network converge.
[0103] Further, the training diagram of S4 provided in the embodiment of the present invention is as follows: Figure 4 As shown in the figure, during the training process, the clear image is first input into the teacher network model, and the encoder of the teacher network outputs n clear image feature maps, which are
[0104] where i = 1, 2, 3, ..., n; c i 、w i 、h i Respectively represent the number of channels, width and height of the feature map obtained by the i-th residual feature extraction module, Feat ti represents the clear image feature map output by the i-th residual feature extraction module of the encoder of the teacher network; Represents the size of the three-dimensional space where the feature map extracted by the i-th residual feature extraction module is located.
[0105] The blurred image corresponding to the clear image is input into the student network, and the encoder of the student network outputs n blurred image feature maps, which are
[0106] where i = 1, 2, 3, ..., n; c i 、w i 、h i Respectively represent the number of channels, width and height of the feature map obtained by the i-th residual feature extraction module, Feat ti represents the blurred image feature map output by the i-th residual feature extraction module of the encoder of the student network; Represents the size of the three-dimensional space where the feature map extracted by the i-th residual feature extraction module is located.
[0107] The error between the teacher network and the student network is calculated based on the n clear image feature maps output by the encoder of the teacher network and the n blurred image feature maps output by the encoder of the student network.
[0108] According to the i residual feature extraction module outputs corresponding to the encoder of the teacher network and the encoder of the student network, the error of each residual feature extraction module output is calculated respectively, Loss st1 、Loss st2 ,...Loss stn , calculate the error Loss between the teacher network and the student network based on the error output by the n residual feature extraction modules of the teacher network and the student network st .
[0109] In order to obtain the error of the target detection network, in this embodiment, the clear image and the blurred image in the paired data set of the clear image and the blurred image are respectively input into the target detection network to obtain the target detection error of the blurred image and the target detection error of the clear image, such as Figure 4 As shown, the clear image passes through the student network and the detection network along the direction of the red dotted arrow, and the target detection error of the clear image is calculated according to the loss function of the target detection network; the blurred image passes through the student network and the detection network along the direction of the black solid arrow, and the target detection error of the blurred image is calculated according to the loss function of the target detection network.
[0110] Furthermore, the overall error of the target detection network is obtained based on the two types of errors. According to the specific application scenario, the target detection network used, the loss function corresponding to different target detection network structures is different. The loss function of the target detection network is used to calculate the target detection error of the blurred image and the target detection error of the clear image respectively.
[0111] Calculate the overall error of the target detection network, the calculation formula is:
[0112] Loss total =αLoss st +(1-α)(Loss obj +Loss obj )
[0113] Among them: Loss total is the overall error of the target detection network; Loss st is the error between the teacher network and the student network; Loss obj is the target detection error of the blurred image; Loss obj_is the target detection error of the clear image; α∈(0,1), which is used to balance the weight between image enhancement and target detection.
[0114] Furthermore, the error between the teacher network and the student network is calculated as:
[0115]
[0116] Where: i = 1, 2, 3, ..., n; c i 、w i 、h i Respectively represent the number of channels, width and height of the feature map obtained by the i-th residual feature extraction module, Feat ti Feat represents the clear image feature map output by the i-th residual feature extraction module of the encoder of the teacher network; si Represents the blurred image feature map output by the i-th residual feature extraction module of the encoder of the student network.
[0117] In order to improve the training accuracy, the calculation formula of the error between the teacher network and the student network can be further rewritten as:
[0118]
[0119] in It means that only keep hard The value of the quantile, τ hard ∈[0, 1].
[0120] If the value is greater than the quantile, it means that the sample is difficult to fit; if the value is less than the quantile, it means that the sample is easy to fit. In this implementation, a quantile τ is set. hard , It means that only keep hard The value of the quantile allows the model to focus only on difficult samples, forcing the model to learn more difficult samples. This improves the training efficiency of the model and improves the accuracy of the model.
[0121] This embodiment hard The value of is manually set as a hyperparameter according to the application scenario, or it can be set as a learnable variable.
[0122] This embodiment also discloses a target detection method under a special environment, using any one of the target detection systems under a special environment, including the following steps:
[0123] Step 1: Training the target detection network to obtain the initial target detection model;
[0124] The target detection network includes a teacher network and a target detection network, and the target detection network includes a student network and a detection network;
[0125] The teacher network is used to learn the feature expressions of clear images in normal environments at each layer in the deep neural network;
[0126] The target detection network is used to identify the target in the image;
[0127] The student network is the backbone of the target detection network, which is used to learn the feature mapping relationship between blurry images in special environments and clear images in normal environments.
[0128] The detection network is the rest of the object detection network, which is used to output the location and category of the object in the image;
[0129] The teacher network and the target detection network are trained end-to-end to obtain a trained initial target detection model;
[0130] Step 2: Modify the target detection model to obtain a general target detection model;
[0131] Remove the teacher network of the target detection model to obtain the general target detection model, which includes the student network and the detection network;
[0132] Step 3: Collect the image to be detected;
[0133] Step 4: Input the image to be detected into the general target detection model, and identify the target in the image through the general target detection model.
[0134] In this embodiment, the general target detection model includes a student network and a detection network. The student network structure is the encoder part of the teacher network, and also includes n residual feature extraction modules. The image to be detected is input into the general target detection model, and n feature maps to be detected are output through the encoder of the student network. The n feature maps to be detected are input into the detection network of the general target detection model to output the position and category of the target in the image to be detected, thereby completing the detection of the target in the image to be detected.
[0135] Specifically, the reasoning steps of the target detection system under a special environment in this implementation method refer to Figure 1 As shown, the network finally used for target detection in the image is a general model for target detection. The general model does not include a teacher network, but is composed of a student network and a detection network. The image to be detected is collected by a camera. The image to be detected can be any image. Any image is input into the student network of the general model for target detection, and feature extraction is achieved through the student network. The output features of the student network are then input into the detection network of the general model for target detection, and the target detection result is finally output.
[0136] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0137] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A target detection system in a special environment, characterized in that: It includes a teacher network and a target detection network, wherein the target detection network includes a student network and a detection network; The teacher network is used to learn the feature expressions of each layer of the deep neural network in a clear image under a normal environment; The teacher network is an autoencoding network, including an encoder and a decoder. The encoder of the teacher network includes n A residual feature extraction module, represents the first i Residual feature extraction modules, where i =1, 2, 3, ..., n , n is a positive integer; The target detection network is used to identify targets in the image; The student network is the backbone of the target detection network and is used to learn the feature mapping relationship between the blurred image in a special environment and the clear image in a normal environment; The student network is the encoder part of the teacher network. The encoder of the student network corresponds one-to-one with the encoder of the teacher network. The encoder of the student network includes n A residual feature extraction module, The student network i A residual feature extraction module; The detection network is the remaining part of the target detection network, which is used to output the position and category of the target in the image; The teacher network and the target detection network are trained end-to-end to obtain a trained initial target detection model; The teacher network and the target detection network are trained end-to-end, and the specific training steps are as follows: Step S1: constructing a clear image set, where the clear image set is a clear image under normal environment; Step S2: using the clear image set to train the teacher network to obtain a teacher network model; Step S3: constructing a paired data set of clear images and blurred images, wherein the paired data set of clear images and blurred images includes a clear image set and a blurred image set, and obtaining the blurred image set by synthesizing a corresponding blurred image under a special environment using each clear image with a target annotation in the clear image set; Step S4: Based on the teacher network model, the object detection network is trained using the paired data set of clear images and blurred images; The step S4 specifically includes: Step S41: Input the clear image into the teacher network model, and the encoder of the teacher network outputs n A clear image feature map; Step S42: Input the blurred image corresponding to the clear image into the student network, and the encoder of the student network outputs n A blurred image feature map; Step S43: According to the encoder output of the teacher network n The clear image feature map and the encoder output of the student network n A blurred image feature map is generated to calculate the error between the teacher network and the student network; Step S44: Output the encoder of the student network n A blurred image feature map is input into the detection network, and the target detection error of the blurred image is calculated according to the loss function of the target detection network; Step S45: Input the clear image into the student network, and the encoder of the student network outputs n A clear image feature map; Step S46: Output the encoder of the student network n A clear image feature map is input into the detection network, and the target detection error of the clear image is calculated according to the loss function of the target detection network; Step S47: Calculate the overall error of the target detection network, the calculation formula is: in: is the overall error of the target detection network; is the error between the teacher network and the student network; is the target detection error of the blurred image; An object detection error for the clear image; , used to balance the weight between image enhancement and target detection; Step S48: using the overall error of the target detection network to update the model parameters of the student network and the detection network, the model parameters of the teacher network remain unchanged; S49: Repeat steps S41 to S48 until the teacher network and the target detection network converge; When performing target detection in an image, the teacher network of the target detection initial model is removed to obtain a general target detection model, which includes a student network and a detection network. The target in the image is identified through the general target detection model.
2. The target detection system under a special environment according to claim 1, characterized in that: The target detection network can be any deep learning-based target detection network, including a single-stage target detection network and a two-stage target detection network.
3. The target detection system under a special environment according to claim 1, characterized in that: The clear image set is a clear image in the open source dataset ImageNet or coco.
4. The target detection system under a special environment according to claim 1, characterized in that: In step S2, the training error function of the teacher network is , train the teacher network until convergence to obtain the teacher network model.
5. The target detection system under a special environment according to claim 1, characterized in that: The calculation formula of the error between the teacher network and the student network is: in: i =1, 2, 3, ..., n ; c i , w i , h i Respectively represent i The number of channels, width and height of the feature map obtained by the residual feature extraction module; represents the encoder of the teacher network i A clear image feature map output by a residual feature extraction module; represents the encoder of the student network i The blurred image feature map output by the residual feature extraction module.
6. The target detection system under a special environment according to claim 1, characterized in that: The calculation formula of the error between the teacher network and the student network is: in: i =1, 2, 3, ..., n ; c i , w i , h i Respectively represent i The number of channels, width and height of the feature map obtained by the residual feature extraction module; represents the encoder of the teacher network i A clear image feature map output by a residual feature extraction module; represents the encoder of the student network i The blurred image feature map output by the residual feature extraction module; Indicates that only the values greater than The value of the quantile, .
7. A method for detecting a target in a special environment, using a target detection system in a special environment as claimed in any one of claims 1 to 6, characterized in that: The following steps are involved: Step 1: Training the target detection network to obtain the initial target detection model; The target detection network includes a teacher network and a target detection network, and the target detection network includes a student network and a detection network; The teacher network is used to learn the feature expressions of each layer of the deep neural network in a clear image under a normal environment; The teacher network is an autoencoding network, including an encoder and a decoder. The encoder of the teacher network includes n A residual feature extraction module, represents the first i Residual feature extraction modules, where i =1, 2, 3, ..., n , n is a positive integer; The target detection network is used to identify targets in the image; The student network is the backbone of the target detection network and is used to learn the feature mapping relationship between the blurred image in a special environment and the clear image in a normal environment; The student network is the encoder part of the teacher network. The encoder of the student network corresponds one-to-one with the encoder of the teacher network. The encoder of the student network includes n A residual feature extraction module, The student network i A residual feature extraction module; The detection network is the remaining part of the target detection network, which is used to output the position and category of the target in the image; The teacher network and the target detection network are trained end-to-end to obtain a trained initial target detection model; The specific training steps of the teacher network and the target detection network using end-to-end training are: Step S1: constructing a clear image set, where the clear image set is a clear image under normal environment; Step S2: using the clear image set to train the teacher network to obtain a teacher network model; Step S3: constructing a paired data set of clear images and blurred images, wherein the paired data set of clear images and blurred images includes a clear image set and a blurred image set, and obtaining the blurred image set by synthesizing a corresponding blurred image under a special environment using each clear image with a target annotation in the clear image set; Step S4: Based on the teacher network model, the object detection network is trained using the paired data set of clear images and blurred images; The step S4 specifically includes: Step S41: Input the clear image into the teacher network model, and the encoder of the teacher network outputs n A clear image feature map; Step S42: Input the blurred image corresponding to the clear image into the student network, and the encoder of the student network outputs n A blurred image feature map; Step S43: According to the encoder output of the teacher network n The clear image feature map and the encoder output of the student network n A blurred image feature map is generated to calculate the error between the teacher network and the student network; Step S44: Output the encoder of the student network n A blurred image feature map is input into the detection network, and the target detection error of the blurred image is calculated according to the loss function of the target detection network; Step S45: Input the clear image into the student network, and the encoder of the student network outputs n A clear image feature map; Step S46: Output the encoder of the student network n A clear image feature map is input into the detection network, and the target detection error of the clear image is calculated according to the loss function of the target detection network; Step S47: Calculate the overall error of the target detection network, the calculation formula is: in: is the overall error of the target detection network; is the error between the teacher network and the student network; is the target detection error of the blurred image; An object detection error for the clear image; , used to balance the weight between image enhancement and target detection; Step S48: using the overall error of the target detection network to update the model parameters of the student network and the detection network, the model parameters of the teacher network remain unchanged; S49: Repeat steps S41 to S48 until the teacher network and the target detection network converge; Step 2: modifying the initial target detection model to obtain a general target detection model; Removing the teacher network of the target detection initial model to obtain the target detection general model, wherein the target detection general model includes a student network and a detection network; Step 3: Collect the image to be detected; Step 4: Input the image to be detected into the general target detection model, and identify the target in the image through the general target detection model.
Citation Information
Patent Citations
Enhanced and refined network and method for target detection in severe weather
CN116704284A
Lung disease lesion unsupervised segmentation method based on knowledge distillation
CN113902761A
Remote sensing image small target detection method and device
CN117409314A