A method and device for measuring the velocity of a micro-nano scale flow target

By using adaptive overlapping slicing and improved YOLO network detection, combined with dual-threshold cascaded tracking algorithm and inter-frame proximity matching, the problems of missed detection and discontinuous velocity measurement in the detection of micro-nano-scale flowing targets are solved, and efficient and accurate velocity measurement of micro-nano-scale flowing targets is achieved.

CN122283178APending Publication Date: 2026-06-26SOUTHWEST PETROLEUM UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTHWEST PETROLEUM UNIV
Filing Date
2026-03-23
Publication Date
2026-06-26

Smart Images

  • Figure CN122283178A_ABST
    Figure CN122283178A_ABST
Patent Text Reader

Abstract

This application discloses a method and apparatus for measuring the velocity of micro- and nano-scale flowing targets, belonging to the fields of computer vision and fluid experimental measurement. The method includes: reading video containing micro- and nano-scale flowing targets frame by frame to generate multiple initial images; adaptively overlapping and slicing each initial image frame using a sliding window with a preset overlap rate to obtain a slice to be detected; performing parallel small target detection on each slice as a detection box to obtain a detection result group containing detection box information of micro- and nano-scale flowing targets; performing cross-slice fusion deduplication on the detection result group to obtain a deduplication result; based on the deduplication result, using a dual-threshold cascaded multi-target tracking algorithm to maintain the trajectory of micro- and nano-scale flowing targets, obtaining a maintenance result; and based on the maintenance result, using an inter-frame proximity matching algorithm to calculate the instantaneous velocity of each micro- and nano-scale flowing target. This application improves the detection accuracy, tracking stability, and velocity calculation reliability of micro- and nano-scale flowing targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer vision and fluid experimental measurement technology, and in particular to a method and apparatus for measuring the velocity of micro- and nano-scale flowing targets. Background Technology

[0002] In the fields of computer vision and fluid experimental measurement, the high-precision detection and tracking of micro- and nano-scale flowing targets (such as microbubbles, microdroplets, or particles) has significant application value. These targets are commonly found in microfluidic devices, interfacial process research, and oil and gas development experiments. Their size typically ranges from 30 to 80 pixels, and they usually occupy a very small area in the image, are easily deformed, move rapidly, and are prone to blurring and interference from noise, uneven lighting, or occlusion. Accurately sensing their position, quantity, and velocity parameters is crucial for inverting fluid dynamics behavior. For example, in microbubble velocity monitoring, it is necessary to acquire real-time data on the target's equivalent radius, trajectory continuity, and instantaneous velocity to support online experimental monitoring and data inversion. However, the extremely small size and varied shapes of micro- and nano-scale flowing targets in images, coupled with complex imaging conditions, pose serious challenges to the detection integrity, tracking robustness, and velocity measurement reliability of vision systems.

[0003] Existing technologies primarily employ small target detection methods based on full-image inference, combined with a single-threshold multi-target tracking strategy for target trajectory maintenance, and velocity measurement through the continuity of tracking IDs. Specifically, the detection phase relies on standard YOLO and other networks for direct inference across full-resolution frames, while the tracking phase applies Kalman filtering and the Hungarian algorithm for trajectory matching, using only a single confidence threshold (e.g., 0.5) to process detection boxes. Velocity calculation heavily depends on the continuous allocation of tracking IDs, i.e., calculating physical velocity by combining the displacement of the same ID in adjacent frames with pixel calibration coefficients (e.g., 1 pixel = 13.02 μm) and frame rate (e.g., 30 fps). These methods are generally feasible in conventional scenarios, but their limitations become increasingly apparent when the proportion of micro- and nano-sized flowing targets is low, or when there is rapid or dense flow.

[0004] Existing technologies have significant drawbacks: First, small target detection methods based on full-graph inference suffer from high false negative rates for micro- and nano-scale flowing targets due to excessively large receptive fields and downsampling losses. Second, single-threshold multi-target tracking strategies are prone to trajectory interruptions and frequent ID switching when targets briefly disappear, become blurred, or are occluded, making it difficult to effectively handle scenarios with fluctuating confidence. Finally, velocity measurement is highly dependent on the continuity of tracking IDs; once an ID is lost or reassigned, it results in missing or mismatched velocity sequences, leading to low sustainability of velocity measurement. Summary of the Invention

[0005] This application provides a method and apparatus for measuring the velocity of micro- and nano-scale flowing targets, which can solve the problems of high false negative rate for small targets, inability to effectively handle scenarios with fluctuating confidence, and low velocity measurement sustainability in existing methods for measuring micro- and nano-scale flowing targets.

[0006] To achieve the above objectives, the technical solution of this invention is as follows: In a first aspect, embodiments of the present invention provide a method for measuring the velocity of micro / nano-scale flowing targets, comprising: Step 1: Read the video containing micro- and nano-scale flowing targets frame by frame to generate multiple initial images; Step 2: For each frame of the initial image, perform adaptive overlapping slicing using a sliding window with a preset overlap rate to obtain the slice to be detected; Step 3: Perform small target detection in parallel on each frame of the slice to be detected as a detection box to obtain a detection result group containing the detection box information of the micro-nano-scale flowing target; Step 4: Perform cross-slice fusion deduplication on the detection result group to obtain the deduplication result; Step 5: Based on the deduplication results, use a dual-threshold cascaded multi-target tracking algorithm to maintain the trajectory of the micro-nano-scale flow target and obtain the maintenance results; Step 6: Based on the maintenance results, the instantaneous velocity of each of the micro-nano-scale flowing targets is calculated using the inter-frame proximity matching algorithm.

[0007] In conjunction with the first aspect, in one possible implementation, step 6 further includes: writing the instantaneous velocity into a dual buffer pool, with a short-term window for high-frequency fluctuation analysis and a long-term window for macro trend verification.

[0008] In conjunction with the first aspect, one possible implementation method for velocity measurement of micro / nano-scale flowing targets also includes: Step 7: Overlay a visualization selection box onto the tracked targets to generate an output video. Output the structured results of the micro-nano-scale flowing targets. The structured results include the total number and average radius of the micro-nano-scale flowing targets, the first crossing record of each individual, the equivalent radius of each micro-nano-scale flowing target, the 0.5-second particle size velocity sequence, and the 5-second particle size velocity summary.

[0009] In conjunction with the first aspect, in one possible implementation, in step 3, the small target detection employs an improved YOLO network that includes a high-resolution feature layer P2.

[0010] In conjunction with the first aspect, in one possible implementation, step 3 of the small target detection introduces a non-destructive sampling module, a feature enhancement module, and a lightweight attention module.

[0011] In conjunction with the first aspect, in one possible implementation, step 4, which involves cross-slice fusion and deduplication of the detection result group, includes: Step 41: Map the detection boxes of each of the slices to be detected back to the original image coordinate system; Step 42: Combine the converted bounding boxes of all the slices to be detected into a global list; Step 43: Perform a nonmaximum suppression algorithm on the global list.

[0012] In conjunction with the first aspect, in one possible implementation, step 43 includes: iterative traversal steps until the list is cleared, wherein the traversal steps include: Step 431: Sort the detection boxes in the global list in descending order of confidence; Step 432: Traverse the sorted global list and select the detection box with the highest confidence as the reference box; Step 433: Delete all remaining detection boxes whose intersection-union ratio with the baseline box is greater than a preset threshold.

[0013] In conjunction with the first aspect, in one possible implementation, step 5, the use of a dual-threshold cascaded multi-target tracking algorithm to maintain the target trajectory includes: Detection boxes with a high matching confidence threshold or greater than or equal to the threshold are matched first and the tracked trajectory is updated. Within a preset buffer time, for unmatched trajectories, a second matching is performed on detection boxes that are greater than or equal to the low recovery confidence threshold. If a match is found, the trajectory of the micro-nano-scale flowing target within the corresponding detection box is recovered. If no match is found after the preset buffer time, the trajectory of the micro-nano-scale flowing target within the corresponding detection box is deleted.

[0014] In conjunction with the first aspect, in one possible implementation, after step 5, the following is also included: A preset counting line or counting region is set. When the centroid of the micro-nano-scale flowing target crosses the preset counting line for the first time or fully enters the counting region for the first time, deduplication counting is triggered and the timestamp, spatial position, and target radius information of the first crossing or entry of the micro-nano-scale flowing target are recorded.

[0015] Secondly, another embodiment of the present invention provides a velocity measurement device for micro / nano-scale flowing targets, comprising: The reading module is used to read video frames by frames containing micro- and nano-scale flowing targets and generate multiple initial images. The slicing module is used to adaptively overlap slice each frame of the initial image with a preset overlap rate through a sliding window to obtain the slice to be detected. The detection module is used to perform small target detection in parallel by treating each frame of the slice to be detected as a detection box, and to obtain a detection result group containing the detection box information of the micro-nano-scale flowing target. The deduplication module is used to perform cross-slice fusion deduplication on the detection result group to obtain the deduplication result; The maintenance module is used to maintain the trajectory of the micro-nano-scale flow target using a dual-threshold cascaded multi-target tracking algorithm based on the deduplication result, and obtain the maintenance result. The calculation module is used to calculate the instantaneous velocity of each of the micro-nano-scale flowing targets based on the maintenance results using an inter-frame proximity matching algorithm.

[0016] Thirdly, in yet another embodiment of the present invention, a server is provided, comprising: a memory and a processor; The memory is used to store program instructions; The processor is used to execute program instructions in the server, causing the server to perform the velocity measurement method for micro-nano-scale flowing targets described above.

[0017] Fourthly, in another embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing executable instructions, which, when executed by a computer, enable the velocity measurement method for micro-nano-scale flowing targets as described above.

[0018] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages: The velocity measurement method for micro-nano-scale flowing targets provided in this application first generates an initial image by reading video frame by frame to ensure the integrity of the data foundation. Then, an adaptive overlapping slicing technique with a preset overlap rate is used to divide each frame of the initial image into multiple slices to be detected, significantly magnifying the local details of the micro-nano-scale flowing targets. This overcomes the difficulty in model recognition caused by the small target size during direct full-image detection, thereby greatly improving the detection rate of micro-nano-scale flowing targets. Next, by treating the slices to be detected as independent detection boxes and performing small target detection in parallel, this method achieves efficient parallel processing and optimizes detection efficiency. Then, a cross-slice fusion deduplication operation eliminates duplicate detection boxes, ensuring target uniqueness and laying an accurate data foundation for subsequent tracking. Based on this, a multi-target tracking algorithm with dual threshold cascades is used for trajectory maintenance. This method effectively handles situations where the target briefly disappears or is occluded, enhancing the robustness and continuity of tracking. Finally, an inter-frame proximity matching algorithm is used to calculate the instantaneous velocity, ensuring the real-time performance and accuracy of the velocity measurement. Overall, the method in this application embodiment significantly improves the accuracy of micro- and nano-scale flowing target detection, the stability of tracking, and the reliability of velocity calculation through the above-described synergistic steps. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A flowchart of a velocity measurement method for micro / nano-scale flowing targets provided in this application embodiment; Figure 2 Example 1 of actual detection provided in this application embodiment, (a) in the figure, (b) tracking result; Figure 3 Example 2 of actual detection provided in this application embodiment, (a) in the figure, (b) tracking result; Figure 4 Example 3 of actual detection provided in this application embodiment, (a) in the figure, (b) tracking result; Figure 5 Example 4 of actual detection provided in this application embodiment, in which (a) is the original image and (b) is the tracking result; Figure 6 A screenshot of the output video provided in the embodiments of this application; Figure 7 A result view showing the total number and average radius of the output micro / nano-scale flowing targets provided in this application embodiment; Figure 8 A result view of the individual's first traverse record provided in this application embodiment; Figure 9 A result view of the 0.5-second particle size velocity sequence provided in an embodiment of this application; Figure 10 A result view of the 5-second granularity velocity summary provided for an embodiment of this application. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0022] Please refer to Figure 1 As shown, this embodiment of the invention provides a method for measuring the velocity of micro- and nano-scale flowing targets, including: Step 1: Read the video containing micro / nano-scale flowing targets frame by frame to generate multiple initial images. For example, during system initialization, input a video file containing micro / nano-scale flowing targets (e.g., P1.mp4, resolution 1368×768 pixels, frame rate 30fps), load a custom YOLO weight (best.pt) and a SAHI-encapsulated detection model (confidence threshold 0.5). Read the video containing micro / nano-scale flowing targets frame by frame to generate multiple initial images. These micro / nano-scale flowing targets include tiny targets with dimensions of 30-80 pixels, such as microbubbles, microdroplets, or microparticles.

[0023] Step 2: Based on the size range of the micro / nano-scale flowing targets, set the size of the sliding window and a preset overlap rate. For each initial image frame, adaptively overlap and slice it using the sliding window with the preset overlap rate to obtain the slices to be detected. For example, each initial image frame is sliced ​​into approximately 15 320×320 pixel slices (horizontal / vertical overlap of 112 pixels) using the sliding window with a 35% overlap rate. For the edge regions of the initial image, since adaptive overlap slicing cannot be implemented, the edge regions are extended outwards by a certain length during retrieval to prevent missed detections of edges in the initial image.

[0024] In practice, each initial image frame is very large, such as 1368×768 pixels, but micro- and nano-sized flowing targets (such as microbubbles) only occupy a small portion of it ((30~80)×(30~80) pixels). If the entire initial image is used directly for detection, it is equivalent to searching for a tiny image in a very large initial image, which the model may not be able to "see" and will result in missed detections. Step 2 cuts the large initial image into multiple slices (sub-plots) to be detected (e.g., cut into about 15 slices of 320×320 pixels each; if the preset overlap rate is 35%, the slices overlap horizontally and vertically by 112 pixels). In each slice, the micro- and nano-sized flowing targets occupy a larger proportion, that is, the details are magnified, and the detection model is more likely to find the micro- and nano-sized flowing targets.

[0025] If a micro- or nano-sized flow target is located precisely on the boundary of the slice to be detected, such as a microbubble with half on the left and half on the right slice, the microbubble is easily missed because it is cut into at least two parts. Adaptive overlapping slices with a preset overlap rate ensure that adjacent slices overlap, guaranteeing that the micro- or nano-sized flow target at the boundary is completely covered by at least one slice, thus preventing missed detections at the boundary. When the overlap rate is 0, the overlapping area of ​​adjacent windows is 20-0% of the area of ​​a single window. 2 .

[0026] Optionally, the preset overlap rate is 0.2 to 0.5, which provides flexibility and allows the overlap rate to be adjusted according to the target size, image resolution and noise level to adapt to the detection needs in different scenarios, ultimately improving the robustness and accuracy of the overall method.

[0027] Preferably, in this embodiment, o=0.35, so that each 320×320 pixel slice to be detected accounts for approximately 57% (calculated as 2×0.35-0.35). 2 =0.7-0.1225≈57.75%) The area overlaps with the adjacent slice to be detected, thus ensuring that the target appears in at least two windows.

[0028] The sliding window method starts from the top left corner of the initial image and moves the window to the bottom right, moving a fixed distance each time (but less than the window size to ensure overlap). For example, with a window size of 320×320 pixels, moving horizontally by 208 pixels (320 pixels minus 112 overlapping pixels) results in approximately 15 slices to be detected. These slices are then detected in parallel (using the YOLO model), and the results are fused and output.

[0029] Adaptive overlapping slices can use fixed or variable sizes. For example, a fixed size is defined as slice dimensions SLICE_HEIGHT=320 pixels and SLICE_WIDTH=320 pixels. Variable sizes allow SLICE_HEIGHT and SLICE_WIDTH to be adjusted based on the target size or resolution. Setting the overlap ratio o=0.35, meaning each sliding window overlaps with adjacent windows by 35% in both the horizontal and vertical directions, is equivalent to 112 pixels when the fixed size is 320×320 pixels. SAHI automatically segments the input frame into several slices to be detected according to the above dimensions in row-major order. Each slice contains the overlapping area of ​​adjacent slices. Each slice is independently fed into a pre-trained YOLO model for inference, increasing the recall rate for small targets with low contrast and boundaries.

[0030] The selection criteria for the size of the slice to be detected are related to the target size. Generally, the size of the slice to be detected can be set to a fixed value (e.g., 320×320 pixels), or it can be adaptively adjusted according to the resolution of the input image, the target size, or the network's receptive field. Typically, the size of the slice to be detected is set to 2 to 4 times the average diameter of the micro / nano-scale flowing target, and not smaller than the spatial receptive field of the detection network.

[0031] Step 3: Perform small target detection in parallel on each frame as a detection box to obtain a detection result group containing micro-nano-scale flowing target detection box information.

[0032] Specifically, the slice to be detected is acquired and identified as a detection box (xyxy). For each slice to be detected obtained through adaptive overlapping slicing via a sliding window, each frame of the slice to be detected is treated as a detection box, thereby generating multiple detection boxes. These detection boxes can then be processed in parallel, improving efficiency. Moreover, each detection box is better able to find micro- and nano-scale flowing targets.

[0033] Furthermore, in step 3, the small target detection employs an improved YOLO network that includes a high-resolution feature layer P2.

[0034] Specifically, the improved YOLO network comprises a three-segment architecture: a Backbone feature extraction network, a Neck feature fusion network, and a Head detection head. The Backbone feature extraction network takes a 640×640 pixel image as input and executes the following sequentially: a Conv layer downsamples the image to 320×320 pixels; the SDDown module processes and connects the C3CCB and MFEM modules to generate a P2 layer feature map (160×160 pixels); the SDDown module processes and connects the C3CCB and MFEM modules to generate a P3 layer feature map (80×80 pixels); the SDDown module processes and connects the C3CCB and MFEM modules to generate a P4 layer feature map (40×40 pixels); and the SDDown module processes and connects the C3CCB and SPPELAN modules to generate a P5 layer feature map (20×20 pixels). This embodiment of the improved YOLO network includes a high-resolution feature layer P2, removes the P1 layer, and improves layers P2 through P5, with significant improvements made to the P2 layer.

[0035] The Backbone feature extraction network includes input size, layer sequence (such as Conv, SDDown, C3CCB, MFEM, SPPELAN), output size of each layer (P2, P3, P4, P5), and downsampling process.

[0036] The Neck feature fusion network employs an improved PANet architecture, incorporating feature fusion at four scales: a top-down path from layer P5 to layers P4, P3, and P2; and a bottom-up path from layer P2 to layers P3, P4, and P5; fusing multi-scale features from different layers. This Neck feature fusion network includes feature fusion paths (top-down and bottom-up), the number of fusion scales, and a multi-scale feature integration mechanism.

[0037] The Head detection head outputs detection results at three scales through the Detect module, corresponding to layer indices [21, 24, 27]. This Head detection head includes the functionality of the Detect module, the number of output scales, and the specific indices.

[0038] Improvements include: adding a P2 detection layer, fusing features from P2, P3, and P4 layers starting from layer 0; specifically implemented through a YAML configuration file: introducing the SDDown module to process P2 layer features, using the Concat module to fuse with Neck, and outputting three detection heads through the Detect module. This improvement includes the P2 layer fusion mechanism (fusing P2 / P3 / P4 starting from layer 0), YAML configuration details (such as calls to SDDown, Concat, and Detect), and a configuration file example (light-yolo.yaml).

[0039] The P2 layer offers advantages for small targets: higher resolution features: the P2 feature map size is 160×160 pixels, which is 4 times the area of ​​the P3 layer (80×80 pixels); fine-grained information preservation: for small targets smaller than 32×32 pixels, the P2 layer can provide more refined spatial information; enhanced localization accuracy: the denser feature map grid makes bounding box regression more accurate.

[0040] Furthermore, in step 2, the small target detection introduces a non-destructive sampling module, a feature enhancement module, and a lightweight attention module to improve the recall rate of 30-80 pixel micro-nano-scale mobile targets, that is, to significantly increase the relative proportion of small targets (30-80 pixels) in the receptive field, thereby increasing the detection recall rate from 65% to 92%.

[0041] The lossless downsampling module is the Space-to-Depth downsampling module (SDDown), which includes: Downsampling without information loss: Pixels are reconstructed to the channel dimension through Space-to-Depth, fully preserving spatial information and avoiding the loss of small target information caused by traditional pooling or stride convolution. Reduced feature map loss: For small targets (e.g., 3×3 pixels), traditional 2×2 pixel pooling loses 75% of information, while SDDown retains 100% of the information. Enhanced feature representation of small targets: The channels are expanded by 4 times, providing a richer feature representation space.

[0042] The feature enhancement module includes a Multi-scale Feature Enhancement Module (improved MFEM). This includes: 1. Multi-scale receptive fields: four scales—3×3, 7×7, 11×11, and 21×21—capturing both local and global contextual information simultaneously. 2. Separate convolutions to reduce computation: large convolution kernels are decomposed using (1×k)+(k×1), reducing the number of parameters from k... 2To reduce the number of parameters to 2k, if the asymmetric kernel is k=3, this application uses an asymmetric convolution kernel of (1×3)+(3×1), reducing the number of parameters to 1×3+3×1=6, while existing methods require 3×3=9, thus enhancing directional features: better capturing the edge and directional information of small targets. 3. Progressive feature enhancement: Features are gradually refined through a chained structure of branch0→branch1→branch2→branch3. 4. Residual scaling mechanism: Setting scale=0.1 prevents gradient explosion and maintains training stability.

[0043] The feature enhancement module also includes Spatial Pyramid Pooling ELAN (SPPELAN), which includes: 1. Multi-scale pooling pyramid: By concatenating three MaxPools, receptive fields of 1×, 2×, 3×, and 4× are obtained. 2. Resolution preservation: stride=1 ensures that the output size remains unchanged, and small targets will not disappear due to pooling. 3. Context aggregation: Integrates contextual information at different scales to help distinguish small targets from the background.

[0044] The lightweight attention module is the SimAttention module (parameter-free attention), which improves upon the SimAttention part of C3CCB-CSP Bottleneck with CrossConv. It includes: 1. A non-parametric attention mechanism: using the formula y=(x-μ). 2 / (4σ²+ε)+0.5, output = x×Sigmoid(y). 2. Lightweight design: No additional parameters, reducing computational burden. 3. Adaptive feature enhancement: Selectively enhances important features and suppresses background noise, improving the representation of small target features.

[0045] The method in this application embodiment is supported by a multi-scale high-resolution detection head. The underlying detection network adopts an improved YOLO network that includes a high-resolution feature layer P2 (160×160 pixels), and integrates components such as the SDDown lossless downsampling module, the MFEM feature enhancement module, the C3CCB asymmetric convolution and the SimAttention lightweight attention module, so as to comprehensively improve the feature expression capability and localization accuracy of small targets.

[0046] Step 4: Perform cross-slice fusion deduplication on the detection result group to obtain the deduplicated result. Because there are overlapping areas between the detection slices, the same micro / nano-scale flow target (such as a microbubble) may be detected simultaneously by 2-4 adjacent slices. This can lead to multiple duplicate detection frames for a single micro / nano-scale flow target. For example, slice 1 reports the location of microbubble A as (10, 20), and slice 2 reports the location as (11, 21), but they are actually the same microbubble. Directly counting the data related to micro / nano-scale flow targets would result in an inflated number of micro / nano-scale flow targets, leading to confusion in subsequent tracking and velocity measurement. Cross-slice fusion deduplication of the detection result group solves the problem of duplicate counting in practice and ensures statistical accuracy.

[0047] The detection results are fused and deduplicated across slices, including: Step 41: Mapping the detection bounding boxes of each slice back to the original image coordinate system. Specifically, the bounding boxes detected for each slice are based on the local coordinates of the upper left corner of that slice, and need to be converted to global coordinates in the original image coordinate system using an offset (SAHI automatically converts them back to the original frame coordinate system during the output stage): horizontally through... = +offset x Calculation, perpendicular direction through = +offset y The calculation involves determining the offset based on the position of the slice to be detected within the overall image. and For local coordinates, offset x and offset y These are the horizontal and vertical offsets. This step ensures that all detection boxes are aligned to a unified global spatial reference.

[0048] Since each slice to be detected is cut from the initial image, it has its own small coordinates (e.g., the origin is at the top left corner of the slice). We need to know the actual positions of these slices on the initial image. Therefore, this step involves calculating the offset of each slice on the initial image (e.g., its exact position within the initial image), adding this offset to the slice's coordinates, converting it back to its correct position on the initial image, and then placing it back in its correct position.

[0049] Step 42: Compile the converted bounding boxes of all the plots to be detected into a global list (xyxys). This list contains the detection boxes from all the plots to be detected, covering the entire image area. It includes both duplicate candidate boxes of the same target in overlapping areas of adjacent plots to be detected, and new boxes generated due to supplementary detection at the edges of the plots to be detected. During the tiling process, adjacent plots to be detected have overlapping areas, so the same micro-nano-scale flowing target may be detected in multiple plots to be detected. This step is to collect all the converted bounding boxes (i.e., the target boxes detected in each small patch) into a large list. This list is a large set containing all possible target boxes, but there may be duplicates (because things in overlapping areas are detected multiple times).

[0050] Step 43: The global list contains many bounding boxes, some of which are duplicates (e.g., the same micro / nano-scale flowing target is marked multiple times in different slices). To eliminate redundant detections, a non-maximum suppression (NMS) algorithm is performed on the global list. This specifically includes an iterative traversal step until the list is empty. The traversal step includes: Step 431: Sort the detection boxes in the global list in descending order of confidence (higher confidence boxes are placed first).

[0051] Step 432: Traverse the sorted global list and select the detection box with the highest confidence as the reference box.

[0052] Step 433: Delete all remaining detection boxes whose Intersection over Union (IOU) with the baseline box is greater than the preset threshold (postprocess_match_threshold, e.g., 0.5).

[0053] This step performs non-maximum suppression (NMS) on the entire original image at the full-scale. After detecting the slice to be detected, the coordinates are uniformly restored and then processed to ensure that the target in the overlapping area is retained only once.

[0054] The problem of cross-slice duplicate counting is a core challenge in current slice-based methods for detecting and counting dense small targets. When micro- or nano-sized flowing targets (such as bubbles) cross the boundaries of two or more adjacent image slices, existing techniques perform NMS independently within each slice and then stitch the results back into the larger image. Because of the lack of duplicate detection in overlapping areas between slices, the same target is detected and counted multiple times. This localized processing severely compromises the accuracy of the overall counting, especially in high-density scenes where errors are significantly amplified. The method in this embodiment fundamentally solves this problem by introducing a Global Non-Maximum Suppression (GlobalNMS) mechanism. After completing the initial detection of all slices, it maps all local detection boxes back to the original global image coordinate system and performs a one-time NMS operation across the entire image. This global deduplication process accurately identifies and suppresses duplicate detection boxes originating from different slices targeting the same micro- or nano-sized flowing target, retaining only the unique detection result with the highest confidence. This not only completely eliminates false duplicate counts caused by the boundaries of the slices to be detected, significantly improving the overall counting accuracy, but also overcomes the inherent field-of-view limitations of traditional slice processing modes. It significantly optimizes performance through global fusion deduplication. While retaining the high recall rate advantage of slice detection, it effectively eliminates redundant boxes through global NMS, achieving a better balance between detection accuracy and recall rate. It achieves a leap from "local optimum" to "global optimum" detection, and shows a decisive advantage, especially in large-scale, high-density micro-nano-scale flowing target counting tasks.

[0055] Step 5: Based on the deduplication results, a multi-target tracking algorithm with dual threshold cascades is used to maintain the trajectory of micro- and nano-scale flowing targets, and the maintenance results are obtained.

[0056] This multi-target tracking algorithm can be the BYTE tracking algorithm. In practice, the BYTETracker is initialized with a high matching confidence threshold of 0.6, a low recovery confidence threshold of 0.4, an IOU threshold of 0.6, and a trajectory preset buffer time of 300 frames. The BYTE tracking algorithm effectively addresses the confidence fluctuation problem caused by rapid movement, shape changes, or brief occlusion of micro- and nano-sized targets through a cascaded matching mechanism of the high matching confidence threshold (0.6) and the low recovery confidence threshold (0.4). When micro- and nano-sized targets experience imaging blurring due to fluid disturbances, the high threshold priority matching ensures reliable locking of clear targets, while the low threshold secondary matching mechanism can capture target instances with declining confidence. Combined with a trajectory buffer window of up to 10 seconds (300 frames), the target can recover its original trajectory even after experiencing multiple frames of occlusion, avoiding the frequent ID switching problem caused by traditional single-threshold strategies. The combination of this dual-threshold cascading strategy and buffering mechanism reduces the ID switching rate by 60% and the trajectory interruption rate by 45% in scenarios involving dense bubble clusters and cross-movement, significantly improving the continuity of microbubble equivalent radius measurement and velocity sequence calculation. Simultaneously, the BYTE tracking algorithm, through the synergistic optimization of Kalman filter prediction and the Hungarian algorithm, achieves sub-pixel-level trajectory matching accuracy while maintaining a real-time processing speed of 30 frames per second. This provides a stable and reliable trajectory data foundation for subsequent instantaneous velocity calculation based on centroid displacement, making it particularly suitable for industrial online inspection scenarios requiring long-term monitoring of the motion trends of micro- and nano-scale targets.

[0057] In practice, tracking a single micro / nano-scale flow target among numerous such targets can be challenging if only one standard is used, such as a fully enclosed arc-shaped region. This can easily lead to the loss of micro / nano-scale flow targets if they are slightly obscured. The dual-domain approach in step 5 uses two tracking standards to prevent target loss. For example, the first-level matching uses a high threshold with strict conditions, such as requiring a detection confidence level ≥ 0.6, thus recognizing only clear targets and prioritizing matching only clearly defined micro / nano-scale flow targets, such as those in fully enclosed arc-shaped regions, to avoid mistracking them. The second-level matching uses a low threshold with relatively lenient conditions, such as requiring a detection confidence level ≥ 0.4, to capture blurred or slightly obscured micro / nano-scale flow targets. If a micro / nano-scale flow target briefly disappears and then reappears, the second-level matching can re-capture it.

[0058] Further, step 5: Target trajectory maintenance is achieved using a dual-threshold cascaded multi-target tracking algorithm. This is achieved by prioritizing the first and second level matching of the dual thresholds, and then cascading them. This includes: matching detection boxes with a high matching confidence threshold (e.g., 0.6) with the Kalman filter predicted trajectory (Hungarian algorithm + IOU>0.6) and updating the tracked trajectory (Tracked state trajectory) to quickly match clear targets; within a preset buffer time (e.g., 300 frames (10s)), for unmatched trajectories (Lost state trajectories, such as slightly occluded micro / nano-scale flowing targets), a second matching is performed on detection boxes with a low recovery confidence threshold (e.g., 0.4). If a match is found, the trajectory of the micro / nano-scale flowing target within the corresponding detection box is restored (from Lost state to Tracked state). If no match is found after the preset buffer time, the trajectory of the micro / nano-scale flowing target within the corresponding detection box is deleted. That is, the trajectory states are divided into Tracked (normal drawing), Lost (retained during the buffer period), and Removed (deleted after timeout). This buffer period ensures that even if micro- and nano-sized flowing targets disappear briefly, their trajectories will not be immediately deleted, thereby significantly reducing the false detection rate of micro- and nano-sized flowing targets. The method in this application employs a two-level matching strategy with a high matching confidence threshold and a low recovery confidence threshold, combined with a trajectory buffering mechanism of up to 300 frames, significantly reducing the ID switching rate to 60%. It effectively addresses target occlusion, blurred scenes, or densely occluded scenes, and improves trajectory continuity, demonstrating good industrial applicability and promotion potential.

[0059] Optionally, the preset buffer time is no less than a few seconds corresponding to the video frame rate, so as to preserve the trajectory of the micro-nano-scale flowing target when it briefly disappears or is occluded and to support subsequent recovery.

[0060] Multi-target tracking algorithms, such as the BYTE tracking algorithm, typically have only a single threshold, such as 0.6. If a micro- or nano-sized flowing target (such as a microbubble) drops from 0.7 to 0.45 due to ambiguity, existing methods discard all microbubbles with a confidence level below 0.6, effectively abandoning the microbubble and interrupting the trajectory. Alternatively, if a micro- or nano-sized flowing target (such as a microbubble) reappears after being occluded for 3 seconds, existing methods lose the microbubble's ID, assign a new ID, and double the count.

[0061] This application employs a cascaded multi-target tracking algorithm with a buffer period based on dual-domain values ​​to maintain target trajectory. It can maintain a high threshold and prevent false tracking. During the buffer period, it uses a low recovery confidence threshold for matching, which can preserve the original microbubble trajectory. It can recover the trajectory of microbubbles that would be lost with traditional single-threshold tracking, maintain the continuity of the microbubble trajectory, and release the target when it becomes blurred without cutting it off. It ensures that the trajectory can be continued even if it disappears briefly, preventing loss. It can reduce the ID switching rate of micro-nano-scale flowing targets by 60%.

[0062] To ensure accurate counting, after step 5, the process includes setting a preset counting line (e.g., with a fixed image size, set at 68% of the image height, i.e., 522 pixels) or a counting region. When the centroid of the micro / nano-scale flowing target first crosses the preset counting line or fully enters the counting region, deduplication is triggered, and the timestamp, spatial location, and target radius information of the first crossing or entry of the micro / nano-scale flowing target are recorded to avoid duplicate counting. Specifically: Traditional counting methods count the number of targets in an image as there are targets. This application counts micro- and nano-scale moving targets, which are dynamic. If there are m targets in the previous frame and n targets in the next frame (m < n), some micro- and nano-scale moving targets in the next frame are the same as those in the previous frame. Therefore, this application does not use existing full-image counting methods, but instead uses a method of setting preset technical lines or counting regions. By counting and recording the unique identification information of micro- and nano-scale moving targets only when they first meet the spatial conditions, it ensures that the same moving micro- and nano-scale moving target is counted only once in consecutive frames, avoiding the problem of duplicate counting caused by the motion of micro- and nano-scale moving targets.

[0063] Step 6: Based on the maintenance results, the instantaneous velocity of each micro-nano scale flowing target is calculated using the inter-frame proximity matching algorithm.

[0064] The inter-frame proximity matching algorithm searches for the centroid with the smallest Euclidean distance among all micro-nano-scale flowing targets in the previous frame for each micro-nano-scale flowing target in the current frame. When the distance is less than a preset distance (e.g., 25 pixels), the pixel displacement (distance between centroids) is combined with the physical calibration coefficient (1 pixel = 13.02 μm) to calculate the physical displacement (synthesized velocity, which calculates the horizontal displacement Δx or vertical displacement Δy according to actual needs and outputs it). Then, combined with the frame rate (30fps), the instantaneous velocity v = |Δy| × 13.02 × 30 = |Δy| × 390.6 μm / s is obtained.

[0065] The method in this application employs an inter-frame proximity matching algorithm to find the nearest neighbor (Euclidean distance less than 25 pixels) in the previous frame for each micro-nano-scale flowing target (such as a microbubble) in the current frame. For example, in frame N: microbubble A is located at (100, 200), and in frame N+1: microbubble B is located at (100, 205). Microbubble B has a vertical displacement of Δy = 5 pixels from microbubble A, meaning it is only 5 pixels away. Therefore, microbubble A and microbubble B are determined to be the same microbubble. Existing technologies assign an ID to each micro-nano-scale flowing target and calculate its velocity by continuously tracking the ID of each target. However, once a micro-nano-scale flowing target is occluded, the target is lost. The method in this application embodiment does not rely on the ID of each micro-nano-level flowing target. It only looks at the relative position of micro-nano-level flowing targets in adjacent frames and directly calculates the sequential velocity of each micro-nano-level flowing target using two frames of images. Position matching ensures data continuity, and pure spatial relationship avoids the risk of ID binding. Even if the micro-nano-level flowing target is occluded in the middle, the velocity can still be calculated as long as the position is close. It seamlessly connects velocity recording, improves velocity measurement coverage, simplifies calculation, and has low memory usage.

[0066] The ID-free inter-frame proximity velocity measurement algorithm abandons the strong dependence on tracking IDs and instead performs nearest neighbor matching based on the spatial Euclidean distance (threshold < 25 pixels) between the centroids of bubbles in the current frame and the previous frame. Combined with the physical calibration coefficient (1 pixel = 13.02 μm) and the frame rate (30fps), it calculates the instantaneous vertical velocity in real time, ensuring that velocity data can still be output stably even if the ID is interrupted.

[0067] Furthermore, the equivalent radius is determined by the selection box ( Figures 2-4 The equivalent area calculated from the width and height of the red box (in the middle) is converted and then combined with the physical calibration coefficient (1 pixel = 13.02 μm) to convert it into a micro / nano-scale radius. The equivalent radius r of the micro / nano-scale flowing target is... 13.02 (μm), where, h is the width of the selection box, and h is the height of the selection box.

[0068] The velocity measurement method for micro-nano-scale flowing targets provided in this application first generates an initial image by reading video frame by frame to ensure the integrity of the data foundation. Then, an adaptive overlapping slicing technique with a preset overlap rate is used to divide each frame of the initial image into multiple slices to be detected, significantly magnifying the local details of the micro-nano-scale flowing targets. This overcomes the difficulty in model recognition caused by the small target size during direct full-image detection, thereby greatly improving the detection rate of micro-nano-scale flowing targets. Next, by treating the slices to be detected as independent detection boxes and performing small target detection in parallel, this method achieves efficient parallel processing and optimizes detection efficiency. Then, a cross-slice fusion deduplication operation eliminates duplicate detection boxes, ensuring target uniqueness and laying an accurate data foundation for subsequent tracking. Based on this, a multi-target tracking algorithm with dual threshold cascades is used for trajectory maintenance. This method effectively handles situations where the target briefly disappears or is occluded, enhancing the robustness and continuity of tracking. Finally, an inter-frame proximity matching algorithm is used to calculate the instantaneous velocity, ensuring the real-time performance and accuracy of the velocity measurement. Overall, the method in this application embodiment significantly improves the accuracy of micro- and nano-scale flowing target detection, the stability of tracking, and the reliability of velocity calculation through the above-described synergistic steps.

[0069] Furthermore, step 6 also includes: writing the instantaneous velocity into a dual buffer pool, with a short window (0.5 seconds / 15 frames) used for high-frequency fluctuation analysis and a long window (5 seconds / 150 frames) used for macroscopic trend verification. This significantly improves the robustness and reliability of velocity measurement. The short window captures the instantaneous velocity fluctuations of micro- and nano-scale targets (such as microbubble acceleration changes caused by turbulent disturbances), while the long window verifies the macroscopic trend of velocity (such as continuous increase or periodic oscillation) through statistical analysis. The two working together can identify abnormal velocity values ​​caused by imaging noise or transient occlusion, avoiding misjudgments at a single time scale and providing multi-granularity data support for fluid dynamics analysis. Furthermore, the centroid position (c x c y Stored in the FIFO buffer pool (capacity 30 frames).

[0070] Step 7: Overlay a visual selection box over the target with the tracking status "Tracked" (e.g., ...). Figures 2-4 (Select the video in the red box) Generate the output video (maintaining the original resolution and frame rate) (e.g.) Figure 6 (This is a screenshot from a video). The output is a structured result of the micro-nano-scale flow targets. The structured result includes the total number and average radius of the micro-nano-scale flow targets (Count_Radius.csv) (e.g., ...). Figure 7 As shown), the individual's first traverse record (Detail_Radius.csv) (as shown) Figure 8 As shown), the equivalent radius and 0.5-second particle size velocity sequence of each micro / nano-scale flowing target (Speed_Detail.csv) Figure 9) and 5-second granular speed summary (Speed_Summary.csv) Figure 10 There is a total of 1 visualization video and 5 CSV files.

[0071] This application's embodiments are particularly applicable to target scenes that occupy a very small proportion of the initial image. Addressing the problems of low recall, easily interrupted tracking, and data loss due to reliance on ID continuity in velocity measurement in existing technologies for small target detection, this application's embodiment improves the effective perception capability of small targets, enhances trajectory robustness by combining a multi-level matching strategy, and introduces an inter-frame position association mechanism based on spatial proximity. It achieves stable velocity calculation without relying on target ID continuity, providing a high-precision visual tracking and ID-independent velocity measurement method. This method significantly improves the detection integrity, tracking continuity, and velocity measurement reliability of small targets in complex flow scenarios. Its effectiveness has been verified in practical applications such as microbubble flow velocity monitoring, demonstrating good engineering application value. It can be used for online monitoring and data inversion in microfluidics, interface processes, and oil and gas development-related experiments. It is a "detection-tracking-velocity measurement" end-to-end method that can simultaneously achieve high recall detection, strong robust tracking, high integrity perception, high continuity tracking, and high reliability velocity inversion and sustainable velocity measurement for micro- and nano-scale flow targets under complex experimental imaging conditions. It can solve the three core problems of existing computer vision systems in complex scenarios such as low proportion of small targets, fast movement, and easy occlusion: (1) small target omission caused by full-image reasoning; (2) ID switching or trajectory breakage caused by single threshold tracking strategy when the target is blurred or briefly occluded; (3) traditional speed measurement methods rely heavily on the continuity of tracking ID. Once the ID is lost, the speed cannot be calculated, resulting in serious data loss.

[0072] like Figures 2-5 This is a practical detection example provided in the embodiments of this application. Left (a) is the original image, and right (b) is the tracking result. Comparison. Figure 2 and Figure 3 It can be seen that the method of this application embodiment is applicable to micro-nano-scale flow targets of different sizes ( Figure 2 There are relatively large micro- and nano-sized flowing targets. Figure 3 All of these targets (small-sized micro / nano-scale flowing targets) can be detected and tracked stably. Because the method in this application employs an improved YOLO network including a high-resolution feature layer P2, the method is optimized for detecting micro / nano-scale flowing targets and artifacts. Figure 4 and Figure 5 As can be seen, the method in this application embodiment can accurately identify micro- and nano-scale flowing targets and eliminate artifacts, exhibiting excellent noise resistance. Furthermore, by Figures 2-4As can be seen, all micro- and nano-scale flow targets are selected by the red selection box, and there is no extra blank space around them. Each red selection box selects one micro- and nano-scale flow target, thus enabling the accurate measurement of the equivalent radius of the micro- and nano-scale flow targets (the equivalent radius is calculated from the length and width of the selection box).

[0073] Another embodiment of the present invention provides a velocity measurement device for micro / nano-scale flowing targets, comprising: The reading module is used to read video frames by frame containing micro- and nano-scale flowing targets and generate multiple initial images.

[0074] The slicing module is used to adaptively overlap and slice each initial frame of the image with a preset overlap rate through a sliding window to obtain the slice to be detected.

[0075] The detection module treats each frame's slice to be detected as a detection box and performs small target detection in parallel, obtaining a set of detection results containing micro- and nano-scale flowing target detection box information. Small target detection employs an improved YOLO network with a high-resolution feature layer P2. The module also incorporates a non-destructive sampling module, a feature enhancement module, and a lightweight attention module.

[0076] The deduplication module is used to perform cross-slice fusion deduplication on the detection result group to obtain the deduplication result.

[0077] The deduplication module includes: a mapping submodule, used to map the detection boxes of each slice to be detected back to the original image coordinate system; a collection submodule, used to collect the converted bounding boxes of all slices to be detected into a global list; and an execution submodule, used to perform a non-maximum suppression algorithm on the global list.

[0078] The execution submodule includes an iteration unit for iterating through the steps until the list is cleared. The iteration steps include: sorting the detection boxes in the global list in descending order of confidence; traversing the sorted global list and selecting the detection box with the highest confidence as the reference box; and deleting all other detection boxes whose intersection-union ratio with the reference box is greater than a preset threshold.

[0079] The maintenance module is used to maintain the trajectory of micro- and nano-scale flowing targets based on the deduplication results and using a multi-target tracking algorithm with dual thresholds.

[0080] The maintenance module includes: a primary matching submodule, which prioritizes matching detection boxes with a high matching confidence threshold and updates the tracked trajectory; and a secondary matching submodule, which performs secondary matching on unmatched trajectories with detection boxes with a low recovery confidence threshold within a preset buffer time. If a match is found, the trajectory of the micro-nano-scale flowing target within the corresponding detection box is restored. If no match is found within the preset buffer time, the trajectory of the micro-nano-scale flowing target within the corresponding detection box is deleted.

[0081] The calculation module is used to calculate the instantaneous velocity of each micro-nano-scale flowing target based on the maintenance results using an inter-frame proximity matching algorithm. The calculation module also writes the instantaneous velocity into a dual buffer pool: a short-term window for high-frequency fluctuation analysis and a long-term window for macroscopic trend verification.

[0082] The counting module is used to set a preset counting line or counting area. When the centroid of a micro-nano-scale flowing target crosses the preset counting line for the first time or fully enters the counting area for the first time, it triggers deduplication counting and records the timestamp, spatial position, and target radius information of the first crossing or entry of the micro-nano-scale flowing target.

[0083] The output module is used to overlay a visual selection box on the tracked target to generate an output video. The output outputs the structured results of micro-nano-scale flowing targets. The structured results include the total number and average radius of micro-nano-scale flowing targets, the first crossing record of an individual, the equivalent radius of each micro-nano-scale flowing target, a 0.5-second particle size velocity sequence, and a 5-second particle size velocity summary.

[0084] Another embodiment of the present invention provides a server, including: a memory and a processor.

[0085] The memory is used to store program instructions.

[0086] The processor is used to execute program instructions in the server, causing the server to perform the aforementioned velocity measurement method for micro- and nano-scale flowing targets.

[0087] In another embodiment of the present invention, a computer-readable storage medium is provided, which stores executable instructions, and when a computer executes the executable instructions, it can realize the velocity measurement method of micro-nano-scale flowing targets as described above.

[0088] The aforementioned storage media include, but are not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), Cache, Hard Disk Drive (HDD), or Memory Card. Memory can be used to store computer program instructions.

[0089] While this application provides method operation steps as shown in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in this embodiment is merely one possible execution order among many and does not represent the only execution order. In actual device or client product execution, the method can be executed sequentially according to this embodiment or the accompanying drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment).

[0090] The apparatus or module described in the above embodiments can be implemented by a computer chip or physical entity, or by a product with a certain function. For ease of description, the above apparatus is described by dividing it into various modules according to their functions. In implementing this application, the functions of each module can be implemented in one or more software and / or hardware. Of course, a module that implements a certain function can also be implemented by combining multiple sub-modules or sub-units.

[0091] The methods, apparatus, or modules in this application can be implemented in a computer-readable program code manner. The controller can be implemented in any suitable manner, such as a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of a memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code manner, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included within it for implementing various functions can also be considered as structures within the hardware component. Alternatively, the device used to implement various functions can be viewed as either a software module that implements the method or a structure within a hardware component.

[0092] Some modules in the apparatus of this application can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0093] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary hardware. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, or it can be embodied in the process of data migration. The computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to execute the methods of various embodiments or some parts of the embodiments of this application.

[0094] The various embodiments described in this specification are presented in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. All or part of this application can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, mobile communication terminals, multiprocessor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.

[0095] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of this application.

Claims

1. A method for measuring the velocity of micro / nano-scale flowing targets, characterized in that, include: Step 1: Read the video containing micro- and nano-scale flowing targets frame by frame to generate multiple initial images; Step 2: For each frame of the initial image, perform adaptive overlapping slicing using a sliding window with a preset overlap rate to obtain the slice to be detected; Step 3: Perform small target detection in parallel on each frame of the slice to be detected as a detection box to obtain a detection result group containing the detection box information of the micro-nano-scale flowing target; Step 4: Perform cross-slice fusion deduplication on the detection result group to obtain the deduplication result; Step 5: Based on the deduplication results, use a dual-threshold cascaded multi-target tracking algorithm to maintain the trajectory of the micro-nano-scale flow target and obtain the maintenance results; Step 6: Based on the maintenance results, the instantaneous velocity of each of the micro-nano-scale flowing targets is calculated using the inter-frame proximity matching algorithm.

2. The velocity measurement method for micro / nano-scale flowing targets according to claim 1, characterized in that, Step 6 further includes: writing the instantaneous velocity into a dual buffer pool, with a short window for high-frequency fluctuation analysis and a long window for macro trend verification.

3. The velocity measurement method for micro / nano-scale flowing targets according to claim 1 or 2, characterized in that, Also includes: Step 7: Overlay a visualization selection box onto the tracked targets to generate an output video. Output the structured results of the micro-nano-scale flowing targets. The structured results include the total number and average radius of the micro-nano-scale flowing targets, the first crossing record of each individual, the equivalent radius of each micro-nano-scale flowing target, the 0.5-second particle size velocity sequence, and the 5-second particle size velocity summary.

4. The velocity measurement method for micro / nano-scale flowing targets according to claim 1, characterized in that, In step 3, the small target detection uses an improved YOLO network that includes a high-resolution feature layer P2.

5. The velocity measurement method for micro / nano-scale flowing targets according to claim 1 or 4, characterized in that, In step 3, the small target detection introduces a non-destructive sampling module, a feature enhancement module, and a lightweight attention module.

6. The velocity measurement method for micro / nano-scale flowing targets according to claim 1, characterized in that, Step 4, which involves cross-slice fusion and deduplication of the detection result group, includes: Step 41: Map the detection boxes of each of the slices to be detected back to the original image coordinate system; Step 42: Combine the converted bounding boxes of all the slices to be detected into a global list; Step 43: Perform a nonmaximum suppression algorithm on the global list.

7. The velocity measurement method for micro / nano-scale flowing targets according to claim 6, characterized in that, Step 43 includes: iterative traversal until the list is empty, wherein the traversal step includes: Step 431: Sort the detection boxes in the global list in descending order of confidence; Step 432: Traverse the sorted global list and select the detection box with the highest confidence as the reference box; Step 433: Delete all remaining detection boxes whose intersection-union ratio with the baseline box is greater than a preset threshold.

8. The velocity measurement method for micro / nano-scale flowing targets according to claim 1, characterized in that, In step 5, the target trajectory maintenance using the dual-threshold cascaded multi-target tracking algorithm includes: Detection boxes with a high matching confidence threshold or greater than or equal to the threshold are matched first and the tracked trajectory is updated. Within a preset buffer time, for unmatched trajectories, a second matching is performed on detection boxes that are greater than or equal to the low recovery confidence threshold. If a match is found, the trajectory of the micro-nano-scale flowing target within the corresponding detection box is recovered. If no match is found after the preset buffer time, the trajectory of the micro-nano-scale flowing target within the corresponding detection box is deleted.

9. The velocity measurement method for micro / nano-scale flowing targets according to claim 1 or 8, characterized in that, After step 5, the following also includes: A preset counting line or counting region is set. When the centroid of the micro-nano-scale flowing target crosses the preset counting line for the first time or fully enters the counting region for the first time, deduplication counting is triggered and the timestamp, spatial position, and target radius information of the first crossing or entry of the micro-nano-scale flowing target are recorded.

10. A velocity measuring device for micro / nano-scale flowing targets, characterized in that, include: The reading module is used to read video frames by frames containing micro- and nano-scale flowing targets and generate multiple initial images. The slicing module is used to adaptively overlap slice each frame of the initial image with a preset overlap rate through a sliding window to obtain the slice to be detected. The detection module is used to perform small target detection in parallel by treating each frame of the slice to be detected as a detection box, and to obtain a detection result group containing the detection box information of the micro-nano-scale flowing target. The deduplication module is used to perform cross-slice fusion deduplication on the detection result group to obtain the deduplication result; The maintenance module is used to maintain the trajectory of the micro-nano-scale flow target using a dual-threshold cascaded multi-target tracking algorithm based on the deduplication result, and obtain the maintenance result. The calculation module is used to calculate the instantaneous velocity of each of the micro-nano-scale flowing targets based on the maintenance results using an inter-frame proximity matching algorithm.