Motion observation method, system and device based on creeping track of target organism

Through multi-level cascade matching and ReID algorithms, combined with IOU and HOG feature cosine similarity, the problem of real-time observation and identity connection of target organisms is solved, effective scale conversion is provided, and precise motion information recording of target organisms is achieved, improving the Positioning accuracy and recording effect.

CN118762401AActive Publication Date: 2024-10-11ZHEJIANG TUOPUYUN AGRI SCI & TECH CO LTD

Patent Information

Application Number
CN202411239411.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-10-11
Estimated Expiration
2044-09-05

AI Technical Summary

Technical Problem

Existing technology cannot realize real-time tracking and observation and real-time trajectory recording of target organisms, and there is a lack of unified solutions to deal with problems that arise during crawling observation of various types of target organisms.

Method used

A multi-level cascade matching method is used to match the target detection frame and the target tracking frame, combined with IOU, HOG feature cosine similarity and Euclidean distance, to achieve real-time observation of slow and fast moving target organisms, and perform identity succession through the ReID algorithm ; At the same time, it provides a measurement method for the crawling scale of the target creature, converting pixel speed and distance into actual speed and distance.

Benefits of technology

It realizes real-time observation and effective identity connection of multiple types of target organisms, accurately records crawling trajectory, speed, time and other movement information, and improves the positioning accuracy and recording of movement conditions of target organisms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118762401A_ABST
    Figure CN118762401A_ABST
Patent Text Reader

Abstract

The invention discloses a motion observation method, system and device based on a creeping track of a target organism. The method comprises the following steps: acquiring a creeping training video of the target organism; a tracker and a life cycle variable are distributed for each target, and multi-target tracking of continuous frames is carried out; performing cascade matching on the screened target detection frame and the target tracking frame of the current frame; calculating the pixel crawling speed of the matched tracking sequence; and acquiring a proportional scale according to the target pixel crawling distance and the physical distance of the target in the real world, and further calculating the actual crawling distance and the actual crawling speed of the target organism. According to the invention, a multi-layer cascade matching method is adopted to match a detection frame and a target tracking frame, so that real-time observation of crawling of multiple types of target organisms such as slow moving target organisms, fast moving target organisms, moth type target organisms with jumping crawling and the like is realized; and movement information such as a crawling track, a crawling speed, crawling time, a crawling distance and staying time is accurately recorded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of big data processing, and in particular relates to a motion observation method, system and device based on the crawling trajectory of a target organism. Background Art

[0002] At present, there are endless scientific studies on target organisms, such as observing the feeding preferences, phototaxis, mating behavior, etc. of target reptiles. By analyzing the behavior of target organisms, we can effectively record their corresponding movement patterns and habits, effectively guide pests and beneficial insects, and have a vital impact on the management and prevention of crop diseases and pests. The traditional method of observing the crawling of target organisms is generally by naked eye observation, but naked eye observation takes a long time and the observation effect of the observation equipment on the market is poor, it is impossible to achieve multi-target observation, and the trajectory of the target organism is easy to be disconnected.

[0003] With the in-depth use of artificial intelligence technology in the agricultural field, it has been possible to detect designated target organisms through deep learning technology to achieve effective positioning of target organisms, and to improve the generalization detection ability of multiple target organisms by expanding the data set. However, in the field of target organism observation, there is still no effective method to track and observe target organisms in real time and record real-time trajectory, crawling speed, crawling distance and other movement parameters. There is also no unified and effective solution to the problems that arise during the crawling observation of various types of target organisms. Summary of the invention

[0004] In view of the deficiencies in the prior art, the present invention discloses a motion observation method, system and device based on the crawling trajectory of a target organism.

[0005] The motion observation method based on the crawling trajectory of the target organism comprises the following steps: Acquire a crawling video of a target organism, perform target detection on a video frame to obtain a target area, and screen out falsely detected targets in the target area to obtain a target detection frame, wherein the target detection frame includes at least one detection frame; Assign a target marker to the target detection frame, and perform multi-target tracking on the target detection frame to generate a target tracking frame; Cascade matching is performed on the target detection frame and the target tracking frame to obtain a matched tracking sequence; The center point displacement of the target tracking frame is obtained through the matched tracking sequence, and then the pixel crawling distance is obtained; The pixel crawling time is obtained by intercepting the time difference of the center point of the tracking frame, and the target pixel crawling speed is obtained according to the pixel crawling distance and pixel crawling time; The pixel crawling distance and the real physical distance are calculated to obtain a scale, and the pixel crawling distance and the pixel crawling speed are calculated according to the scale to obtain the actual crawling distance and the actual crawling speed of the target organism.

[0006] As an implementation method, the target detection frame and the target tracking frame are cascade matched to obtain a matched tracking sequence, and the cascade matching includes at least three stages of cascade matching, which includes the following steps: The first stage of cascade matching: perform IOU matching between the target detection frame and the target tracking frame, calculate the IOU value between each target detection frame and each target tracking frame, and perform the first Hungarian matching between the target detection frame and the target tracking frame whose IOU value is greater than the first preset threshold; Second-stage cascade matching: For the target detection frame and target tracking frame whose IOU value of the first-stage cascade matching frame is less than the first preset threshold, the HOG feature cosine similarity of the target detection frame and the target tracking frame is calculated, and the second Hungarian matching is performed in combination with the Euclidean distance similarity; The third stage is cascade matching: the target detection box and the target tracking box are matched based on ReID.

[0007] As an implementable method, the first stage cascade matching includes the following steps: Calculate the IOU value of each target detection frame and each target tracking frame respectively, and perform IOU matching between the target detection frame and the target tracking frame; For a target detection frame and a target tracking frame whose IOU value is greater than a first preset threshold, the best match between the target detection frame and the target tracking frame between adjacent frames is obtained by using the Hungarian matching algorithm; The calculation formula of the IOU value is:

[0008] Among them, A represents the target detection box set, and B represents the target tracking box set.

[0009] As an implementable method, the second stage cascade matching includes the following steps: In the first stage, the target detection frame and the target tracking frame whose IOU value of the cascade matching frame is less than the first preset threshold are concatenated, and the HOG feature cosine similarity of the target detection frame and the target tracking frame is calculated; Calculate the Euclidean distance between the center point of the target detection frame and the center point of the target tracking frame; The second Hungarian matching result is obtained by weighted summing of Euclidean distance similarity and HOG feature cosine similarity; The Euclidean distance calculation formula between the center point of the target detection frame and the center point of the target tracking frame is:

[0010] in, Represents the Euclidean distance between the center point of the target detection frame and the center point of the target tracking frame, Represents the center point coordinates of the target detection box, Indicates the center point coordinates of the target tracking box; The calculation formula for the second Hungarian matching result is:

[0011] in, represents the Euclidean distance similarity, Represents the cosine similarity of HOG features, Represents the weighted sum of Euclidean distance similarity and HOG feature cosine similarity. represents the normalized weight factor of the similarity based on Euclidean distance, Represents the normalized weight factor based on the cosine similarity of HOG features.

[0012] As an implementable method, the third stage cascade matching includes the following steps: Acquire the newly detected target biological video frame, retain a number of frames as the feature query library of the ROI area, and acquire the video frame of the target biological corresponding to the target marker, wherein the newly detected target biological video frame has the same number of frames as the target biological video frame corresponding to the target marker; The pre-trained feature extraction network is trained using a metric learning loss function to obtain a trained feature extraction network; The trained feature extraction network performs ROI feature extraction on the newly detected target biological video frame and the target biological video frame corresponding to the target marker, and obtains the ROI feature extraction result of the newly detected target biological video frame and the ROI feature extraction result of the target biological video frame corresponding to the target marker; Calculate the cosine similarity of the newly detected target biological video frame ROI feature extraction result and the target biological video frame ROI feature extraction result corresponding to the target marker, and add the cosine similarities to obtain a total cosine similarity; When the total cosine similarity is greater than a second preset threshold, the newly detected target organism is determined to be a target organism that has appeared before, and a target marker is given to the newly detected target organism; otherwise, a new target marker is given to the newly detected target organism, thereby completing the ReID matching of the target organism and obtaining a matched tracking sequence; The cosine similarity calculation formula is:

[0013] in, Represents the ROI feature extraction result of the newly detected target biological video frame, Represents the ROI feature extraction result of the target biological video frame corresponding to the target marker; The total cosine similarity calculation formula is:

[0014] in, represents the total cosine similarity, Represents cosine similarity.

[0015] As an implementable method, the method of acquiring a target organism crawling training video and performing target detection on continuous video frames to obtain a target area includes the following steps: Obtain a crawling video of the target organism, capture video frames for target framing, and obtain a target calibration frame to form a calibration data set; The calibration data set is divided into a training set, a validation set, and a test set, and the target detection pre-training model is trained and validated to obtain the target detection model; The target detection model is used to perform target detection on continuous video frames to obtain the target area.

[0016] As an implementable method, the method of assigning a target marker to a target detection frame and performing multi-target tracking on the target detection frame to generate a target tracking frame includes the following steps: Assign target markers to the filtered target detection boxes and assign trackers to each target; The tracker tracks the target detection frame, matches the obtained detection target with the detection target appearing in the next frame, performs multi-target tracking on the target detection frame and adds life cycle rules in the tracking process to obtain the target tracking frame.

[0017] A motion observation system based on the crawling trajectory of a target organism includes a data acquisition module, a target detection frame allocation module, a cascade matching module, a pixel crawling distance acquisition module, a target pixel crawling data acquisition module, and an actual crawling data acquisition module. A data acquisition module is used to acquire a crawling video of a target organism, perform target detection on a video frame to obtain a target area, and perform false detection target screening on the target area to obtain a target detection frame, wherein the target detection frame includes at least one detection frame; A target detection frame assignment module is used to assign a target marker to a target detection frame and perform multi-target tracking on the target detection frame to generate a target tracking frame; The cascade matching module is used to perform cascade matching between the target detection frame and the target tracking frame to obtain a matched tracking sequence; A pixel crawling distance acquisition module is used to obtain the center point displacement of the target tracking frame through the matched tracking sequence, and then obtain the pixel crawling distance; The target pixel crawling data acquisition module is used to obtain the pixel crawling time by intercepting the time difference of the center point of the tracking frame, and obtain the target pixel crawling speed according to the pixel crawling distance and the pixel crawling time; The actual crawling data acquisition module is used to calculate according to the pixel crawling distance and the real physical distance to obtain a scale. The pixel crawling distance and the pixel crawling speed are calculated according to the scale to obtain the actual crawling distance and the actual crawling speed of the target organism.

[0018] As an implementation method, the target detection frame and the target tracking frame are cascade matched to obtain a matched tracking sequence, and the cascade matching includes at least three stages of cascade matching, which includes the following steps: The first stage of cascade matching: perform IOU matching between the target detection frame and the target tracking frame, calculate the IOU value between each target detection frame and each target tracking frame, and perform the first Hungarian matching between the target detection frame and the target tracking frame whose IOU value is greater than the first preset threshold; Second-stage cascade matching: For the target detection frame and target tracking frame whose IOU value of the first-stage cascade matching frame is less than the first preset threshold, the HOG feature cosine similarity of the target detection frame and the target tracking frame is calculated, and the second Hungarian matching is performed in combination with the Euclidean distance similarity; The third stage is cascade matching: the target detection box and the target tracking box are matched based on ReID.

[0019] As an implementable method, the method of assigning a target marker to a target detection frame and performing multi-target tracking on the target detection frame to generate a target tracking frame includes the following steps: Assign target markers to the filtered target detection boxes and assign trackers to each target; The tracker tracks the target detection frame, matches the obtained detection target with the detection target appearing in the next frame, performs multi-target tracking on the target detection frame and adds life cycle rules in the tracking process to obtain the target tracking frame.

[0020] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following method is implemented: Acquire a crawling video of a target organism, perform target detection on a video frame to obtain a target area, and screen out falsely detected targets in the target area to obtain a target detection frame, wherein the target detection frame includes at least one detection frame; Assign a target marker to the target detection frame, and perform multi-target tracking on the target detection frame to generate a target tracking frame; Cascade matching is performed on the target detection frame and the target tracking frame to obtain a matched tracking sequence; The center point displacement of the target tracking frame is obtained through the matched tracking sequence, and then the pixel crawling distance is obtained; The pixel crawling time is obtained by intercepting the time difference of the center point of the tracking frame, and the target pixel crawling speed is obtained according to the pixel crawling distance and pixel crawling time; The pixel crawling distance and the real physical distance are calculated to obtain a scale, and the pixel crawling distance and the pixel crawling speed are calculated according to the scale to obtain the actual crawling distance and the actual crawling speed of the target organism.

[0021] A motion observation device based on the crawling trajectory of a target organism comprises a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the following method is implemented: Acquire a crawling video of a target organism, perform target detection on a video frame to obtain a target area, and screen out falsely detected targets in the target area to obtain a target detection frame, wherein the target detection frame includes at least one detection frame; Assign a target marker to the target detection frame, and perform multi-target tracking on the target detection frame to generate a target tracking frame; Cascade matching is performed on the target detection frame and the target tracking frame to obtain a matched tracking sequence; The center point displacement of the target tracking frame is obtained through the matched tracking sequence, and then the pixel crawling distance is obtained; The pixel crawling time is obtained by intercepting the time difference of the center point of the tracking frame, and the target pixel crawling speed is obtained according to the pixel crawling distance and pixel crawling time; The pixel crawling distance and the real physical distance are calculated to obtain a scale, and the pixel crawling distance and the pixel crawling speed are calculated according to the scale to obtain the actual crawling distance and the actual crawling speed of the target organism.

[0022] The present invention has significant technical effects due to the adoption of the above technical solution: 1. The present invention adopts a multi-layer cascade matching method to match the detection frame and the target tracking frame: the IOU matching, HOG feature cosine similarity, and Euclidean distance of the target detection frame and the target tracking frame realize the real-time observation of the crawling of various types of target organisms, such as slow-moving target organisms, fast-moving target organisms, moth target organisms with jumping crawling, and target organisms with displacement mutations; the ReID algorithm is introduced into the target organism crawling observation, so that when the target organism reappears after leaving the video screen, it can still perform effective identity continuation, thereby more effectively recording the movement of the target organism; 2. The present invention also provides a method for measuring the crawling scale of the target organism, and provides an effective scale conversion method, which effectively converts information such as the pixel speed and pixel distance of the target organism crawling in the video screen into the actual crawling physical speed and physical distance, so as to more effectively obtain the actual movement of the target organism; 3. The motion observation method of the crawling trajectory of the target organism described in the present invention is a target detection method based on deep learning, which has a high target organism positioning accuracy and can accurately record motion information such as crawling trajectory, crawling speed, crawling time, crawling distance, and dwell time. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0024] Figure 1 It is a schematic diagram of the flow of the motion observation method based on the crawling trajectory of the target organism according to the present invention; Figure 2 It is an overall schematic diagram of the motion observation system based on the crawling trajectory of the target organism described in the present invention. DETAILED DESCRIPTION

[0025] The present invention will be further described below in conjunction with the accompanying drawings and embodiments. The following embodiments are explanations of the present invention and the present invention is not limited to the following embodiments.

[0026] Embodiment 1: A motion observation method based on the crawling trajectory of the target organism, such as Figure 1 As shown, the following steps are included: S100, obtaining a crawling video of a target organism, performing target detection on a video frame to obtain a target area, and filtering out falsely detected targets in the target area to obtain a target detection frame, wherein the target detection frame includes at least one detection frame; S200, assigning a target marker to the target detection frame, and performing multi-target tracking on the target detection frame to generate a target tracking frame; S300, performing cascade matching on the target detection frame and the target tracking frame to obtain a matched tracking sequence; S400, obtaining the center point displacement of the target tracking frame through the matched tracking sequence, and then obtaining the pixel crawling distance; S500, obtaining pixel crawling time by intercepting the time difference of the center point of the tracking frame, and obtaining the target pixel crawling speed according to the pixel crawling distance and the pixel crawling time; S600, calculating according to the pixel crawling distance and the real physical distance to obtain a scale, and calculating the pixel crawling distance and the pixel crawling speed according to the scale to obtain the actual crawling distance and the actual crawling speed of the target organism.

[0027] The present invention adopts a multi-layer cascade matching method to match the detection frame and the target tracking frame: the IOU matching, HOG feature cosine similarity, and Euclidean distance of the target detection frame and the target tracking frame realize the real-time observation of the crawling of various types of target organisms such as slow-moving target organisms, fast-moving target organisms, moth target organisms with jumping crawling, and target organisms with displacement mutations; the ReID algorithm is introduced into the target organism crawling observation, so that when the target organism reappears after leaving the video screen, it can still perform effective identity continuation, thereby more effectively recording the movement of the target organism; the present invention also provides a measurement method for the crawling scale of the target organism, and provides an effective scale conversion method, which effectively converts the pixel speed, pixel distance and other information of the target organism crawling in the video screen into the actual crawling physical speed and physical distance, so that the actual movement of the target organism can be more effectively obtained; the motion observation method of the crawling trajectory of the target organism described in the present invention is a target detection method based on deep learning, which has a high positioning accuracy of the target organism and can accurately record the crawling trajectory, crawling speed, crawling time, crawling distance, residence time and other motion information.

[0028] In this embodiment, step S100 acquires a crawling video of a target organism, performs target detection on a video frame to obtain a target area, and performs false detection target screening on the target area to obtain a target detection frame, which specifically includes the following steps: S110: Obtain a crawling video of the target organism as a training set, capture pictures every N frames and save them locally, use a calibration tool labelImg to frame the captured pictures to obtain a target organism calibration frame dataset of the video frame; S120: dividing the target biological calibration frame data set into a training data set, a verification data set, and a test data set, wherein the ratio of the training data set, the verification data set, and the test data set is 8:1:1; S130: train the target pre-detection model yolov8 with the training data set to obtain a target detection model, and perform target detection; S140: Perform image processing on the data set after target detection to filter out false detection frames with pure color background, and obtain a filtered target detection frame.

[0029] Step S200 assigns a target marker to the target detection frame, and performs multi-target tracking on the target detection frame to generate a target tracking frame, which specifically includes the following steps: S210: Assign a target marker to the target detection frame, and assign a tracker and a life cycle variable to each target marker.

[0030] S220: Perform multi-target tracking of consecutive frames on the target detection frame to generate a target tracking frame, and construct a total tracking information module, wherein the total tracking information module includes a target biological tracking information module and a target biological tracking information maintenance module, and life cycle variable parameters are added in this process.

[0031] Step S300 performs cascade matching on the target detection frame and the target tracking frame to obtain a matched tracking sequence. In this embodiment, the cascade matching includes three-stage cascade matching, which specifically includes the following steps: S310: First stage cascade matching: perform IOU matching on the target detection frame and the target tracking frame, calculate the IOU value between each target detection frame and each target tracking frame, and perform the first Hungarian matching on the target detection frame and the target tracking frame whose IOU value is greater than the first preset threshold.

[0032] The first stage cascade matching includes the following steps: Calculate the IOU value of each target detection frame and each target tracking frame respectively, and perform IOU matching between the target detection frame and the target tracking frame; For a target detection frame and a target tracking frame whose IOU value is greater than a first preset threshold, the best match between the target detection frame and the target tracking frame between adjacent frames is obtained by using the Hungarian matching algorithm; The calculation formula of the IOU value is:

[0033] Among them, A represents the target detection box set, and B represents the target tracking box set.

[0034] S320: Second stage cascade matching: For the target detection frame and the target tracking frame whose IOU value of the first stage cascade matching frame is less than the first preset threshold, the HOG feature cosine similarity of the target detection frame and the target tracking frame is calculated, and the second Hungarian matching is performed in combination with the Euclidean distance similarity.

[0035] The second stage cascade matching includes the following steps: In the first stage, the target detection frame and the target tracking frame whose IOU value of the cascade matching frame is less than the first preset threshold are concatenated, and the HOG feature cosine similarity of the target detection frame and the target tracking frame is calculated; Calculate the Euclidean distance between the center point of the target detection frame and the center point of the target tracking frame; The second Hungarian matching result is obtained by weighted summing of the Euclidean distance similarity and the HOG feature cosine similarity.

[0036] The Euclidean distance calculation formula between the center point of the target detection frame and the center point of the target tracking frame is:

[0037] in, Represents the Euclidean distance between the center point of the target detection frame and the center point of the target tracking frame, Represents the center point coordinates of the target detection box, Indicates the center coordinates of the target tracking box.

[0038] The calculation formula for the second Hungarian matching result is:

[0039] in, represents the Euclidean distance similarity, Represents the cosine similarity of HOG features, Represents the weighted sum of Euclidean distance similarity and HOG feature cosine similarity. represents the normalized weight factor of the similarity based on Euclidean distance, Represents the normalized weight factor based on the cosine similarity of HOG features.

[0040] S330: The third stage cascade matching: the target detection box and the target tracking box are matched based on ReID.

[0041] The third stage cascade matching includes the following steps: Acquire the newly detected target biological video frame, retain a number of frames as the feature query library of the ROI area, and acquire the video frame of the target biological corresponding to the target marker, wherein the newly detected target biological video frame has the same number of frames as the target biological video frame corresponding to the target marker; The pre-trained feature extraction network is trained using a metric learning loss function to obtain a trained feature extraction network; The trained feature extraction network performs ROI feature extraction on the newly detected target biological video frame and the target biological video frame corresponding to the target marker, and obtains the ROI feature extraction result of the newly detected target biological video frame and the ROI feature extraction result of the target biological video frame corresponding to the target marker; Calculate the cosine similarity of the newly detected target biological video frame ROI feature extraction result and the target biological video frame ROI feature extraction result corresponding to the target marker, and add the cosine similarities to obtain a total cosine similarity; When the total cosine similarity is greater than the second preset threshold, the newly detected target organism is determined to be a target organism that has appeared before, and a target marker is given to the newly detected target organism. Otherwise, a new target marker is given to the newly detected target organism, thereby completing the ReID matching of the target organism and obtaining the matched tracking sequence.

[0042] The cosine similarity calculation formula is:

[0043] in, Represents the ROI feature extraction result of the newly detected target biological video frame, Represents the ROI feature extraction result of the target biological video frame corresponding to the target marker; The total cosine similarity calculation formula is:

[0044] in, represents the total cosine similarity, Represents cosine similarity.

[0045] In step S400, the center point displacement of the target tracking frame is obtained through the matched tracking sequence, and then the pixel crawling distance is obtained.

[0046] In S500, the pixel crawling time is obtained by intercepting the time difference of the center point of the tracking frame, and the target pixel crawling speed is obtained according to the pixel crawling distance and the pixel crawling time; In S500, a scale is obtained based on the pixel crawling distance and the real physical distance, and the pixel crawling distance and the pixel crawling speed are calculated based on the scale to obtain the actual crawling distance and the actual crawling speed of the target organism.

[0047] Compared with the traditional naked-eye target organism observation method, the main improvements are: effectively recording the real trajectory of the target organism crawling with high accuracy. For the target organism crawling in various situations (slow movement, fast movement, jump movement, displacement mutation, re-identification of target organisms), it has good trajectory recording results. In addition, this embodiment also provides effective speed, distance, crawling time and other indicators. By converting the scale, the movement of the target organism in the picture is effectively converted into the observation index of actual movement, which is more helpful for relevant scientific researchers to study the movement, habits, preferences, etc. of the target organism.

[0048] Embodiment 2: A motion observation system based on the crawling trajectory of target organisms, such as Figure 2As shown, it includes: a data acquisition module 100, a target detection frame allocation module 200, a cascade matching module 300, a pixel crawling distance acquisition module 400, a target pixel crawling data acquisition module 500, and an actual crawling data acquisition module 600. The data acquisition module 100 is used to acquire a crawling video of a target organism, perform target detection on a video frame to obtain a target area, and perform false detection target screening on the target area to obtain a target detection frame, wherein the target detection frame includes at least one detection frame; The target detection frame assignment module 200 is used to assign a target marker to the target detection frame and perform multi-target tracking on the target detection frame to generate a target tracking frame; A cascade matching module 300 is used to perform cascade matching on the target detection frame and the target tracking frame to obtain a matched tracking sequence; The pixel crawling distance acquisition module 400 is used to obtain the center point displacement of the target tracking frame through the matched tracking sequence, and then obtain the pixel crawling distance; The target pixel crawling data acquisition module 500 is used to obtain the pixel crawling time by intercepting the time difference of the center point of the tracking frame, and obtain the target pixel crawling speed according to the pixel crawling distance and the pixel crawling time; The actual crawling data acquisition module 600 is used to calculate based on the pixel crawling distance and the real physical distance to obtain a scale. The pixel crawling distance and the pixel crawling speed are calculated based on the scale to obtain the actual crawling distance and actual crawling speed of the target organism.

[0049] The present invention is divided into two parts, a training part and a test part. The development operating system of the training part can be Linux-Ubuntu-20.04, the CPU model is Inter Core i7-8700, the memory size is 64 GB, two NV markers IAGeForce RTX 4090 are used as GPUs to support model training, the graphics card driver version is 515.57, the cuda version is 11.7, the tensorrt version is 8.5.1.7, the main development languages ​​are C++ and Python, and the opencv version 4.6 is used when configuring the convolutional network. Of course, other operating systems developed in this way can also be realized.

[0050] Various changes and modifications can be made without departing from the spirit and scope of the present invention, and all equivalent technical solutions also belong to the scope of the present invention.

[0051] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0052] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0053] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0054] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0055] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0056] It should be noted that: The "one embodiment" or "embodiment" mentioned in the specification means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "one embodiment" or "embodiment" appearing in various places throughout the specification do not necessarily refer to the same embodiment.

[0057] In addition, it should be noted that the shapes and names of the parts of the specific embodiments described in this specification may be different. Any equivalent or simple changes made based on the structure, features and principles described in the patent concept of the present invention are included in the protection scope of the patent of the present invention. The technicians in the technical field of the present invention can make various modifications or supplements to the specific embodiments described or replace them in a similar manner, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A motion observation method based on the crawling trajectory of a target organism, characterized in that: The following steps are involved: Acquire a crawling video of a target organism, perform target detection on a video frame to obtain a target area, and screen out falsely detected targets in the target area to obtain a target detection frame, wherein the target detection frame includes at least one detection frame; Assign a target marker to the target detection frame, and perform multi-target tracking on the target detection frame to generate a target tracking frame; Cascade matching is performed on the target detection frame and the target tracking frame to obtain a matched tracking sequence; The center point displacement of the target tracking frame is obtained through the matched tracking sequence, and then the pixel crawling distance is obtained; The pixel crawling time is obtained by intercepting the time difference of the center point of the tracking frame, and the target pixel crawling speed is obtained according to the pixel crawling distance and pixel crawling time; The pixel crawling distance and the real physical distance are calculated to obtain a scale, and the pixel crawling distance and the pixel crawling speed are calculated according to the scale to obtain the actual crawling distance and the actual crawling speed of the target organism.

2. The motion observation method based on the crawling trajectory of the target organism according to claim 1 is characterized in that: The target detection frame and the target tracking frame are cascade matched to obtain a matched tracking sequence, wherein the cascade matching includes at least three stages of cascade matching, and the following steps are included: The first stage of cascade matching: perform IOU matching between the target detection frame and the target tracking frame, calculate the IOU value between each target detection frame and each target tracking frame, and perform the first Hungarian matching between the target detection frame and the target tracking frame whose IOU value is greater than the first preset threshold; Second-stage cascade matching: For the target detection frame and target tracking frame whose IOU value of the first-stage cascade matching frame is less than the first preset threshold, the HOG feature cosine similarity of the target detection frame and the target tracking frame is calculated, and the second Hungarian matching is performed in combination with the Euclidean distance similarity; The third stage is cascade matching: the target detection box and the target tracking box are matched based on ReID.

3. The motion observation method based on the crawling trajectory of the target organism according to claim 2 is characterized in that: The first stage cascade matching includes the following steps: Calculate the IOU value of each target detection frame and each target tracking frame respectively, and perform IOU matching between the target detection frame and the target tracking frame; For a target detection frame and a target tracking frame whose IOU value is greater than a first preset threshold, the best match between the target detection frame and the target tracking frame between adjacent frames is obtained by using the Hungarian matching algorithm; The calculation formula of the IOU value is: Among them, A represents the target detection box set, and B represents the target tracking box set.

4. The motion observation method based on the crawling trajectory of the target organism according to claim 2 is characterized in that: The second stage cascade matching includes the following steps: In the first stage, the target detection frame and the target tracking frame whose IOU value of the cascade matching frame is less than the first preset threshold are concatenated, and the HOG feature cosine similarity of the target detection frame and the target tracking frame is calculated; Calculate the Euclidean distance between the center point of the target detection frame and the center point of the target tracking frame; The second Hungarian matching result is obtained by weighted summing of Euclidean distance similarity and HOG feature cosine similarity; The Euclidean distance calculation formula between the center point of the target detection frame and the center point of the target tracking frame is: in, Represents the Euclidean distance between the center point of the target detection frame and the center point of the target tracking frame, Represents the center point coordinates of the target detection box, Indicates the center point coordinates of the target tracking box; The calculation formula for the second Hungarian matching result is: in, represents the Euclidean distance similarity, Represents the cosine similarity of HOG features, Represents the weighted sum of Euclidean distance similarity and HOG feature cosine similarity. represents the normalized weight factor of the similarity based on Euclidean distance, Represents the normalized weight factor based on the cosine similarity of HOG features.

5. The motion observation method based on the crawling trajectory of the target organism according to claim 2 is characterized in that: The third stage cascade matching includes the following steps: Acquire the newly detected target biological video frame, retain a number of frames as the feature query library of the ROI area, and acquire the video frame of the target biological corresponding to the target marker, wherein the newly detected target biological video frame has the same number of frames as the target biological video frame corresponding to the target marker; The pre-trained feature extraction network is trained using a metric learning loss function to obtain a trained feature extraction network; The trained feature extraction network performs ROI feature extraction on the newly detected target biological video frame and the target biological video frame corresponding to the target marker, and obtains the ROI feature extraction result of the newly detected target biological video frame and the ROI feature extraction result of the target biological video frame corresponding to the target marker; Calculate the cosine similarity of the newly detected target biological video frame ROI feature extraction result and the target biological video frame ROI feature extraction result corresponding to the target marker, and add the cosine similarities to obtain a total cosine similarity; When the total cosine similarity is greater than a second preset threshold, the newly detected target organism is determined to be a target organism that has appeared before, and a target marker is given to the newly detected target organism; otherwise, a new target marker is given to the newly detected target organism, thereby completing the ReID matching of the target organism and obtaining a matched tracking sequence; The cosine similarity calculation formula is: in, Represents the ROI feature extraction result of the newly detected target biological video frame, Represents the ROI feature extraction result of the target biological video frame corresponding to the target marker; The total cosine similarity calculation formula is: in, represents the total cosine similarity, Represents cosine similarity.

6. The motion observation method based on the crawling trajectory of the target organism according to claim 1 is characterized in that: The method of obtaining a target organism crawling training video and performing target detection on continuous video frames to obtain a target area includes the following steps: Obtain a crawling video of the target organism, capture video frames for target framing, and obtain a target calibration frame to form a calibration data set; The calibration data set is divided into a training set, a validation set, and a test set, and the target detection pre-training model is trained and validated to obtain the target detection model; The target detection model is used to detect targets in continuous video frames to obtain the target area.

7. The motion observation method based on the crawling trajectory of the target organism according to claim 1 is characterized in that: The step of assigning a target marker to a target detection frame and performing multi-target tracking on the target detection frame to generate a target tracking frame includes the following steps: Assign target markers to the filtered target detection boxes and assign trackers to each target; The tracker tracks the target detection frame, matches the obtained detection target with the detection target appearing in the next frame, performs multi-target tracking on the target detection frame and adds life cycle rules in the tracking process to obtain the target tracking frame.

8. A motion observation system based on the crawling trajectory of a target organism, characterized in that: It includes data acquisition module, target detection frame allocation module, cascade matching module, pixel crawling distance acquisition module, target pixel crawling data acquisition module, and actual crawling data acquisition module. A data acquisition module is used to acquire a crawling video of a target organism, perform target detection on a video frame to obtain a target area, and perform false detection target screening on the target area to obtain a target detection frame, wherein the target detection frame includes at least one detection frame; The target detection frame assignment module is used to assign a target marker to the target detection frame and perform multi-target tracking on the target detection frame to generate a target tracking frame; The cascade matching module is used to perform cascade matching between the target detection frame and the target tracking frame to obtain a matched tracking sequence; A pixel crawling distance acquisition module is used to obtain the center point displacement of the target tracking frame through the matched tracking sequence, and then obtain the pixel crawling distance; The target pixel crawling data acquisition module is used to obtain the pixel crawling time by intercepting the time difference of the center point of the tracking frame, and obtain the target pixel crawling speed according to the pixel crawling distance and the pixel crawling time; The actual crawling data acquisition module is used to calculate according to the pixel crawling distance and the real physical distance to obtain a scale. The pixel crawling distance and the pixel crawling speed are calculated according to the scale to obtain the actual crawling distance and the actual crawling speed of the target organism.

9. The motion observation system based on the crawling trajectory of the target organism according to claim 8, characterized in that: The target detection frame and the target tracking frame are cascade matched to obtain a matched tracking sequence, wherein the cascade matching includes at least three stages of cascade matching, and the following steps are included: The first stage of cascade matching: perform IOU matching between the target detection frame and the target tracking frame, calculate the IOU value between each target detection frame and each target tracking frame, and perform the first Hungarian matching between the target detection frame and the target tracking frame whose IOU value is greater than the first preset threshold; Second-stage cascade matching: For the target detection frame and target tracking frame whose IOU value of the first-stage cascade matching frame is less than the first preset threshold, the HOG feature cosine similarity of the target detection frame and the target tracking frame is calculated, and the second Hungarian matching is performed in combination with the Euclidean distance similarity; The third stage is cascade matching: the target detection box and the target tracking box are matched based on ReID.

10. The motion observation system based on the crawling trajectory of the target organism according to claim 8, characterized in that: The step of assigning a target marker to a target detection frame and performing multi-target tracking on the target detection frame to generate a target tracking frame includes the following steps: Assign target markers to the filtered target detection boxes and assign trackers to each target; The tracker tracks the target detection frame, matches the obtained detection target with the detection target appearing in the next frame, performs multi-target tracking on the target detection frame and adds life cycle rules in the tracking process to obtain the target tracking frame.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

12. A motion observation device based on the crawling trajectory of a target organism, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Video tracking method and device of moving creatures

    CN108830881A

  • Multi-target tracking positioning and motion state estimation method based on unmanned aerial vehicle

    CN113269098A

  • Maneuvering multi-target tracking method based on combination of kernel adaptive filtering and YOLOX detection

    CN114972418A

  • Target speed detection method and device, equipment and storage medium

    CN115995053A

  • Traffic vehicle tracking method based on video frame skipping processing

    CN116109671A

Cited By

  • Data processing method and device supporting global situation awareness information presentation

    CN120123562A