Improved deepsort ship tracking anti-occlusion method and system

By training a ship detector and a reid model, and utilizing a pixel-wise matching strategy and an expanded sample library, the ship tracking errors of the Deepsort method during occlusion and turning were resolved, achieving high-accuracy ship detection and tracking.

CN115393707BActive Publication Date: 2026-04-14SHANGHAI YINGJUE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI YINGJUE TECH CO LTD
Filing Date
2022-07-14
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

The Deepsort method is prone to target trajectory matching errors when encountering partial occlusion and turning during ship tracking.

Method used

By acquiring manually labeled ship samples with and without occlusion, the ship detector is trained. A pixel-by-pixel matching strategy is used to detect and track ships. The REID model is combined with target tracking to enhance the training sample library to cope with occlusion and turning.

Benefits of technology

It reduced the target missed detection rate, solved the tracking failure problem caused by occlusion and turning, and improved the accuracy of detection and tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115393707B_ABST
    Figure CN115393707B_ABST
Patent Text Reader

Abstract

The application provides an improved Deepsort ship tracking anti-occlusion method and system, comprising the following steps: S1: obtaining artificially labeled unoccluded ship samples and occluded ship samples, and training a ship detector by using the ship samples to obtain a trained ship detector; S2: detecting a ship in an image by using the trained ship detector; when a target ship is not detected, a pixel-by-pixel matching strategy is used to detect the target ship; S3: when the target ship is detected, a reid model is used for tracking, and when the target ship is not tracked, the pixel-by-pixel matching strategy is used to track the occluded target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ship detection and tracking technology, and more specifically, to an improved Deepsort ship tracking anti-obstruction method and system. Background Technology

[0002] Utilizing optical images for ship monitoring is a crucial technology in the maritime field. This technology is significant for improving the quality of maritime surveillance and reducing activities such as smuggling, illegal immigration, illegal fishing, illegal sand mining, and illegal transportation. Using the Deepsort method based on deep learning for ship tracking is a recent trend in this field. However, the Deepsort method suffers from target trajectory mismatch when dealing with local occlusion problems, especially when occlusion occurs simultaneously with complex ship behaviors such as turning.

[0003] Patent document CN107092890A (application number: 201710272557.4) discloses a ship detection and tracking method based on infrared video. The method involves: detecting and extracting the sea-line area using the gradient operator method and Hough transform method; segmenting the sea surface region from the video image using the sea-line area; extracting the foreground from the infrared video using an improved ViBe algorithm; extracting suspected targets from the sea surface region of the video image; simultaneously repairing the extracted image; capturing targets by analyzing image texture features based on statistical histograms; and tracking moving targets using the MeanShift algorithm based on multi-feature and saliency detection.

[0004] This invention provides an improved Deepsort ship tracking anti-occlusion method that can effectively compensate for the shortcomings of the Deepsort method when encountering occlusion. When a ship is partially occluded, even if a synchronous turning occurs, it will not be judged as a newly appearing target due to matching errors, thus ensuring that the ship tracking trajectory is complete during the occlusion process. Summary of the Invention

[0005] In view of the deficiencies in the prior art, the purpose of this invention is to provide an improved Deepsort ship tracking anti-occlusion method and system.

[0006] An improved Deepsort ship tracking anti-occlusion method provided by the present invention includes:

[0007] Step S1: Obtain manually labeled unobstructed ship samples and occluded ship samples, and use the ship samples to train the ship detector to obtain the trained ship detector.

[0008] Step S2: Detect ships in the image using the trained ship detector; if no target ship is detected, detect the target ship using a pixel-by-pixel matching strategy.

[0009] Step S3: When the target ship is detected, the REID model is used for tracking. When the target ship is not tracked, a pixel-by-pixel matching strategy is used to track the occluded target.

[0010] Preferably, the manually labeled, unobstructed ship samples are labeled by using rectangular boxes to mark the ships.

[0011] The manually labeled ship samples with obstructions were obtained using:

[0012] Step S1.1: Use the real occluders in the cropped image or the rectangular blocks with randomly filled content as the mask image;

[0013] Step S1.2: Scaling the mask image at random scales to simulate occlusions at different distances;

[0014] Step S1.3: Randomly overlay the scaled mask onto the ship, ensuring that the occlusion level of the ship meets the preset requirements, and batch produce occluded ship samples.

[0015] Step S1.4: Calculate the unobstructed portion of the ship and re-label the unobstructed portion of the ship using rectangles.

[0016] Preferably, step S2 employs:

[0017] Step S2.1: Traverse all ship template images corresponding to all ships in the history record;

[0018] Step S2.2: Perform a traversal matching of the current image with all ship template images to obtain the corresponding matching degree;

[0019] Step S2.3: Select the ship template image with the highest matching degree, obtain the pixels that can be matched by the ship template image with the highest matching degree and analyze them. When there are unmatched pixels with an area that meets the preset conditions, and the unmatched pixels can form a relatively complete connected region, it means that the current position is occluded; obtain the bounding rectangle of the occluded region based on the unmatched connected region, and at the same time obtain the unoccluded region.

[0020] Step S2.4: Calculate the matching degree of the unobstructed area. When the matching degree of the unobstructed area is higher than the preset value, it is considered that the target ship has been detected.

[0021] Preferably, step S3 employs the following methods:

[0022] Step S3.1: Traverse all ship images corresponding to all ships within a preset historical time period;

[0023] Step S3.2: For the currently detected target ship, compare the detected target ship with the image of each target ship within a preset historical time period;

[0024] Step S3.3: Based on the size of each target ship image within a historical preset time period, scale the currently detected target ship to the same height, and at the same time scale the width of the currently retrieved target ship proportionally to obtain a new target ship.

[0025] Step S3.4: Traverse and match the new target ship with the target ships at the corresponding historical time, and calculate the matching degree at each position;

[0026] Step S3.5: When the matching degree of the new target ship at a certain position of the target ship at the corresponding historical time is higher than the threshold, the match is considered successful.

[0027] Preferably, locally cropped samples are used to enhance the REID model for tracking occluded and turning targets;

[0028] Based on all ship images corresponding to each ship within a historical preset time period, random cropping is performed, rectangular frames are randomly set, and images within the rectangular frames are used as new sample images.

[0029] The reid model is trained using new sample images until the Triplet Loss function converges, resulting in the trained reid model. The trained reid model network is then used to detect whether the ship in the current image is a ship that has appeared before.

[0030] An improved Deepsort ship tracking anti-interference system according to the present invention includes:

[0031] Module M1: Obtain manually labeled unobstructed ship samples and occluded ship samples, and use the ship samples to train the ship detector to obtain the trained ship detector.

[0032] Module M2: Detects ships in images using the trained ship detector; when no target ship is detected, it uses a pixel-by-pixel matching strategy to detect the target ship.

[0033] Module M3: When a target ship is detected, it uses the REID model for tracking. When the target ship is not tracked, it uses a pixel-by-pixel matching strategy to track occluded targets.

[0034] Preferably, the manually labeled, unobstructed ship samples are labeled by using rectangular boxes to mark the ships.

[0035] The manually labeled ship samples with obstructions were obtained using:

[0036] Module M1.1: Uses rectangular blocks that extract real occlusions from cropped images or randomly fill content as mask images;

[0037] Module M1.2: Scaling the mask image at random scales to simulate occlusions at different distances;

[0038] Module M1.3: Randomly overlays the scaled mask image onto the ship, and the occlusion degree of the ship meets the preset requirements, and batch-produces occluded ship samples.

[0039] Module M1.4: Calculates the unobstructed portion of the ship and re-labels the unobstructed portion of the ship using rectangles.

[0040] Preferably, the module M2 adopts:

[0041] Module M2.1: Traverses all ship template images corresponding to all ships in the history;

[0042] Module M2.2: Iterates through and matches the current image with all ship template images to obtain the corresponding matching degree;

[0043] Module M2.3: Select the ship template image with the highest matching degree, obtain the pixels that can be matched by the ship template image with the highest matching degree and analyze them. When there are unmatched pixels with an area that meets the preset conditions, and the unmatched pixels can form a relatively complete connected region, it means that the current position is occluded; obtain the bounding rectangle of the occluded region based on the unmatched connected region, and at the same time obtain the unoccluded region.

[0044] Module M2.4: Calculates the matching degree of the unobstructed area. When the matching degree of the unobstructed area is higher than the preset value, it is considered that the target ship has been detected.

[0045] Preferably, the module M3 adopts:

[0046] Module M3.1: Traverses all ship images corresponding to all ships within a preset historical time period;

[0047] Module M3.2: For the currently detected target ship, compare the detected target ship with the images of each target ship within a preset historical time period;

[0048] Module M3.3: Based on the size of each target ship image within a preset historical time period, the currently detected target ship is scaled to the same height, and the width of the currently retrieved target ship is scaled proportionally to obtain a new target ship.

[0049] Module M3.4: Iterates and matches the new target ship against the target ships at the corresponding historical time, and calculates the matching degree at each position;

[0050] Module M3.5: When the matching degree of a new target ship at a certain position of a target ship at the corresponding historical time is higher than the threshold, the match is considered successful.

[0051] Preferably, locally cropped samples are used to enhance the REID model for tracking occluded and turning targets;

[0052] Based on all ship images corresponding to each ship within a historical preset time period, random cropping is performed, rectangular frames are randomly set, and images within the rectangular frames are used as new sample images.

[0053] The reid model is trained using new sample images until the Triplet Loss function converges, resulting in the trained reid model. The trained reid model network is then used to detect whether the ship in the current image is a ship that has appeared before.

[0054] Compared with the prior art, the present invention has the following beneficial effects:

[0055] 1. Traditional Deepsort methods cannot track targets when they are not detected. This invention minimizes the target detection miss rate.

[0056] 2. The traditional Deepsort method fails to track targets due to occlusion, a problem that this invention has solved to the greatest extent possible;

[0057] 3. This invention also solves the problem to the greatest extent possible when the target is simultaneously obscured and deformed, making it impossible to track;

[0058] 4. Based on the unobstructed ship samples, obstructed ship samples were added to expand the training sample library, which made up for the detection performance of YOLOv5 for incomplete ships and improved the detection accuracy.

[0059] 5. By using a pixel-by-pixel matching strategy, we can compensate for the missed detection and tracking phenomena caused by insufficient detector training, thereby further enhancing the detection and tracking performance. Attached Figure Description

[0060] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0061] Figure 1 Flowchart of the improved Deepsort ship tracking anti-occlusion method.

[0062] Figure 2 This is a schematic diagram of a ship sample that has been obscured.

[0063] Figure 3 This is a schematic diagram of a ship sample that has been obscured.

[0064] Figure 4 This is a schematic diagram of a ship sample that has been obscured.

[0065] Figure 5 This is a schematic diagram of a ship sample that has been obscured. Detailed Implementation

[0066] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0067] Example 1

[0068] An improved Deepsort ship tracking anti-occlusion method provided by the present invention, such as... Figure 1 As shown, it includes:

[0069] Step S1: Obtain manually labeled unobstructed ship samples and occluded ship samples, and use the ship samples to train the ship detector to obtain the trained ship detector.

[0070] Specifically, the manually labeled unobstructed ship samples are labeled by using rectangular boxes to mark the ships.

[0071] The manually labeled ship samples with obstructions were obtained using:

[0072] Step S1.1: Use the real occluders in the cropped image or the rectangular blocks with randomly filled content as the mask image;

[0073] Step S1.2: Scaling the mask image at random scales to simulate occlusions at different distances;

[0074] Step S1.3: Randomly overlay the scaled mask onto the ship, ensuring that the occlusion level of the ship meets the preset requirements, and batch produce occluded ship samples.

[0075] Step S1.4: Calculate the unobstructed portion of the ship and re-label the unobstructed portion of the ship using rectangles.

[0076] Step S2: Detect ships in the image using the trained ship detector; if no target ship is detected, detect the target ship using a pixel-by-pixel matching strategy.

[0077] Specifically, step S2 employs the following:

[0078] Step S2.1: Traverse all ship template images corresponding to all ships in the history record;

[0079] Step S2.2: Perform a traversal matching of the current image with all ship template images to obtain the corresponding matching degree;

[0080] Step S2.3: Select the ship template image with the highest matching degree, obtain the pixels that can be matched by the ship template image with the highest matching degree and analyze them. When there are unmatched pixels with an area that meets the preset conditions, and the unmatched pixels can form a relatively complete connected region, it means that the current position is occluded; obtain the bounding rectangle of the occluded region based on the unmatched connected region, and at the same time obtain the unoccluded region.

[0081] Step S2.4: Calculate the matching degree of the unobstructed area. When the matching degree of the unobstructed area is higher than the preset value, it is considered that the target ship has been detected.

[0082] Step S3: When the target ship is detected, the REID model is used for tracking. When the target ship is not tracked, a pixel-by-pixel matching strategy is used to track the occluded target.

[0083] Specifically, step S3 employs the following:

[0084] Step S3.1: Traverse all ship images corresponding to all ships within a preset historical time period;

[0085] Step S3.2: For the currently detected target ship, compare the detected target ship with the image of each target ship within a preset historical time period;

[0086] Step S3.3: Based on the size of each target ship image within a historical preset time period, scale the currently detected target ship to the same height, and at the same time scale the width of the currently retrieved target ship proportionally to obtain a new target ship.

[0087] Step S3.4: Traverse and match the new target ship with the target ships at the corresponding historical time, and calculate the matching degree at each position;

[0088] Step S3.5: When the matching degree of the new target ship at a certain position of the target ship at the corresponding historical time is higher than the empirical threshold, the match is considered successful.

[0089] Specifically, local cropped samples are used to enhance the REID model for tracking occluded and turning targets;

[0090] Based on all ship images corresponding to each ship within a historical preset time period, random cropping is performed, rectangular frames are randomly set, and images within the rectangular frames are used as new sample images.

[0091] The reid model is trained using new sample images until the Triplet Loss function converges, resulting in the trained reid model. The trained reid model network is then used to detect whether the ship in the current image is a ship that has appeared before.

[0092] An improved Deepsort ship tracking anti-interference system according to the present invention includes:

[0093] Module M1: Obtain manually labeled unobstructed ship samples and occluded ship samples, and use the ship samples to train the ship detector to obtain the trained ship detector.

[0094] Specifically, the manually labeled unobstructed ship samples are labeled by using rectangular boxes to mark the ships.

[0095] The manually labeled ship samples with obstructions were obtained using:

[0096] Module M1.1: Uses rectangular blocks that extract real occlusions from cropped images or randomly fill content as mask images;

[0097] Module M1.2: Scaling the mask image at random scales to simulate occlusions at different distances;

[0098] Module M1.3: Randomly overlays the scaled mask image onto the ship, and the occlusion degree of the ship meets the preset requirements, and batch-produces occluded ship samples.

[0099] Module M1.4: Calculates the unobstructed portion of the ship and re-labels the unobstructed portion of the ship using rectangles.

[0100] Module M2: Detects ships in images using the trained ship detector; when no target ship is detected, it uses a pixel-by-pixel matching strategy to detect the target ship.

[0101] Specifically, module M2 adopts:

[0102] Module M2.1: Traverses all ship template images corresponding to all ships in the history;

[0103] Module M2.2: Iterates through and matches the current image with all ship template images to obtain the corresponding matching degree;

[0104] Module M2.3: Select the ship template image with the highest matching degree, obtain the pixels that can be matched by the ship template image with the highest matching degree and analyze them. When there are unmatched pixels with an area that meets the preset conditions, and the unmatched pixels can form a relatively complete connected region, it means that the current position is occluded; obtain the bounding rectangle of the occluded region based on the unmatched connected region, and at the same time obtain the unoccluded region.

[0105] Module M2.4: Calculates the matching degree of the unobstructed area. When the matching degree of the unobstructed area is higher than the preset value, it is considered that the target ship has been detected.

[0106] Module M3: When a target ship is detected, it uses the REID model for tracking. When the target ship is not tracked, it uses a pixel-by-pixel matching strategy to track occluded targets.

[0107] Specifically, module M3 adopts:

[0108] Module M3.1: Traverses all ship images corresponding to all ships within a preset historical time period;

[0109] Module M3.2: For the currently detected target ship, compare the detected target ship with the images of each target ship within a preset historical time period;

[0110] Module M3.3: Based on the size of each target ship image within a preset historical time period, the currently detected target ship is scaled to the same height, and the width of the currently retrieved target ship is scaled proportionally to obtain a new target ship.

[0111] Module M3.4: Iterates and matches the new target ship against the target ships at the corresponding historical time, and calculates the matching degree at each position;

[0112] Module M3.5: When the matching degree of a new target ship at a certain position of a target ship at the corresponding historical time is higher than the empirical threshold, the match is considered successful.

[0113] Specifically, local cropped samples are used to enhance the REID model for tracking occluded and turning targets;

[0114] Based on all ship images corresponding to each ship within a historical preset time period, random cropping is performed, rectangular frames are randomly set, and images within the rectangular frames are used as new sample images.

[0115] The reid model is trained using new sample images until the Triplet Loss function converges, resulting in the trained reid model. The trained reid model network is then used to detect whether the ship in the current image is a ship that has appeared before.

[0116] Example 2

[0117] Example 2 is a preferred example of Example 1.

[0118] This invention provides an improved Deepsort ship tracking anti-occlusion method, comprising:

[0119] First, the detectors used in Deepsort were upgraded to reduce the missed detections in cases of partial occlusion.

[0120] Suppose that the detector used in the current Deepsort algorithm is a YOLOv5 deep neural network. The training process of the YOLOv5 deep neural network is as follows: Ships are manually labeled, and rectangular outlines are used to represent the boundaries and positions of ships in the image. A large number of ship samples are prepared in advance, and then the YOLOv5 deep neural network is trained until the detection performance meets the requirements. However, since the entire ship is often marked during labeling, when encountering partially occluded ships, the YOLOv5 detector may miss detection because it has never seen such incomplete samples. This situation is fatal for tracking and may lead to the breakage of the tracking trajectory.

[0121] This invention employs the following method to compensate for the detection performance of YOLOv5 against incomplete ships:

[0122] First, various obstructions are artificially created as mask images.

[0123] There are two types of mask images: one type comes from real occlusions in the image, obtained by extracting and cropping from the image, such as... Figure 2-5 The tower cranes, mountains, trees, navigation marks, etc. shown can all be used as obstructions; one type is a rectangular block with randomly filled content, including various colors, textures, patterns, etc.

[0124] Secondly, the mask image is scaled at a random scale.

[0125] The mask image is randomly scaled to simulate occlusions at different distances. During scaling, the horizontal and vertical directions are kept at the same scale to prevent distortion of the occluded objects, which could affect the training results.

[0126] Then, the mask image is randomly overlaid onto the ship to batch produce occluded ship samples;

[0127] For the current image containing the ship, a new coordinate C is randomly generated based on the center point coordinates of the ship's outline. This ensures that when a mask image centered at point C is superimposed, there is an overlap between the mask image and the ship (the ship's occlusion level is above 10% and below 90%). Then, the unoccluded portion of the ship is calculated and its position is re-recorded in the form of a rectangular frame.

[0128] This allows us to obtain a large number of partial samples of the obscured ships.

[0129] Finally, the YOLOv5 network is trained sufficiently. Specifically, new samples are added to the original sample library and trained until the detection rate meets the requirements, so that it can also achieve the required detection rate for obstructed ships.

[0130] The handling methods for missed detections include:

[0131] This invention enhances the sample library by supplementing it with a large number of occluded samples, and then retrains the ship detector, thereby improving the detection performance. When detecting ships in the current image, if a certain target is not detected (i.e., it could be detected in the previous frame and the occlusion level was not high), but the detection result in the current frame causes some old targets to be unable to be matched by the reid model, then the following method is needed to confirm whether the missed detection is due to insufficient training of the detector:

[0132] First, the algorithm iterates through all template images corresponding to all IDs in the historical data. These template images are typically used for ship tracking, often spanning hundreds, thousands, or even longer frames. Each ship has an outline in each frame. The trajectory of each ship is the "historical data." When a video contains multiple ships, each is assigned an ID to distinguish them. The ID of the same ship remains consistent across different frames. To achieve tracking, the algorithm stores a template library for each ship. This library contains multiple template images, which are essentially images of ships from previous frames (possibly not all, but selected for suitability). During tracking, these template images are referenced, and tracking is achieved by comparing similarities. "All template images corresponding to all IDs" refers to all template images for all ships, stored at their original size without scaling.

[0133] Secondly, for a specific template image T, i.e., when tracking and matching a specific ship, all template images in the template library for that ship are traversed. When the current template image T is encountered, it is matched within the current image. The template image T is scanned starting from the top left corner of the current image, proceeding from left to right and from top to bottom, thus scanning each position.

[0134] Then, at the current position, calculate the difference (the sum of the absolute values ​​of the differences in the R, G, and B channels) between each pixel of the template image T and the corresponding pixel of the current image, to obtain the matching degree for each position in the entire image (the smaller the difference, the higher the matching degree). The value with the highest matching degree is taken as the matching degree of the current template; based on the matching degree, the template image with the highest matching degree is selected from all template images.

[0135] Then, based on the template with the highest matching degree and its optimal matching position, further analysis is performed: observe the pixels that can be matched in the template image at this time. If there are large areas of unmatched pixels, and the unmatched pixels form a relatively complete connected region, it indicates that the position has been occluded. The bounding rectangle of the occluded region is obtained based on the unmatched connected region, thus identifying the occluded region. The matching degree is then recalculated in the unoccluded region.

[0136] Then, if the matching degree of the unoccluded area is higher than 0.7 (the number of matched pixels in the unoccluded area is equal to the total number of pixels in the unoccluded area), the match is considered successful; if the match fails, it is considered that the target has temporarily disappeared, and no processing is performed in the current frame, but the system will still try to find the target in subsequent frames. If it appears, the trajectory is continued. If it does not reappear for a long time, it means that the target has truly disappeared.

[0137] Finally, the obtained matching position is used as the position of the target in the current frame, and the trajectory information of the target is updated. The position box information of the current frame is also added to the trajectory queue, and the template library is updated.

[0138] Preliminary matching is performed using the reid model in Deepsort.

[0139] The tracking and matching is performed using the ReID model. Specifically, in the current image, the YOLOv5 model is first used to detect all the ships, and then the ReID model is used to match the newly detected ships with the ships in the previous video frames to form a tracking trajectory.

[0140] When performing real-time tracking on video, each new frame is first used to track ships using the Deepsort algorithm, and then an enhanced strategy is used to fill in any gaps to prevent ships missed by Deepsort from going untracked.

[0141] Cases where ReID network matching fails due to occlusion.

[0142] Suppose a ship has an ID of 1. In a new image frame, the ship is indeed detected. However, due to occlusion, this local area fails to match correctly with the historical template image. In this case, a pixel-by-pixel matching strategy is needed to salvage the situation, as follows:

[0143] First, iterate through all the IDs;

[0144] Secondly, for the ship corresponding to the current ID, Img_new is compared with each image (marked as Ti) in the template library;

[0145] Then, scale the height of Img_new to match Ti, and scale the width of Image_new proportionally to obtain Img_new2;

[0146] Then, the scaled image Img_new2 is traversed from left to right in Ti, and the matching degree of each position is calculated (by comparing RGB values ​​pixel by pixel);

[0147] Finally, if the matching degree of Img_new2 at a certain position in Ti is higher than the empirical threshold (0.8), then the matching is considered successful.

[0148] When occlusion and turning occur simultaneously, even after pixel-by-pixel matching, some older ships may still fail to match. This is likely because the ships have turned simultaneously, causing local matching to fail due to perspective issues. In this case, a new strategy is needed—using deep neural networks to determine whether the occluded portion is part of the overall image.

[0149] In addition to providing complete viewpoints for each image subset corresponding to each ID, random cropping is also required on these images to simulate occluded samples. Based on each existing image in the current subset, a rectangle (its size and position are randomly set) is randomly selected, and the image content within that rectangle is cropped out as a new sample image, which is also placed in the subset.

[0150] Then, based on the expanded sample set, Triplet Loss is used as the loss function for further training. The reid model trained in this way will be able to determine whether the current image sub-block is an old ship, thus ensuring that tracking is not interfered with by occlusion and turning.

[0151] Specifically, a wide ResNet network is used to extract depth features F0 from the image region inside the detected ship frame in the current frame. Then, depth features Fi are also extracted from each template image stored in the template library using wide ResNet. Finally, a matching process is performed to find the closest match between Fi and F0. The match with the smallest distance is selected as the final result. If the minimum distance meets the requirements, the tracking is considered successful. The tracking is then complete.

[0152] During real-time tracking, any occluded or incomplete image samples encountered after turning should also be included in the template queue to ensure the integrity of the template library.

[0153] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.

[0154] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. An improved Deepsort ship tracking anti-occlusion method, characterized in that, include: Step S1: Obtain manually labeled unobstructed ship samples and occluded ship samples, and use the ship samples to train the ship detector to obtain the trained ship detector. Step S2: Detect ships in the image using the trained ship detector; If no target ship is detected, a pixel-by-pixel matching strategy is used to detect the target ship. Step S3: When the target ship is detected, the ReID model is used for tracking. When the target ship is not tracked, the pixel-by-pixel matching strategy is used to track the occluded target. The manually labeled, unobstructed ship samples are labeled using rectangular boxes. The manually labeled ship samples with obstructions were obtained using: Step S1.1: Use the real occluders in the cropped image or the rectangular blocks with randomly filled content as the mask image; Step S1.2: Scaling the mask image at random scales to simulate occlusions at different distances; Step S1.3: Randomly overlay the scaled mask onto the ship, ensuring that the occlusion level of the ship meets the preset requirements, and batch produce occluded ship samples. Step S1.4: Calculate the unobstructed portion of the ship and re-label the unobstructed portion of the ship using rectangles.

2. The improved Deepsort ship tracking anti-occlusion method according to claim 1, characterized in that, Step S2 employs the following: Step S2.1: Traverse all ship template images corresponding to all ships in the history record; Step S2.2: Perform a traversal matching of the current image with all ship template images to obtain the corresponding matching degree; Step S2.3: Select the ship template image with the highest matching degree, obtain the pixels that can be matched by the ship template image with the highest matching degree and analyze them. When there are unmatched pixels with an area that meets the preset conditions, and the unmatched pixels can form a relatively complete connected region, it means that the current position is occluded; obtain the bounding rectangle of the occluded region based on the unmatched connected region, and at the same time obtain the unoccluded region. Step S2.4: Calculate the matching degree of the unobstructed area. When the matching degree of the unobstructed area is higher than the preset value, it is considered that the target ship has been detected.

3. The improved Deepsort ship tracking anti-occlusion method according to claim 1, characterized in that, Step S3 employs the following: Step S3.1: Traverse all ship images corresponding to all ships within a preset historical time period; Step S3.2: For the currently detected target ship, compare the detected target ship with the image of each target ship within a preset historical time period; Step S3.3: Based on the size of each target ship image within a historical preset time period, scale the currently detected target ship to the same height, and at the same time scale the width of the currently retrieved target ship proportionally to obtain a new target ship. Step S3.4: Traverse and match the new target ship with the target ships at the corresponding historical time, and calculate the matching degree at each position; Step S3.5: When the matching degree of the new target ship at a certain position of the target ship at the corresponding historical time is higher than the threshold, the match is considered successful.

4. The improved Deepsort ship tracking anti-occlusion method according to claim 1, characterized in that, Locally cropped samples are used to enhance the ReID model's ability to track occluded and turning targets; Based on all ship images corresponding to each ship within a historical preset time period, random cropping is performed, rectangular frames are randomly set, and images within the rectangular frames are used as new sample images. The reid model is trained using new sample images until the Triplet Loss function converges, resulting in the trained reid model. The trained reid model network is then used to detect whether the ship in the current image is a ship that has appeared before.

5. An improved Deepsort ship tracking anti-interference system, characterized in that, include: Module M1: Obtain manually labeled unobstructed ship samples and occluded ship samples, and use the ship samples to train the ship detector to obtain the trained ship detector. Module M2: Detects ships in images using the trained ship detector; when no target ship is detected, it uses a pixel-by-pixel matching strategy to detect the target ship. Module M3: When a target ship is detected, the ReID model is used for tracking. When the target ship is not tracked, a pixel-by-pixel matching strategy is used to track occluded targets. The manually labeled, unobstructed ship samples are labeled using rectangular boxes. The manually labeled ship samples with obstructions were obtained using: Module M1.1: Uses rectangular blocks that extract real occlusions from cropped images or randomly fill content as mask images; Module M1.2: Scaling the mask image at random scales to simulate occlusions at different distances; Module M1.3: Randomly overlays the scaled mask image onto the ship, and the occlusion degree of the ship meets the preset requirements, and batch-produces occluded ship samples. Module M1.4: Calculates the unobstructed portion of the ship and re-labels the unobstructed portion of the ship using rectangles.

6. The improved Deepsort ship tracking anti-interference system according to claim 5, characterized in that, The module M2 adopts: Module M2.1: Traverses all ship template images corresponding to all ships in the history; Module M2.2: Iterates through and matches the current image with all ship template images to obtain the corresponding matching degree; Module M2.3: Select the ship template image with the highest matching degree, obtain the pixels that can be matched by the ship template image with the highest matching degree and analyze them. When there are unmatched pixels with an area that meets the preset conditions, and the unmatched pixels can form a relatively complete connected region, it means that the current position is occluded; obtain the bounding rectangle of the occluded region based on the unmatched connected region, and at the same time obtain the unoccluded region. Module M2.4: Calculates the matching degree of the unobstructed area. When the matching degree of the unobstructed area is higher than the preset value, it is considered that the target ship has been detected.

7. The improved Deepsort ship tracking anti-interference system according to claim 5, characterized in that, The module M3 adopts: Module M3.1: Traverses all ship images corresponding to all ships within a preset historical time period; Module M3.2: For the currently detected target ship, compare the detected target ship with the images of each target ship within a preset historical time period; Module M3.3: Based on the size of each target ship image within a preset historical time period, the currently detected target ship is scaled to the same height, and the width of the currently retrieved target ship is scaled proportionally to obtain a new target ship. Module M3.4: Iterates and matches the new target ship against the target ships at the corresponding historical time, and calculates the matching degree at each position; Module M3.5: When the matching degree of a new target ship at a certain position of a target ship at the corresponding historical time is higher than the threshold, the match is considered successful.

8. The improved Deepsort ship tracking anti-interference system according to claim 5, characterized in that, Locally cropped samples are used to enhance the ReID model's ability to track occluded and turning targets; Based on all ship images corresponding to each ship within a historical preset time period, random cropping is performed, rectangular frames are randomly set, and images within the rectangular frames are used as new sample images. The reid model is trained using new sample images until the Triplet Loss function converges, resulting in the trained reid model. The trained reid model network is then used to detect whether the ship in the current image is a ship that has appeared before.

Citation Information

Patent Citations

  • Ship detecting and tracking method based on infrared video

    CN107092890A

  • Pedestrian image occlusion detection method based on cyclic confrontation generation network

    CN108573222A

  • A ship target tracking method based on depth learning

    CN109509214A