A target detection method and classification model based on spectrogram
By using multi-scale feature extraction and transfer learning of the spectrum map in water acoustic target detection, the problems of complexity and sparse data of the marine environment are solved, and high confidence water acoustic target detection is achieved, saving labeling costs and improving Detection accuracy.
Patent Information
- Application Number
- CN202411427789.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-10-14
AI Technical Summary
In complex marine environments, due to sparse data, difficulty in labeling data and changes in marine environment in water acoustic target detection, the accuracy of target signal recognition is low, and the existing supervised learning methods require a large amount of labeled data, making it difficult to adapt to the detection tasks in the new sea area.
Using the spectrogram-based target detection method, transfer learning and unsupervised learning are performed through low-level feature extraction module and multi-scale advanced feature extraction module combining feature alignment and classification module classification model, and the model is trained using source domain data to reduce the target The dependence of domain data enables high confidence detection of unknown sea areas.
Without a large amount of target domain labeling data, the detection accuracy of about 85% is achieved, saving manual labeling time, improving detection performance, and maintaining a high recognition accuracy in the new sea area.
Smart Images

Figure CN118962683B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an underwater target detection method, in particular to a target detection method and a classification model based on a spectrogram. Background Art
[0002] At present, hydroacoustics and hydroacoustic engineering have become popular research fields, and hydroacoustic target detection is an important research direction and technical problem in the field of hydroacoustics. In a complex marine environment, a hydroacoustic passive detection array can identify potential targets by analyzing the collected hydroacoustic signals. However, the continuous changes in the marine environment and the complexity of hydroacoustic signals make the identification of target signals more difficult, so improving the detection accuracy of target signals has become an urgent problem that needs to be solved. At the same time, with the continuous development of the field of artificial intelligence, intelligent classification technology has provided a variety of new methods and ideas for hydroacoustic target detection.
[0003] In the original underwater acoustic target detection task, it is usually completed manually, mainly relying on the subjective consciousness and experience of the observer to judge whether the sound signal collected by the sonar contains a target. However, the manual detection process is difficult to meet the actual needs of long-term continuous detection, especially when faced with a surge in the amount of original acoustic data and more serious noise. In recent years, the development of digital signal processing technology has greatly improved the accuracy of target detection, and artificial intelligence technology has also been applied. However, the underwater acoustic target detection technology based on supervised learning requires a large amount of labeled data. In the field of underwater acoustic target detection with scarce data and difficult data annotation, the recognition accuracy is significantly reduced in the case of small samples. Further research requires a lot of manpower and material resources, and it is difficult to fundamentally solve the problem. Not only that, the trained model is only applicable to the current marine environment. Once the waters change, the detection efficiency may drop significantly. In addition, it is relatively difficult to obtain underwater acoustic data, the amount of data is limited, and labeling requires a lot of manpower and material resources. The supervised learning method requires a large amount of labeled data, so the detection task in a new sea area faces challenges. Summary of the invention
[0004] One of the purposes of the present invention is to provide a target detection method based on a spectrogram to solve the problem that a large amount of labeling is required for hydroacoustic data in unknown sea areas.
[0005] A second object of the present invention is to provide a classification model for target detection so as to establish a model for effectively detecting targets.
[0006] One of the purposes of the present invention is achieved in that:
[0007] A target detection method based on a spectrogram comprises the following steps:
[0008] S1. Collect the hydroacoustic signal of the target domain, determine the source domain of the same type as the target domain, and obtain the hydroacoustic signal of the source domain in the database according to the detection task of the hydroacoustic signal of the target domain. The hydroacoustic signal of the source domain is labeled with 0 or 1, 0 means no target, 1 means there is a target, and the target domain is the sea area to be tested;
[0009] S2. Plot the underwater acoustic signals in the target domain and the source domain as spectrograms respectively;
[0010] S3. Establish a classification model for target detection, input the spectrograms of the target domain and the source domain into the classification model for training and classification, and obtain the target detection result;
[0011] The classification model includes:
[0012] A low-level feature extraction module, connected to the multi-scale high-level feature extraction module, is used to extract low-level features of the spectrogram;
[0013] A multi-scale high-level feature extraction module, connected to the low-level feature extraction module and the feature alignment and classification module, for extracting high-level features of the spectrogram; and
[0014] The feature alignment and classification module is connected to the multi-scale advanced feature extraction module to output target detection results.
[0015] Furthermore, the specific method of drawing the spectrogram in step S2 is:
[0016] Based on the window length of Fourier transform, the underwater acoustic signal is Fourier transformed to generate a spectrogram, and the number of points of the window length of Fourier transform is 512~2048.
[0017] Furthermore, the specific method of training and classification in step S3 is:
[0018] The spectrograms of the target domain and the source domain are simultaneously input into the classification model for iterative training. Each training is performed using the classification loss function and the multi-scale feature alignment loss function to adjust the model parameters until the set conditions are met. The training is then stopped and the label corresponding to each sample in the output target domain is the target detection result.
[0019] The second object of the present invention is achieved in this way:
[0020] A classification model for target detection, comprising:
[0021] A low-level feature extraction module, connected to the multi-scale high-level feature extraction module, is used to extract low-level features of the spectrogram;
[0022] A multi-scale high-level feature extraction module, connected to the low-level feature extraction module and the feature alignment and classification module, for extracting high-level features of the spectrogram; and
[0023] The feature alignment and classification module is connected to the multi-scale advanced feature extraction module to output target detection results.
[0024] Further, the low-level feature extraction module includes a first convolutional layer and sixteen bottleneck blocks;
[0025] The input of the low-level feature extraction module passes through the first convolutional layer and then passes through sixteen bottleneck blocks in sequence. The sixteenth bottleneck block inputs the output result into the multi-scale high-level feature extraction module.
[0026] Furthermore, each bottleneck block includes three convolutional layers.
[0027] Further, the multi-scale high-level feature extraction module includes a first convolution structure, a second convolution structure, a third convolution structure, a fourth convolution structure and a global average pooling layer;
[0028] The output results of the sixteenth bottleneck block all pass through four convolution structures, and the outputs of the four convolution structures all pass through a global average pooling layer to generate a multi-scale feature set, which is then output to the feature alignment and classification module.
[0029] Furthermore, the first convolution structure includes a 1×1 convolution layer; the second convolution structure includes a 1×1 convolution layer and a 5×5 convolution layer; the third convolution structure includes a 3×3 average pooling layer and a 1×1 convolution layer; the fourth convolution structure includes a 1×1 convolution layer and two 3×3 convolution layers; the convolution kernel size of the global average pooling layer is 7×7.
[0030] Furthermore, the feature alignment and classification module includes a multi-layer perceptron classifier, which predicts the features after feature alignment, outputs predicted labels and pseudo labels, realizes feature alignment using a multi-scale feature alignment loss function, adjusts network parameters using a classification loss function, and outputs confidence labels.
[0031] Furthermore, the calculation formula of the multi-scale feature alignment loss function is:
[0032] ;
[0033] in, is the multi-scale feature alignment loss, is the feature set of all samples in the source domain, is the feature set of all samples in the target domain, C is the label category of the classification model, and its value is 2. is the mapping function, ns is the number of samples in the source domain, n t is the number of samples in the target domain, is the feature set of each sample in the source domain, for The feature set of samples with label category c in , is the feature set of each sample in the target domain, for The feature set of samples with label category c in .
[0034] The present invention uses a classification model to transfer learning and unsupervised learning of the data in the source domain, thereby classifying the data in the target domain. It only needs to establish a classification model, input the data in the source domain and the data in the target domain into the classification model, and after iterative training, a high-confidence label can be obtained. When detecting other sea areas in the future, the classification model can continue to be used for training without the need to re-establish the model. When training the model, there is no need to waste a lot of manpower and material resources to collect a large amount of data in the target domain for labeling, which greatly saves the cost of manual labeling; using the existing label data in the source domain, the knowledge is transferred to a new sea area with similar classification tasks, without relying on the label data of the new sea area, so that the existing information is automatically used for detection, and the detection accuracy of the recognition classifier for the target domain is improved. In addition, the spectrogram of the underwater acoustic data can be input into the multi-scale feature extraction network, avoiding the complex process of manually designing features, and using deep learning to automatically extract domain-invariant features, thereby enhancing the generalization of features.
[0035] The present invention extracts multi-scale features from actual underwater acoustic target sound signal data, and after migration when the target domain is completely unknown, obtains a higher detection accuracy rate, effectively solving the problem of low detection accuracy of the current unsupervised underwater acoustic target detection method in the actual marine environment. Multi-scale feature extraction can more comprehensively characterize the characteristics of underwater acoustic signals and further improve underwater acoustic detection performance. The present invention not only achieves a considerable detection accuracy rate of about 85% without using target domain labeled data, but also has little difference in detection accuracy compared with the results obtained by training with a large amount of target domain labeled data, thereby effectively improving its application value.
[0036] In the field of underwater acoustic target detection, especially when data is scarce and there is a large amount of unlabeled data, the unsupervised domain adaptation learning of the present invention can save a lot of manual annotation time and make full use of the labeled samples in the source domain database. The present invention can also quickly perform a priori detection of the target water area in practical applications, providing an effective solution for the identification and monitoring of underwater acoustic targets. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a flow chart of the method of the present invention.
[0038] Figure 2 It is the structural diagram of the bottleneck block.
[0039] Figure 3 It is the structural diagram of the multi-scale advanced feature extraction module. DETAILED DESCRIPTION
[0040] The present invention is further described below.
[0041] like Figure 1 As shown, the target detection method based on the spectrogram provided by the present invention comprises the following steps:
[0042] S1. Collect the hydroacoustic signal of the target domain, determine the source domain of the same type as the target domain, and obtain the hydroacoustic signal of the source domain in the database according to the detection task of the hydroacoustic signal of the target domain.
[0043] Among them, the underwater acoustic signal in the source domain is labeled with 0 or 1. The label 0 represents no target, and the label 1 represents a target. The target domain is the sea area to be tested, and the source domain is the sea area that has been detected. The type can be deep sea or shallow sea.
[0044] The present invention uses a vertical array of sonar receivers to collect water acoustic signals. The water acoustic signals in the target domain have no labels and need to be input into a classification model for detection.
[0045] The detection task can be to detect whether there are ships or different types of ships; for example, the detection task of the hydroacoustic signal of the target domain E is to detect whether there are ships, determine the source domain F of the same type as the target domain E, and obtain the hydroacoustic signal of the source domain F in the database whose detection task is to detect whether there are ships.
[0046] S2. Plot the hydroacoustic signals of the target domain and the source domain as spectrograms.
[0047] The hydroacoustic signals collected in the target domain and the source domain are divided into 1 second hydroacoustic signals, and the window length of the Fourier transform is selected to be 512 to 2048 points. The sampling frequency of the hydroacoustic signal used in the present invention is 17067 Hz, the window length of the Fourier transform is selected to be 2048 points, the number of overlapping samples between the two windows is 1024 points, the number of points of the Fourier transform, that is, the resolution of the spectrum is 2048 points, and the segmented hydroacoustic signal is Fourier transformed and plotted into a spectrogram. In this way, a large amount of labeled source domain spectrogram data and unlabeled target domain spectrogram data can be obtained.
[0048] The underwater acoustic signal in the source domain is labeled. After segmentation, each portion has the label. For example, a 50-second underwater acoustic signal labeled "there is a ship" is segmented, and the 50 signals obtained all have the label "there is a ship".
[0049] S3. Establish a classification model for target detection, input the spectrograms of the target domain and the source domain into the classification model for training and classification, and obtain the target detection result.
[0050] Combination Figure 1 ,The classification model includes a multi-scale high-level feature extraction module, a low-level ,feature extraction module, and a feature alignment and classification module; the multi-scale high-level ,feature extraction module is connected with the low-level feature extraction module and the ,feature alignment and classification module respectively.
[0051] The spectrograms in the target domain and the source domain are divided into a set number of batches. In each training process, the spectrograms of the target domain and the source domain are simultaneously input into the classification model. The labels corresponding to the output source domain samples are predicted labels. Each source domain sample corresponds to a real label. The labels corresponding to the output target domain samples are pseudo labels. The cross entropy loss function and the multi-scale alignment loss function are used to calculate the loss function according to the pseudo labels, predicted labels, real labels, and the features corresponding to the source and target domains. The classification model is adjusted and iteratively trained until the set conditions are met. The training is stopped and the pseudo labels of the output target domain spectrogram data are high confidence labels. The set conditions may be that the training rounds reach a preset number of times or the classification model reaches a preset accuracy. In this way, the network can continuously learn and improve the accuracy of common features, and gradually optimize the classification effect of the classification model in the target domain during the iteration process.
[0052] During the training process, the classification loss function and the multi-scale feature alignment loss function are used to adjust the parameters in the model.
[0053] Among them, the calculation formula of the multi-scale feature alignment loss function is:
[0054] (1)
[0055] in, is the multi-scale feature alignment loss, is the feature set of all samples in the source domain, is the feature set of all samples in the target domain, C is the label category of the classification model, and its value is 2, n s is the number of samples in the source domain, is the mapping function, n t is the number of samples in the target domain, is the feature set of each sample in the source domain, for The feature set of samples with label category c in , is the feature set of each sample in the target domain, for The feature set of samples with label category c in .
[0056] The target detection method based on the spectrogram provided by the present invention can be used to detect different types of ships. For example, if there is a cargo ship, the G sea area is the target area, the H sea area is the source area, and both the G sea area and the H sea area are deep sea. A hydroacoustic signal is collected in the G sea area, and the detection task of the hydroacoustic signal in the G sea area is to detect whether there is a cargo ship; the hydroacoustic signal for detecting whether there is a cargo ship in the H sea area is obtained in a database, and the collected hydroacoustic signal of the G sea area and the hydroacoustic signal of the H sea area in the database are respectively plotted into spectrograms, and the spectrograms of the G sea area and the H sea area are input into a classification model for iterative training. When the set conditions of the classification model are met, the training of the classification model is stopped, and the label corresponding to the output data of the G sea area is the result of target detection in the G sea area.
[0057] The present invention also provides a classification model for target detection, which specifically includes a low-level feature extraction module, a multi-scale high-level feature extraction module and a feature alignment and classification module.
[0058] The low-level feature extraction module includes a convolution layer and multiple residual blocks. The deep residual network used in the present invention is ResNet-50, that is, sixteen bottleneck blocks (i.e., residual blocks). The bottleneck block (Bottleneck) is a type of residual block, which is widely used in ResNet-50. In ResNet-50, the gradient vanishing and performance saturation problems in the deep network are solved by introducing residual connection. Each residual block (Residual block) contains multiple convolution layers and a jump connection. This design enables the network to maintain good performance while deepening. After the spectrograms of the target domain and the source domain are input to the first convolution layer with a convolution kernel size of 7×7, they pass through sixteen bottleneck blocks to extract the low-level features of the spectrogram, and finally output to the multi-scale high-level feature extraction module.
[0059] Each bottleneck block includes a second convolutional layer with a convolution kernel size of 1×1, a third convolutional layer with a convolution kernel size of 3×3, and a fourth convolutional layer with a convolution kernel size of 1×1. In order to ensure that the input and output sizes are the same, the structure of each bottleneck block is slightly different. When the stride of the second convolutional layer of the bottleneck block is 1, the number of channels is 64, the stride of the third convolutional layer is 1, the number of channels is 64, and the stride of the fourth convolutional layer is 1, the number of channels is 256, the input of the bottleneck block passes through the second convolutional layer, the third convolutional layer, and the fourth convolutional layer in sequence, and then adds the input of the bottleneck block. The addition result is activated by the activation function to obtain the output of the bottleneck block; when the stride of the second convolutional layer of the bottleneck block is 1, the number of channels is 128, the stride of the third convolutional layer is 2, the number of channels is 128, and the stride of the fourth convolutional layer is 1, the number of channels is 512, the input of the bottleneck block is divided into two branches, one branch passes through the second convolutional layer, the third convolutional layer, and the fourth convolutional layer in sequence, and the other branch passes through the fifth convolutional layer with a convolution kernel size of 1×1, a stride of 2, and a number of channels of 512. The outputs of the two branches are added, and the addition result is activated by the activation function to obtain the output of the bottleneck block.
[0060] The activation functions in this classification model are all ReLU activation functions to alleviate the gradient disappearance problem.
[0061] like Figure 2 As shown in the figure, taking the input data with an input size of [56,56,256] as an example, first use a 1×1 convolution kernel and a convolution with 128 channels to reduce the amount of data, then use a 3×3 convolution kernel and a convolution with 128 channels to extract features, and finally use a 1×1 convolution kernel and a convolution with 512 channels to restore the data, and obtain an output of size [28,28,512]. However, since the input size is [56,56,256] and the output size is [28,28,512], the input and output sizes are different. Therefore, it is necessary to downsample the input data and use a 1×1 convolution kernel, a 512 channel number, and a convolution operation with a stride of 2 to obtain data of the same size as [28,28,512]. Then add the two data of the same size to complete the residual output. Another case is when the output size after three convolutions is the same as the input size, there is no need to downsample the input data. The input data and the convolved data can be directly added to complete the jump connection.
[0062] When the size of the original spectrogram is [224, 224, 3], it first undergoes a 7×7 convolution operation and then is processed by 16 bottleneck blocks, and finally the low-level feature data size of the spectrogram is obtained to be [7, 7, 2048]. Then, these low-level feature data will be input into the multi-scale high-level feature extraction module for multi-scale feature extraction.
[0063] Since a single convolution structure can only extract partial information from the original data, it cannot fully represent the characteristics of the original information. Therefore, the present invention uses a variety of different convolution structures to process low-level feature data at the same time, thereby obtaining multi-scale high-level feature information.
[0064] like Figure 3 As shown in Figure 1, the Inception module of GoogleNet has been improved. This module contains four different convolution operations, which are designed to handle the situation where the number of input low-level feature data channels is large (for example, [7, 7, 2048]). In order to effectively process this data, the four convolution structures all adopt the step of reducing and compressing the data.
[0065] The multi-scale high-level feature extraction module includes a first convolution structure, a second convolution structure, a third convolution structure, a fourth convolution structure and a global average pooling layer. The data output by the low-level feature extraction module passes through the first convolution structure, the second convolution structure, the third convolution structure and the fourth convolution structure. The output of each convolution structure passes through the global average pooling layer to obtain a multi-scale feature set.
[0066] The first convolution structure only uses one convolution layer with a kernel size of 1×1 and a stride of 1 to reduce the dimensionality of low-level features; the second convolution structure first uses a convolution layer with a kernel size of 1×1 and a stride of 1 to reduce the dimensionality, and then uses a convolution layer with a kernel size of 5×5 and a stride of 1 to extract features; the third convolution structure first uses an average pooling layer with a kernel size of 3×3 and a stride of 1 to extract features, and then uses a convolution layer with a kernel size of 1×1 and a stride of 1 to reduce the dimensionality of the data; the fourth convolution structure first uses a convolution layer with a kernel size of 1×1 and a stride of 1 to reduce the dimensionality, and then uses a convolution layer with a kernel size of 3×3 and a stride of 1 twice in a row to extract deeper features.
[0067] The features extracted by the four convolution structures are respectively input into the global average pooling layer with a convolution kernel size of 7×7 to further reduce the dimension and generate multi-scale high-level features, which are then input into the feature alignment and classification module, thereby achieving label prediction for the target domain data.
[0068] First, the multi-scale features of the source domain and the target domain are combined into input columns and passed into the multi-layer perceptron classifier. The source domain data has true labels, so the network parameters can be adjusted by calculating the cross entropy loss function (i.e., classification loss function) between the predicted label and the true label, thereby improving the accuracy of feature classification. For the multi-scale features of the target domain, a pseudo label is first obtained through the classifier, and then the pseudo label, the true label of the source domain, and the multi-scale features of the source domain and the target domain are used. Finally, the conditional maximum mean difference method is used to achieve feature alignment between the source domain and the target domain.
[0069] The multilayer perceptron classifier is a two-layer fully connected neural network. The first layer contains 288 neurons and the second layer contains 2 neurons, representing the target and no-target situations respectively.
[0070] The data in the source domain and the target domain are not from the same domain, and the distribution of the data may be different. In order to achieve effective migration, it is necessary to align the multi-scale high-level features of the source domain and the target domain, and select the loss function and regularization term to discover the common features between them.
[0071] The Maximum Mean Discrepancy (MMD) method has been widely used to measure the difference between marginal distributions, and its main function is to evaluate the difference between two independent distributions. The premise of this method is that if the two distributions are the same, the statistical characteristics of the samples extracted from the two distributions should also be the same. In the present invention, although the environmental conditions for detecting targets in different sea areas may be different, the task itself is the same. Therefore, the detection targets under different sea conditions can be regarded as coming from the same distribution. The specific implementation of the maximum mean difference method is to find a mapping function to map all sample values of two different distributions to corresponding function values, and then calculate their means and make differences respectively to obtain the mean difference. If a mapping function can be found to minimize the maximum mean difference, it means that the two distributions are the same under a specific mapping. Such a method can quantify and compare the differences between the two distributions, thereby guiding the implementation of feature alignment and domain adaptation tasks.
[0072] The present invention takes into account that data samples of the same category should be in the same subspace, even if they belong to different domains. Therefore, it is chosen to reduce the conditional distribution of the source domain and the target domain, and the conditional maximum mean discrepancy (CMMD) method is used as the multi-scale feature alignment loss function to perform feature alignment. The conditional maximum mean difference method achieves feature alignment by minimizing the maximum mean difference between samples of the same category, avoiding similar situations such as aligning multi-scale features with targets in the source domain with multi-scale features without targets in the target domain, thereby preventing the occurrence of negative transfer effects. However, this method requires the label of the target domain, so the pseudo-label method is chosen to perform the conditional maximum mean difference method, hoping to improve the quality of pseudo-labels in the process of continuous iteration, thereby achieving the goals of feature alignment and domain adaptation. The conditional maximum mean difference loss is used as the multi-scale feature alignment loss function, and the calculation formula is:
[0073] (2)
[0074] (3)
[0075] Among them, formula (2) uses MMD to calculate the multi-scale feature alignment loss, and formula (3) uses CMMD to calculate the multi-scale feature alignment loss. is the multi-scale feature alignment loss, is the feature set of all samples in the source domain, is the feature set of all samples in the target domain, C is the label category of the classification model, and its value is 2, n s is the number of samples in the source domain, is the mapping function, n t is the number of samples in the target domain, is the feature set of each sample in the source domain, for The feature set of samples with label category c in , is the feature set of each sample in the target domain, for The feature set of samples with label category c in .
[0076] The label categories include no target and target. c=1 and c=2 are two label categories, which can be defined by yourself.
[0077] Among them, one sample is a 1s underwater acoustic signal after segmentation.
[0078] Minimize the maximum mean difference, The smaller the value of , the smaller the distribution difference between the features of the target domain and the source domain. The cross entropy loss function is calculated based on the data features of the source domain after feature alignment and adjusts the parameters of the classification model.
[0079] The calculation formula of the total loss function is:
[0080] (4)
[0081] Among them, J represents the cross entropy loss function, p k (·) is the output of the classification model, is the label in the source domain output by the classification model, is the spectrogram of the source domain input classification model, for The corresponding true label, d(·,·) represents the multi-scale feature alignment loss calculated by formula (3), and λ is a parameter used to balance the loss.
[0082] The calculation formula of λ is:
[0083] (5)
[0084] Among them, γ is fixed to 10, and p increases linearly from 0 to 1 according to the number of iterations.
[0085] The spectrograms in the target domain and the source domain are divided into a set number of batches. In each training process of the classification model, the spectrograms of the target domain and the source domain are simultaneously input into the classification model. The labels corresponding to the output source domain samples are predicted labels. Each source domain sample corresponds to a real label. The labels corresponding to the output target domain samples are pseudo labels. The cross entropy loss function and the multi-scale alignment loss function are used to calculate the loss function according to the pseudo labels, predicted labels, real labels, and the features corresponding to the source and target domains. The classification model is adjusted and iteratively trained until the set conditions are met, and the training is stopped. The pseudo labels of the output target domain samples are high-confidence labels. The set conditions may be that the training rounds reach a preset number of times, or that the classification model reaches a preset accuracy. In this way, the network can continuously learn and improve the accuracy of common features, and gradually optimize the classification effect of the classification model in the target domain during the iteration process.
[0086] During the training process, the classification loss function and the multi-scale feature alignment loss function are used to adjust the parameters in the model.
[0087] The Institute of Acoustics of the Chinese Academy of Sciences conducted a sea trial in the South China Sea and collected data on the radiation noise of real ships under actual sea conditions. The data were collected in three different sea areas three times, and the same number of samples were randomly selected in sea areas A, B and C to carry out the task of detecting whether there are ships.
[0088] The present invention conducts specific target recognition experimental tests based on data provided by the Institute of Acoustics, Chinese Academy of Sciences.
[0089] First, draw the spectrogram of the underwater acoustic signal, split all the long sound signal data into one-second segments; take the underwater acoustic signal per second as the unit, use a 2048-point window to perform Fourier transform, and set the number of overlapping samples and the number of Fourier transform points to 1024 and 2048 points respectively to draw the spectrogram. For each experiment, all the data from two sea areas are selected, and both the source domain data and the target domain data are included in the experiment. In the experiment, the pixel value of each spectrogram is [224,224,3]. The present invention uses a network based on ResNet-50 to extract the low-level features of the spectrogram. Then, use Figure 3 A multi-scale advanced feature extraction module is used to obtain more representative multi-scale features. By concatenating four multi-scale features, 288-dimensional features can be obtained.
[0090] The multi-scale features extracted from the source domain and the target domain are input into Figure 1 In the feature alignment and classification module, the conditional maximum mean difference method is used as the multi-scale feature alignment loss function to make the multi-scale features of the source domain and the target domain have the same distribution in the same category, and improve the quality of the target domain pseudo-label through continuous iteration.
[0091] When using the classification model for training, the maximum number of training times is set to 30, the weight decay parameter of L2 regularization is 0.0005, and the learning rate is set to 0.001. According to the given hyperparameters and the data of the source domain and the target domain, the classification model is trained, and the label data of the target domain is output to calculate the detection accuracy.
[0092] The Domain Adversarial Method (DAM) is one of the most widely used methods for feature alignment. DAM introduces adversarial loss to make the feature distribution of the model in the source domain and the target domain similar, thereby achieving feature alignment.
[0093] Table 1: Comparison of the accuracy of CMMD, MMD and DAM
[0094]
[0095] According to Table 1, B→A indicates that B is the source domain and A is the target domain. Comparing the CMMD used in the present invention with MMD and DAM, the CMMD used in the present invention has a higher accuracy than other methods.
[0096] As shown in Table 2, only ResNet-50 is used as the training network. The data of sea area A, sea area B and sea area C are input into ResNet-50 respectively, and divided into training set and test set at a ratio of 4:1. The training process is supervised training. The self-test accuracy of sea area A on the data set is 86.30%, the self-test accuracy of sea area B on the data set is 94.82%, and the self-test accuracy of sea area C on the data set is 85.59%. Among them, the targetless data is the data without ships, and the target data is the data with ships.
[0097] Table 2: Data Description
[0098]
[0099] The present invention uses sea area A as the source area and sea area B as the target area. In this case, the detection accuracy of target area B is 87.33%. In addition, the present invention uses sea area C as the source area and sea area B as the target area. In this case, the detection accuracy of target area B reaches 91.04%. It can be seen that the accuracy of the present invention is not much different from the self-test accuracy, and the present invention saves the labeling cost.
Claims
1. A target detection method based on spectrogram, characterized in that: The steps include: S1. Collect the hydroacoustic signal of the target domain, determine the source domain of the same type as the target domain, and obtain the hydroacoustic signal of the source domain in the database according to the detection task of the hydroacoustic signal of the target domain. The hydroacoustic signal of the source domain is labeled with 0 or 1, 0 means no target, 1 means there is a target, and the target domain is the sea area to be tested; S2. Plot the underwater acoustic signals in the target domain and the source domain as spectrograms respectively; S3. Establish a classification model for target detection, divide the spectrograms of the target domain and the source domain into batches of a set number, and input them into the classification model for training and classification. In each training process, the spectrograms of the target domain and the source domain are simultaneously input into the classification model, and the labels corresponding to the output source domain samples are predicted labels. Each source domain sample corresponds to a real label, and the labels corresponding to the output target domain samples are pseudo labels. The cross entropy loss function and the multi-scale alignment loss function are used to calculate the loss function according to the pseudo labels, predicted labels, real labels, and the corresponding features of the source domain and the target domain. The classification model is adjusted and iteratively trained until the set conditions are met, and the training is stopped. The pseudo labels of the output target domain spectrogram data are high-confidence labels, and the target detection results are obtained. The classification model includes: A low-level feature extraction module, connected to the multi-scale high-level feature extraction module, is used to extract low-level features of the spectrogram; A multi-scale high-level feature extraction module, connected to the low-level feature extraction module and the feature alignment and classification module, for extracting high-level features of the spectrogram; and The feature alignment and classification module is connected to the multi-scale advanced feature extraction module to output target detection results.
2. The target detection method based on spectrogram according to claim 1, characterized in that: The specific method of drawing the spectrogram in step S2 is: Based on the window length of Fourier transform, the underwater acoustic signal is Fourier transformed to generate a spectrogram, and the number of points of the window length of Fourier transform is 512~2048.
3. The target detection method based on spectrogram according to claim 1, characterized in that: The specific method of training and classification in step S3 is: The spectrograms of the target domain and the source domain are simultaneously input into the classification model for iterative training. Each training is performed using the classification loss function and the multi-scale feature alignment loss function to adjust the model parameters until the set conditions are met. The training is then stopped and the label corresponding to each sample in the output target domain is the target detection result.
4. The target detection method based on spectrogram according to claim 1, characterized in that: The low-level feature extraction module includes a first convolutional layer and sixteen bottleneck blocks; The input of the low-level feature extraction module passes through the first convolutional layer and then passes through sixteen bottleneck blocks in sequence. The sixteenth bottleneck block inputs the output result into the multi-scale high-level feature extraction module.
5. The target detection method based on spectrogram according to claim 4, characterized in that: Each bottleneck block consists of three convolutional layers.
6. The target detection method based on spectrogram according to claim 4, characterized in that: The multi-scale high-level feature extraction module includes a first convolution structure, a second convolution structure, a third convolution structure, a fourth convolution structure and a global average pooling layer; The output results of the sixteenth bottleneck block all pass through the above four convolutional structures. The outputs of the four convolutional structures all pass through the global average pooling layer to generate a multi-scale feature set, which is then output to the feature alignment and classification module.
7. The target detection method based on spectrogram according to claim 6, characterized in that: The first convolution structure includes a 1×1 convolution layer; the second convolution structure includes a 1×1 convolution layer and a 5×5 convolution layer; the third convolution structure includes a 3×3 average pooling layer and a 1×1 convolution layer; the fourth convolution structure includes a 1×1 convolution layer and two 3×3 convolution layers; the convolution kernel size of the global average pooling layer is 7×7.
8. The target detection method based on spectrogram according to claim 1, characterized in that: The feature alignment and classification module includes a multi-layer perceptron classifier, which predicts the features after feature alignment, outputs predicted labels and pseudo labels, realizes feature alignment using a multi-scale feature alignment loss function, adjusts network parameters using a classification loss function, and outputs confidence labels.
9. The target detection method based on spectrogram according to claim 8, characterized in that: The calculation formula of the multi-scale feature alignment loss function is: ; in, is the multi-scale feature alignment loss, is the feature set of all samples in the source domain, is the feature set of all samples in the target domain, C is the label category of the classification model, and its value is 2. is the mapping function, n s is the number of samples in the source domain, n t is the number of samples in the target domain, is the feature set of each sample in the source domain, for The feature set of samples with label category c in , is the feature set of each sample in the target domain, for The feature set of samples with label category c in .