A dual-branch ship classification recognition method and system fusing contrastive learning
By employing a dual-branch ship classification and recognition method that integrates contrastive learning, and utilizing multi-scale feature extraction and supervised contrastive learning mechanisms, the problem of reduced recognition accuracy caused by imbalanced ship data is solved, thereby improving recognition performance and the ability to distinguish a few categories.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INST OF ACOUSTICS CHINESE ACAD OF SCI
- Filing Date
- 2026-02-02
- Publication Date
- 2026-06-02
AI Technical Summary
Existing ship classification and identification methods suffer from reduced accuracy when faced with imbalanced data. Traditional methods struggle to effectively improve the identification capabilities of a few categories, and conventional contrastive learning methods lack adaptability under imbalanced conditions.
A dual-branch ship classification and recognition method based on fusion contrastive learning is adopted. By combining a multi-scale shared feature extractor and a feature enhancement branch with attention mechanism and category-aware sampling, a supervised contrastive learning mechanism is designed to build stable feature representation and discrimination ability.
It significantly improved the accuracy of ship identification and the F1-macro index under highly imbalanced conditions, enhanced the identification performance of a few categories, and improved the identification effect in imbalanced data scenarios.
Smart Images

Figure CN122135073A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of signal processing and deep learning, and in particular to a dual-branch ship classification and identification method and system that integrates contrastive learning. Background Technology
[0002] With the increasing frequency of maritime activities, the number and types of ships have increased significantly. Research on ship classification and identification is of great value in marine economic development and safety monitoring. Ship radiated noise signals contain rich ship information and are an important basis for target identification. Identification using passive sonar to receive ship radiated noise signals has advantages such as low power consumption and strong concealment, and its application prospects are quite broad.
[0003] Currently, ship classification and identification mainly fall into two categories: manual sonar identification and automatic machine identification. Manual identification relies on experienced sonar operators and is easily affected by environmental and human factors, leading to low identification efficiency. Machine identification, on the other hand, can automatically learn and extract key features from large amounts of data, reducing reliance on prior knowledge, enhancing the objectivity of the identification process, and improving identification efficiency. Automatic machine identification methods mainly include traditional machine learning methods and deep learning methods. Traditional machine learning methods primarily include Naive Bayes, decision trees, support vector machines, K-nearest neighbors, and hidden Markov models.
[0004] However, with the increasing complexity of the marine environment, machine learning methods are struggling to meet the accuracy requirements of practical applications. Compared to traditional shallow classifiers, deep learning methods employ an end-to-end learning model, possessing stronger feature representation capabilities and the ability to fully exploit hidden patterns in data, gradually becoming the mainstream research direction for ship classification and identification. Deep neural network models integrate feature learning, feature optimization, and classification decisions within a single framework. Through the cooperation between each stage, they better handle complex feature representations, demonstrating enormous application potential in this field. For example, in the paper "Cao X, Togneri R, Zhang X, et al. Convolutional neural network with second-order pooling for underwater target classification[J]. IEEE Sensors Journal, 2019", Cao et al. learned temporal correlation from the time-spectral representation of ship signals and proposed a classification model combining convolutional neural networks and second-order pooling, achieving effective identification of ship targets.
[0005] To achieve optimal recognition results, deep learning-based ship classification and recognition methods require a sufficient and balanced dataset to ensure the model can fully learn the features of various ship targets. However, in practical applications, due to significant differences in the frequency of different types of ships in the same sea area, the available ship radiated noise data often suffers from imbalance. The scarcity of samples in some categories makes the model susceptible to data bias during training, leading to predictions that favor the majority class and thus reducing overall recognition performance.
[0006] Data imbalance is not only present in ship classification and identification tasks, but also widely appears in image classification, object detection, and other fields, attracting considerable attention. However, due to the complexity of underwater acoustic data acquisition conditions and the difficulty of data annotation, existing research on data imbalance in ship classification and identification tasks remains relatively limited. Currently, methods to address this problem mainly fall into two categories: data resampling and algorithm optimization. Data resampling methods include undersampling of the majority class and oversampling of the minority class. Undersampling achieves class balance by reducing the number of majority class samples, but this leads to the loss of feature information in the majority class, weakening its feature representation ability, and therefore is rarely used in practice. Oversampling methods typically resample minority class samples to adjust the data distribution, or generate new minority class samples through interpolation to improve data diversity. However, these methods do not essentially increase the effective information content of the input data, and their improvement on model performance is relatively limited. In addition, interpolation-based sample generation methods are difficult to maintain time dependence and are not suitable for time-series signals such as underwater acoustic signals. Algorithm optimization mainly includes cost-sensitive learning and ensemble learning strategies. Cost-sensitive learning leverages prior information from imbalanced datasets to assign different misclassification costs to different classes, thereby increasing the model's attention to minority class samples during training. Compared to data resampling methods, this approach can alleviate class imbalance without disrupting the original data distribution, but typically requires repeated adjustments to the cost parameters to achieve ideal classification performance. Ensemble learning methods train multiple weak classifiers and fuse their predictions to construct a stronger classifier with superior performance, thus improving the ability to identify minority classes. However, these methods are time-consuming to train and infer, making them difficult to deploy in real-world scenarios and limiting their practical applicability.
[0007] In recent years, contrastive learning, as an important research direction in unsupervised learning, has demonstrated excellent performance in fields such as natural language processing and computer vision. Compared with the limitations of traditional methods in feature modeling and parameter tuning, contrastive learning directly constructs similar and dissimilar sample pairs from the data, completing discriminative training without the need for extensive parameter adjustments or complex ensemble structures, and learning more discriminative features. In the field of underwater information processing, contrastive learning has also shown good application potential. In the paper "J. Han...",... et al. , 'Underwater image restoration via contrastive learning and a real-world dataset', Remote Sensing In the paper "P. Zhu 2022", Han et al. combined contrastive learning with generative adversarial networks for underwater image restoration, effectively improving the image restoration quality by maximizing the mutual information between the original and restored images. Furthermore, in the paper "P. Zhu et al. , 'SFC-Sup: Robust Two-Stage Underwater Acoustic Target Recognition Method Based on Supervised Contrastive Learning', IEEE Transactions on Geoscience and Remote Sensing In their paper, "2023", Zhu et al. designed a two-stage underwater acoustic target recognition method combining spectral feature classification and contrastive learning. By mining the consistency features of different sound segments, they further improved the recognition accuracy under continuous recording conditions. However, conventional contrastive learning methods are usually based on the default assumptions of sufficient sample quantity and relatively balanced class distribution. Their positive and negative sample pair construction strategies and objective function design do not consider feature learning bias under class imbalance conditions. Therefore, existing methods lack adaptability to imbalanced data scenarios. Summary of the Invention
[0008] The purpose of this invention is to propose a ship classification and identification method and system to solve the problem of reduced identification accuracy caused by the uneven distribution of ship data categories in the prior art. By introducing contrastive learning and constructing a dual-branch learning structure, the identification ability of a few types of ships is improved while ensuring the stability of model training.
[0009] To achieve the above objectives, this invention provides a dual-branch ship classification and identification method that integrates contrastive learning, characterized by the following steps: Preprocess the time-domain signal of ship radiated noise and extract MFCC features; The MFCC features are input into a trained dual-branch ship classification and recognition model based on fusion and contrast learning. Output the prediction results for ship categories; In the training stage of the dual-branch ship classification and identification model based on fusion contrast learning, after preprocessing the ship radiated noise time-domain signal to extract MFCC features, data augmentation processing is also performed on the MFCC features. The dual-branch ship classification and recognition model based on fusion contrastive learning includes: The multi-scale shared feature extractor is used to extract features from the input MFCC features and the enhanced MFCC features in parallel using convolutional kernels of different scales, and to concatenate the outputs of each scale convolution to form a shared feature that integrates multi-scale information. The classification learning branch is used to weight and strengthen the key discriminative features by multi-scale shared features formed by MFCC features, and then perform classification to output the prediction results of ship categories; and calculate the classification loss based on the prediction results and the true labels. The feature enhancement branch is used to enhance the feature representation ability of the multi-scale shared features formed by MFCC features and the multi-scale shared features formed by enhanced MFCC features. Then, the feature is input into the projection head to obtain the embedded features. Based on the obtained embedded features and the embedded features of positive and negative samples, the contrastive loss is calculated.
[0010] As a preferred embodiment of the above method, the classification learning branch includes a residual learning block, an attention fusion block, a global average pooling layer, and a classifier. In the classification learning branch, the multi-scale shared features formed by MFCC features are respectively passed through the residual learning block, the attention fusion block, and the global average pooling layer to weight and strengthen the key discriminative features. Then, they are fed into the classifier to output the prediction result of the ship category, and the classification loss is calculated based on the prediction result and the true label.
[0011] As another preferred embodiment of the above method, the feature enhancement branch includes a residual learning block, an attention fusion block, a global average pooling layer, and a projection head. The multi-scale shared features formed by MFCC features and the multi-scale shared features formed by enhanced MFCC features are passed through the residual learning block, the attention fusion block, and the global average pooling layer to enhance the feature expressive power. Then, they are input into the projection head to obtain embedded features, which are used to construct the similarity and difference relationships between samples. Based on the obtained embedded features and the embedded features of positive and negative samples, the contrast loss is calculated.
[0012] As another preferred embodiment of the above method, the classification loss and contrast loss are summed to form a joint training loss function; the entire network model is then trained end-to-end using the joint training loss function.
[0013] As another preferred embodiment of the above method, the multi-scale shared feature extractor includes: a three-branch parallel convolutional module using three different sizes of convolutional kernels and a combination module; The three convolutional modules are consistent in depth and structure, and each convolutional module includes an initial convolutional layer, a residual learning block, and a skip connection structure. The initial convolutional layers include a 2D convolutional layer, a Batch Normalization (BN) layer, a ReLU activation function, and a max pooling layer. The operation formulas for the initial convolutional layers in each branch are as follows: (1) in, Indicates the input MFCC, Indicates size is convolution kernel, Activate ReLU; The residual learning block consists of a two-dimensional convolutional layer, a batch normalization (BN) layer, a ReLU activation function, and a skip connection structure. Its operation formula is as follows: (2) in, , The convolution kernel for the two convolutional layers in the residual learning block; The combination module combines features from the three scales of the three-branch convolution module along the channel dimension to form multi-scale shared features.
[0014] As a further preferred embodiment of the above method, a supervised contrastive learning mechanism is introduced into the feature enhancement branch, which uses the category label information provided by the classification learning branch to constrain the construction of positive and negative sample pairs during the contrastive learning process.
[0015] As a further preferred embodiment of the above method, the supervised contrastive learning mechanism is specifically as follows: Let any ship sample For anchor samples, their corresponding category labels are: Different augmented views of the sample are generated using data augmentation strategies, denoted as... and The class label remains unchanged; samples with the same class label as the anchor sample and their data-augmented versions are defined as positive samples, while samples with different class labels and their data-augmented versions are defined as negative samples. Each anchor sample generates two augmented versions through a hierarchical data augmentation strategy. After mapping and normalization by the shared feature extraction module and feature augmentation branch, the embedding representation used for contrastive learning is obtained, as shown in the following equation: (10) in, This refers to the network module preceding the projection head. For projection head, For the first The first sample One data-enhanced version; The data augmentation strategy is a hierarchical data augmentation based on MFCC, which differentiates and augments different MFCC coefficients by analyzing the contribution of different MFCC coefficients to category discrimination from the perspective of MFCC feature statistics.
[0016] As a further preferred embodiment of the above method, the joint training loss function is: (16) in, Indicates the loss in classification learning; To compare learning loss; Classification learning loss The cross-entropy loss function, weighted by a cosine factor, is defined as follows: (17) in, This represents the probability that a ship sample is predicted to be its true class; when A larger value indicates that the sample is easier to classify, while a smaller value indicates that the sample is more difficult to classify. For the standard cross-entropy loss term, The introduced cosine weighting factor; The adjustment exponent is used to control the modulation intensity of the cosine weight's contribution to the sample loss; Comparative learning loss As shown in the following formula: (18) in, Represents the set of features for all anchor samples. Represents the set of positive samples for anchor samples. This represents the set of samples other than the anchor sample within the training batch. This is the cosine similarity calculation function. This is a temperature coefficient used to adjust the smoothness of the similarity distribution.
[0017] As a further preferred approach to the above method, the training phase also includes category-aware sampling, which introduces category constraints into the mini-batch construction process, as follows: Assume there are a total of The ship category, the first The index set of ship-type samples is During the construction of each mini-batch, the first step is to randomly select from the entire set of categories. There are several different categories; for each selected category... From its sample set Random sampling There are 1 sample, denoted as _ . The sample sets of all categories are merged to form a small batch, as shown in equation (11) below: (11).
[0018] To achieve the above objectives, the present invention also provides a dual-branch ship classification and identification system that integrates contrastive learning, for implementing the above-mentioned dual-branch ship classification and identification method, characterized in that it includes: The preprocessing module is used to preprocess the time-domain signal of ship radiated noise and extract MFCC features; A dual-branch ship classification and identification model that integrates contrastive learning is used to receive the MFCC feature input and output the prediction result of the ship category; In the training phase of the fusion-contrast learning-based dual-branch ship classification and recognition model, the preprocessing module is further used to perform data augmentation processing on the MFCC features; the fusion-contrast learning-based dual-branch ship classification and recognition model includes: The multi-scale shared feature extractor is used to extract features from the input MFCC features and the enhanced MFCC features in parallel using convolutional kernels of different scales, and to concatenate the outputs of each scale convolution to form a shared feature that integrates multi-scale information. The classification learning branch is used to weight and strengthen the key discriminative features by multi-scale shared features formed by MFCC features, and then perform classification to output the prediction results of ship categories; and calculate the classification loss based on the prediction results and the true labels. The feature enhancement branch is used to enhance the feature expressive power of the multi-scale shared features formed by MFCC features and the multi-scale shared features formed by enhanced MFCC features. Then, the feature is input into the projection head to obtain the embedded features. Based on the obtained embedded features and the embedded features of positive and negative samples, the contrast loss is calculated. The joint training loss function module is used to sum the classification loss and the contrastive loss to form the joint training loss function, which is then used to train the entire network model end-to-end.
[0019] Compared with the prior art, the advantages of this application are: (1) To address the performance degradation caused by imbalanced ship data, a dual-branch ship recognition network (DBSRN) integrating contrastive learning is proposed. Multi-scale feature extraction captures key information at different levels, and an attention mechanism is used to achieve feature fusion. A contrastive learning mechanism is introduced to enhance the discriminative power of feature representations by mining the similarities and differences between samples. A joint training loss function is used to optimize the network, enabling the feature enhancement branch based on contrastive learning to better serve the classification task, thereby effectively improving the overall recognition performance. Introducing contrastive learning into ship classification and recognition tasks has unique advantages. On the one hand, contrastive learning learns discriminative features from the overall data structure level by constraining the distribution structure of features in the embedding space. Compared to relying solely on classification loss for decision boundary learning, contrastive learning is less sensitive to imbalanced label distribution, helping to mitigate the adverse effects of data imbalance on recognition performance. On the other hand, contrastive learning is usually combined with diverse data augmentation strategies, which can construct richer learning samples for minority ship classes, thereby improving the model's ability to distinguish between ship classes with scarce samples. Experimental results on the Shipsear dataset show that, under highly imbalanced conditions where the proportions of the five ship types are 0.5%, 0.5%, 98%, 0.5%, and 0.5%, respectively, DBSRN improves the recognition accuracy by 25.20%, 20.40%, and 17.60% compared to the classic classification models ECAPA-TDNN, Cam++, and MR-CNN-A, and improves the F1-macro accuracy by 30.01%, 25.27%, and 20.43%, respectively.
[0020] (2) To address the insufficient adaptability of conventional contrastive learning methods in the context of imbalanced ship data, a class-aware supervised contrastive learning mechanism (CA-SupCon) is proposed. By optimizing the construction method of positive and negative sample pairs, the inter-class discriminative ability of the model under imbalanced conditions is enhanced; a class-aware sampling mechanism is designed to ensure class coverage and sample quantity within a batch, providing stable and sufficient training data for contrastive learning. Experimental results on the Shipsear dataset show that under highly imbalanced conditions with the proportions of five ship sample types being 0.5%, 0.5%, 98%, 0.5%, and 0.5%, respectively, CA-SupCon improves the recognition accuracy by 8.00% and the F1-macro accuracy by 9.74% compared to the conventional contrastive learning method SimCLR.
[0021] (3) Traditional data augmentation methods often have uncontrollable effects on time-frequency features, leading to the destruction of highly discriminative ship features. To address this issue, a hierarchical mel-frequency cepstral coefficients augmentation (H-MFCCAug) strategy is proposed. By analyzing the discriminative power of each cepstral coefficient, its importance in ship category discrimination is evaluated, and a differentiated augmentation strategy is applied accordingly to construct more discriminative sample pairs for CA-SupCon. Experimental results on the Shipsear dataset show that under highly imbalanced conditions where the proportions of the five ship categories are 0.5%, 0.5%, 98%, 0.5%, and 0.5%, respectively, the recognition accuracy of H-MFCCAug is improved by 8.80% and 2.80% compared to random time-frequency masking and hybrid waveform augmentation, respectively, and by 11.23% and 2.55% compared to F1-macro, respectively. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the dual-branch ship identification network structure in a specific embodiment of the present invention; Figure 2 This is a schematic diagram of the residual learning block in a specific embodiment of the present invention; Figure 3 This is a schematic diagram of the classification learning branch structure in a specific embodiment of the present invention; Figure 4 The radar chart showing the average MFCC values for each category in a specific embodiment of the present invention.
[0023] Explanation of English and Chinese labels in the attached diagram: Ship signal indicates a ship's signal; MFCC represents Mel frequency cepstral coefficients; Data augmentation refers to data enhancement. Multi-scales shared feature extractor; Conv represents convolution; The classification learning branch represents the classification learning branch. The feature enhancement branch represents the feature enhancement branch; Residual block represents a residual learning block; Attention represents the attention fusion block; Global Avg Pooling represents a global average pooling layer; Classifier represents a classifier; Projector represents the mapping header; Linear represents a linear layer; ReLU represents the ReLU function; Label means label; Joint training refers to training conducted in conjunction with other participants. Batch Normalization (BN) represents the batch normalization layer. Softmax represents the Softmax layer. Outpu means output; Sigmoid represents the Sigmoid activation function; GAP stands for Global Average Pooling Layer. Detailed Implementation
[0024] The technical solutions provided in this application are further illustrated below with reference to the embodiments.
[0025] Imbalanced class data leads to majority class ship samples dominating gradient updates during training, limiting the effective participation of minority class samples. This results in a looser distribution of intra-class features and compressed inter-class boundaries, ultimately reducing overall recognition accuracy. Contrastive learning, by constructing training objectives at the sample level, alleviates the problem of insufficient sample participation under imbalanced data conditions to some extent. Such methods allow each ship sample to participate in feature learning through its corresponding positive and negative samples, improving feature discriminativeness at the sample level compared to traditional classification methods. However, conventional contrastive learning methods still struggle to effectively address severe data imbalance at the class level. Because they are typically based on the default assumption of balanced class numbers, the number of positive samples available for constructing minority class data is limited, making it difficult to fully characterize intra-class feature structures. Consequently, the representation of the minority class in the feature space remains susceptible to interference from the majority class.
[0026] To address the aforementioned issues and further enhance the recognition capabilities of ship identification systems under imbalanced data conditions, this invention provides a dual-branch ship recognition network (DBSRN) that integrates contrastive learning. This network utilizes multi-scale convolution and attention mechanisms to enhance feature representation capabilities and designs a contrastive learning mechanism that matches the characteristics of ship signals, achieving more discriminative feature learning.
[0027] As a specific embodiment of the present invention, a dual-branch ship classification and identification method integrating contrastive learning includes the following steps: Preprocess the ship noise time-domain signal to extract MFCC features; The MFCC features are input into a trained dual-branch ship classification and recognition model based on fusion and contrast learning. Output the prediction results for ship categories.
[0028] like Figure 1 As shown, specifically, in the stage of training the dual-branch ship classification and recognition model of the fusion contrast learning, after preprocessing the ship radiated noise time-domain signal to extract MFCC features, the MFCC features are further subjected to data augmentation processing.
[0029] The dual-branch ship classification and recognition model based on fusion contrastive learning includes: The multi-scale shared feature extractor is used to extract features from the input MFCC features and the enhanced MFCC features in parallel using convolutional kernels of different scales, and to concatenate the outputs of each scale convolution to form a shared feature that integrates multi-scale information. The classification learning branch is used to weight and strengthen the key discriminative features of the input shared features, then perform classification, and output the prediction result of the ship category; and calculate the classification loss based on the prediction result and the true label. The feature enhancement branch is used to enhance the expressive power of shared features, which are then input into the projection head to obtain embedded features. Based on the obtained embedded features and the embedded features of positive and negative samples, the contrastive loss is calculated.
[0030] During the training phase, the ship radiated noise time-domain signal is first preprocessed to extract MFCC features, which serve as the input feature representation for the subsequent network. Data augmentation is then performed on the MFCC features to provide positive and negative samples for subsequent contrastive learning. Next, the extracted MFCC features and the augmented MFCC features are input into a multi-scale shared feature extractor. Convolutional kernels of different scales are used in parallel for feature extraction. The outputs of each scale convolution are then concatenated to form a shared feature representation that integrates multi-scale information, including multi-scale shared features formed from the MFCC features and multi-scale shared features formed from the augmented MFCC features.
[0031] Building upon this, multi-scale shared features are simultaneously input into both the classification learning branch and the feature enhancement branch. The classification learning branch includes a residual learning block, an attention fusion block, a global average pooling layer, and a classifier. Within the classification learning branch, the multi-scale shared features formed by the MFCC features are weighted and enhanced through the residual learning block, attention fusion block, and global average pooling layer, respectively, before being fed into the classifier to output the predicted ship category. Then, the classification loss is calculated based on the predicted result and the true label.
[0032] The feature enhancement branch includes a residual learning block, an attention fusion block, a global average pooling layer, and a projection head. In the feature enhancement branch, the multi-scale shared features formed from MFCC features and the multi-scale shared features formed from enhanced MFCC features also pass through the residual learning block, attention fusion block, and global average pooling layer to enhance feature expressive power. These are then input into the projection head to obtain embedded features, which are used to construct similarity and difference relationships between samples. Based on the obtained embedded features and the embedded features of positive and negative samples, a contrastive loss is calculated.
[0033] Finally, the classification loss and contrastive loss are summed to form the joint training loss function. The entire network is then trained end-to-end using this joint training loss function. The contrastive learning branch, guided by feature constraints, learns shared features in reverse, thereby improving the discriminative ability of the classification branch, especially the ability to distinguish minority class samples. The network model training is complete when the preset number of training epochs is reached or the joint training loss function converges.
[0034] During the testing phase, the radiated noise signal of the ship to be identified is input, and MFCC is extracted as the network input. No MFCC data augmentation is performed in this phase. The feature enhancement branch based on contrastive learning does not participate in the calculation. Only the classification learning branch is retained, and the ship identification prediction result is output, thus achieving efficient and stable ship classification and identification.
[0035] The multi-scale shared feature extractor is described in detail below.
[0036] The multi-scale shared feature extractor includes a three-branch parallel convolutional module and a combination module using three different sizes of convolutional kernels.
[0037] To fully capture the local structural differences in the time-frequency features of ship signals, a multi-scale shared feature extractor is employed. The network module of this invention uses the MFCC of the ship signal as input and performs multi-scale feature extraction through a three-branch parallel convolutional structure, providing low-level features for the classification learning branch and the feature enhancement branch. Feature pathways are constructed using convolutional kernels of three different sizes: 3×3, 5×5, and 7×7, enabling the model to simultaneously obtain multi-scale representation capabilities from local details to broad structures within the same feature space. The three branches maintain consistency in network depth and structure, with each branch containing a convolutional module. Each convolutional module includes an initial convolutional layer, a residual learning block, and skip connections contained within the residual learning block, used to progressively enhance feature representation capabilities and ensure stable gradient propagation.
[0038] The initial convolutional layer consists of a two-dimensional convolutional layer, batch normalization (BN), a ReLU activation function, and a max pooling layer, providing stable intermediate feature representations for subsequent residual learning. The initial convolutional operations of each branch are shown in Equation (1).
[0039] (1) in, Indicates the input MFCC, Indicates size is convolution kernel, Activate ReLU.
[0040] The residual learning block consists of a two-dimensional convolutional layer, a batch normalization (BN) layer, a ReLU activation function, and skip connections, such as... Figure 2 As shown in equation (2). Skip connections add the features extracted from the convolution to the corresponding input element by element, and then activate them with ReLU to obtain the final output.
[0041] (2) in, , This represents the convolution kernels of the two convolutional layers in the residual learning block. The kernel sizes of the two convolutional layers in the residual learning block are consistent with the kernel sizes of the initial convolutional layers, and the three branches are 3×3, 5×5, and 7×7, respectively.
[0042] Residual structures can promote the effective propagation of gradients in deep networks, alleviate the feature degradation problem caused by convolution stacking, enable the model to stably capture the high-dimensional deep features of ship signals, and make minority class samples less likely to be submerged by majority class gradients during the optimization process.
[0043] Finally, the combination module combines the features from the three scales of the three-branch convolutional structure along the channel dimension to form a shared feature space, i.e., multi-scale shared features, as shown in Equation (3).
[0044] (3) The complementary fusion of multi-scale information effectively enhances the overall feature representation capability, providing a feature foundation for subsequent classification and recognition.
[0045] The following describes in detail the classification learning branch for category discrimination.
[0046] To achieve category prediction of ship signals, a proposed classification learning branch structure is as follows: Figure 3 As shown. The input to this branch is the fused features output by the multi-scale shared feature extractor, and its network structure consists of residual learning blocks, attention fusion blocks, global average pooling layers, and a classifier.
[0047] The residual learning block uses the same structure as the multi-scale shared feature extractor to ensure continuity. The attention fusion block mainly consists of four parts: convolutional feature extraction path, weight extraction path, attention weighting, and residual fusion. In the convolutional feature extraction path, the input multi-scale features are downsampled through consecutive convolutional ReLU activation units. For the input features... The feature representation obtained by this path is shown in equation (4).
[0048] (4) in, Indicates global average pooling. This represents the convolution-ReLU activation operation for the convolution feature extraction path.
[0049] The weight extraction path is structurally symmetrical to the convolutional feature extraction path, including a convolution-activation unit, global average pooling, and a sigmoid activation function, used to generate channel attention weights. Its output form is shown in Equation (5).
[0050] (5) in, Activated for sigmoid. This represents the convolution-ReLU activation operation for the weight extraction path.
[0051] Then, the generated channel weights are applied to the convolutional features to achieve attention weighting, as shown in Equation (6).
[0052] (6) in, This indicates element-wise multiplication between channels.
[0053] To further improve representation stability, an attention fusion block introduces a residual learning mechanism. The input features are mapped to the same number of channels through a 1×1 convolution, and the output is shown in Equation (7).
[0054] (7) in, This represents a 1×1 convolution transformation.
[0055] The output of the attention fusion block is then passed through a global average pooling layer to compress the spatial dimension and obtain a more stable global feature representation. Finally, this global feature is mapped to the class space by a classifier consisting of fully connected layers and Softmax to generate predicted probabilities for each class.
[0056] The feature enhancement branch based on contrastive learning is described in detail below.
[0057] To further enhance the discriminative power of multi-scale shared features, a feature enhancement branch based on contrastive learning is proposed. This branch shares the same multi-scale features as the classification learning branch as input. The input multi-scale features are sequentially passed through a residual learning block, an attention fusion block, and a global average pooling layer to progressively improve the expressive power of the features. Then, a projection head consisting of two fully connected layers maps the global features to the contrastive embedding space, obtaining the feature vector used for contrastive learning.
[0058] The feature vector, along with the prediction results from the classification learning branch, participates in the joint optimization of the model. Under the dual constraints of classification supervision and contrastive supervision, the network is guided to learn a more discriminative feature distribution while maintaining its classification discriminativeness. The specific design of the contrastive learning mechanism, including the construction method of positive and negative sample pairs, the data augmentation strategy combining ship signal characteristics, and the corresponding training loss function, will be described in detail later.
[0059] The following section details the category-aware supervised contrastive learning mechanism.
[0060] To enhance the differentiation of different ship categories in the feature space, a supervised contrastive learning mechanism is introduced into the feature enhancement branch. Unlike traditional unsupervised contrastive learning, which relies solely on data augmentation of the samples themselves to construct positive sample relationships, this method fully utilizes the category label information provided by the classification learning branch. During the contrastive learning process, it constrains the construction of positive and negative sample pairs, further enhancing the aggregation of similar samples in the feature space and the separability between samples of different categories. This makes the optimization objective more aligned with the discriminative requirements of ship classification and identification tasks.
[0061] Let any ship sample For anchor samples, their corresponding category labels are: Data augmentation strategies can be used to generate different augmented views of the sample, denoted as... and The class labels remain unchanged. In the supervised contrastive learning framework, samples with the same class label as the anchor sample and their data-augmented versions are defined as positive samples, while samples with different class labels and their data-augmented versions are defined as negative samples. The definitions of the positive and negative sample sets are shown in equations (8) and (9). The data augmentation method used is the proposed hierarchical MFCC augmentation strategy, the details of which will be explained later.
[0062] (8) (9) In the network implementation, each anchor sample generates two enhanced versions through a hierarchical data augmentation strategy. After mapping and normalization by the shared feature extraction module and feature augmentation branch, an embedding representation for contrastive learning is obtained, as shown in Equation (10).
[0063] (10) in, This refers to the network module preceding the projection head. For projection head, For the first The first sample A data-enhanced version.
[0064] By introducing a supervised contrastive learning mechanism, the feature enhancement branch imposes further constraints on the feature space structure, providing a more discriminative feature representation for subsequent joint optimization.
[0065] However, in the context of imbalanced data, if conventional random sampling methods are still used to construct mini-batches, the majority class samples will typically account for a much larger proportion of the batches than the minority class samples. When the class imbalance is high, it may even lead to situations where some minority class samples are completely missing in some training batches. Since the construction rules for positive and negative sample pairs in supervised contrastive learning mechanisms are highly dependent on the class distribution of samples within a batch, the above problems will result in an insufficient number of positive sample pairs and inadequate class coverage of negative samples, thus affecting the ability of contrastive loss to constrain inter-class discriminative features.
[0066] To address the aforementioned issues, a category-aware sampling mechanism was further designed, introducing category constraints into the mini-batch construction process. This mechanism ensures that different ship categories are accessed evenly during training through two-stage sampling of categories and samples, improving the balance of category distribution at the batch level and providing a guarantee for the stable construction of positive and negative sample pairs in supervised contrastive learning.
[0067] Assume there are a total of The first ship category, the The index set of ship-type samples is During the construction of each mini-batch, the first step is to randomly select from the entire set of categories. There are several different categories. Then, for each selected category... From its sample set Random sampling There are 1 sample, denoted as _ . Finally, all of them The sample sets of each category are merged to form a small batch, as shown in Equation (11).
[0068] (11) Given that the total number of ship categories in this implementation method test is relatively small ( ), using a mini-batch construction method that covers all categories, that is, letting A fixed number of samples are selected for each category. This mechanism ensures that each training batch contains all ship categories, providing a sufficient set of negative samples for each sample, while the relatively fixed batch structure improves the stability of the model in learning discriminative features under imbalanced data conditions.
[0069] The following describes the layered MFCC enhancement strategy in detail.
[0070] To address the issue of uncontrollable impact of traditional augmentation methods on different discriminative features in the time-frequency feature space, a hierarchical data augmentation method based on MFCCs is proposed. This method does not directly apply random perturbations to the original waveform; instead, it uses MFCCs as the data augmentation object, fully leveraging the differences in class discrimination capabilities among different MFCC coefficients to design targeted, differentiated perturbation strategies. By implementing controllable local perturbations in the feature space, excessive destruction of irrelevant features is avoided.
[0071] To ensure that the key discriminative features used for ship category differentiation are not compromised, the contribution of different MFCC coefficients to category differentiation is analyzed from a feature statistics perspective. For each type of ship signal, this specific embodiment of the invention randomly selects 100 samples and calculates the mean representation of their MFCC features over the time dimension, thereby obtaining the overall distribution characteristics of each type of ship signal in the MFCC feature space, such as... Figure 4 As shown.
[0072] Depend on Figure 4 It can be seen that the different MFCC coefficients have significantly different roles in class distinction. ABCDE represent different types of ship signals, and MFCC-1 to MFCC-12 are the MFCC coefficients. Among them, under MFCC-1, the mean of the E-class ship signal samples is significantly lower than that of the other four classes, which is an important discriminant feature for distinguishing E from other classes. MFCC-2 shows the most significant inter-class differences, generally exhibiting a distribution relationship of D>A>C>B>E, which is the most important discriminant feature. MFCC-3 and MFCC-4 show some differences between classes, but also overlap, and are considered secondary discriminant features. MFCC-5 to MFCC-12 almost completely overlap between classes, with small inter-class differences and weak discriminant ability.
[0073] Based on this, a hierarchical data augmentation strategy is designed in the MFCC feature space. Let the MFCC obtained from the input ship sample after time-frequency transformation be represented as follows: ,in Indicates the number of time frames. Denotes the dimension of the MFCC coefficients, the th MFCC in time frame The value at point is denoted as .
[0074] For MFCC-2, which has the largest contribution to discrimination, random perturbation is introduced while maintaining the stability of the class discrimination structure, and scale transformation is performed with a certain probability. Its enhancement form is shown in Equation (12).
[0075] (12) in, This represents zero-mean Gaussian noise. For random scaling factor, This represents the probability of a scaling transformation occurring.
[0076] For MFCC-1, which also has obvious discrimination ability but requires high stability, apply a small random perturbation, as shown in Equation (13).
[0077] (13) in, ,and .
[0078] For MFCC-3 and MFCC-4, which have certain discrimination capabilities but overlap between classes, a weaker random perturbation is introduced, as shown in Equation (14).
[0079] (14) in, ,and .
[0080] For MFCC-5 to MFCC-12, which have weaker distinguishability, no enhancement processing is performed, as shown in Equation (15).
[0081] (15) The joint training loss function is described in detail below. To further mitigate the performance degradation caused by data imbalance from the perspective of training objectives, a joint training loss function is proposed for end-to-end optimization of the dual-branch ship identification network. This loss function consists of classification learning loss and contrastive learning loss, as shown in Equation (16).
[0082] (16) in, This represents the classification learning loss, used to guide the model in determining the ship category; To contrast the learning loss, it is used to enhance the separability between different ship categories in the feature space.
[0083] Classification learning loss The cross-entropy loss function, which is weighted by a cosine factor, is defined as shown in equation (17).
[0084] (17) in, This represents the probability that a given ship sample is predicted to be its true class. When A larger value indicates that the sample is easier to classify, while a smaller value indicates that the sample is more difficult to classify. For the standard cross-entropy loss term, This is the introduced cosine weighting factor.
[0085] In the cosine factor, The adjustment exponent is used to control the modulation intensity of the cosine weights' contribution to the sample loss. When When the curve of the cosine factor approaches zero, it gives greater gradient weights to hard-to-classify samples; when At that time, the weighting effect weakens; When the cosine factor degenerates to a constant 1, the loss function is equivalent to the standard cross-entropy loss. This is the period scaling factor, used to control the periodicity of the cosine function. When When the weighting factor is large, it is more sensitive to changes in the predicted probability; when When the value is smaller, the cosine curve changes more gently, and the weighting effect is relatively weakened.
[0086] Standard cross-entropy loss produces a small gradient when samples are relatively easy to classify. In imbalanced data scenarios, this characteristic further exacerbates the model's bias towards the majority class. Because majority class samples are typically easier to identify correctly, their gradient contribution to the overall loss function is relatively limited, thus weakening the model's ability to learn the discriminative features of the minority class. By introducing a cosine weighting factor, the model can adaptively adjust the loss weights according to the prediction difficulty of the samples, achieving gradient redistribution without altering the data distribution and enhancing its focus on difficult-to-classify samples, especially minority class samples.
[0087] Comparative learning loss The design is based on the idea of supervised contrastive learning, as shown in Equation (18).
[0088] (18) in, Represents the set of features for all anchor samples. Represents the set of positive samples for anchor samples. This represents the set of samples other than the anchor sample within the training batch. This is the cosine similarity calculation function. This is a temperature coefficient used to adjust the smoothness of the similarity distribution.
[0089] The proposed joint training loss, by forming complementary constraints between classification learning loss and supervised contrastive learning loss, enables the model to further narrow the distance between similar ship samples in the feature space, while widening the gap between different categories. This mechanism can improve the feature aggregation and class separability of minority class samples under imbalanced data conditions, thereby enhancing the overall ship recognition performance.
[0090] Accordingly, a specific embodiment of the present invention also provides a dual-branch ship classification and identification system that integrates comparative learning, for implementing the above-mentioned identification method, characterized in that it includes: The preprocessing module is used to preprocess the ship noise time-domain signal and extract MFCC features; A dual-branch ship classification and identification model that integrates contrastive learning is used to receive the MFCC feature input and output the prediction result of the ship category; In the training phase of the fusion-contrast learning-based dual-branch ship classification and recognition model, the preprocessing module is further used to perform data augmentation processing on the MFCC features; the fusion-contrast learning-based dual-branch ship classification and recognition model includes: The multi-scale shared feature extractor is used to extract features from the input MFCC features and the enhanced MFCC features in parallel using convolutional kernels of different scales, and to concatenate the outputs of each scale convolution to form a shared feature that integrates multi-scale information. The classification learning branch is used to weight and strengthen the key discriminative features by multi-scale shared features formed by MFCC features, and then perform classification to output the prediction results of ship categories; and calculate the classification loss based on the prediction results and the true labels. The feature enhancement branch is used to enhance the feature expressive power of the multi-scale shared features formed by MFCC features and the multi-scale shared features formed by enhanced MFCC features. Then, the feature is input into the projection head to obtain the embedded features. Based on the obtained embedded features and the embedded features of positive and negative samples, the contrast loss is calculated. The joint training loss function module is used to sum the classification loss and the contrastive loss to form the joint training loss function, which is then used to train the entire network model end-to-end.
[0091] As can be seen from the above detailed description, the key improvement of this invention lies in: (1) Dual-branch ship identification network integrating contrastive learning: a) Multi-scale shared feature extractor, which constructs a feature extraction structure by using three different sizes of convolutional kernels to obtain ship feature information at different levels; b) Classification learning branch for category discrimination, which combines attention mechanism to perform feature fusion to achieve ship category discrimination; c) Feature enhancement branch based on contrastive learning, which is used to learn discriminative feature representation; d) Joint training loss function, which performs collaborative optimization of dual-branch network so that the feature learning results of contrastive learning branch can effectively serve classification task.
[0092] (2) Category-aware supervised contrastive learning mechanism. a) In the contrastive learning process, combine the category label information provided by the classification learning branch to improve the construction strategy of positive and negative sample pairs so that it explicitly considers category information; b) Design a category-aware sampling mechanism to ensure the integrity of category coverage in each training batch, and at the same time control the distribution of the number of samples of different categories to provide stable training conditions for contrastive learning.
[0093] (3) Layered MFCC enhancement strategy. a) Analyze the contribution of different cepstral coefficients in ship classification; b) Apply targeted data augmentation methods to cepstral coefficients with different discrimination capabilities, avoiding the destruction of key ship features by traditional random data augmentation, improving the training quality of feature enhancement branches, and thus further improving the overall recognition performance.
[0094] From the description of specific embodiments of the present invention, it is evident that, compared to the prior art, the advantages or beneficial effects of the present invention are as follows: (1) To address the performance degradation caused by imbalanced ship data, a dual-branch ship recognition network (DBSRN) integrating contrastive learning is proposed. Multi-scale feature extraction captures key information at different levels, and an attention mechanism is used to achieve feature fusion. A contrastive learning mechanism is introduced to enhance the discriminative power of feature representations by mining the similarities and differences between samples. A joint training loss function is used to optimize the network, enabling the feature enhancement branch based on contrastive learning to better serve the classification task, thereby effectively improving the overall recognition performance. Introducing contrastive learning into ship classification and recognition tasks has unique advantages. On the one hand, contrastive learning learns discriminative features from the overall data structure level by constraining the distribution structure of features in the embedding space. Compared to the method of learning decision boundaries solely based on classification loss, contrastive learning is less sensitive to imbalanced label distribution, helping to mitigate the adverse effects of data imbalance on recognition performance. On the other hand, contrastive learning is usually combined with diverse data augmentation strategies, which can construct richer learning samples for minority ship classes, thereby improving the model's ability to distinguish between ship classes with scarce samples. Experimental results on the Shipsear dataset show that, under highly imbalanced conditions where the proportions of the five ship types are 0.5%, 0.5%, 98%, 0.5%, and 0.5%, respectively, DBSRN improves the recognition accuracy by 25.20%, 20.40%, and 17.60% compared to the classic classification models ECAPA-TDNN, Cam++, and MR-CNN-A, and improves the F1-macro accuracy by 30.01%, 25.27%, and 20.43%, respectively.
[0095] (2) To address the insufficient adaptability of conventional contrastive learning methods in the context of imbalanced ship data, a class-aware supervised contrastive learning mechanism (CA-SupCon) is proposed. By optimizing the construction method of positive and negative sample pairs, the inter-class discriminative ability of the model under imbalanced conditions is enhanced; a class-aware sampling mechanism is designed to ensure class coverage and sample quantity within a batch, providing stable and sufficient training data for contrastive learning. Experimental results on the Shipsear dataset show that under highly imbalanced conditions with the proportions of five ship sample types being 0.5%, 0.5%, 98%, 0.5%, and 0.5%, respectively, CA-SupCon improves the recognition accuracy by 8.00% and the F1-macro accuracy by 9.74% compared to the conventional contrastive learning method SimCLR.
[0096] (3) Traditional data augmentation methods often have uncontrollable effects on time-frequency features, leading to the destruction of highly discriminative ship features. To address this issue, a hierarchical mel-frequency cepstral coefficients augmentation (H-MFCCAug) strategy is proposed. By analyzing the discriminative power of each cepstral coefficient, its importance in ship category discrimination is evaluated, and a differentiated augmentation strategy is applied accordingly to construct more discriminative sample pairs for CA-SupCon. Experimental results on the Shipsear dataset show that under highly imbalanced conditions where the proportions of the five ship categories are 0.5%, 0.5%, 98%, 0.5%, and 0.5%, respectively, the recognition accuracy of H-MFCCAug is improved by 8.80% and 2.80% compared to random time-frequency masking and hybrid waveform augmentation, respectively, and by 11.23% and 2.55% compared to F1-macro, respectively.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A dual-branch ship classification and recognition method integrating contrastive learning, characterized in that, Includes the following steps: Preprocess the time-domain signal of ship radiated noise and extract MFCC features; The MFCC features are input into a trained dual-branch ship classification and recognition model based on fusion and contrast learning. Output the prediction results for ship categories; In the training stage of the dual-branch ship classification and identification model based on fusion contrast learning, after preprocessing the ship radiated noise time-domain signal to extract MFCC features, data augmentation processing is also performed on the MFCC features. The dual-branch ship classification and recognition model based on fusion contrastive learning includes: The multi-scale shared feature extractor is used to extract features from the input MFCC features and the enhanced MFCC features in parallel using convolutional kernels of different scales, and to concatenate the outputs of each scale convolution to form a shared feature that integrates multi-scale information. The classification learning branch is used to weight and strengthen the key discriminative features by multi-scale shared features formed by MFCC features, and then perform classification to output the prediction results of ship categories; and calculate the classification loss based on the prediction results and the true labels. The feature enhancement branch is used to enhance the feature representation ability of the multi-scale shared features formed by MFCC features and the multi-scale shared features formed by enhanced MFCC features. Then, the feature is input into the projection head to obtain the embedded features. Based on the obtained embedded features and the embedded features of positive and negative samples, the contrastive loss is calculated.
2. The dual-branch ship classification and identification method according to claim 1, characterized in that, The classification learning branch includes a residual learning block, an attention fusion block, a global average pooling layer, and a classifier. In the classification learning branch, the multi-scale shared features formed by MFCC features are weighted and strengthened by the residual learning block, the attention fusion block, and the global average pooling layer, respectively. Then, they are fed into the classifier to output the prediction result of the ship category. Based on the prediction result and the true label, the classification loss is calculated.
3. The dual-branch ship classification and identification method according to claim 2, characterized in that, The feature enhancement branch includes a residual learning block, an attention fusion block, a global average pooling layer, and a projection head. The multi-scale shared features formed by MFCC features and the multi-scale shared features formed by enhanced MFCC features are passed through the residual learning block, attention fusion block, and global average pooling layer to enhance feature expressive power. Then, they are input into the projection head to obtain embedded features, which are used to construct similarity and difference relationships between samples. Based on the obtained embedded features and the embedded features of positive and negative samples, the contrastive loss is calculated.
4. The dual-branch ship classification and identification method according to claim 3, characterized in that, The classification loss and contrastive loss are summed to form a joint training loss function; the entire network model is then trained end-to-end using the joint training loss function.
5. The dual-branch ship classification and identification method according to claim 1, characterized in that, The multi-scale shared feature extractor includes: a three-branch parallel convolutional module and a combination module using three different sizes of convolutional kernels; The three convolutional modules are consistent in depth and structure, and each convolutional module includes an initial convolutional layer, a residual learning block, and a skip connection structure. The initial convolutional layers include a 2D convolutional layer, a Batch Normalization (BN) layer, a ReLU activation function, and a max pooling layer. The operation formulas for the initial convolutional layers in each branch are as follows: (1) in, Indicates the input MFCC, Indicates size is convolution kernel, Activate ReLU; The residual learning block consists of a two-dimensional convolutional layer, a batch normalization (BN) layer, a ReLU activation function, and a skip connection structure. Its operation formula is as follows: (2) in, , The convolution kernel for the two convolutional layers in the residual learning block; The combination module combines features from the three scales of the three-branch convolution module along the channel dimension to form multi-scale shared features.
6. The dual-branch ship classification and identification method according to claim 1, characterized in that, The feature enhancement branch introduces a supervised contrastive learning mechanism, which uses the category label information provided by the classification learning branch to constrain the construction of positive and negative sample pairs during the contrastive learning process.
7. The dual-branch ship classification and identification method according to claim 6, characterized in that, The supervised contrastive learning mechanism is as follows: Let any ship sample For anchor samples, their corresponding category labels are: ; Different augmented views of this sample are generated using data augmentation strategies, denoted as... and The class label remains unchanged; samples with the same class label as the anchor sample and their data-augmented versions are defined as positive samples, while samples with different class labels and their data-augmented versions are defined as negative samples. Each anchor sample generates two augmented versions through a hierarchical data augmentation strategy. After mapping and normalization by the shared feature extraction module and feature augmentation branch, the embedding representation used for contrastive learning is obtained, as shown in the following equation: (10) in, This refers to the network module preceding the projection head. For projection head, For the first The first sample One data-enhanced version; The data augmentation strategy is a hierarchical data augmentation based on MFCC, which differentiates and augments different MFCC coefficients by analyzing the contribution of different MFCC coefficients to category discrimination from the perspective of MFCC feature statistics.
8. The dual-branch ship classification and identification method according to claim 7, characterized in that, The joint training loss function is: (16) in, Indicates the loss in classification learning; To compare learning loss; Classification learning loss The cross-entropy loss function, weighted by a cosine factor, is defined as follows: (17) in, This represents the probability that a ship sample is predicted to be its true class; when A larger value indicates that the sample is easier to classify, while a smaller value indicates that the sample is more difficult to classify. For the standard cross-entropy loss term, The introduced cosine weighting factor; The adjustment exponent is used to control the modulation intensity of the cosine weight's contribution to the sample loss; Comparative learning loss As shown in the following formula: (18) in, Represents the set of features for all anchor samples. This represents the set of positive samples for anchor samples. This represents the set of samples other than the anchor sample within the training batch. This is the cosine similarity calculation function. This is a temperature coefficient used to adjust the smoothness of the similarity distribution.
9. The dual-branch ship classification and identification method according to claim 7, characterized in that, The training phase also includes category-aware sampling, which introduces category constraints into the mini-batch construction process, as detailed below: Assume there are a total of The ship category, the first The index set of ship-type samples is During the construction of each mini-batch, the first step is to randomly select from the entire set of categories. There are several different categories; for each selected category... From its sample set Random sampling There are 1 sample, denoted as _ . The sample sets of all categories are merged to form a small batch, as shown in equation (11) below: (11)。 10. A dual-branch ship classification and identification system integrating contrastive learning, used to implement the identification method of claim 1, characterized in that, include: The preprocessing module is used to preprocess the time-domain signal of ship radiated noise and extract MFCC features; A dual-branch ship classification and identification model that integrates contrastive learning is used to receive the MFCC feature input and output the prediction result of the ship category; In the training phase of the fusion-contrast learning-based dual-branch ship classification and recognition model, the preprocessing module is further used to perform data augmentation processing on the MFCC features; the fusion-contrast learning-based dual-branch ship classification and recognition model includes: The multi-scale shared feature extractor is used to extract features from the input MFCC features and the enhanced MFCC features in parallel using convolutional kernels of different scales, and to concatenate the outputs of each scale convolution to form a shared feature that integrates multi-scale information. The classification learning branch is used to weight and strengthen the key discriminative features by multi-scale shared features formed by MFCC features, and then perform classification to output the prediction results of ship categories; and calculate the classification loss based on the prediction results and the true labels. The feature enhancement branch is used to enhance the feature expressive power of the multi-scale shared features formed by MFCC features and the multi-scale shared features formed by enhanced MFCC features. Then, the feature is input into the projection head to obtain the embedded features. Based on the obtained embedded features and the embedded features of positive and negative samples, the contrast loss is calculated. The joint training loss function module is used to sum the classification loss and the contrastive loss to form the joint training loss function, which is then used to train the entire network model end-to-end.