An underwater target recognition method based on knowledge distillation

Through improved knowledge distillation technology and Gaussian process regression compression deep neural network, combined with underwater laser cameras and image enhancement algorithms, the problem of deploying deep neural networks on resource-limited equipment is solved, and efficient and real-time underwater target recognition is achieved.

CN114283325BActive Publication Date: 2024-10-18HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111578694.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2024-10-18
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

Due to its large number of parameters and large size, deep neural networks are difficult to deploy in embedded devices with limited resources, making it difficult to achieve real-time performance and accuracy in underwater target recognition.

Method used

Improved knowledge distillation technology is used to compress the teacher model through Gaussian process regression, generate a lightweight student network, and replace it into the yolov5 target detection network. It combines underwater laser cameras and image enhancement algorithms to achieve real-time underwater target recognition.

Benefits of technology

It achieves efficient underwater target recognition on equipment with limited resources, improves recognition accuracy and real-time performance, reduces memory usage and computational complexity, and balances detection speed and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114283325B_ABST
    Figure CN114283325B_ABST
Patent Text Reader

Abstract

The present invention discloses an underwater target recognition method based on knowledge distillation; the method is as follows: 1. Pre-train a complex model as a teacher model; the complex model uses a convolutional neural network. 2. Use a knowledge distillation method based on Gaussian process regression to compress the teacher model to obtain a student network; 3. Replace the compressed student network with the classification network in the yolov5 target detection network used for underwater target recognition; 4. Use an underwater laser camera to collect underwater real-time images; 5. Use an image enhancement algorithm to improve the quality of the returned underwater real-time images; 6. Input the image into the updated yolov5 target detection network in real time to achieve real-time underwater target recognition; the present invention changes the method of using a convolutional neural network as a student network in the traditional knowledge distillation method, and proposes a method of fitting the teacher network knowledge through a Gaussian regression process to achieve the purpose of knowledge transfer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of underwater target recognition, and in particular relates to an underwater target recognition method based on knowledge distillation. Background Art

[0002] As an auxiliary means of various underwater tasks, underwater target recognition technology can help underwater operators and underwater vehicles to better carry out underwater tasks. In the civilian field, underwater target recognition can be used for underwater cable laying, underwater pipeline quality inspection, underwater equipment maintenance and repair, fishery monitoring, etc. In the military field, it can be used for reconnaissance, mine laying, mine removal and underwater rescue. In order to better help achieve these underwater tasks, an underwater target recognition technology with accurate and fast recognition speed is very important.

[0003] With the increasing development of deep learning, it has achieved good results and applications in target recognition, image classification and other fields. Therefore, the application of deep learning neural networks to identify underwater targets has gradually become the mainstream direction in the future. Compared with traditional methods, deep neural networks can accurately extract features through deep networks, and can identify and locate underwater targets more accurately and have a higher recognition rate.

[0004] Since electromagnetic waves attenuate quickly underwater and have a relatively weak ability to transmit data through seawater, deep neural networks must be deployed locally on the device. However, deep neural networks often have many parameters and are bulky, making it difficult to deploy them in embedded devices with limited resources. Therefore, we propose an underwater target recognition technology based on improved knowledge distillation, which aims to use an effective model compression method to make the compressed classification network have a lightweight size, speed up its reasoning speed, and have good accuracy. Summary of the invention

[0005] The present invention aims to provide an underwater target recognition method based on knowledge distillation to address the shortcomings and deficiencies of the prior art. The method can collect images through an underwater camera and use a lightweight network trained by knowledge distillation to determine and mark the types of underwater targets.

[0006] An underwater target recognition method based on improved knowledge distillation compression technology, the specific steps are as follows:

[0007] S10) pre-train a complex model as a teacher model; the complex model adopts a convolutional neural network.

[0008] S20) Use the knowledge distillation method based on Gaussian process regression to compress the teacher model and obtain the student network.

[0009] S30) The compressed student network replaces the classification network in the yolov5 target detection network for underwater target recognition.

[0010] S40) uses an underwater laser camera to collect real-time underwater images.

[0011] S50) uses an image enhancement algorithm to improve the quality of the underwater real-time image transmitted back.

[0012] S60) inputs the image into the updated yolov5 target detection network in real time to achieve real-time underwater target recognition.

[0013] Preferably, in step S10), the Resnet152 neural network is selected as the teacher model; the Resnet152 neural network consists of 1 convolution layer, 1 maximum pooling layer, 1 average pooling layer and 50 residual structures.

[0014] Preferably, the knowledge distillation process based on Gaussian process regression in step S20) is as follows:

[0015] The output of the last fully connected layer of the teacher network is used as the teacher's knowledge to guide the student network. The temperature factor T is introduced to make the output of the teacher network smoother. The processed teacher network output Y i as follows:

[0016]

[0017] Among them, z i is the output of the fully connected layer, and T is a custom parameter. The writing vector form is

[0018] Y=[Y1,Y3,Y3,…,Y m ].

[0019] Among them, Y is the teacher network output vector and m is the number of categories.

[0020] Define a preprocessing layer to extract image features and reduce dimensionality. The preprocessing layer consists of a depth-separable convolution kernel and a maximum pooling layer. The preprocessing obtains a low-dimensional feature vector X * =[x1,x2,x3,…,x n ] T , which is used as the input vector. The input vector is compared with its corresponding classification result y * It is expressed as (x * ,y * ), the prior knowledge f(x) of the Gaussian process is expressed as:

[0021] f(x)~N(μ f ,K ff )

[0022] Where N(·) is Gaussian distribution; μ f is the mean; K ffis the variance.

[0023] Prior knowledge f(x) and classification result y * Obey a joint Gaussian distribution:

[0024]

[0025] in, represents the joint Gaussian distribution; variance K ff = k(x,x), variance K fy = k(x,x * ), variance K yy = k(x * ,x * ), k(·) is the Gaussian kernel function.

[0026] Then we have a given (x * ,y * ) after the function distribution f is:

[0027]

[0028] At this time, we get the mean of the Gaussian process and covariance Input vector x * In the function distribution f, the result is the classification result y * .

[0029] Take the function distribution f as the student network.

[0030] Preferably, the yolov5 target detection network described in step S30) includes an input end, a Backbone, a Neck and a Prediction, and has two major functions: detection and positioning and classification and recognition.

[0031] Preferably, the specific process of step S40) is: installing an underwater laser camera in the underwater vehicle, which can effectively collect images within a certain range around the vehicle, and transmit the images back for target recognition after image enhancement processing.

[0032] Preferably, the specific process of step S50) is: calculating the histogram h(k) of the entire image. The histogram is an overall description of all grayscale values ​​of an image, which is expressed as:

[0033] h(k)=n k ,k=0,1,…,L-1

[0034] Among them, n k is the number of pixels with gray level k in the image; L is the number of gray levels; the height of each column of the histogram corresponds to n k .

[0035] According to the histogram, the probability P(k) of each pixel is obtained, which is expressed as:

[0036] P(k)=n k / N

[0037] Where N represents the total number of pixels in the image.

[0038] Multiply the probability of each pixel by the dynamic range and round it down to get the enhanced image.

[0039] Preferably, step S60) inputs the image into the target detection network in real time to realize real-time underwater target recognition, specifically including: after the image is enhanced, the image collected by the underwater laser camera is input into the updated yolov5 target detection network to realize automatic recognition of the target object in the image.

[0040] The beneficial effects of the present invention are:

[0041] (1) The present invention proposes a novel knowledge distillation method, which changes the traditional knowledge distillation method of using a convolutional neural network as a student network and proposes a method of fitting the teacher network knowledge through a Gaussian regression process to achieve the purpose of knowledge transfer. Since the Gaussian regression process method does not require a large number of parameters in the neural network, a higher compression rate is achieved.

[0042] (2) Since the compressed network is simpler than the neural network and has a smaller number of parameters, the present invention solves the problem that it is difficult to deploy complex neural networks on embedded devices with limited resources, realizes offline detection of underwater targets, and improves the real-time problem of the prior art.

[0043] (3) Compared with other compression methods, the prediction value of the Gaussian process is probabilistic. Therefore, the present invention can calculate the empirical confidence interval and then refit the prediction in a certain area, thereby maintaining a relatively high recognition accuracy and achieving a balance between detection speed and detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a schematic diagram of the process of the present invention.

[0045] Figure 2 Schematic diagram of the reinforcement learning strategy distillation of the present invention.

[0046] Figure 3 Schematic diagram of the residual structure of the Resnet152 neural network in the present invention. DETAILED DESCRIPTION

[0047] The present invention is further described below in conjunction with the accompanying drawings.

[0048] like Figure 1As shown, an underwater target recognition method based on improved knowledge distillation compression technology, the technical solution is as follows:

[0049] S10) Pre-train a complex model as a teacher model; specifically including:

[0050] First, the Resnet152 neural network is trained for underwater target classification. The trained complex model is used as the network to be compressed, which has higher accuracy. Resnet152 is stacked with residual structure as the basic module, which can deepen the depth of the neural network and make it more and more accurate. Figure 3 As shown:

[0051] Assume the input is x, and the mapping learned by two fully connected layers is H(x). Assuming that H(x) has the same dimension as x, fitting H(x) is equivalent to fitting the residual function H(x)-x. Let the residual function F(x) = H(x)-x, then the original function becomes F(x)+x, so a cross-layer connection is directly added to the original network to pass the identity mapping of x.

[0052] The entire residual structure can be defined as y = F(x, {W i})+x, where F(x, {W i}) refers to the residual mapping of the fitting. As shown in the figure above, there are two fully connected layers, that is, F = W2σ(W1x), where σ refers to the ReLu activation function. When F and x have the same dimension, they can be directly added element by element; but if they are different, a linear function must be added to x to map it to a vector with the same dimension as F. At this time, the entire residual structure is y = F(x, {W i})+W s x, where W s is a matrix for dimension matching.

[0053] The entire Resnet152 consists of 1 convolution layer, 1 maximum pooling layer, 1 average pooling layer and 50 residual structures. It has a good classification effect for underwater targets. We use it as a teacher network to guide student network training.

[0054] S20) Use the knowledge distillation method based on Gaussian process regression to compress the teacher model and obtain the student network.

[0055] like Figure 2As shown, the Resnet152 obtained in step S10) is used as a teacher model to guide the student network training. Knowledge distillation is a method of knowledge transfer, which transfers the knowledge of a trained complex model to a small network, and the small network is used as the final task model to achieve the purpose of compressing the model. In the present invention, we use Gaussian process regression instead of the convolutional neural network in traditional knowledge distillation as the student network. Gaussian process is one of the random processes, which is a collection of random variables that conform to the normal distribution in a one-dimensional set. A Gaussian process is determined by a mean function and a covariance matrix. For a Gaussian process: X = [x1, x2, x3, ..., x n ] T , where n is the feature dimension, x1, x2, x3, ..., x n is the feature sample corresponding to each dimension. X conforms to the high-dimensional normal distribution, μ = [μ1, μ2, μ3, ..., μ n ] T is the mean vector, ∑ is the covariance matrix between these n features, and ∑ is expanded as follows:

[0056]

[0057] where cov i,j Represents the covariance between feature i and feature j. The covariance is simulated by the Gaussian process kernel. We choose the radial basis function as the Gaussian process kernel. The formula is as follows:

[0058]

[0059] Among them, x i and x j represents the labeling of the dimension, σ and l are free parameters. At this time, the Gaussian process is obtained, which is expressed as:

[0060] f(x)~N(μ(x),K(x,x))

[0061] Where N represents the mean function and K is the covariance function between the dimensions of the two vectors.

[0062] The knowledge distillation process based on Gaussian process regression is as follows: the output of the last fully connected layer of the teacher network is used as the teacher's knowledge to guide the student network. In order to make the knowledge of the teacher network more effective, we introduce the temperature factor T to make the output of the teacher network smoother. The processed teacher network output is as follows:

[0063]

[0064] where z i is the output of the fully connected layer, and T is a custom parameter. The writing vector form is

[0065] Y=[Y1,Y3,Y3,...,Y m ].

[0066] Among them, Y is the teacher network output vector and m is the number of categories.

[0067] Since Gaussian process regression performs poorly in high dimensions, when inputting images for classification, we first define a preprocessing layer to extract image features and reduce dimensionality. The preprocessing layer consists of a depthwise separable convolution kernel and a maximum pooling layer. After preprocessing, the image becomes a low-dimensional feature vector X * =[x1, x2, x3, ..., x n ] T , which is used as the input vector. At this time, we represent the input and its corresponding classification as (x * ,y * ), the prior of the Gaussian process is expressed as:

[0068] f(x)~N(μ f , K ff )

[0069] Assume that it and the predicted value follow a joint Gaussian distribution:

[0070]

[0071] where μ f is the mean, K ff = k(x, x), K fy = k(x, x * ), K yy = k(x * , x * )

[0072] Then we have a given (x * ,y * ) after the function distribution f is:

[0073]

[0074] At this time, we get the mean of the Gaussian process and covariance In the input vector x * The mean value at is the obtained classification result.

[0075] The present invention only uses one preprocessing layer as a means of feature extraction and dimensionality reduction, and the remaining steps are all Gaussian process fitting processes. By fitting the image input and the output of the teacher network, the type of image to be classified can be accurately predicted, and the complex convolutional layer used to extract features in the traditional neural network recognition process is abandoned, which greatly reduces memory usage resources and saves the forward propagation calculation of traditional neural network training, greatly accelerating the recognition rate.

[0076] S30) The compressed student network replaces the classification network in the yolov5 target detection network for underwater target recognition, specifically including:

[0077] The student network obtained in step S20) is used to improve yolov5. Yolov5 is the current mainstream target detection network, which is divided into four parts: input, backbone, neck and prediction. It has two major functions: detection and positioning and classification and recognition. We use the obtained student network to replace the backbone network in yolov5 for classification tasks, which greatly improves the classification and recognition speed.

[0078] S40) using an underwater laser camera to collect underwater real-time images, specifically including:

[0079] Installing an underwater laser camera in an underwater vehicle can effectively collect images within a certain range around the vehicle and transmit the images back for target recognition after image enhancement processing.

[0080] S50) uses an image enhancement algorithm to improve the quality of the underwater laser image transmitted back, including:

[0081] S50) using an image enhancement algorithm to improve the quality of the underwater laser image transmitted back, the image enhancement algorithm uses histogram equalization to better highlight the contrast information of the image. Specifically including:

[0082] First, calculate the histogram h(k) of the entire image. The histogram is an overall description of all grayscale values ​​of an image, expressed as:

[0083] h(k)=n k ,k=0,1,…,L-1

[0084] Among them, n k is the number of pixels with gray level k in the image; L is the number of gray levels; the height of each column of the histogram corresponds to n k .

[0085] Secondly, the probability of each pixel occurring P(k) is calculated based on the histogram, which is expressed as:

[0086] P(k)=n k / N

[0087] Where N represents the total number of pixels in the image.

[0088] Finally, find the probability corresponding to each pixel and multiply it by the dynamic range, round it down and get the equalized image.

[0089] S60) inputs the image into the target detection network in real time to realize real-time underwater target recognition, specifically including: inputting the image collected by the underwater laser camera into the locally deployed improved yolov5 target detection network after image enhancement, the network can automatically locate the object in the image, and identify the category of the object in the image through a lightweight classification network, and mark the image with a description.

Claims

1. An underwater target recognition method based on knowledge distillation, characterized in that: The following steps are involved: S10) pre-training a complex model as a teacher model; the complex model adopts a convolutional neural network; S20) Using the knowledge distillation method based on Gaussian process regression to compress the teacher model, a student network is obtained; the knowledge distillation process based on Gaussian process regression is as follows: The output of the last fully connected layer of the teacher network is used as the teacher's knowledge to guide the student network. The temperature factor T is introduced to make the output of the teacher network smoother. The processed teacher network output Y i as follows: Among them, z i is the output of the fully connected layer, T is a custom parameter; the writing vector form is <h2 style=";text-align:left;direction:ltr">Y = [Y1,Y3,Y3,…,Y<h2 style=";text-align:left;direction:ltr"> m <h2 style=";text-align:left;direction:ltr"> ]; Among them, Y is the teacher network output vector, and m is the number of categories; Define a preprocessing layer to extract image features and reduce dimensionality. The preprocessing layer consists of a depth-separable convolution kernel and a maximum pooling layer. The preprocessing obtains a low-dimensional feature vector X * =[x1,x2,x3,…,x n ] T , which is used as the input vector; the input vector and its corresponding classification result y * It is expressed as (x * ,y * ), the prior knowledge f(x) of the Gaussian process is expressed as: f(x)~N(μ f ,K ff ) Where N(·) is Gaussian distribution; μ f is the mean; K ff is the variance; Prior knowledge f(x) and classification result y * Obey a joint Gaussian distribution: in, represents the joint Gaussian distribution; variance K ff = k(x,x), variance K fy = k(x,x * ), variance K yy = k(x * ,x * );k(·) is the Gaussian kernel function; Then we have a given (x * ,y * ) after the function distribution f is: At this time, we get the mean of the Gaussian process and covariance Input vector x * In the function distribution f, the result is the classification result y * ; Use function distribution f as the student network; S30) replacing the compressed student network with the classification network in the yolov5 target detection network for underwater target recognition; S40) using an underwater laser camera to collect underwater real-time images; S50) using an image enhancement algorithm to improve the quality of the underwater real-time image transmitted back; S60) inputs the image into the updated yolov5 target detection network in real time to achieve real-time underwater target recognition.

2. The underwater target recognition method based on knowledge distillation according to claim 1 is characterized in that: In step S10), the Resnet152 neural network is selected as the teacher model; the Resnet152 neural network consists of 1 convolution layer, 1 maximum pooling layer, 1 average pooling layer and 50 residual structures.

3. The underwater target recognition method based on knowledge distillation according to claim 1 is characterized in that: The yolov5 target detection network described in step S30) includes an input end, a Backbone, a Neck and a Prediction, and has two major functions: detection and positioning and classification and recognition.

4. The underwater target recognition method based on knowledge distillation according to claim 1 is characterized in that: The specific process of step S40) is: installing an underwater laser camera in the underwater vehicle, which can effectively collect images of a certain range around the vehicle, and transmit the images back for target recognition after image enhancement processing.

5. The underwater target recognition method based on knowledge distillation according to claim 1 is characterized in that: The specific process of step S50) is: calculate the histogram h(k) of the entire image. The histogram is an overall description of all grayscale values ​​of an image, expressed as: h(k)=n k ,k=0,1,…,L-1 Among them, n k is the number of pixels with gray level k in the image; L is the number of gray levels; the height of each column of the histogram corresponds to n k ; According to the histogram, the probability P(k) of each pixel is obtained, which is expressed as: P(k)=n k / N Where N represents the total number of pixels in the image; Multiply the probability of each pixel by the dynamic range and round it down to get the enhanced image.

6. The underwater target recognition method based on knowledge distillation according to claim 1 is characterized in that: Step S60) inputs the image into the target detection network in real time to realize real-time underwater target recognition, specifically including: inputting the image collected by the underwater laser camera into the updated yolov5 target detection network after image enhancement to realize automatic recognition of the target object in the image.

Citation Information

Patent Citations

  • Target detection method and system based on multi-scale feature map reconstruction and knowledge distillation

    CN111626330A