Small sample behavior recognition method and system based on event camera
By employing a small-sample behavior recognition method using event cameras and utilizing a noise-aware event encoder and a distillation prototype distance fusion module, the difficulties of behavior recognition under extreme conditions and large-scale data annotation of traditional cameras are solved, achieving efficient behavior recognition under extreme lighting and fast-moving conditions.
Patent Information
- Application Number
- CN202410419901.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2044-04-09
AI Technical Summary
Existing technologies struggle to capture high-quality images under extreme lighting or rapid movement conditions, resulting in poor behavior recognition performance. Furthermore, behavior recognition methods based on event cameras rely on large-scale labeled data, increasing costs and raising privacy and ethical concerns.
A few-sample behavior recognition method is adopted, which acquires data through an event camera and uses a noise-aware event encoder and a distillation prototype distance fusion module to achieve behavior recognition of few-sample data, including preprocessing, noise reduction, feature extraction and multi-metric classification.
Achieve rapid and accurate behavior recognition under poor lighting conditions and with limited samples, reduce reliance on large-scale data, lower storage costs, and address privacy and ethical issues.
Smart Images

Figure CN118314625B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of behavior recognition and analysis technology, specifically relating to a small sample behavior recognition method and system based on event cameras. Background Technology
[0002] Currently, most behavior recognition research relies on data acquisition using traditional visual cameras. However, under extreme lighting conditions or rapid movement, traditional cameras often struggle to capture high-quality images, significantly impacting the effectiveness of action recognition. Against this backdrop, event cameras, as an innovative visual sensor, offer a new perspective for capturing fast-moving actions and handling poorly lit scenes by recording real-time changes in pixel brightness, thus paving a new path for the development of behavior recognition technology.
[0003] While event camera technology has demonstrated significant potential in visual tasks, most current research on event camera-based behavior recognition still relies on traditional supervised learning methods. These methods often require large amounts of labeled data, significantly increasing research costs and limiting their application in scenarios where sufficient data is difficult to obtain. First, constructing large-scale event datasets is not only time-consuming but also requires specialized software for data processing and analysis, leading to a substantial increase in human and time costs. Second, although the data recorded by event cameras is inherently sparse, the sheer volume of data generated results in a dramatic increase in storage costs. More importantly, considering the potential privacy and ethical issues involving human behavioral data, collecting large-scale data is impractical in certain situations. Therefore, how to achieve behavior recognition based on small sample data from event cameras is a pressing problem that needs to be solved. Summary of the Invention
[0004] This invention provides a method and system for few-sample behavior recognition based on event cameras, in order to solve the problem of difficulty in achieving behavior recognition based on few-sample data from event cameras.
[0005] In a first aspect, the present invention provides a few-sample behavior recognition method based on an event camera, the method comprising the following steps:
[0006] Acquire small sample event data using the event camera;
[0007] The small sample event data is preprocessed, and the preprocessed small sample event data is divided into training set data and test set data, wherein the data label of any data in the training set data is different from the data label of any data in the test set data.
[0008] Extract the support set data with the data labels and the query set data without the data labels from the training set data;
[0009] The support set data and the query set data are processed by a noise-aware event encoder to obtain a denoised support set data frame set and a denoised query set data frame set.
[0010] The denoised support set data frame set and the denoised query set data frame set are input into a preset backbone network and a preset time transformer for feature processing to obtain the first low-dimensional feature corresponding to the denoised support set data frame set and the second low-dimensional feature corresponding to the denoised query set data frame set.
[0011] The first low-dimensional feature and the second low-dimensional feature are input into the distillation prototype distance fusion module for multi-metric classification to obtain the classification result.
[0012] The behavior recognition results of the small sample event data are obtained by analyzing the classification results.
[0013] Optionally, the noise-aware event encoder includes a spatiotemporal adaptive denoising module and an event frame encoder. The step of processing the support set data and the query set data through the noise-aware event encoder to obtain a denoised support set data frame set and a denoised query set data frame set includes the following steps:
[0014] The spatiotemporal adaptive denoising module is used to denoise the support set data and the query set data.
[0015] The event frame encoder is used to convert the format of the denoised support set data and the query set data, converting the support set data into a denoised support set data frame set and the query set data into a denoised query set data frame set.
[0016] Optionally, the denoising process performed on the support set data and the query set data by the spatiotemporal adaptive denoising module includes the following steps:
[0017] All event data samples in the support set data and the query set data are used as event points;
[0018] Traverse all the event points and perform an event point filtering step through the spatiotemporal adaptive denoising module to remove noisy event points from the support set data and the query set data;
[0019] The event points retained in the support set data are integrated into a support set event stream, and the event points retained in the query set data are integrated into a query set event stream;
[0020] The event point filtering step includes the following steps:
[0021] Calculate the average distance between the event point and its k neighboring points, and define the average distance as the dynamic radius;
[0022] The event point is assigned a neighbor weight by using a time decay function and according to a preset time filtering window.
[0023] The number of effective neighbors of the event point is calculated by combining the dynamic radius, the time filtering window, and the neighbor weight;
[0024] Whether to retain the event point is determined based on the number of valid neighbors.
[0025] Optionally, the formula for calculating the dynamic radius is as follows:
[0026]
[0027] In the formula: r i Let d(e) represent the dynamic radius of the i-th event point, k represent the number of neighboring points of the event point, and d(e) represent the dynamic radius of the i-th event point. i e ij ) represents the i-th event point e i With its j-th neighbor point e ij Euclidean distance.
[0028] Optionally, the formula for calculating the number of valid neighbors of the event point is as follows:
[0029]
[0030] Where: N i This represents the number of valid neighbors of the i-th event point. Let t represent the set of all the data points mentioned. i t represents the timestamp of the i-th event point. ij This represents the timestamp of the j-th neighbor of the i-th event point. Δ t represents the time filtering window. w(t ij , t i ) represents the time decay weight relative to the i-th event point and its j-th neighbor point, exp(·) represents the exponential function, and τ represents the time decay constant.
[0031] Optionally, the step of using the event frame encoder to perform format conversion on the denoised support set data and query set data, converting the support set data into a denoised support set data frame set and the query set data into a denoised query set data frame set, includes the following steps:
[0032] The event frame encoder is used to divide the support set event stream and the query set event stream into multiple support set time windows and multiple query set time windows, respectively, and each support set time window and each query set time window contains an equal number of event points;
[0033] For each support set time window or each query set time window, the pixel value of the corresponding time frame is determined based on the polarity of the event point within the time window, thereby obtaining the first time frame set corresponding to the support set time window and the second time frame set corresponding to the query set time window.
[0034] The first time frame set is converted into a three-channel format to obtain the denoising support set data frame set;
[0035] The second time frame set is converted into a three-channel format to obtain a denoised query set data frame set.
[0036] Optionally, the step of inputting the first low-dimensional feature and the second low-dimensional feature into the distillation prototype distance fusion module for multi-metric classification to obtain the classification result includes the following steps:
[0037] Use all the first low-dimensional features as the prototype vectors of the prototype network in the distillation prototype distance fusion module;
[0038] All the second low-dimensional features are used as query vectors and integrated into an event data feature vector. The geometric dimensional distance between the event data feature vector and the prototype vector is calculated.
[0039] The orientation dimension measure between the event data feature vector and the prototype vector is evaluated using an orientation metric formula.
[0040] The similarity of the distribution dimension between the event data feature vector and the prototype vector is determined by a measurement method based on optimal transmission theory.
[0041] The geometric dimension distance, the orientation dimension metric, and the distribution dimension similarity are normalized using the knowledge distillation soft labeling method to obtain a comprehensive distance metric.
[0042] Based on the comprehensive distance metric and multi-metric classification according to the prototype network, the classification result is obtained.
[0043] Optionally, the formula for calculating the geometric distance is as follows:
[0044]
[0045] In the formula: q = [q1, q2, ..., q L] represents the event data feature vector, L represents the number of query vectors in the event data feature vector, and s n This represents the prototype vector of the nth class. q represents the geometric distance between the event data feature vector and the prototype vector. g s represents the g-th query vector in the event data feature vector. n,m This represents the m-th element in the prototype vector of the n-th class;
[0046] The direction measurement formula is as follows:
[0047]
[0048] In the formula: This represents the directional dimension measure between the event data feature vector and the prototype vector.
[0049] The formula for calculating the similarity of the distribution dimensions is as follows:
[0050]
[0051] In the formula: ρ(q) represents the probability distribution derived from the feature vector of the event data, ρ(s) n ) represents the probability distribution derived from the prototype vector. The distributional dimensionality similarity between the event data feature vector and the prototype vector is represented by inf, where inf denotes the infimum and d(x, y) denotes the metric space. The distance between any two points x and y, where x and y represent positions or states in a probability distribution, and π is the ... n The joint distribution between )) is a regularization parameter used to control the trade-off between transportation costs and the differences between distributions. The KL divergence is denoted by ρ(q) and ρ(s). n The deviation between the multiplicative distributions of )
[0052] Optionally, extracting the support set data with the data labels and the query set data without the data labels from the training set data includes the following steps:
[0053] Extract training set data of N classes of data labels from the training set data;
[0054] Extract K event data samples from the training set data of the N categories of data labels, and combine the K event data samples into support set data;
[0055] The query set data consists of several event data samples that are to be classified and do not have the data labels extracted from the training set data.
[0056] In a second aspect, the present invention also provides a few-shot behavior recognition system based on an event camera, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the few-shot behavior recognition method based on an event camera as described in the first aspect.
[0057] The beneficial effects of this invention are:
[0058] This invention utilizes the Few-Shot Learning (FSL) method to train a machine learning model with limited data samples, mimicking the human learning process to achieve rapid classification learning. Specifically, it employs a noise-aware event encoder and a distillation-prototype distance fusion module to implement a few-sample behavior recognition method based on event cameras. Considering that the subject of action recognition is humans and that actions have a strong temporal dependence, the noise-aware event encoder used in this invention removes noise while retaining key behavioral information and adapts the data for neural network processing, addressing input format differences. The distillation-prototype distance fusion module maximizes the extraction of key information from limited event data. This method can explore the intrinsic characteristics of event data, thereby reducing reliance on prior knowledge. Attached Figure Description
[0059] Figure 1 This is a flowchart illustrating a few-sample behavior recognition method based on an event camera in one embodiment of this application.
[0060] Figure 2 This is a diagram illustrating the overall framework of a few-sample behavior recognition method based on an event camera in one embodiment of this application.
[0061] Figure 3 This is a schematic diagram of the structure of a noise-sensing encoder in one embodiment of this application. Detailed Implementation
[0062] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0063] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0064] Figure 1 This is a flowchart illustrating a few-sample behavior recognition method based on an event camera in one embodiment. It should be understood that, although... Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps. For example Figure 1 As shown, the few-sample behavior recognition method based on event cameras disclosed in this invention specifically includes the following steps:
[0065] S101. Acquire small sample event data through the event camera.
[0066] The event camera is a novel type of visual sensor that, instead of periodically capturing the brightness of the entire pixel array, asynchronously records the time and location of brightness changes for each pixel. When objects move in the scene, the event camera generates a series of events, each containing pixel location, timestamp, and the polarity of the brightness change. This event data is known as few-sample events, or event data under few-sample conditions. The set of all acquired few-sample event data is denoted as E, where each independent few-sample event data point e is represented as a four-dimensional tuple (X, Y, T, P). Here, (X, Y) specifies the spatial coordinates of the event, T represents the time of occurrence, and P represents the polarity of the event's illumination change.
[0067] S102. Preprocess the small sample event data and split the preprocessed small sample event data into training set data and test set data.
[0068] Preprocessing small sample event data mainly includes data cleaning and standardization to remove noise and outliers, improving data quality. The data label of any data point in the training set is different from that of any data point in the test set. To facilitate small sample learning, the preprocessed small sample event data needs to be split into training and test sets, while avoiding any overlap in categories. Specifically, the training set data T... train Defined as T train ={(E, yv)|y u ∈Y train}, where each y u It comes from the unique tag set Y train The label. Similarly, the test set data T test Defined as T test ={(E, y u )|y u ∈Y test}, where Y test It is a different set of tags.
[0069] S103. Extract labeled support set data and unlabeled query set data from the training set data.
[0070] In this invention, the contextual meta-learning method is mainly used to optimize the network. In one embodiment, step S103 specifically includes the following steps:
[0071] The invention involves extracting training data with N labeled classes from the training set data, then extracting K event data samples from the training set data, and combining these K event data samples into a support set data. This method of extracting training data is called N-way K-shot. Then, several unlabeled event data samples to be classified are extracted from the training set data to form a query set data. The main objective of this invention is to classify the unlabeled event data in the query set data into a specific category in the support set data.
[0072] In one implementation, during the testing phase, the same N-way K-way task method can be used to extract the support set data and query set data for testing.
[0073] S104. The support set data and query set data are processed by the noise-aware event encoder to obtain the denoised support set data frame set and the denoised query set data frame set.
[0074] In each N-channel K-series task scenario, the support set data and query set data are processed by a noise-aware event encoder to generate denoised frame-level representations, i.e., denoised support set data frame sets. and denoised query set data frame set Where C represents the number of channels, and H and W represent the height and width of the event frame, respectively.
[0075] S105. Input the denoised support set data frame set and the denoised query set data frame set into a preset backbone network and a preset time transformer for feature processing to obtain the first low-dimensional feature corresponding to the denoised support set data frame set and the second low-dimensional feature corresponding to the denoised query set data frame set.
[0076] The backbone network extracts basic features from the data, while the time-series transformer processes time-series data and extracts temporal features. Inputting the denoised support set and query set data frames into these two networks yields the corresponding high-dimensional features. (See reference...) Figure 2 The backbone network used to process the denoising support set data frame set and the denoising query set data frame set can share weights.
[0077] S106. Input the first low-dimensional feature and the second low-dimensional feature into the distillation prototype distance fusion module for multi-metric classification to obtain the classification result.
[0078] S107. Analyze the classification results to obtain the behavior recognition results of small sample event data.
[0079] The implementation principle of this method is as follows:
[0080] This implementation method utilizes the Few-Shot Learning (FSL) method to train a machine learning model with limited data samples, mimicking the human learning process to achieve rapid classification learning. Specifically, it employs a noise-aware event encoder and a distillation prototype distance fusion module. The noise-aware event encoder denoises the event data in the spatiotemporal dimensions and encodes the event data into a standard input stream. The distillation prototype distance fusion fully utilizes the information inherent in the event data for more accurate measurement and classification, without relying on prior visual knowledge. Considering that the subject of action recognition is humans, and actions have a strong temporal dependence, the noise-aware event encoder used in this invention removes noise while retaining key behavioral information and adapts the data for neural network processing, resolving input format differences. The distillation prototype distance fusion module maximizes the extraction of key information from limited event data. Ultimately, action recognition based on an event camera is achieved under poor lighting conditions and with limited samples.
[0081] In one embodiment, the noise-aware event encoder includes a spatiotemporal adaptive denoising module and an event frame encoder, and step S104 specifically includes the following steps:
[0082] The spatiotemporal adaptive denoising module is used to denoise the support set data and query set data;
[0083] The event frame encoder is used to convert the format of the denoised support set data and query set data, converting the support set data into a denoised support set data frame set and the query set data into a denoised query set data frame set.
[0084] In this embodiment, refer to Figure 3 The noise-aware encoder consists of two core sub-modules: a spatiotemporal adaptive denoising module and an event frame encoder. The spatiotemporal adaptive denoising module is responsible for filtering event data to enhance the representation of actions. The event frame encoder, on the other hand, is responsible for converting discrete event data into an input format similar to video frames, enabling it to be directly processed by the neural network.
[0085] Event cameras possess high temporal resolution, enabling them to keenly capture changes in lighting. Simultaneously, they can record extremely subtle changes in motion, providing incredibly rich temporal detail. This is crucial for accurately capturing and recognizing behavioral patterns. However, this high temporal resolution also leads to the recording data capturing significant noise. For example, random changes in lighting can sometimes be misclassified as valid events. In few-shot learning tasks, input data with excessive noise can cause the model to capture incorrect patterns, thus weakening its generalization performance. Therefore, denoising is necessary for few-shot event camera behavior recognition tasks. The main goal of denoising is to remove irrelevant noisy events from the acquired data, retaining only those data that accurately reflect action information, thereby improving the model's recognition accuracy and generalization performance.
[0086] In one implementation, the step of denoising the support set data and query set data using a spatiotemporal adaptive denoising module specifically includes the following steps:
[0087] All event data samples in the support set data and query set data will be used as event points;
[0088] Traverse all event points and use the spatiotemporal adaptive denoising module to perform an event point filtering step to remove noisy event points from the support set data and query set data.
[0089] The event points retained in the support set data are integrated into the support set event stream, and the event points retained in the query set data are integrated into the query set event stream.
[0090] In this embodiment, the event point filtering step includes the following steps:
[0091] Calculate the average distance between the event point and its k neighboring points, and define the average distance as the dynamic radius;
[0092] The time decay function is used to assign neighbor weights to each neighbor point of the event point according to a preset time filtering window.
[0093] The number of effective neighbors of an event point is calculated by combining dynamic radius, time filter window and neighbor weight;
[0094] Whether to retain an event point is determined based on the number of valid neighbors.
[0095] In this embodiment, the formula for calculating the dynamic radius is as follows:
[0096]
[0097] In the formula: r i Let d(e) represent the dynamic radius of the i-th event point, k represent the number of neighboring points of the event point, and d(e) represent the dynamic radius of the event point. i e ij ) represents the i-th event point e i With its j-th neighbor point e ij Euclidean distance.
[0098] Dynamic radius r i The density is adaptively determined based on the local density surrounding each event point, thus providing a flexible response to the spatial distribution of events and enhancing the overall model's ability to distinguish between noisy and meaningful events based on spatial context. Considering the significant dependence of event data on temporal attributes in action recognition tasks, a temporal filtering window strategy is added to further optimize data filtering. Specifically, within a given temporal filtering window Δt, only those neighboring points within Δt in terms of temporal distance to the event point are considered as valid neighbors. The condition for a valid neighbor is:
[0099] |t ij -t i |≤Δt
[0100] By using time window filtering, the model can effectively select event points that are closely related to the current analysis point in both time and space, ensuring that the data being processed and analyzed is more relevant in context. Imposing this constraint also reduces the amount of data that needs to be processed, thereby improving processing speed. Next, regarding the temporal continuity of event data, to reduce the impact of outdated data from past sequences on the current denoising process, a time decay function is introduced to assign weights to each neighbor point, thereby enhancing the influence of temporally closer neighbors. The specific formula is as follows:
[0101]
[0102] In the formula: w(t) ij , t i) represents the time decay weight relative to the i-th event point and its j-th neighbor point, exp(·) represents the exponential function, τ represents the time decay constant, and τ is used to control the decay rate.
[0103] Finally, by integrating the dynamic radius, time filtering window, and neighbor weights, the number of effective neighbors N for each point is calculated. i The number of valid neighbors N of the event point i The calculation formula is as follows:
[0104]
[0105] Where: N i Let S represent the number of valid neighbors of the i-th event point, and let S represent the set of all data points. i t represents the timestamp of the i-th event point. ij Let represent the timestamp of the j-th neighbor of the i-th event point, and Δt represent the time filtering window. Event point e i These are retained as non-noise event points.
[0106] In one implementation, if N i If the minimum neighbor threshold is exceeded, the following actions can be taken:
[0107]
[0108] In the formula: Let θ be the set of all retained non-noise event points, and let θ represent the minimum neighbor threshold.
[0109] In one implementation, the step of using an event frame encoder to convert the format of the denoised support set data and query set data, converting the support set data into a denoised support set data frame set and the query set data into a denoised query set data frame set, specifically includes the following steps:
[0110] The event frame encoder is used to divide the support set event stream and the query set event stream into multiple support set time windows and multiple query set time windows, respectively. Each support set time window and each query set time window contains an equal number of event points.
[0111] For each support set time window or each query set time window, the pixel value of the corresponding time frame is determined based on the polarity of the event point within the time window, thus obtaining the first time frame set corresponding to the support set time window and the second time frame set corresponding to the query set time window.
[0112] The first time frame set is converted into a three-channel format to obtain the denoising support set data frame set;
[0113] The second time frame set is converted into a three-channel format to obtain a denoised query set data frame set.
[0114] In this implementation, the data generated by the event camera consists primarily of a sparse set of tuples. This data needs to be transformed to conform to the input format required by the network before neural network processing. The model uses an event frame format to encode the event data to achieve this. The entire event stream is divided into... A time window, ensuring that each window... It contains an equal number of event points. For each time window... Process event points to update the corresponding time frame F t The pixel values in the image. This can be expressed by the following formula:
[0115]
[0116] Here, P represents the polarity of the event point, and (X, Y) represents the spatial coordinates of the event point within the frame. The resulting set of time frames is a two-dimensional image frame representation, accumulating the event data for each time window. Given that neural network processing requires a three-channel input format, and considering the original single-channel nature of the event frames, it is necessary to process each frame F... t Convert to a three-channel format.
[0117] In one embodiment, step S106 specifically includes the following steps:
[0118] All first low-dimensional features are used as prototype vectors of the prototype network in the distillation prototype distance fusion module;
[0119] All second-low-dimensional features are used as query vectors and integrated into event data feature vectors. The geometric dimensional distance between the event data feature vector and the prototype vector is calculated.
[0120] The orientation dimensionality between the feature vector and prototype vector of event data is evaluated using an orientation metric formula.
[0121] The similarity of the distribution dimensions between the feature vectors and prototype vectors of event data is determined by a measurement method based on optimal transmission theory.
[0122] The knowledge distillation soft labeling method is used to normalize the geometric distance, orientation metric, and distribution similarity to obtain a comprehensive distance metric.
[0123] The classification results are obtained by using a comprehensive distance metric and performing multi-metric classification based on the prototype network.
[0124] In this embodiment, prototype networks possess efficient and concise category recognition capabilities in the field of few-shot learning. On the other hand, considering the unevenness and complexity of the spatial distribution of event data, using only a single similarity metric is insufficient to fully capture the rich and complex relationships between the data. Therefore, as... Figure 3 As shown, the prototype distance fusion module can comprehensively consider multiple key dimensions such as geometric scale, directionality, and distribution characteristics, thereby achieving in-depth measurement in multiple dimensions and significantly improving the performance of the prototype network in event data understanding and category classification.
[0125] All first low-dimensional features are used as prototype vectors of the prototype network in the distillation prototype distance fusion module, and all second low-dimensional features are used as query vectors and integrated into event data feature vectors. The geometric distance between the event data feature vector and the prototype vector is calculated using the following formula:
[0126]
[0127] In the formula: q = [q1, q2, ..., q L ] represents the event data feature vector, L represents the number of query vectors in the event data feature vector, and s n Represents the prototype vector of the nth class. q represents the geometric distance between the event data feature vector and the prototype vector. g s represents the g-th query vector in the event data feature vector. n,m This represents the m-th element in the n-th class of prototype vectors;
[0128] The orientation metric is used to evaluate the directional dimension between the event data feature vector and the prototype vector. The orientation metric formula is as follows:
[0129]
[0130] In the formula: This measure represents the directional dimension between the event data feature vector and the prototype vector. By quantifying the angle between the vectors, the directional dimension measure captures subtle differences in the direction of the samples. It is effective in analyzing samples that exhibit similar trends but differ in size.
[0131] Finally, to explore the similarity between the event data feature vector and the prototype vector in terms of distribution dimension, a measurement method based on optimal transport theory is used to capture the differences in complex distribution patterns. This step is achieved by calculating the Wasserstein distance between the two probability distributions. The formula for calculating the similarity in distribution dimension is as follows:
[0132]
[0133] In the formula: ρ(q) represents the probability distribution derived from the feature vector of the event data, ρ(s) n ) represents the probability distribution derived from the prototype vector. The distributional dimensionality similarity between the event data feature vector and the prototype vector is represented by inf, where inf denotes the infimum, and d(x, y) denotes the metric space. The distance between any two points x and y, where x and y represent positions or states in a probability distribution, and π is the ... n The joint distribution between )) is a regularization parameter used to control the trade-off between transportation costs and the differences between distributions. The KL divergence is denoted by ρ(q) and ρ(s). n The deviation between the multiplicative distributions of )
[0134] Although distance measurements have been obtained from geometric, directional, and distributional dimensions, the different scales of these measurements need to be normalized or standardized to align them on the same measurement scale and ensure fair comparisons. Specifically, the concept of soft labeling from knowledge distillation can be utilized, along with a normalization strategy that preserves the variance in the measurements. Specifically, each set of distance measurements is first calculated... The standard deviation and variance are calculated, and then the data are standardized to transform it into a distribution centered at 0 with a standard deviation of 1. The formula can be expressed as:
[0135]
[0136] In this way, subtle comparisons between distances can be preserved. Subsequently, all normalized distances are weighted and fused to obtain a comprehensive distance metric. The specific formula for the comprehensive distance metric is as follows:
[0137]
[0138] In the formula: Let w represent the normalized geometric distance, orientation metric, and distribution similarity, respectively. A w B w C These represent the weights for geometric distance, orientation metric, and distribution similarity, respectively. This optimized and fused distance metric updates the prototype network's decision-making process, enabling classification decisions to more accurately reflect the true similarity between samples.
[0139] The present invention also discloses a few-shot behavior recognition system based on an event camera, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the few-shot behavior recognition method based on an event camera as described in any of the above embodiments.
[0140] The processor can be a central processing unit (CPU). Of course, depending on the actual use, it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc., and this application does not limit it in this regard.
[0141] The memory can be an internal storage unit of a computer device, such as a hard disk or RAM, or an external storage device, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD), or flash memory card (FC) provided on the computer device. Furthermore, the memory can be a combination of internal storage units and external storage devices of a computer device. The memory is used to store computer programs and other programs and data required by the computer device. The memory can also be used to temporarily store data that has been output or will be output. This application does not limit this.
[0142] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of protection of this application is limited to these examples; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of one or more embodiments of this application as described above, which are not provided in detail for the sake of brevity.
[0143] One or more embodiments in this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments in this application should be included within the protection scope of this application.
Claims
1. A few-sample behavior recognition method based on event cameras, characterized in that, Includes the following steps: Acquire small sample event data using an event camera; The small sample event data is preprocessed, and the preprocessed small sample event data is divided into training set data and test set data, wherein the data label of any data in the training set data is different from the data label of any data in the test set data. Extract the support set data with the data labels and the query set data without the data labels from the training set data; The support set data and the query set data are processed by a noise-aware event encoder to obtain a denoised support set data frame set and a denoised query set data frame set. The denoised support set data frame set and the denoised query set data frame set are input into a preset backbone network and a preset time transformer for feature processing to obtain the first low-dimensional feature corresponding to the denoised support set data frame set and the second low-dimensional feature corresponding to the denoised query set data frame set. The first low-dimensional feature and the second low-dimensional feature are input into the distillation prototype distance fusion module for multi-metric classification to obtain the classification result. The behavior recognition results of the small sample event data are obtained by analyzing the classification results.
2. The few-sample behavior recognition method based on event cameras according to claim 1, characterized in that, The noise-aware event encoder includes a spatiotemporal adaptive denoising module and an event frame encoder. The process of processing the support set data and the query set data through the noise-aware event encoder to obtain a denoised support set data frame set and a denoised query set data frame set includes the following steps: The spatiotemporal adaptive denoising module is used to denoise the support set data and the query set data. The event frame encoder is used to convert the format of the denoised support set data and the query set data, converting the support set data into a denoised support set data frame set and the query set data into a denoised query set data frame set.
3. The few-sample behavior recognition method based on event cameras according to claim 2, characterized in that, The denoising process performed on the support set data and the query set data by the spatiotemporal adaptive denoising module includes the following steps: All event data samples in the support set data and the query set data are used as event points; Traverse all the event points and perform an event point filtering step through the spatiotemporal adaptive denoising module to remove noisy event points from the support set data and the query set data; The event points retained in the support set data are integrated into a support set event stream, and the event points retained in the query set data are integrated into a query set event stream; The event point filtering step includes the following steps: Calculate the average distance between the event point and its k neighboring points, and define the average distance as the dynamic radius; The event point is assigned a neighbor weight by using a time decay function and according to a preset time filtering window. The number of effective neighbors of the event point is calculated by combining the dynamic radius, the time filtering window, and the neighbor weight; Whether to retain the event point is determined based on the number of valid neighbors.
4. The few-sample behavior recognition method based on event cameras according to claim 3, characterized in that, The formula for calculating the dynamic radius is as follows: In the formula: r i Let d(e) represent the dynamic radius of the i-th event point, k represent the number of neighboring points of the event point, and d(e) represent the dynamic radius of the i-th event point. i e ij ) represents the i-th event point e i With its j-th neighbor point e ij Euclidean distance.
5. The few-sample behavior recognition method based on event cameras according to claim 4, characterized in that, The formula for calculating the number of valid neighbors of the event point is as follows: Where: N i This represents the number of valid neighbors of the i-th event point. Let t represent the set of all the data points mentioned. i t represents the timestamp of the i-th event point. ij This represents the timestamp of the j-th neighbor of the i-th event point, and Δt represents the time filtering window. w(t ij , t i ) represents the time decay weight relative to the i-th event point and its j-th neighbor point, exp(·) represents the exponential function, and τ represents the time decay constant.
6. The few-sample behavior recognition method based on event cameras according to claim 3, characterized in that, The step of using the event frame encoder to convert the format of the denoised support set data and the query set data, converting the support set data into a denoised support set data frame set and the query set data into a denoised query set data frame set, includes the following steps: The event frame encoder is used to divide the support set event stream and the query set event stream into multiple support set time windows and multiple query set time windows, respectively, and each support set time window and each query set time window contains an equal number of event points; For each support set time window or each query set time window, the pixel value of the corresponding time frame is determined based on the polarity of the event point within the time window, thereby obtaining the first time frame set corresponding to the support set time window and the second time frame set corresponding to the query set time window. The first time frame set is converted into a three-channel format to obtain the denoising support set data frame set; The second time frame set is converted into a three-channel format to obtain a denoised query set data frame set.
7. The few-sample behavior recognition method based on event cameras according to claim 1, characterized in that, The step of inputting the first low-dimensional feature and the second low-dimensional feature into the distillation prototype distance fusion module for multi-metric classification to obtain the classification result includes the following steps: Use all the first low-dimensional features as the prototype vectors of the prototype network in the distillation prototype distance fusion module; All the second low-dimensional features are used as query vectors and integrated into an event data feature vector. The geometric dimensional distance between the event data feature vector and the prototype vector is calculated. The orientation dimension measure between the event data feature vector and the prototype vector is evaluated using an orientation metric formula. The similarity of the distribution dimension between the event data feature vector and the prototype vector is determined by a measurement method based on optimal transmission theory. The geometric dimension distance, the orientation dimension metric, and the distribution dimension similarity are normalized using the knowledge distillation soft labeling method to obtain a comprehensive distance metric. Based on the comprehensive distance metric and multi-metric classification according to the prototype network, the classification result is obtained.
8. The few-sample behavior recognition method based on event camera according to claim 7, characterized in that, The formula for calculating the geometric distance is as follows: In the formula: q = [q1, q2, ..., q L ] represents the event data feature vector, L represents the number of query vectors in the event data feature vector, and s n This represents the prototype vector of the nth class. q represents the geometric distance between the event data feature vector and the prototype vector. g s represents the g-th query vector in the event data feature vector. n,m This represents the m-th element in the prototype vector of the n-th class; The direction measurement formula is as follows: In the formula: This represents the directional dimension measure between the event data feature vector and the prototype vector; The formula for calculating the similarity of the distribution dimensions is as follows: In the formula: ρ(q) represents the probability distribution derived from the feature vector of the event data, ρ(s) n ) represents the probability distribution derived from the prototype vector. The distributional dimensionality similarity between the event data feature vector and the prototype vector is represented by inf, where inf denotes the infimum and d(x, y) denotes the metric space. The distance between any two points x and y, where x and y represent positions or states in a probability distribution, and π is the ... n The joint distribution between )) is a regularization parameter used to control the trade-off between transportation costs and the differences between distributions. The KL divergence is denoted by ρ(q) and ρ(s). n The deviation between the multiplicative distributions of ) 9. The few-sample behavior recognition method based on event cameras according to claim 1, characterized in that, The step of extracting support set data with the data labels and query set data without the data labels from the training set data includes the following steps: Extract training set data of N classes of data labels from the training set data; Extract K event data samples from the training set data of the N categories of data labels, and combine the K event data samples into support set data; The query set data consists of several event data samples that are to be classified and do not have the data labels extracted from the training set data.
10. A few-sample behavior recognition system based on an event camera, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the event camera-based few-shot behavior recognition method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Special audio event layered and generalized identification method based on SVM (Support Vector Machine) and GMM (Gaussian Mixture Model)
CN102799899A
Space target recognition method and device based on small sample training and computer equipment
CN116597384A
