4.1. Dataset and Experimental Configuration
To verify the effectiveness of the proposed method in complex scenarios, experiments were conducted using both a public dataset and a self-constructed maritime ship dataset. The public dataset used in this study is the MOT16 dataset, while the self-constructed dataset is used for experiments involving maritime ship detection, recognition, and tracking.
In the experiments, the MOT16 dataset is mainly used to evaluate the general multi-object tracking performance of the proposed tracking algorithm in complex scenes. It should be noted that the objects in the MOT16 dataset are pedestrians. Therefore, the related experiments are not specifically designed for ship targets; instead, they are intended to verify the algorithm’s capability in target association and trajectory maintenance under conditions involving dense targets, frequent occlusions, and complex motion patterns. Since multi-object tracking algorithms share common mechanisms in terms of association strategies, trajectory management, and motion modeling, the MOT16 dataset can effectively reflect the tracking robustness of the algorithm in complex dynamic environments.
In addition to the public dataset, a self-constructed maritime ship dataset was built for this study. The dataset consists of two parts: virtual simulation data and real maritime surveillance data. The virtual data are generated using the Unreal Engine (UE), which is used to expand hull number samples and construct a hull number feature database. The real data are collected from actual maritime surveillance videos and are used to evaluate the algorithm’s performance in detection, matching, and continuous tracking under real-world conditions. In the overall dataset, the ratio of virtual data to real data is approximately 3:7.
The dataset contains approximately 6700 images and several video sequences, with a unified image resolution of 1920 × 1080. Among them, about 30% of the samples contain clearly recognizable hull numbers. Some example images from the dataset are shown in
Figure 12.
In terms of dataset partitioning, the ship detection dataset is divided into training, validation, and test sets according to a ratio of 8:1:1. The training set is used for training the object detection model, the validation set is used for parameter tuning, and the test set is used for final performance evaluation. For the feature extraction network (ReID) training, the dataset is divided based on target IDs, ensuring that the ship IDs in the training set and the test set do not overlap, thereby guaranteeing the model’s generalization ability to unseen targets. Tracking experiments are mainly evaluated on video sequences, where the detection results serve as inputs to further verify the performance of target association and trajectory maintenance.
The experimental environment is based on the Windows 11 operating system, with hardware configured as an Intel i9 processor and an NVIDIA RTX 3090 GPU with 24 GB of memory. The algorithm is implemented using the PyTorch 2.3.1 deep learning framework.
During the training of the object detection network, the official YOLOv5 pretrained weights are used for initialization and then fine-tuned on the ship detection dataset. During training, a cosine annealing strategy is employed to dynamically adjust the learning rate. In addition, data augmentation techniques such as Mosaic augmentation, random horizontal flipping, and scale transformation are introduced to improve the model’s generalization ability in complex maritime environments. The detailed training parameters of the detection network are shown in
Table 2.
During the training of the feature extraction network, the input images are uniformly resized to 128 × 64 resolution, and data augmentation strategies such as random cropping and random horizontal flipping are adopted to improve the robustness of the model. Meanwhile, the input images are normalized, with the mean and variance set to [0.485, 0.456, 0.406] and [0.229, 0.224, 0.225], respectively, which are consistent with the settings used in ImageNet pretrained models. The detailed training parameters of the feature extraction network are shown in
Table 3.
To ensure the fairness of experimental comparisons, all comparison methods adopt the same dataset partitioning and training configurations, with differences only in the feature extraction structures or tracking strategies.
4.2. Evaluation Indicators
In order to better evaluate the performance of the DeepSORT-OCR model, the selected evaluation metrics are crucial for measuring the model’s performance. They can comprehensively reflect the accuracy, robustness, and generalization ability of the model in the target detection and tracking tasks. In this study, MOTA (Multiple Object Tracking Accuracy), MOTP (Multiple Object Tracking Precision), MT (Mostly Tracked), ML (Mostly Lost), and the number of ID switches are used as evaluation metrics to assess the performance of the DeepSORT-OCR model.
The following is a detailed analysis of the evaluation indicators:
FN represents false negative examples, which is the sum of all missed detections in the entire video, while FP represents false positive examples, which is the sum of all false alarms in the entire video. IDSW is the total number of ID switches—that is, the number of target ID switches throughout the tracking process. GT is the total number of actual targets. Ct represents the number of matches in the t-th frame, and dt,i represents the distance between the predicted bounding box and the real bounding box of the i-th target in the t-th frame.
MT represents the proportion of successfully tracked targets to the total number of targets.
ML is the proportion of targets with a loss time exceeding a given threshold in the entire tracking sequence to the total number of targets.
To evaluate the performance of the hull number recognition module, samples containing clearly identifiable hull numbers were selected from the self-constructed ship dataset to build a hull number recognition subset and the OCR recognition results were quantitatively evaluated. Since the hull number recognition task involves both the accuracy of individual character recognition and the correctness of the entire hull number string, the performance is evaluated from two levels: character-level recognition and hull-number-level recognition.
At the character level, the evaluation mainly measures the OCR model’s ability to correctly recognize individual characters. At the hull-number level, the evaluation determines whether the entire hull number string is completely and correctly recognized. To comprehensively evaluate the hull number recognition performance, four metrics are adopted: Accuracy, Precision, Recall, and F1-score.
The evaluation metrics are explained as follows.
In recognition tasks, commonly used evaluation metrics are mainly employed to measure the model’s performance in terms of recognition accuracy, recall capability, and overall recognition quality under complex maritime conditions.
Precision measures the proportion of correctly recognized characters among all characters predicted as correct by the OCR model. It is defined as
where
TP represents the number of correctly recognized characters, and
FP represents the number of incorrectly recognized characters.
Recall measures the proportion of correctly recognized characters among all actual characters. It is defined as
where
FN represents the number of characters that were not correctly recognized.
The
F1-score combines
Precision and
Recall and serves as an important indicator of recognition performance. It is defined as
For character-level evaluation, Character Recognition Accuracy (Character Accuracy) is also used to measure the proportion of correctly recognized characters. It is defined as
where
represents the number of correctly recognized characters and
represents the total number of characters.
In addition, to evaluate the recognition performance of complete hull number strings, Hull Number Accuracy is introduced and defined as
where
represents the number of hull numbers that are completely recognized correctly, and
represents the total number of hull numbers. A hull number is considered correctly recognized only when all characters in the string are correctly identified.
Through these evaluation metrics, the OCR module can be comprehensively evaluated from both character recognition accuracy and overall hull number recognition accuracy, thereby verifying the effectiveness of the CBAM-ResNet feature enhancement mechanism in improving hull number recognition performance.
4.3. Analysis of Experimental Results
- A.
General Experimental Validation
To verify the general performance of the proposed tracking algorithm in complex scenarios, comparative experiments were conducted with SORT, DeepSORT, ByteTrack, QDTrack, and the improved DeepSORT algorithm proposed in this paper. The experiments were carried out on the MOT16 benchmark dataset. The target category in this dataset is pedestrians; however, its complex target interactions and frequent occlusion changes make it suitable for evaluating the performance of multi-object tracking algorithms in terms of target association, trajectory maintenance, and occlusion recovery. Therefore, the MOT16 dataset is used in this study to verify the general multi-object tracking capability of the proposed algorithm.
It should be noted that the MOT16 dataset does not contain ship targets or hull number information. Therefore, the Hull Number Match module proposed in this work is not involved in this part of the experiment. This module is mainly evaluated in the subsequent experiments conducted on the self-constructed maritime ship dataset, where it is used to verify ship identity recognition and long-term tracking performance.
In the experiments, all tracking algorithms adopt the same detector, i.e., the detection results generated by the trained YOLOv5 model, as the input to ensure the fairness of the comparative experiments. Under the same detection results and runtime environment, the performance of different tracking algorithms is quantitatively evaluated. The experimental results are shown in
Table 4.
As shown in
Table 4, the improved DeepSORT algorithm proposed in this paper achieves better tracking performance on the MOT16 dataset. Specifically, the MOTA reaches 66.53%, which is an improvement of 5.13% compared with DeepSORT, indicating that the proposed method achieves higher overall tracking accuracy in complex scenarios. Meanwhile, the MT metric increases to 38.54%, while the ML metric decreases to 13.89%, indicating that the algorithm can successfully track more targets while reducing tracking failures. In addition, the number of ID Switches (IDSW) is reduced to 528, further demonstrating the advantage of the proposed method in improving target association stability.
In terms of computational efficiency, since all algorithms employ the same YOLOv5 detector, the overall runtime speed is mainly influenced by the detection stage. As a result, the differences in FPS among different tracking algorithms are relatively small. The proposed method maintains a real-time processing speed of 36.5 FPS, with an average processing latency of 27.4 ms and GPU memory consumption of 962.9 MB, while achieving higher tracking accuracy. This indicates that the method has good real-time performance and resource efficiency in practical applications.
In summary, the experiments on the MOT16 dataset are mainly designed to verify the general multi-object tracking capability of the algorithm in complex dynamic environments, while the detection and tracking performance for ship targets will be further validated in the subsequent experiments conducted on the self-constructed maritime ship dataset.
- B.
Experiments on the Self-Constructed Dataset
To further verify the applicability and performance advantages of the proposed improved tracking algorithm in complex maritime environments, comparative experiments were conducted on the self-constructed maritime ship dataset. During the experiment, the YOLOv5 model trained on this dataset was first used to generate target detection results, which were then used as the common input for all tracking algorithms to ensure fairness in the comparison. Based on this setup, the proposed algorithm was compared with four representative multi-object tracking methods: SORT, DeepSORT, ByteTrack, and QDTrack. The experiments mainly evaluated the tracking accuracy and stability of each method under complex maritime conditions such as illumination variations, wave interference, and target occlusion. The experimental results are shown in
Table 5.
It should be noted that unlike the previous MOT16 experiments, the Hull Number Match module was enabled in the self-constructed ship dataset experiments. This module recognizes ship hull numbers using OCR and matches the recognition results with the hull number feature database. In this way, semantic identity constraints based on hull number information are introduced during the target association stage to enhance identity discrimination and long-term tracking stability.
As shown in
Table 5, the improved tracking algorithm proposed in this paper achieves the best overall performance on the self-constructed maritime ship dataset. Specifically, the MOTA reaches 70.89%, which is approximately 5.15% higher than that of DeepSORT, indicating that the improved algorithm achieves higher overall tracking accuracy in complex maritime environments. Meanwhile, the MOTP increases to 80.84%, demonstrating that the proposed method also improves target localization accuracy.
In terms of trajectory stability, the number of ID switches of the proposed method is reduced to 124, which is approximately 37.4% lower than that of DeepSORT. This result indicates that introducing hull number semantic constraints combined with multi-feature matching mechanisms can effectively reduce identity switching and improve the stability of target association. In addition, the MT metric increases to 36.58%, while the ML metric decreases to 16.82%, showing that the improved algorithm is able to successfully track more targets while reducing tracking failures.
Regarding computational efficiency, although the proposed method introduces the Hull Number Match module during the matching stage, the overall inference speed still maintains 34.7 FPS, with an average processing latency of 28.8 ms and GPU memory consumption of 985.5 MB, indicating that the method still maintains good real-time processing capability. Overall, the proposed method can effectively improve tracking accuracy and trajectory stability in complex maritime scenarios while maintaining real-time performance, demonstrating its practical value in maritime multi-ship tracking tasks.
To analyze the contribution of each improvement module to the overall tracking performance, ablation experiments were conducted on the self-constructed ship dataset. Taking the complete model as the baseline, each module was removed individually while keeping the remaining modules unchanged, including the CBAM-ResNet50 feature enhancement module, the LSTM-AKF motion prediction module, the Inner-SIoU matching strategy, and the Hull Number Match module. The experimental results are shown in
Table 6, where √ indicates the module is enabled and × indicates it is disabled.
As shown in
Table 6, when the CBAM-ResNet50 module is removed, the MOTA decreases to 69.42%, and the number of ID switches increases to 151, indicating that the attention mechanism can enhance appearance feature representation and thus improve the accuracy of target matching. When the LSTM-AKF module is removed, the MOTA decreases to 69.01% and IDSW increases to 158, demonstrating that LSTM-based motion modeling and adaptive Kalman filtering effectively improve trajectory prediction accuracy and reduce association errors.
When the Inner-SIoU matching strategy is removed, the MOTA decreases to 68.83%, and IDSW increases to 162, indicating that the improved spatial matching mechanism enhances the stability of target localization and association. When the Hull Number Match module is removed, the performance degradation is the most significant, with the MOTA dropping to 67.54% and IDSW increasing to 181. This result shows that introducing hull number semantic constraints can significantly reduce identity switches and improve long-term tracking stability in maritime ship scenarios.
Overall, the proposed modules complement each other in feature representation, motion modeling, and target association, jointly improving the performance of multi-object tracking in complex maritime environments and enabling the full model to achieve the best experimental results.
To visually demonstrate the tracking performance of the proposed algorithm in complex scenarios, several consecutive frames from UE virtual environment video sequences and real maritime surveillance videos were selected for qualitative comparison. The results are shown in
Figure 13 and
Figure 14, where the images on the left represent the tracking results of the YOLOv5–DeepSORT algorithm, and the images on the right show the tracking results of the improved DeepSORT algorithm proposed in this paper. In the figures, the red boxes highlight typical regions where tracking differences, such as identity switches or missed associations, can be observed.
- C.
Hull Number Subset Experiments
To further analyze the practical role of hull number semantic information in ship target tracking, and to verify the improvement of hull number recognition performance brought by the CBAM-ResNet feature enhancement module, a hull number recognition subset was constructed by selecting all samples containing clearly visible hull numbers from the self-constructed maritime ship dataset. This subset was used to evaluate both the hull number recognition module and the contribution of hull number semantic features to target association.
First, the hull number recognition module is evaluated on this subset. Two OCR recognition schemes are compared, namely, the original OCR model and the OCR model enhanced with the CBAM-ResNet feature enhancement module, inorder to analyze the effect of the attention mechanism on hull number recognition performance. The recognition performance is evaluated from two levels: character-level (Character-level) and complete hull number recognition level (Hull Number-level). The evaluation metrics include Character Accuracy (Char Accuracy), Precision, Recall, and F1-score. The experimental results are shown in
Table 7.
As shown in
Table 7, after introducing the CBAM-ResNet feature enhancement module, the hull number recognition performance improves significantly across all evaluation metrics. Specifically, the character-level recognition accuracy increases from 90.8% to 94.7%, while the overall hull number recognition accuracy increases from 83.6% to 88.9%. These results indicate that the CBAM attention mechanism can effectively enhance the feature representation of hull number character regions, making character structural information more distinguishable in complex maritime backgrounds, thereby improving the stability and accuracy of OCR recognition in challenging maritime environments.
After evaluating the hull number recognition performance, multi-object tracking experiments are further conducted on the hull number subset to analyze the influence of hull number semantic features on target association performance. In this experiment, all tracking methods use the detection results generated by the YOLOv5 detector trained on the self-constructed dataset as the unified input to ensure fair comparison. Consistent with the experiments conducted on the full dataset, the proposed method fuses visual appearance features and hull number semantic features during the target association stage and integrates them through a dynamic weighting strategy.
Since all targets in this subset contain recognizable hull numbers, the semantic features of these numbers can provide more stable identity constraints during the association process. The experimental results are shown in
Table 8.
As shown in
Table 8, when hull number information can be reliably obtained, the proposed tracking algorithm achieves further improvements in both Multiple Object Tracking Accuracy (MOTA) and Multiple Object Tracking Precision (MOTP). The MOTA reaches 77.18%, which is 7.31% higher than DeepSORT, and the MOTP increases to 82.46%. These results demonstrate that when hull number semantic information is fully available, the proposed method can further improve the accuracy of target association.
In terms of trajectory stability, the number of ID switches (IDSW) decreases to 53, indicating that hull number semantic features can provide additional identity cues when targets have similar appearances or experience occlusion, thereby effectively reducing identity switching. Meanwhile, the MT metric increases to 41.35%, while the ML metric decreases to 13.92%, showing that the improved algorithm can stably track more targets and reduce tracking failures.
To visually demonstrate the improvement in tracking stability brought by the Hull Number Feature Extraction module, a typical scenario from a video sequence is selected for qualitative visualization.
Figure 15 presents three groups of comparison results. The first image shows the moment when the OCR module successfully recognizes the hull number for the first time, where both the target ID and the recognized hull number are displayed above the detection box. The second and third images compare the tracking results with and without the OCR module under the same frame. The comparison clearly shows that after introducing hull number semantic features, the system achieves more stable identity maintenance and trajectory continuity. The experimental visualization results are shown in
Figure 15.
In summary, the CBAM-ResNet feature enhancement module effectively improves hull number recognition performance, and the hull number semantic features provide stable semantic constraints for ship identity discrimination during target association, thereby further improving the accuracy and stability of multi-ship tracking in maritime environments.
- D.
Cross-Domain Generalization Experiment
To further evaluate the generalization capability of the proposed method across different data domains, cross-domain experiments were conducted on the self-constructed maritime ship dataset. According to the data source, the dataset is divided into three settings, namely, purely synthetic, purely real, and mixed data, and an additional cross-domain scenario (synthetic training–real testing) is constructed. The experimental results are shown in
Table 9.
As shown in
Table 9, the proposed method achieves the best performance under the mixed-data training and testing setting, indicating that combining real data and synthetic data can effectively improve the model’s adaptability to different scenarios. Under both pure synthetic data and pure real data domains, the model also maintains relatively stable tracking performance, demonstrating that the proposed method performs robustly within a single data domain. Furthermore, under the cross-domain testing condition, the MOTA still reaches 67.95%, showing only a moderate decrease. This result indicates that the proposed method maintains good generalization capability across different data distributions.