A dynamic target detection method and device based on multi-frame feature aggregation
By introducing the relationship module into Faster RCNN, the global and local features in the video are aggregated, which solves the accuracy problem of dynamic target detection under occlusion, blur and illumination changes, and improves the detection accuracy and positioning accuracy.
Patent Information
- Application Number
- CN202110758306.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-05
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-07-05
AI Technical Summary
Existing dynamic target detection methods are susceptible to reduced accuracy caused by changes in occlusion, blur, and lighting conditions.
Add a relationship module after the fully connected layer of Faster RCNN, including a global relationship module and a local relationship module. Randomly select multiple frames from the video as global frames and local frames, and aggregate semantic features and location features through the global relationship module and local relationship module. Generate enhanced candidate region features and finally detect dynamic targets.
By utilizing the contextual information in the video, the accuracy of dynamic target detection and detection frame positioning are improved, achieving accurate detection of dynamic targets.
Smart Images

Figure CN113449662B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a dynamic target detection method and device based on multi-frame feature aggregation. Background Art
[0002] In the study of dynamic target detection, people try to apply static image target detection directly to each frame of the video. However, this method does not take advantage of the fact that video is a collection of spatial and temporal information, and is therefore susceptible to problems such as reduced accuracy caused by occlusion, blur, and changes in lighting conditions. Summary of the invention
[0003] The present invention provides a dynamic target detection method and device based on multi-frame feature aggregation, so as to solve the technical problem that the existing dynamic target detection method is easily affected by occlusion, blur and changes in lighting conditions, etc., which leads to reduced accuracy.
[0004] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0005] On the one hand, the present invention provides a dynamic target detection method based on multi-frame feature aggregation, comprising:
[0006] Add a relation module after the fully connected layer of Faster RCNN; wherein the relation module includes a global relation module and a local relation module;
[0007] Randomly select multiple frames from frames adjacent to key frames in the video as local frames; randomly select multiple frames from the video as global frames; wherein the key frames contain dynamic targets to be detected;
[0008] Aggregating the semantic features of the global frame to the local frame and the key frame through the global relationship module to obtain an enhanced local frame and a first enhanced key frame; aggregating the semantic features and position features of the enhanced local frame to the first enhanced key frame through the local relationship module to obtain a second enhanced key frame; aggregating the semantic features and position features of other candidate areas except the selected candidate area in the second enhanced key frame to the selected candidate area through the local relationship module to obtain a third enhanced key frame;
[0009] Based on the third enhanced key frame, a detection result of the current dynamic target is obtained.
[0010] Furthermore, aggregating the semantic features of the global frame into the local frame and the key frame includes:
[0011] The generalized cosine similarity is used to measure the semantic similarity between two candidate regions, so as to determine whether the two candidate regions belong to the same category. The expression is:
[0012]
[0013] Among them, φ(.) and ψ(.) represent transformation functions, represents the i-th candidate region in the k-th frame, represents the jth candidate region in the fth frame; express and The semantic similarity between them, T represents transposition;
[0014] Use the softmax function to normalize the similarity of all candidate regions, map the output value range of each output node to [0, 1], and constrain the sum of the output values of each output node to 1. The expression is:
[0015]
[0016] in, Indicates semantic similarity The normalized processing result of
[0017] Aggregate the semantic features of the global frame to the local frame and the key frame, and the expression is:
[0018]
[0019] in, Represents the i-th candidate region in the k-th frame The semantic feature aggregation result of , Ω is the frame index set randomly selected for aggregating the semantic features of the global frame, and N is the number of candidate regions in each frame.
[0020] Further, aggregating the semantic features and position features of the enhanced local frame into the first enhanced key frame includes:
[0021] Construct a relationship function to aggregate the semantic features and position features of the candidate region object set in B to the nth candidate region in the P frame, that is, the relationship feature f R(n) It is expressed as:
[0022]
[0023] in, represents the semantic features of the lth object in B, W v is the linear transformation matrix; ω ln is the relationship weight factor, indicating the influence from other objects, expressed as:
[0024]
[0025] in, and Respectively represent the position feature weight and semantic feature weight between the lth candidate box in B and the nth candidate box in P frame; Represents the sum of the position feature weight and semantic feature weight between the object set in B and the nth object in the P frame;
[0026] The local relationship module further enhances the semantic feature information and position feature information of each candidate region through r relationship feature modules, which is expressed as:
[0027]
[0028] in, represents the semantic features of the nth candidate region in the P frame, represents the relational feature obtained after the rth relational feature module, f ra (p n , B) represents the enhanced feature obtained by connecting r relationship features and original semantic features to the nth candidate region feature in the P frame;
[0029] Use f ra (P, B) represents the set of all enhanced candidate region features, that is, all candidate regions in P are enhanced by the features of the candidate regions in B;
[0030] Aggregate the semantic features and position features of the enhanced local frame into the first enhanced key frame, expressed as:
[0031] K L =f ra (K′, L′)
[0032] Among them, K′ and L′ represent the candidate regions of the first enhanced key frame and the candidate regions of the enhanced local frame respectively, and K L It represents the set of all candidate regions of the first enhanced key frame after local frame enhancement, that is, the set of all candidate regions of the second enhanced key frame.
[0033] Furthermore, the semantic features and position features of other candidate regions except the selected candidate region in the second enhanced key frame are aggregated into the selected candidate region, and the expression is:
[0034] K LK =f ra (K L , K L )
[0035] Among them, K LK It represents the set of all candidate regions of the second enhanced key frame after self-enhancement, that is, the set of all candidate regions of the third enhanced key frame.
[0036] Further, The expression is:
[0037]
[0038] Among them, W K and W Q They are all matrices, indicating that the original semantic features and Projected into the subspace to measure the matching degree, d k Represents the feature dimension.
[0039] Further, The expression is:
[0040]
[0041] Among them, W G is a matrix used to transform embedded features into scalar weights; ε G (.) represents a transformation function, which is used to map the geometric features of the two candidate boxes into a high-dimensional representation; dim(.) represents a transformation coordinate formula, which is used to map the position feature into a 4-dimensional relative geometric feature to ensure invariance; represents the position feature of the lth candidate box in B, Represents the position features of the nth candidate box in the P frame. Both position features use 4-dimensional geometric features.
[0042] Further, obtaining a detection result of the current dynamic target based on the third enhanced key frame includes:
[0043] The third enhanced key frame features are classified and regressed, and finally the detection result of the current dynamic target is obtained through non-maximum suppression.
[0044] On the other hand, the present invention also provides a dynamic target detection device based on multi-frame feature aggregation, the dynamic target detection device based on multi-frame feature aggregation comprises:
[0045] A dynamic target detection framework building module, used to add a relationship module after the fully connected layer of Faster RCNN; wherein the relationship module includes a global relationship module and a local relationship module;
[0046] The global frame and local frame acquisition module is used to randomly select multiple frames from frames adjacent to the key frame in the video as local frames; randomly select multiple frames from the video as global frames; wherein the key frame contains the dynamic target to be detected;
[0047] A multi-frame feature aggregation module, configured to aggregate the semantic features of the global frame to the local frame and the key frame through the global relationship module to obtain an enhanced local frame and a first enhanced key frame; aggregate the semantic features and position features of the enhanced local frame to the first enhanced key frame through the local relationship module to obtain a second enhanced key frame; aggregate the semantic features and position features of other candidate areas except the selected candidate area in the second enhanced key frame to the selected candidate area through the local relationship module to obtain a third enhanced key frame;
[0048] The target detection module is used to obtain the detection result of the current dynamic target based on the third enhanced key frame.
[0049] On the other hand, the present invention further provides an electronic device, comprising a processor and a memory; wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the above method.
[0050] In yet another aspect, the present invention further provides a computer-readable storage medium, wherein the storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to implement the above method.
[0051] The beneficial effects brought about by the technical solution provided by the present invention include at least:
[0052] The present invention introduces a relationship module into a target detection framework based on Faster RCNN, and proposes a dynamic target detection framework based on Faster RCNN. The global relationship module is used to aggregate global semantic features in a semantic neighborhood, and the local relationship module is used to simultaneously aggregate local semantic and position features in a temporal neighborhood. Thus, the context information in the video is effectively used for dynamic target detection, and the goal of enhancing the semantic features of the current frame and the precise positioning of the detection frame through the context information is achieved. The semantic information and position information of other frames in the video are used to improve the accuracy of key frame category detection and the accuracy of detection frame positioning. The technical solution of the present invention can achieve accurate detection of dynamic targets in videos. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.
[0054] Figure 1 A schematic diagram of the execution flow of a dynamic target detection method based on multi-frame feature aggregation provided by the first embodiment of the present invention;
[0055] Figure 2 A schematic diagram of the network structure of a dynamic target detection framework based on Faster RCNN provided in the second embodiment of the present invention;
[0056] Figure 3 A schematic diagram of the execution flow of a dynamic target detection method based on multi-frame feature aggregation provided by the second embodiment of the present invention;
[0057] Figure 4 A schematic diagram of a global relationship module construction process provided by the second embodiment of the present invention;
[0058] Figure 5 A schematic diagram of the local relationship module construction process provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0060] First embodiment
[0061] This embodiment provides a dynamic target detection method based on multi-frame feature aggregation, which can be implemented by an electronic device, which can be a terminal or a server. The execution process of the dynamic target detection method based on multi-frame feature aggregation is as follows: Figure 1 As shown, the following steps are included:
[0062] S1, adding a relation module after the fully connected layer of Faster RCNN; wherein the relation module includes a global relation module and a local relation module;
[0063] S2, randomly selecting multiple frames from frames adjacent to the key frame in the video as local frames; randomly selecting multiple frames from the video as global frames; wherein the key frame contains a dynamic target to be detected;
[0064] S3, aggregating the semantic features of the global frame to the local frame and the key frame through the global relationship module to obtain an enhanced local frame and a first enhanced key frame; aggregating the semantic features and position features of the enhanced local frame to the first enhanced key frame through the local relationship module to obtain a second enhanced key frame; aggregating the semantic features and position features of other candidate areas except the selected candidate area in the second enhanced key frame to the selected candidate area through the local relationship module to obtain a third enhanced key frame;
[0065] S4, obtaining a detection result of the current dynamic target based on the third enhanced key frame.
[0066] In summary, this embodiment introduces a relationship module into the target detection framework based on Faster RCNN, and proposes a dynamic target detection framework based on Faster RCNN. The global relationship module is used to aggregate global semantic features in a semantic neighborhood, and the local relationship module is used to simultaneously aggregate local semantic and position features in a temporal neighborhood. In this way, the context information in the video is effectively used for dynamic target detection, and the goal of enhancing the semantic features of the current frame and the precise positioning of the detection frame through the context information is achieved. The semantic information and position information of other frames in the video are used to improve the accuracy of key frame category detection and the accuracy of detection frame positioning. The technical solution of the present invention can achieve accurate detection of dynamic targets in videos.
[0067] Second embodiment
[0068] This embodiment provides a dynamic target detection method based on multi-frame feature aggregation, which proposes a Figure 2 The dynamic target detection framework based on Faster RCNN shown in the figure is improved based on Faster RCNN. The improvement method is as follows: a relationship module is introduced into Faster RCNN; wherein, the dynamic target detection framework based on Faster RCNN consists of a feature extraction network, an RPN network, ROI Pooling, and a classification and regression subnet, and the relationship module is embedded after the fully connected layer after ROI Pooling; wherein, the relationship module includes a global relationship module and a local relationship module, which are used to realize feature aggregation.
[0069] After constructing a dynamic target detection framework based on Faster RCNN, this embodiment randomly selects M frames from frames adjacent to the key frame as local frames; randomly selects F frames from the video as global frames, and aggregates the global semantic features of the F frames to local frames and key frames in the semantic neighborhood through the global relationship module; then aggregates the semantic and position features of the enhanced local frames to the key frames through the local relationship module; finally, the enhanced key frames are self-enhanced through the local relationship module, and the aggregated key frame features are classified and regressed, and finally the detection result of the current key frame is obtained through non-maximum suppression (NMS).
[0070] It should be noted that if the object is difficult to locate in the current frame, we can use similar objects in adjacent frames or frame differences to assist in positioning, which we call local positioning information. If it is difficult for us to determine the category of the object in this frame, we can find objects in any other frame that are highly similar to the current blurred object to assist in positioning. This type of information is defined as global semantic information.
[0071] Specifically, the framework includes N GA global relationship module is responsible for aggregating the semantic information of the global frame into local frames and key frames within the semantic neighborhood. Aggregating local frame features into key frames requires N L A local relation module is responsible for aggregating the semantic and position information of local frames into key frames in the temporal neighborhood. Key frame self-enhancement requires N K A local relation module is responsible for aggregating the semantic and position information of other candidate regions of the key frame into a candidate region of the key frame. The actual number can be adjusted according to experimental needs.
[0072] Based on the above, the execution process of the dynamic target detection method based on multi-frame feature aggregation of this embodiment is as follows: Figure 3 As shown, the following steps are included:
[0073] Step 101, aggregate global semantic information.
[0074] Specifically, the implementation process of aggregating global frame semantic information into local frames and key frames is as follows:
[0075] Assume that frame F is randomly selected as the global frame in the video, and the candidate regions generated by frame F after passing through ROI are combined to form a global pool G. Frame M is randomly selected as the local frame, and the candidate regions generated by frame M after passing through ROI are combined to form a local pool L. The candidate regions generated by the key frame after passing through ROI are combined to form a key pool K.
[0076] The candidate regions of the global pool are aggregated into local pools and key pools within the semantic neighborhood through the global relationship module, thereby enhancing the semantic features of key frames and local frames.
[0077] Among them, the construction process of the global relationship module is as follows Figure 4 As shown, the following steps are included:
[0078] Step 201, measuring semantic similarity.
[0079] It should be noted that the candidate area corresponding to the lth frame can be expressed as For a pair of candidate regions The generalized cosine similarity can be used to measure the semantic similarity between them, so as to determine whether two candidate regions belong to the same category. It can be expressed as.
[0080]
[0081] Among them, φ(.) and ψ(.) represent transformation functions. The higher the similarity, the greater the possibility that the candidate regions belong to the same category. represents the i-th candidate region in the k-th frame, represents the jth candidate region in the fth frame; express and The semantic similarity between them, T represents transposition;
[0082] Step 202: Similarity normalization processing.
[0083] It should be noted that in order to maintain the size of the feature after aggregation, we use the softmax function to normalize the similarity of all candidate regions, map the output value range of each output node to [0, 1], and constrain the output value of each output node to be 1, expressed as,
[0084]
[0085] in, Indicates semantic similarity The normalized processing result of
[0086] Step 203: Global semantic feature aggregation.
[0087] Specifically, N candidate regions are generated in each frame, and the i-th candidate region in the k-th frame The aggregate feature is defined as:
[0088]
[0089] Where Ω is a randomly selected frame index set for aggregating global semantic information. k can be expanded to the index of local frames and key frames, that is, assuming that frame k is a key frame, then k∈(k-τ, k+τ). When only the above information is considered, k∈(k-τ, k).
[0090] Step 102, aggregate local semantics and location information.
[0091] Specifically, the above steps are to aggregate the enhanced local frame semantics and position information into the key frame. The candidate area of the local pool aggregates the semantic information and position information into the key pool through the local relationship module, thereby enhancing the key frame semantic features and positioning information.
[0092] Step 103, self-enhance key frame semantics and position information.
[0093] Specifically, for a candidate region in the key pool, the semantic and position information of other candidate regions are aggregated into this candidate region through the local relationship module, thereby enhancing the key frame semantic features and positioning information.
[0094] Among them, the construction process of the local relationship module is as follows Figure 5 As shown, the following steps are included:
[0095] Step 301, construct a relational function.
[0096] It should be noted that, assuming Represent the semantic information and position information of the nth candidate region respectively, then the semantic features and position features of the candidate region object set in B are aggregated to the nth candidate region in P, that is, the relationship feature f R(n) It can be expressed as,
[0097]
[0098] in, represents the semantic features of the lth object in B, W v is the linear transformation matrix.
[0099] Relationship weight factor ω ln Represents the influence from other objects and can be expressed as,
[0100]
[0101] in, Know Respectively represent the position feature weight and semantic feature weight between the lth candidate box in B and the nth candidate box in P frame; Represents the sum of the position feature weight and semantic feature weight between the object set in B and the nth object in the P frame;
[0102] The local relation module can further enhance the semantic and position feature information of each candidate region through r relation feature modules, which can be expressed as:
[0103]
[0104] in, represents the semantic features of the nth candidate region in the P frame, represents the relational feature obtained after the rth relational feature module, f ra (p n , B) represents the enhanced feature obtained by connecting r relationship features and original semantic features to the nth candidate region feature in the P frame;
[0105] Use f ra (P, B) represents the set of all enhanced candidate region features, that is, all candidate regions in P are enhanced by the features of the candidate regions in B.
[0106] Specifically, the features from the local pool are aggregated into the key pool, and the update function can be expressed as:
[0107] K L =f ra (K′, L′) (7)
[0108] Among them, K′ and L′ represent the candidate regions of the first enhanced key frame and the candidate regions of the enhanced local frame respectively, and K L represents the set of all candidate regions of the first enhanced key frame after local frame enhancement, that is, the set of all candidate regions of the second enhanced key frame. L It may undergo multiple enhancements, at which time the input K′ should be updated in a timely manner.
[0109] The key pool feature self-enhancement, the update function can be expressed as,
[0110] K LK =f ra (K L , K L ) (8)
[0111] Among them, K LK K represents the set of all candidate regions of the second enhanced key frame after self-enhancement, that is, the set of all candidate regions of the third enhanced key frame. LK It may undergo multiple enhancements, at which point input K L Should be updated in a timely manner.
[0112] Step 302: construct a semantic weight function.
[0113] Specifically, the semantic feature weight in formula (5) can be expressed as a dot product operation,
[0114]
[0115] Among them, W K and W Q They are all matrices, indicating that the original semantic features and Projected into the subspace to measure the matching degree, d k Represents the feature dimension.
[0116] Step 303: construct a position weight function.
[0117] Specifically, the position feature weight in formula (5) can be expressed as:
[0118]
[0119] Among them, W G Is a matrix that transforms the embedded features into scalar weights. G (.) represents a transformation function, which is used to map the geometric features of the two candidate boxes into a high-dimensional representation; represents the position feature of the lth candidate box in B, Represents the position features of the nth candidate box in the P frame. Both position features use 4-dimensional geometric features.
[0120] Before solving the position feature weight in formula (10), the position feature is first transformed. dim(.) represents a transformation coordinate formula, which maps the position feature into a 4-dimensional relative geometric feature to ensure invariance. Then, the relative geometric features of the two objects are embedded into a denoted as ε G In the high-dimensional representation of , dim(.) can be expressed as,
[0121]
[0122] The main purpose of coordinate transformation is to perform scale normalization to increase scale invariance and perform log operations to avoid training divergence caused by a large range of numerical changes.
[0123] In summary, this embodiment introduces a relationship module into the target detection framework based on Faster RCNN, and proposes a dynamic target detection framework based on Faster RCNN. The global relationship module is used to aggregate global semantic features in a semantic neighborhood, and the local relationship module is used to simultaneously aggregate local semantic and position features in a temporal neighborhood. In this way, the context information in the video is effectively used for dynamic target detection, and the goal of enhancing the semantic features of the current frame and the precise positioning of the detection frame through the context information is achieved. The semantic information and position information of other frames in the video are used to improve the accuracy of key frame category detection and the accuracy of detection frame positioning. The technical solution of the present invention can achieve accurate detection of dynamic targets in videos.
[0124] Third embodiment
[0125] This embodiment provides a dynamic target detection device based on multi-frame feature aggregation, and the dynamic target detection device based on multi-frame feature aggregation includes the following modules:
[0126] A dynamic target detection framework building module, used to add a relationship module after the fully connected layer of Faster RCNN; wherein the relationship module includes a global relationship module and a local relationship module;
[0127] The global frame and local frame acquisition module is used to randomly select multiple frames from frames adjacent to the key frame in the video as local frames; randomly select multiple frames from the video as global frames; wherein the key frame contains the dynamic target to be detected;
[0128] A multi-frame feature aggregation module, configured to aggregate the semantic features of the global frame to the local frame and the key frame through the global relationship module to obtain an enhanced local frame and a first enhanced key frame; aggregate the semantic features and position features of the enhanced local frame to the first enhanced key frame through the local relationship module to obtain a second enhanced key frame; aggregate the semantic features and position features of other candidate areas except the selected candidate area in the second enhanced key frame to the selected candidate area through the local relationship module to obtain a third enhanced key frame;
[0129] The target detection module is used to obtain the detection result of the current dynamic target based on the third enhanced key frame.
[0130] The dynamic target detection device based on multi-frame feature aggregation of this embodiment corresponds to the dynamic target detection method based on multi-frame feature aggregation of the above-mentioned first embodiment; wherein, the functions implemented by each functional module in the dynamic target detection device based on multi-frame feature aggregation of this embodiment correspond one-to-one to each process step in the dynamic target detection method based on multi-frame feature aggregation of the first embodiment; therefore, they will not be repeated here.
[0131] Fourth embodiment
[0132] This embodiment provides an electronic device, which includes a processor and a memory; wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method of the first embodiment.
[0133] The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) and one or more memories, wherein the memory stores at least one instruction, and the instruction is loaded by the processor to execute the above method.
[0134] Fifth embodiment
[0135] This embodiment provides a computer-readable storage medium, which stores at least one instruction, and the instruction is loaded and executed by a processor to implement the method of the first embodiment. The computer-readable storage medium may be a ROM, a random access memory, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc. The instructions stored therein may be loaded by a processor in a terminal to execute the method.
[0136] In addition, it should be noted that the present invention can be provided as a method, an apparatus or a computer program product. Therefore, the embodiments of the present invention can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0137] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of 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, 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.
[0138] 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 These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide for implementing the process in 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.
[0139] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0140] Finally, it should be noted that the above is a preferred embodiment of the present invention. It should be pointed out that although the preferred embodiment of the present invention has been described, for those skilled in the art, once the basic creative concept of the present invention is known, several improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention. Therefore, the attached claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the embodiments of the present invention.
Claims
1. A dynamic target detection method based on multi-frame feature aggregation, characterized in that: include: Add a relation module after the fully connected layer of Faster RCNN; wherein the relation module includes a global relation module and a local relation module; Randomly select multiple frames from frames adjacent to key frames in the video as local frames; randomly select multiple frames from the video as global frames; wherein the key frames contain dynamic targets to be detected; Aggregating the semantic features of the global frame to the local frame and the key frame through the global relationship module to obtain an enhanced local frame and a first enhanced key frame; aggregating the semantic features and position features of the enhanced local frame to the first enhanced key frame through the local relationship module to obtain a second enhanced key frame; aggregating the semantic features and position features of other candidate areas except the selected candidate area in the second enhanced key frame to the selected candidate area through the local relationship module to obtain a third enhanced key frame; Based on the third enhanced key frame, the detection result of the current dynamic target is obtained Aggregating the semantic features of the global frame into the local frame and the key frame, comprising: The generalized cosine similarity is used to measure the semantic similarity between two candidate regions, so as to determine whether the two candidate regions belong to the same category. The expression is: Among them, φ(.) and ψ(.) represent the transformation functions, represents the i-th candidate region in the k-th frame, represents the jth candidate region in the fth frame; express and The semantic similarity between them, T represents transposition; Use the softmax function to normalize the similarity of all candidate regions, map the output value range of each output node to [0,1], and constrain the sum of the output values of each output node to 1. The expression is: in, Indicates semantic similarity The normalized processing result of Aggregate the semantic features of the global frame to the local frame and the key frame, and the expression is: in, Represents the i-th candidate region in the k-th frame The semantic feature aggregation result of , Ω is the frame index set randomly selected for aggregating the semantic features of the global frame, and N is the number of candidate regions in each frame; Aggregating the semantic features and position features of the enhanced local frame into the first enhanced key frame includes: Construct a relationship function to aggregate the semantic features and position features of the candidate region object set in B to the nth candidate region in the P frame, that is, the relationship feature f R(n) It is expressed as: in, represents the semantic features of the lth object in B, W v is the linear transformation matrix; ω ln is the relationship weight factor, indicating the influence from other objects, expressed as: in, and Respectively represent the position feature weight and semantic feature weight between the lth candidate box in B and the nth candidate box in P frame; Represents the sum of the position feature weight and semantic feature weight between the object set in B and the nth object in the P frame; The local relationship module further enhances the semantic feature information and position feature information of each candidate region through r relationship feature modules, which is expressed as: in, represents the semantic features of the nth candidate region in the P frame, represents the relational feature obtained after the rth relational feature module, f ra (p n ,B) represents the enhanced feature obtained by connecting r relationship features and original semantic features of the nth candidate region feature in the P frame; Use f ra (P, B) represents the set of all enhanced candidate region features, that is, all candidate regions in P are enhanced by the features of the candidate regions in B; Aggregate the semantic features and position features of the enhanced local frame into the first enhanced key frame, expressed as: K L =f ra (K ′ ,L ′ ) Among them, K ′ ,L ′ They represent the first enhanced key frame candidate region and the enhanced local frame candidate region respectively, and K L represents the set of all candidate regions of the first enhanced key frame after local frame enhancement, that is, the set of all candidate regions of the second enhanced key frame; The semantic features and position features of other candidate regions except the selected candidate region in the second enhanced key frame are aggregated into the selected candidate region, and the expression is: K LK =f ra (K L ,K L ) Among them, K LK It represents the set of all candidate regions of the second enhanced key frame after self-enhancement, that is, the set of all candidate regions of the third enhanced key frame.
2. The dynamic target detection method based on multi-frame feature aggregation according to claim 1, characterized in that: The expression is: Among them, W K and W Q They are all matrices, indicating that the original semantic features and Projected into the subspace to measure the matching degree, d k Represents the feature dimension.
3. The dynamic target detection method based on multi-frame feature aggregation as claimed in claim 2, characterized in that: The expression is: Among them, W G is a matrix used to transform embedded features into scalar weights; ε G (.) represents a transformation function, which is used to map the geometric features of the two candidate boxes into a high-dimensional representation; dim(.) represents a transformation coordinate formula, which is used to map the position feature into a 4-dimensional relative geometric feature to ensure invariance; represents the position feature of the lth candidate box in B, Represents the position features of the nth candidate box in the P frame. Both position features use 4-dimensional geometric features.
4. The dynamic target detection method based on multi-frame feature aggregation according to claim 1, characterized in that: Based on the third enhanced key frame, a detection result of the current dynamic target is obtained, including: The third enhanced key frame features are classified and regressed, and finally the detection result of the current dynamic target is obtained through non-maximum suppression.
5. A dynamic target detection device based on multi-frame feature aggregation, characterized in that: include: A dynamic target detection framework building module, used to add a relationship module after the fully connected layer of Faster RCNN; wherein the relationship module includes a global relationship module and a local relationship module; The global frame and local frame acquisition module is used to randomly select multiple frames from frames adjacent to the key frame in the video as local frames; randomly select multiple frames from the video as global frames; wherein the key frame contains the dynamic target to be detected; A multi-frame feature aggregation module, configured to aggregate the semantic features of the global frame to the local frame and the key frame through the global relationship module to obtain an enhanced local frame and a first enhanced key frame; aggregate the semantic features and position features of the enhanced local frame to the first enhanced key frame through the local relationship module to obtain a second enhanced key frame; aggregate the semantic features and position features of other candidate areas except the selected candidate area in the second enhanced key frame to the selected candidate area through the local relationship module to obtain a third enhanced key frame; A target detection module, used to obtain a detection result of a current dynamic target based on the third enhanced key frame; Aggregating the semantic features of the global frame into the local frame and the key frame, comprising: The generalized cosine similarity is used to measure the semantic similarity between two candidate regions, so as to determine whether the two candidate regions belong to the same category. The expression is: Among them, φ(.) and ψ(.) represent transformation functions, represents the i-th candidate region in the k-th frame, represents the jth candidate region in the fth frame; express and The semantic similarity between them, T represents transposition; Use the softmax function to normalize the similarity of all candidate regions, map the output value range of each output node to [0,1], and constrain the sum of the output values of each output node to 1. The expression is: in, Indicates semantic similarity The normalized processing result of Aggregate the semantic features of the global frame to the local frame and the key frame, and the expression is: in, Represents the i-th candidate region in the k-th frame The semantic feature aggregation result of , Ω is the frame index set randomly selected for aggregating the semantic features of the global frame, and N is the number of candidate regions in each frame; Aggregating the semantic features and position features of the enhanced local frame into the first enhanced key frame includes: Construct a relationship function to aggregate the semantic features and position features of the candidate region object set in B to the nth candidate region in the P frame, that is, the relationship feature f R(n) It is expressed as: in, represents the semantic features of the lth object in B, W v is the linear transformation matrix; ω ln is the relationship weight factor, indicating the influence from other objects, expressed as: in, and Respectively represent the position feature weight and semantic feature weight between the lth candidate box in B and the nth candidate box in P frame; Represents the sum of the position feature weight and semantic feature weight between the object set in B and the nth object in the P frame; The local relationship module further enhances the semantic feature information and position feature information of each candidate region through r relationship feature modules, which is expressed as: in, represents the semantic features of the nth candidate region in the P frame, represents the relational feature obtained after the rth relational feature module, f ra (p n ,B) represents the enhanced feature obtained by connecting r relationship features and original semantic features of the nth candidate region feature in the P frame; Use f ra (P, B) represents the set of all enhanced candidate region features, that is, all candidate regions in P are enhanced by the features of the candidate regions in B; Aggregate the semantic features and position features of the enhanced local frame into the first enhanced key frame, expressed as: K L =f ra (K ′ ,L ′ ) Among them, K ′ ,L ′ They represent the first enhanced key frame candidate region and the enhanced local frame candidate region respectively, and K L represents the set of all candidate regions of the first enhanced key frame after local frame enhancement, that is, the set of all candidate regions of the second enhanced key frame; The semantic features and position features of other candidate regions except the selected candidate region in the second enhanced key frame are aggregated into the selected candidate region, and the expression is: K LK =f ra (K L ,K L ) Among them, K LK It represents the set of all candidate regions of the second enhanced key frame after self-enhancement, that is, the set of all candidate regions of the third enhanced key frame.
