Micro-motion recognition method and device based on wavelet transform hybrid enhanced contrast learning

Through the wavelet transform hybrid enhanced contrast learning method, the InfoNCE loss function and the multi-head self-attention mechanism are used to solve the problems of small sample size and feature differences in micro-action recognition, and significantly improve the accuracy of micro-action recognition.

CN118506456BActive Publication Date: 2024-10-01UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410938994.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-10-01
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

Micro-action recognition technology faces the problems of small sample size, few annotations, and low category discrimination. Existing methods fail to effectively utilize the short-term or high-frequency characteristics of micro-actions, and the contrastive learning framework is not specifically designed for micro-actions, ignoring its relationship with micro-actions. Differences in conventional gestures.

Method used

A hybrid enhanced contrast learning method based on wavelet transform is used to generate skeleton sequences through random enhancement technology, and the InfoNCE loss function is used for global and local contrast learning. It is combined with a multi-head self-attention mechanism to learn rich features and improve micro-action recognition performance.

Benefits of technology

By combining global and local contrastive learning, the model can learn richer features, significantly improve the performance of micro-action recognition, and achieve more accurate recognition of micro-action fragments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118506456B_ABST
    Figure CN118506456B_ABST
Patent Text Reader

Abstract

The present invention discloses a micro-motion recognition method and device based on wavelet transform hybrid enhanced contrast learning, the method comprising: obtaining an original micro-motion sample video, generating a skeleton sequence and an original skeleton sample according to the original micro-motion sample video; enhancing the original skeleton sample into two different skeleton sequences using a random enhancement technique, and performing global contrast learning using a first InfoNCE loss function; decomposing the skeleton sequence into high-frequency components and low-frequency components using a discrete wavelet transform; generating new difficult samples from the high-frequency components and the low-frequency components through wavelet reconstruction, and performing local contrast learning using a second InfoNCE loss function; and obtaining an overall contrast loss function by weighted summation of the loss function to achieve the expansion of difficult sample pairs, so that the model can learn richer features. Combining global contrast learning with local contrast learning strategies can enable the model to take into account local microscopic features while learning global macroscopic features, thereby greatly improving the performance of micro-motion recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of machine learning, and more specifically to a method and device for micro-motion recognition based on wavelet transform hybrid enhanced contrast learning. Background Art

[0002] Human body movements are one of the important forms of expressing emotions, and to some extent, they are as important as facial expressions and language. Most existing research programs on emotion recognition technology focus on expressive and macro-level body movements, such as waving, bowing, or nodding. These body movements are usually performed intentionally and consciously to communicate with others, and do not reflect the individual's inner emotions. In contrast, micro-movements are subtle and spontaneous body movements that hide human emotional states, such as scratching the head, touching the nose, or rubbing the hands. The main difference between micro-movements and regular body gestures is that micro-movements do not have a clear communication or interaction purpose, but are spontaneous body reactions triggered by external stimuli. These reactions are difficult to control and can therefore convey hidden emotional information more reliably than regular body movements or facial expressions, especially when people intentionally conceal or regulate their emotions in social scenarios. Micro-movements are very different from regular gestures and are more difficult to analyze due to their low intensity, high variability, and complex background. Therefore, micro-movement recognition is a novel and important task for understanding human hidden emotions.

[0003] Currently, micro-motion recognition faces problems such as small sample size, few annotations, and low category discrimination. Contrastive learning, as a self-supervised learning, can effectively alleviate the above problems. Contrastive learning combined with skeleton data has been widely used in the field of human motion recognition. However, there are few unsupervised works on micro-motion recognition, although its data modality is the same as that of human motion recognition and faces similar annotation difficulties and small data volume. Only a few works have designed contrastive learning frameworks for skeleton-based micro-motion recognition and conducted experiments on micro-motion datasets iMiGUE and SMG. Although these methods can achieve good results, they are not specifically designed for micro-motions, thus ignoring the differences between micro-motions and regular gestures. Most methods do not consider the special data characteristics of micro-motions, and the contrastive frameworks used only learn global features and high-level contextual information. Specifically, micro-motions are shorter in both time and space scales than regular gestures. Micro-motions usually occur only in local areas of the human body, such as a single hand, and their duration is shorter, usually less than 3 seconds. The average duration of a sample in the micro-motion dataset SMG is 1.8 seconds, while regular limb movements may last more than 10 seconds. This inspires us to guide the model to learn more representation information from the short-term or high-frequency features of micro-motions. Summary of the invention

[0004] In this embodiment, a micro-motion recognition method and device based on wavelet transform hybrid enhanced contrast learning are provided to solve the above problems.

[0005] In a first aspect, an embodiment of the present invention provides a micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning, the micro-motion recognition method comprising:

[0006] Obtaining an original micro-motion sample video, and generating a skeleton sequence and an original skeleton sample according to the original micro-motion sample video;

[0007] The original skeleton sample is enhanced into two different skeleton sequences by using a random enhancement technique, the two skeleton sequences are embedded and encoded by using two encoders, and global contrast learning is performed by using a first InfoNCE loss function;

[0008] The original skeleton sample is regarded as a one-dimensional time signal, and the skeleton sequence is decomposed into a high-frequency component and a low-frequency component by using discrete wavelet transform; the high-frequency component and the low-frequency component are reconstructed by wavelet to generate a new difficult sample, and the second InfoNCE loss function is used to perform local contrast learning;

[0009] The loss functions are weighted and summed to obtain an overall contrast loss function, self-supervised pre-training is performed, and the trained model is used to perform micro-motion recognition.

[0010] In an optional embodiment, obtaining an original micro-motion sample video, and generating a skeleton sequence and an original skeleton sample according to the original micro-motion sample video includes:

[0011] The OpenPose tool is used to extract skeletons frame by frame from the original micro-motion sample video to obtain a two-dimensional skeleton sequence including the face and upper body.

[0012] The skeleton sequence is uniformly downsampled to 90 frames in the time dimension, and the dimension is The original skeleton sample of micro-motion; among them, is the batch quantity, is the number of channels, is the length of the time series, is the number of skeleton nodes, The number of subjects.

[0013] In an optional embodiment, the encoder includes a first encoder and a second encoder, wherein the second encoder is used to encode one of the skeleton sequences to obtain key-value features, and the key-value features are embedded to form a storage queue.

[0014] In an optional embodiment, the original skeleton sample is enhanced into two different skeleton sequences by using a random enhancement technique, the two skeleton sequences are embedded and encoded by using two encoders, and the global contrast learning is performed by using a first InfoNCE loss function, including:

[0015] Encoding the two skeleton sequences by a first encoder and a second encoder to obtain features;

[0016] The acquired feature embedding is subjected to global average pooling and a fully connected layer to obtain a positive sample pair; and a negative sample pair is obtained from the storage queue;

[0017] The first InfoNCE loss function is used for global contrastive learning.

[0018] In an optional embodiment, the original skeleton sample is regarded as a one-dimensional time signal, and the skeleton sequence is decomposed into a high-frequency component and a low-frequency component by using discrete wavelet transform; the high-frequency component and the low-frequency component are reconstructed by wavelet to generate a new difficult sample, and the local contrast learning is performed by using the second InfoNCE loss function, including:

[0019] The number of channels, skeleton nodes, and subjects are combined, and the original skeleton samples are considered as one-dimensional time signals;

[0020] The skeleton sequence is decomposed into high-frequency components and low-frequency components by using discrete wavelet transform on the time channel;

[0021] Get the high-frequency and low-frequency components of different samples in the same training batch;

[0022] The high-frequency components and low-frequency components of different samples are reconstructed by wavelet to generate new difficult samples;

[0023] A multi-head self-attention mechanism is used to add masks to the feature embedding of difficult samples to construct contrastive learning sample pairs;

[0024] The second InfoNCE loss function is used for local contrastive learning.

[0025] In an optional embodiment, using a multi-head self-attention mechanism to add a mask to the feature embedding of the difficult sample to construct a contrastive learning sample pair includes:

[0026] Embed the output feature of the encoder to find its self-attention matrix and obtain the mask pair through calculation;

[0027] Decomposing the mask pair into salient features and non-salient features;

[0028] Input the features obtained by the encoder and obtain positive sample pairs by performing dot products with the mask pairs respectively;

[0029] By obtaining negative samples from the historical storage queue, the negative sample and the positive sample pair are used as comparative learning samples.

[0030] In an optional embodiment, the loss function is weighted and summed to obtain an overall contrast loss function, self-supervised pre-training is performed, and the trained model is used to perform micro-motion recognition:

[0031] Obtain weights through self-supervised pre-training;

[0032] Freeze some parameters and perform supervised fine-tuning;

[0033] Validate and test the fine-tuned model on the pre-collected dataset;

[0034] The tested model is used for micro-motion recognition tasks.

[0035] Compared with the prior art, the micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning of the present invention has the following beneficial effects:

[0036] The skeleton data of micro-motion segments is treated as a one-dimensional time signal, decomposed using discrete wavelet transform, and random weight gains are added to the high-frequency components. The high frequencies in the same batch are then combined with the low-frequency components of other samples in a random order to generate new unlabeled sample pairs. This enhancement strategy is applied to the micro-motion skeleton recognition contrast learning framework to expand difficult sample pairs, allowing the model to learn richer features. In addition, combining the strategies of global contrast learning and local contrast learning can also enable the model to learn global macro features while taking into account local micro features, thereby greatly improving the performance of micro-motion recognition.

[0037] In a second aspect, an embodiment of the present invention provides a micro-motion recognition device based on wavelet transform hybrid enhanced contrast learning, comprising:

[0038] A preprocessing module, used for acquiring an original micro-motion sample video, and generating a skeleton sequence and an original skeleton sample according to the original micro-motion sample video;

[0039] A global contrast learning module, used for enhancing the original skeleton sample into two different skeleton sequences by using a random enhancement technique, embedding the two skeleton sequences by using two encoders, and performing global contrast learning by using a first InfoNCE loss function;

[0040] A local contrast learning module is used to regard the original skeleton sample as a one-dimensional time signal, and use discrete wavelet transform to decompose the skeleton sequence into high-frequency components and low-frequency components; reconstruct the high-frequency components and the low-frequency components through wavelet to generate new difficult samples, and use the second InfoNCE loss function to perform local contrast learning;

[0041] The training recognition module is used to obtain an overall contrast loss function by weighted summing of the loss functions, perform self-supervised pre-training, and use the trained model to perform micro-motion recognition.

[0042] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a communication interface, a memory and a bus, wherein the processor, the communication interface and the memory communicate with each other through the bus, and the processor can call logic instructions in the memory to execute the steps of the method provided in the first aspect.

[0043] In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method provided in the first aspect.

[0044] Compared with the prior art, the beneficial effects of the micro-motion recognition device, electronic device and storage medium based on wavelet transform hybrid enhanced contrast learning of the present invention are the same as the micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning described in the first aspect, so they will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a flow chart of a micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning in an embodiment of the present invention;

[0046] Figure 2 It is a schematic diagram of a micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning in an embodiment;

[0047] Figure 3 It is a structural block diagram of a micro-motion recognition device based on wavelet transform hybrid enhanced contrast learning in an embodiment of the present invention;

[0048] Figure 4 1 is a structural block diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0050] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0051] In an embodiment of the present invention, a micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning is provided. Figure 1 Flow chart of the micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning of the present invention, as shown in FIG. Figure 1 As shown, the process includes the following steps:

[0052] S100, obtaining an original micro-motion sample video, and generating a skeleton sequence and an original skeleton sample according to the original micro-motion sample video ;

[0053] Combination Figure 2 As shown, it should be noted that the original micro-motion sample video includes multiple original micro-motion clips (such as V1 and V2);

[0054] Specifically, the original micro-motion sample video is obtained, and the skeleton sequence and the original skeleton sample are generated according to the original micro-motion sample video. include:

[0055] The OpenPose tool is used to extract skeletons frame by frame from the original micro-motion sample video to obtain a two-dimensional skeleton sequence including the face and upper body.

[0056] Furthermore, the skeleton sequence is uniformly downsampled to 90 frames in the time dimension, resulting in a dimension of Micro-motion original skeleton sample , is the batch quantity, is the number of channels, is the length of the time series, is the number of skeleton nodes, The number of subjects.

[0057] It should be further explained that, in the process of uniformly downsampling to 90 frames, the excess part and the missing part are truncated and padded with zeros respectively.

[0058] S200, using random enhancement technology to transform the original skeleton sample Enhanced to two different skeleton sequences (i.e. query skeleton data and key-value skeleton data ), using two encoders for two skeleton sequences ( and ) Embedded coding, using the first InfoNCE loss function for global contrastive learning;

[0059] Furthermore, the two encoders are respectively the first encoder and the second encoder , where the second encoder Used to encode one of the skeleton sequences, specifically, the skeleton sequence is key-value skeleton data , key-value features are obtained, and the key-value features are embedded to form a storage queue. Further, the first encoder To query the encoder, the second encoder For key-value encoders.

[0060] It should be noted that the query encoder By back-propagation, the parameters are updated, while the key-value encoder Use the momentum update mechanism to update its parameters. The parameter update method is as follows:

[0061]

[0062] in is the momentum coefficient (a hyperparameter);

[0063] Optionally, ST-GCN is used as the backbone of the encoder.

[0064] Specifically, the original skeleton sample is enhanced into two different skeleton sequences (i.e. and ), using two encoders to embed the two skeleton sequences, and using the first InfoNCE loss function for global contrast learning includes:

[0065] Through the first encoder and the second encoder For two backbone sequences ( and ) Encoding and obtaining features;

[0066] The acquired feature embedding is subjected to global average pooling and a fully connected layer to obtain positive sample pairs, which are expressed as and ; Combined with the above, negative sample pairs are obtained from the storage queue; illustratively, they are obtained from the storage queue constructed by key-value feature embedding in each batch, that is, the remaining samples in each batch can be regarded as sample embeddings Negative sample pairs.

[0067] The first InfoNCE loss function is used for global contrastive learning.

[0068] Specifically it is defined as:

[0069] ;

[0070] in, Represents the dot product, which is used to calculate the similarity between two feature embeddings; and Represent query and key-value embedding respectively. Represents negative samples obtained from the history storage queue. is a hyperparameter that controls the learning rate.

[0071] S300, the original skeleton sample Treated as a one-dimensional time signal, the skeleton sequence is decomposed into high-frequency components and low-frequency components using discrete wavelet transform. ; The high frequency components and low frequency components Generate new difficult samples through wavelet reconstruction and use the second InfoNCE loss function for local contrastive learning;

[0072] It should be noted that the second InfoNCE loss function of local contrastive learning is different from the first InfoNCE loss function of global learning.

[0073] Specifically, the original skeleton sample Treated as a one-dimensional time signal, the skeleton sequence is decomposed into high-frequency components and low-frequency components using discrete wavelet transform. ; The high frequency components and low frequency components Generate new difficult samples through wavelet reconstruction, and use the second InfoNCE loss function for local contrast learning including:

[0074] The number of channels C , Number of skeleton nodes V And the number of subjects M Merge, treating the original skeleton samples as one-dimensional time signals ;

[0075] The skeleton sequence is decomposed into high-frequency components using discrete wavelet transform on the time channel. and low frequency components ;

[0076] Optionally, using the Haar orthogonal basis, a one-dimensional convolution is used to implement a fast wavelet transform to obtain the low-frequency component With high frequency components The calculation is as follows:

[0077]

[0078] ;

[0079] in, , represents the convolution operation. It should be noted that the low-frequency component Pay more attention to the movement trend of the global contour, while the high-frequency components Pay more attention to the movement trend of local details, based on the characteristics of micro-movements, in the high-frequency components A random gain of 0 to 0.8 is added to construct difficult samples with more prominent high-frequency features.

[0080] Get the high-frequency components of different samples in the same training batch and low frequency components ;

[0081] The high frequency components of different samples With low frequency components Generate new difficult samples through wavelet reconstruction; it should be noted that wavelet transform is reversible, so the high-frequency components of different samples in the same training batch can be With low frequency components Recombining,generate new difficult samples through wavelet reconstruction.

[0082] A multi-head self-attention mechanism is used to add masks to the feature embedding of difficult samples to construct contrastive learning sample pairs;

[0083] Specifically, a multi-head self-attention mechanism is used to add masks to the feature embedding of difficult samples to construct contrastive learning sample pairs including:

[0084] Query Encoder The output feature embedding finds its self-attention matrix , the mask pair is obtained by calculation ( and );

[0085] In this embodiment, a pair of masks is obtained by the following formula ( and ):

[0086]

[0087] ,

[0088] in, is a hyperparameter used to adjust the tolerance for neutral features.

[0089] Decompose mask pairs into salient features and non-salient features;

[0090] Input the features obtained by the encoder and obtain positive sample pairs by performing dot products with the mask pairs;

[0091] Specifically, by querying the encoder Key-Value Encoders Get the features respectively ( and ), and the feature ( and ) are respectively matched with the mask pair ( and ) do the dot product and pass through a single layer of MLP to get the positive sample ( ),in, is a set of positive sample pairs, is a set of positive sample pairs.

[0092] More specifically,

[0093]

[0094]

[0095]

[0096]

[0097] in, Represents the length of the data sequence that needs to be pooled. For negative sample pairs, negative samples can be obtained from the historical storage queue. , the negative samples The positive sample pairs are used as comparative learning samples.

[0098] The second InfoNCE loss function is used for local contrastive learning.

[0099] In this embodiment, the second InfoNCE loss function includes two loss functions, which are specifically defined as:

[0100]

[0101]

[0102] In the formula, is a hyperparameter that controls the learning rate.

[0103] S400, performing weighted summation of the loss functions to obtain an overall contrast loss function, performing self-supervised pre-training, and using the trained model to perform micro-motion recognition.

[0104] In this embodiment, the overall loss function is calculated by weighted summation of three contrast loss functions:

[0105]

[0106] in, is the balance coefficient.

[0107] Specifically, the weighted sum of the loss functions is used to obtain the overall contrast loss function, and self-supervised pre-training is performed. The trained model is used for micro-motion recognition, including:

[0108] Obtain weights through self-supervised pre-training;

[0109] Freeze some parameters and perform supervised fine-tuning;

[0110] Validate and test the fine-tuned model on the pre-collected dataset;

[0111] The tested model is used for micro-motion recognition tasks.

[0112] For example, the spatiotemporal graph convolutional neural network ST-GCN is used as the backbone of the encoder, and the training sets of the public datasets iMiGUE and SMG are used as self-supervised pre-training samples for unlabeled pre-training. After the pre-training, the backbone network parameters are frozen, and only the training set data is used for labeled fine-tuning of the last fully connected layer of the model. The TOP-1 and TOP-5 recognition accuracies on the iMiGUE and SMG dataset test sets are counted. The recognition results are shown in Table 1:

[0113] Table 1

[0114]

[0115] It can be seen from Table 1 above that the recognition accuracy of the model after training is greatly increased, which greatly improves the recognition performance of micro-motions.

[0116] The skeleton data of micro-motion segments is treated as a one-dimensional time signal, decomposed using discrete wavelet transform, and random weight gains are added to the high-frequency components. The high frequencies in the same batch are then combined with the low-frequency components of other samples in a random order to generate new unlabeled sample pairs. This enhancement strategy is applied to the micro-motion skeleton recognition contrast learning framework to expand difficult sample pairs, allowing the model to learn richer features. In addition, combining the strategies of global contrast learning and local contrast learning can also enable the model to learn global macro features while taking into account local micro features, thereby greatly improving the performance of micro-motion recognition.

[0117] The embodiment of the present invention also provides a micro-motion recognition device based on wavelet transform hybrid enhanced contrast learning, which is used to implement the above method embodiment, and the description has been made no further. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware of predetermined functions. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0118] like Figure 3 As shown, Figure 3 : is a structural block diagram of a micro-motion recognition device based on wavelet transform hybrid enhanced contrast learning in the present invention, the device comprises:

[0119] A preprocessing module is used to obtain the original micro-motion sample video and generate a skeleton sequence and an original skeleton sample according to the original micro-motion sample video;

[0120] A global contrastive learning module is used to enhance the original skeleton sample into two different skeleton sequences using a random enhancement technique, embed the two skeleton sequences using two encoders, and perform global contrastive learning using a first InfoNCE loss function;

[0121] The local contrast learning module is used to regard the original skeleton sample as a one-dimensional time signal, and use discrete wavelet transform to decompose the skeleton sequence into high-frequency components and low-frequency components; the high-frequency components and low-frequency components are reconstructed by wavelet to generate new difficult samples, and the second InfoNCE loss function is used for local contrast learning;

[0122] The training recognition module is used to obtain the overall contrast loss function by weighted summation of the loss function, perform self-supervised pre-training, and use the trained model to perform micro-motion recognition.

[0123] The skeleton data of micro-motion segments is treated as a one-dimensional time signal, decomposed using discrete wavelet transform, and random weight gains are added to the high-frequency components. The high frequencies in the same batch are then combined with the low-frequency components of other samples in a random order to generate new unlabeled sample pairs. This enhancement strategy is applied to the micro-motion skeleton recognition contrast learning framework to expand difficult sample pairs, allowing the model to learn richer features. In addition, combining the strategies of global contrast learning and local contrast learning can also enable the model to learn global macro features while taking into account local micro features, thereby greatly improving the performance of micro-motion recognition.

[0124] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 4 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the following method:

[0125] Obtaining an original micro-motion sample video, and generating a skeleton sequence and an original skeleton sample according to the original micro-motion sample video;

[0126] The original skeleton sample is enhanced into two different skeleton sequences using random enhancement technology, two encoders are used to embed the two skeleton sequences, and the first InfoNCE loss function is used for global contrast learning;

[0127] The original skeleton sample is regarded as a one-dimensional time signal, and the skeleton sequence is decomposed into high-frequency components and low-frequency components by discrete wavelet transform. The high-frequency components and low-frequency components are reconstructed by wavelet to generate new difficult samples, and the second InfoNCE loss function is used for local contrast learning.

[0128] The weighted sum of the loss functions is used to obtain the overall contrast loss function, self-supervised pre-training is performed, and the trained model is used for micro-motion recognition.

[0129] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0130] The embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method provided by each of the above embodiments is implemented, for example, including: obtaining an original micro-motion sample video, generating a skeleton sequence and an original skeleton sample according to the original micro-motion sample video;

[0131] The original skeleton sample is enhanced into two different skeleton sequences using random enhancement technology, two encoders are used to embed the two skeleton sequences, and the first InfoNCE loss function is used for global contrast learning;

[0132] The original skeleton sample is regarded as a one-dimensional time signal, and the skeleton sequence is decomposed into high-frequency components and low-frequency components by discrete wavelet transform. The high-frequency components and low-frequency components are reconstructed by wavelet to generate new difficult samples, and the second InfoNCE loss function is used for local contrast learning.

[0133] The weighted sum of the loss functions is used to obtain the overall contrast loss function, self-supervised pre-training is performed, and the trained model is used for micro-motion recognition.

[0134] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning, characterized in that: The micro-motion recognition method comprises: Obtaining an original micro-motion sample video, and generating a skeleton sequence and an original skeleton sample according to the original micro-motion sample video; The original skeleton sample is enhanced into two different skeleton sequences by using a random enhancement technique, the two skeleton sequences are embedded and encoded by using two encoders, and global contrast learning is performed by using a first InfoNCE loss function; The first InfoNCE loss function is used for global contrastive learning, which is specifically defined as: ; in, Represents the dot product, which is used to calculate the similarity between two feature embeddings; and Represent query and key-value embedding respectively; Represents negative samples obtained from the historical storage queue; is a hyperparameter that controls the learning speed; The original skeleton sample is regarded as a one-dimensional time signal, and the skeleton sequence is decomposed into a high-frequency component and a low-frequency component by using discrete wavelet transform; the high-frequency component and the low-frequency component are reconstructed by wavelet to generate a new difficult sample, and the second InfoNCE loss function is used to perform local contrast learning; A multi-head self-attention mechanism is used to add masks to the feature embedding of difficult samples to construct contrastive learning sample pairs; The multi-head self-attention mechanism is used to add masks to the feature embedding of difficult samples to construct contrastive learning sample pairs including: Query Encoder The output feature embedding finds its self-attention matrix , the mask pair is obtained by calculation ( and ); A pair of masks is obtained from the following formula ( and ): , in, is a hyperparameter used to adjust the tolerance of neutral features; Decompose mask pairs into salient features and non-salient features; Input the features obtained by the encoder and obtain positive sample pairs by performing dot products with the mask pairs; By querying the encoder Key-Value Encoders Get the features respectively ( and ), and the feature ( and ) are respectively matched with the mask pair ( and ) do the dot product and pass through a single layer of MLP to get the positive sample ( ),in, is a set of positive sample pairs, is a set of positive sample pairs; in, Represents the length of the data sequence that needs to be pooled. For negative sample pairs, negative samples are obtained from the historical storage queue. , the negative samples Use the positive sample pairs as comparative learning samples; The second InfoNCE loss function is used for local contrast learning; the second InfoNCE loss function includes two loss functions, which are specifically defined as: In the formula, is a hyperparameter that controls the learning speed; The first InfoNCE loss function and the second InfoNCE loss function are weighted and summed to obtain the overall contrast loss function, as shown in the following formula: in, is the balance coefficient; Perform self-supervised pre-training and use the trained model for micro-motion recognition.

2. The micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning according to claim 1 is characterized in that: Acquiring an original micro-motion sample video, and generating a skeleton sequence and an original skeleton sample according to the original micro-motion sample video comprises: The OpenPose tool is used to extract skeletons frame by frame from the original micro-motion sample video to obtain a two-dimensional skeleton sequence including the face and upper body. The skeleton sequence is uniformly downsampled to 90 frames in the time dimension, and the dimension is The original skeleton sample of micro-motion; among them, is the batch quantity, is the number of channels, is the length of the time series, is the number of skeleton nodes, The number of subjects.

3. The micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning according to claim 1 is characterized in that: The encoder includes a first encoder and a second encoder, wherein the second encoder is used to encode one of the skeleton sequences to obtain key-value features, and the key-value features are embedded to form a storage queue.

4. The micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning according to claim 3 is characterized in that: The original skeleton sample is enhanced into two different skeleton sequences by using a random enhancement technique, the two skeleton sequences are embedded and encoded by using two encoders, and global contrast learning is performed by using a first InfoNCE loss function, including: Encoding the two skeleton sequences by a first encoder and a second encoder to obtain features; The acquired feature embedding is subjected to global average pooling and a fully connected layer to obtain a positive sample pair; and a negative sample pair is obtained from the storage queue; The first InfoNCE loss function is used for global contrastive learning.

5. The micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning according to claim 2 is characterized in that: The original skeleton sample is regarded as a one-dimensional time signal, and the skeleton sequence is decomposed into a high-frequency component and a low-frequency component by using discrete wavelet transform; the high-frequency component and the low-frequency component are reconstructed by wavelet to generate a new difficult sample, and the local contrast learning is performed using the second InfoNCE loss function, including: The number of channels, skeleton nodes, and subjects are combined, and the original skeleton samples are considered as one-dimensional time signals; The skeleton sequence is decomposed into high-frequency components and low-frequency components by using discrete wavelet transform on the time channel; Get the high-frequency and low-frequency components of different samples in the same training batch; The high-frequency components and low-frequency components of different samples are reconstructed by wavelet to generate new difficult samples; A multi-head self-attention mechanism is used to add masks to the feature embedding of difficult samples to construct contrastive learning sample pairs; The second InfoNCE loss function is used for local contrastive learning.

6. The micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning according to claim 1 is characterized in that: The weighted sum of the loss functions is used to obtain the overall contrast loss function, and self-supervised pre-training is performed. The trained model is used for micro-motion recognition: Obtain weights through self-supervised pre-training; Freeze some parameters and perform supervised fine-tuning; Validate and test the fine-tuned model on the pre-collected dataset; The tested model is used for micro-motion recognition tasks.

7. A micro-motion recognition device based on wavelet transform hybrid enhanced contrast learning, characterized in that: include: A preprocessing module, used for acquiring an original micro-motion sample video, and generating a skeleton sequence and an original skeleton sample according to the original micro-motion sample video; A global contrast learning module, used for enhancing the original skeleton sample into two different skeleton sequences by using a random enhancement technique, embedding the two skeleton sequences by using two encoders, and performing global contrast learning by using a first InfoNCE loss function; The first InfoNCE loss function is used for global contrastive learning, which is specifically defined as: ; in, Represents the dot product, which is used to calculate the similarity between two feature embeddings; and Represent query and key-value embedding respectively; Represents negative samples obtained from the historical storage queue; is a hyperparameter that controls the learning speed; A local contrastive learning module is used to regard the original skeleton sample as a one-dimensional time signal, and use discrete wavelet transform to decompose the skeleton sequence into high-frequency components and low-frequency components; reconstruct the high-frequency components and the low-frequency components through wavelet to generate new difficult samples, and use the second InfoNCE loss function to perform local contrastive learning; use a multi-head self-attention mechanism to add a mask to the feature embedding of the difficult sample to construct a contrastive learning sample pair; The multi-head self-attention mechanism is used to add masks to the feature embedding of difficult samples to construct contrastive learning sample pairs including: Query Encoder The output feature embedding finds its self-attention matrix , the mask pair is obtained by calculation ( and ); A pair of masks is obtained from the following formula ( and ): , in, is a hyperparameter used to adjust the tolerance of neutral features; Decompose mask pairs into salient features and non-salient features; Input the features obtained by the encoder and obtain positive sample pairs by performing dot products with the mask pairs; By querying the encoder Key-Value Encoders Get the features respectively ( and ), and the feature ( and ) are respectively matched with the mask pair ( and ) do the dot product and pass through a single layer of MLP to get the positive sample ( ),in, is a set of positive sample pairs, is a set of positive sample pairs; in, Represents the length of the data sequence that needs to be pooled. For negative sample pairs, negative samples are obtained from the historical storage queue. , the negative samples Use the positive sample pairs as comparative learning samples; The second InfoNCE loss function is used for local contrast learning; the second InfoNCE loss function includes two loss functions, which are specifically defined as: In the formula, is a hyperparameter that controls the learning speed; The first InfoNCE loss function and the second InfoNCE loss function are weighted and summed to obtain the overall contrast loss function, as shown in the following formula: in, is the balance coefficient; The training recognition module is used to obtain an overall contrast loss function by weighted summing of the loss functions, perform self-supervised pre-training, and use the trained model to perform micro-motion recognition.

8. An electronic device, comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the micro-motion recognition method based on wavelet transform hybrid enhanced contrast learning according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Image data processing method, image data recognition method, training method for image recognition model, image data processing apparatus, training apparatus for image recognition model, and image recognition apparatus

    US12651484B2