A micro-expression recognition method based on block-based multi-scale convolutional neural network
The micro-expression recognition method based on block multi-scale convolutional neural network solves the problems of small sample size and category imbalance in micro-expression data set, improves the accuracy and adaptability of recognition, and achieves sensitivity to subtle facial changes. Improvement in accuracy and generalization ability.
Patent Information
- Application Number
- CN202410741153.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing micro-expression recognition technology faces the problems of small sample size and category imbalance in micro-expression data sets, resulting in insufficient generalization ability and accuracy of the recognition algorithm. It is also highly dependent on video data quality and computing resources, making it difficult to apply it to different cultural backgrounds and Adaptation to individual differences.
A micro-expression recognition method based on block multi-scale convolutional neural network is adopted, the dynamic characteristics of micro-expressions are captured through the optical flow feature extraction module, and the sensitivity of the model to subtle facial changes is improved through the block multi-scale convolution module, combined with samples Distribution correction and implicit semantic data enhancement algorithms improve the generalization ability of the model.
It improves the accuracy and universality of micro-expression recognition, alleviates the problems of small sample size and category imbalance, and enables the model to have higher adaptability and recognition capabilities in practical applications.
Smart Images

Figure CN118314617B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of micro-expression technology, and in particular, to a micro-expression recognition method based on a block-based multi-scale convolutional neural network. Background Art
[0002] Microexpressions are extremely subtle and short-lived facial expressions in human non-verbal communication, which usually reveal their true emotions and intentions without the individual's awareness. However, recognizing microexpressions from facial videos faces great challenges because microexpressions are usually very subtle and short-lived, and existing microexpression datasets suffer from serious class imbalance and small sample size problems.
[0003] In order to accurately identify micro-expressions, scholars have proposed a variety of micro-expression recognition methods. Early micro-expression recognition methods mainly rely on Local Binary Patterns on Three Orthogonal Planes (LBP-TOP) and its variants. Although they can extract useful texture features in the spatiotemporal domain, their ability to capture subtle facial movements is limited. At present, the mainstream micro-expression recognition methods use convolutional neural networks (CNN), graph convolutional networks (GCN), attention mechanisms, and their combinations.
[0004] In the prior art, the patent document with application publication number CN116645718A discloses a micro-expression recognition method and system based on a multi-stream architecture, the method comprising: step S30, performing optical flow calculation on each face image to obtain an optical flow image sequence; step S40, calculating the optical flow Strain based on the optical flow image sequence; step S50, using three-dimensional fast Fourier transform to detect vertex frames in each face image; step S60, using a multi-stream framework to extract micro-expression features from vertex frames, and then identifying micro-expressions. The patent document with application publication number CN117392727A discloses a facial micro-expression recognition method based on contrastive learning and feature decoupling, which enhances the recognition ability of the model by fusing dual-end optical flow information, identity information decoupling and contrastive learning strategies. By obtaining the starting frame, peak frame and offset frame, the difference features and two-end optical flow map are calculated, and the triplet loss is used to expand the difference features and decouple them. At the same time, the optical flow map is input into the self-attention micro-expression recognition network for training and the contrast loss is calculated. Finally, the difference features and optical flow features are spliced to obtain the recognition results.
[0005] However, most of the existing micro-expression recognition models are based on traditional facial expression recognition technology. These models usually require a large amount of labeled data for training. Micro-expressions occur at a low frequency and are difficult to capture naturally outside a laboratory environment. Therefore, it is difficult to obtain sufficient training samples. There are serious problems of small sample size and class imbalance in micro-expression datasets, which limits the generalization ability and accuracy of the recognition algorithm. Furthermore, the subjectivity and diversity of micro-expressions also bring additional complexity to recognition. Different cultural backgrounds and individual differences may lead to significant differences in the expression and interpretation of the same micro-expression, which requires the recognition system to have a high degree of adaptability and sensitivity to accurately identify and interpret various subtle facial movements. Therefore, most of the existing technologies may have the following major problems and defects: First, the method has a high dependence on the quality and consistency of video data. If the video quality is poor or there are changes in lighting and angle, it will directly affect the accuracy of feature extraction. Secondly, although the structural reparameterization model improves the generalization ability, the model is highly complex and requires a lot of computing resources, which may be difficult to achieve in a resource-limited environment. In addition, if the training data set lacks breadth and diversity, the model may lack adaptability to different populations or situations in practical applications, affecting the universality and accuracy of recognition.
[0006] In view of this, the present invention provides a micro-expression recognition method based on a block-based multi-scale convolutional neural network. Summary of the invention
[0007] According to the above-mentioned deficiencies, a micro-expression recognition method based on block multi-scale convolutional neural network is provided. The present invention mainly utilizes the optical flow feature extraction module based on block multi-scale convolutional neural network to more accurately capture and enhance the dynamic characteristics of micro-expressions, providing a rich source of information for the recognition process; and then utilizes the block multi-scale convolution module to enhance the model's ability to process complex data and enhance the sensitivity to subtle facial changes, thereby improving the accuracy of micro-expression recognition.
[0008] The technical means adopted by the present invention are as follows:
[0009] The present invention provides a micro-expression recognition method based on a block multi-scale convolutional neural network, comprising:
[0010] Providing a data set, including a plurality of video sequences, wherein the video sequences include a start frame and a vertex frame;
[0011] Selecting one of the video sequences from the data set as a sample to be tested;
[0012] Provides a block-based multi-scale convolutional neural network;
[0013] The sample to be tested is input into the block-based multi-scale convolutional neural network, and the optical flow feature extraction module based on the block-based multi-scale convolutional neural network generates a four-dimensional optical flow feature vector according to the video to be tested; the block-based multi-scale convolution module based on the block-based multi-scale convolutional neural network generates a recognition result according to the four-dimensional optical flow feature vector.
[0014] Preferably, after providing a block-based multi-scale convolutional neural network, the method further includes:
[0015] Dividing a training set from the data set, wherein the training set does not include the sample to be tested;
[0016] Performing sample distribution correction on the training set to obtain a sample set;
[0017] The sample set is used to train the block-based multi-scale convolutional neural network.
[0018] Preferably, performing sample distribution correction on the training set includes:
[0019] Dividing the training set into a plurality of training subsets according to categories, and counting the number of video sequences in each of the training subsets to obtain the maximum number of video sequences;
[0020] Each of the training subsets is traversed, and if the number of video sequences in the ith training subset is less than half of the maximum number of video sequences, the ith training subset is expanded, and the number of video sequences in the ith training subset after expansion is greater than or equal to half of the maximum number of video sequences and less than or equal to the maximum number of video sequences.
[0021] Preferably, using the sample set to train the block-based multi-scale convolutional neural network includes:
[0022] The implicit semantic data enhancement loss function is used for training, and the implicit semantic data enhancement loss function is calculated as follows:
[0023]
[0024] in, is the total number of samples in the training set, is the total number of categories in the training set, is the category label, is a positive coefficient, is the weight difference, is the bias difference, is the deep feature vector.
[0025] Preferably, the optical flow feature extraction module based on the block multi-scale convolutional neural network generates a four-dimensional optical flow feature vector according to the video to be tested, including:
[0026] Calculating an optical flow field according to a starting frame of the sample to be tested and a vertex frame of the sample to be tested;
[0027] Processing the optical flow field in a horizontal direction to obtain a horizontal component, and processing the optical flow field in a vertical direction to obtain a vertical component;
[0028] calculating optical strain based on the horizontal component and the vertical component;
[0029] The optical flow field, the horizontal component, the vertical component and the optical strain constitute the four-dimensional optical flow feature vector.
[0030] Preferably, the optical strain is calculated according to the horizontal component and the vertical component in the following manner:
[0031]
[0032] in, is the optical strain, is the horizontal component, is the vertical component, and is the space coordinate.
[0033] Preferably, the block multi-scale convolution module based on the block multi-scale convolutional neural network generates a recognition result according to the four-dimensional optical flow feature vector, including:
[0034] The four-dimensional optical flow feature vector includes an optical flow field, a horizontal component, a vertical component and an optical strain, and the optical flow field, the horizontal component, the vertical component and the optical strain are all images;
[0035] The block multi-scale convolution module is set corresponding to the image, and the block multi-scale convolution module processes the image to obtain a merged feature map;
[0036] The four merged feature maps are concatenated to obtain a total feature map;
[0037] Performing a 1×1 convolution operation on the total feature map to obtain a reduced-dimensional feature map;
[0038] Expanding the dimension reduction feature map to obtain a first deep feature;
[0039] Processing the first deep feature through two fully connected layers in sequence to obtain a third deep feature;
[0040] The recognition result is calculated according to the third deep feature.
[0041] Preferably, the block multi-scale convolution module processes the image to obtain a merged feature map, including:
[0042] The image is input into the block multi-scale convolution module, and the block multi-scale convolution module divides the image into × blocks arranged in an array, is a positive integer, is a positive integer;
[0043] Performing a convolution operation on each of the blocks to obtain a single-block feature map, including: performing a 7×7 convolution on the block in the i-th row and j-th column and then performing a maximum pooling operation to obtain a first convolution feature map; performing a 5×5 convolution on the block in the i-th row and j-th column and then performing a maximum pooling operation to obtain a second convolution feature map; performing a 3×3 convolution on the block in the i-th row and j-th column and then performing a maximum pooling operation to obtain a third convolution feature map; splicing the first convolution feature map, the second convolution feature map, and the third convolution feature map to obtain a single-block feature map corresponding to the block in the i-th row and j-th column;
[0044] Will × The single-block feature maps are spliced to obtain the merged feature map.
[0045] Compared with the prior art, the present invention has the following advantages:
[0046] 1. The present invention provides a micro-expression recognition method based on a block multi-scale convolutional neural network. The optical flow feature extraction module extracts the optical flow image between the starting frame and the vertex frame in the micro-expression video sequence through the robust TV-L1 optical flow estimation algorithm, which can more accurately capture and enhance the dynamic characteristics of micro-expressions and provide a rich information source for the recognition process; the block multi-scale convolution module decomposes the input data into smaller data blocks, which not only improves the model's ability to process complex data, but also enhances its sensitivity to subtle facial changes, thereby improving the accuracy of micro-expression recognition.
[0047] 2. The present invention provides a micro-expression recognition method based on a block multi-scale convolutional neural network, which effectively improves the generalization ability of the model through the application of sample distribution correction and implicit semantic data enhancement algorithm, alleviates the bias problem caused by the imbalance of categories and limited number of samples in the micro-expression dataset, and makes the model more universal and accurate in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0049] Figure 1 A schematic flow chart of a micro-expression recognition method based on a block-based multi-scale convolutional neural network provided by the present invention.
[0050] Figure 2 A schematic diagram of a process for an optical flow feature extraction module to generate a four-dimensional optical flow feature vector based on a video to be tested.
[0051] Figure 3 A schematic diagram of a process for generating a merged feature map based on a four-dimensional optical flow feature vector by a block-based multi-scale convolution module. DETAILED DESCRIPTION
[0052] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0054] Reference Figure 1 , Figure 1 A flowchart of a micro-expression recognition method based on a block multi-scale convolutional neural network provided by the present invention is provided to illustrate a specific embodiment of the micro-expression recognition method based on a block multi-scale convolutional neural network provided by the present invention, including:
[0055] A data set is provided, the data set includes multiple video sequences, the video sequence includes a start frame and a vertex frame, and the start frame and the vertex frame are determined in the following manner:
[0056] The video sequence includes C frames of face images arranged in time order, the first frame of face image is the starting frame, C is an integer and C≥3;
[0057] Performing region of interest detection on C frames of face images respectively, each frame of face image includes at least two regions of interest;
[0058] It can be understood that, using the face detection technology provided by Dlib, the regions of interest detected include the nose region, the mouth region, the left eyebrow region, and the right eyebrow region;
[0059] Performing C-1 optical flow intensity calculations for optical flow estimation, including: calculating the optical flow intensity of the region of interest corresponding to the first frame face image and the t+1th frame face image during the optical flow intensity calculation for the t-th optical flow estimation, where t is an integer and 1≤t≤C-1;
[0060] It can be understood that the corresponding pixels in the two frames of face images can use the TV-L1 algorithm to calculate the corresponding optical flow; therefore, the optical flow corresponding to all pixels in the region of interest of the two frames of face images can be calculated, and the average optical flow corresponding to all pixels in the region of interest can be calculated to obtain the average optical flow amplitude of the region of interest, and the average optical flow amplitude of the region of interest is Gaussian filtered to reduce noise, so as to obtain the optical flow intensity of the region of interest.
[0061] Perform C-1 times of combined optical flow intensity calculation, including: in the t-th combined optical flow intensity calculation, weighted merging calculation of the optical flow intensities of all the regions of interest obtained in the t-th optical flow estimation optical flow intensity calculation to obtain the t-th combined optical flow intensity;
[0062] Specifically, the t-th combined optical flow intensity calculation can be calculated as follows:
[0063]
[0064] in, is the t-th combined optical flow intensity, is the weight of the optical flow intensity of the ith region of interest in the tth optical flow estimation, is the optical flow intensity of the ith region of interest estimated by the tth optical flow, is the total volume of the region of interest.
[0065] When the t-th combined optical flow intensity is the maximum value among C-1 combined optical flow intensities, the non-initial frame face image corresponding to the optical flow intensity estimated by the t-th optical flow is the vertex frame;
[0066] Select a video sequence from the dataset as a test sample;
[0067] Provides a block-based multi-scale convolutional neural network;
[0068] The sample to be tested is input into the block-based multi-scale convolutional neural network, and the optical flow feature extraction module based on the block-based multi-scale convolutional neural network generates a four-dimensional optical flow feature vector according to the video to be tested; the block-based multi-scale convolution module based on the block-based multi-scale convolutional neural network generates a recognition result according to the four-dimensional optical flow feature vector.
[0069] It can be understood that the present invention provides a micro-expression recognition method based on a block multi-scale convolutional neural network. The optical flow feature extraction module extracts the optical flow image between the start frame and the vertex frame in the micro-expression video sequence through the robust TV-L1 optical flow estimation algorithm, which can more accurately capture and enhance the dynamic characteristics of micro-expressions and provide a rich source of information for the recognition process; the block multi-scale convolution module decomposes the input data into smaller data blocks, which not only improves the model's ability to process complex data, but also enhances its sensitivity to subtle facial changes, thereby improving the accuracy of micro-expression recognition.
[0070] In some optional embodiments, after providing a block-based multi-scale convolutional neural network, the method further includes:
[0071] A training set is divided from the data set, and the training set does not contain the samples to be tested;
[0072] Correct the sample distribution of the training set to obtain a sample set;
[0073] The sample set is used to train the block-based multi-scale convolutional neural network.
[0074] In some optional embodiments, performing sample distribution correction on the training set includes:
[0075] The training set is divided into several training subsets according to the categories, and the number of video sequences in each training subset is counted to obtain the maximum number of video sequences. , is a positive integer;
[0076] Traverse each training subset, if the number of video sequences in the i-th training subset is less than the maximum value of the video sequence Half of the value is rounded down, and the i-th training subset is expanded. The number of video sequences in the i-th training subset after expansion is greater than or equal to the maximum number of video sequences. Half of the maximum number of video sequences and less than or equal to the maximum number of video sequences. Ideally, it should be expanded to .
[0077] It is understandable that there is a significant imbalance in the number of video sequences between different categories in the facial micro-expression training set. To address the class imbalance problem, the present invention uses a sample distribution correction technique that integrates data augmentation techniques such as random flipping and cropping of all image frames of a single video sequence. The combined effect of these methods aims to increase the number of samples in smaller categories to a more balanced level, thereby enhancing the generalization ability of the model.
[0078] Specifically, a transformation function is defined to represent the expansion operation of the training subset. The expansion operation can also be called data augmentation operation, such as random flipping and cropping. The transformation function is calculated as follows:
[0079]
[0080] in, is the original video sequence image frame, is the transformed video sequence image frame.
[0081] The training subset includes at least one video sequence, which includes multiple sequentially arranged image frames. The first image frame is called the starting frame. The vertex frame hides the most comprehensive micro-expression information and has been pre-positioned. If the number of video sequences in the i-th training subset is the largest, the number of video sequences in the i-th training subset is taken as the maximum number of video sequences and expressed as follows:
[0082]
[0083] in, is the number of video sequences in the i-th training subset, The maximum number of video sequences.
[0084] When performing data augmentation operations, it is necessary to consider the balance between the number of video sequences in the training subset and the category distribution. The goal is to enhance model performance by increasing the number of video sequences in each category while avoiding introducing too much noise. Sample distribution correction technology is to apply various data augmentation measures to the number of video sequences less than 0.5. The number of video sequences in the training subset after enhancement is achieved Satisfy 0.5 ≤ ≤ .
[0085] In some optional embodiments, continue to refer to Figure 1 , the sample set is used to train the block-based multi-scale convolutional neural network, including:
[0086] The implicit semantic data enhancement loss function is used for training. The implicit semantic data enhancement loss function is calculated as follows:
[0087]
[0088] in, is the total number of samples in the training set, is the total number of categories in the training set, is the category label, is a positive coefficient, is the weight difference, is the bias difference, is the deep feature vector.
[0089] It should be noted that the video sequence is a sample, each sample has a category label, and the model learns and extracts the deep features of the input sample through its deep network structure. These features are Dimensional vector In the form of is a vector No. components. Positive coefficients controls the strength of semantic data augmentation. In this context, , ,in and Represent the weight matrix and bias in the final fully connected layer respectively. For the category label The class-conditional covariance matrix estimated from the sample .
[0090] It is understandable that for the block-based multi-scale convolutional neural network provided in this embodiment, the implicit semantic data enhancement loss function (ISDA loss) is used for model training. This loss function can transform the training samples along various semantic directions in the feature space of the deep network, but it should be emphasized that ISDA does not physically generate additional samples. The implicit semantic data enhancement loss function is expressed as L ∞ , it can be seamlessly integrated into any deep network by leveraging the cross-entropy loss function, adding almost no additional computational cost to the standard training process.
[0091] In some optional embodiments, referring to Figure 2 , Figure 2 A schematic diagram of a process for an optical flow feature extraction module to generate a four-dimensional optical flow feature vector according to a video to be tested. The optical flow feature extraction module based on a block multi-scale convolutional neural network generates a four-dimensional optical flow feature vector according to a video to be tested, including:
[0092] Calculate the optical flow field according to the starting frame of the sample to be tested and the vertex frame of the sample to be tested;
[0093] The optical flow field is processed horizontally to obtain the horizontal component, and the optical flow field is processed vertically to obtain the vertical component;
[0094] Calculate the optical strain based on the horizontal and vertical components;
[0095] The optical flow field, horizontal component, vertical component and optical strain constitute the four-dimensional optical flow feature vector.
[0096] It is understandable that the start frame and vertex frame are introduced to describe the micro-expression video sequence. The vertex frame hides the most comprehensive micro-expression information, and the micro-expression dataset has located the precise position of the vertex frame in the micro-expression video sequence. The located vertex frame can effectively represent the spatiotemporal characteristics of each micro-expression video sequence while avoiding the generation of redundant frames. By extracting optical flow features between the start frame and the vertex frame, the facial texture and structure information are ignored, and the discriminative feature information of facial micro-expressions is enhanced, so that the subsequent network can focus more on the changes in facial micro-expressions.
[0097] In the facial micro-expression dataset In, through An index can locate a Micro-expression samples of frame images, dataset It can be expressed as:
[0098]
[0099] in, Micro-expression dataset The number of samples in It represents the The total number of image frames in the micro-expression samples. Each video sequence contains a unique vertex frame, whose position is between any frame index from the initial start frame to the end frame. Specifically, the frames corresponding to the start, vertex, and end are marked as , and , the vertex frame can be expressed as:
[0100]
[0101] Optical flow is a widely recognized motion estimation method based on the assumption of constant brightness. The purpose of using optical flow is to identify subtle facial movements by extracting optical flow features between the start frame and the vertex frame. Although optical flow is very sensitive to changes in lighting conditions, the collection of micro-expression data strictly follows controlled lighting conditions. For the t The strength of the frame, is the intensity of the subsequent frame. Under the constraint of constant brightness, the intensity of two consecutive frames can be expressed as:
[0102]
[0103] in, , .
[0104] Assuming that the time interval between the start frame and the vertex frame is small enough, specifically, less than 0.2 seconds, we can get:
[0105]
[0106] in, is the horizontal component of the optical flow field, is the vertical component of the optical flow field.
[0107] Finally, the optical flow field obtained by calculating the start frame and the vertex frame as a representative of the entire video can be expressed as:
[0108]
[0109] in, is the width of the image frame, The height of the image frame.
[0110] Each micro-expression sample consisting of a start frame and a vertex frame will generate a unique four-dimensional optical flow feature vector through the optical flow estimation method, which is calculated as follows:
[0111]
[0112] in, The optical flow field extracted by the TV-L1 optical flow estimation method, the extracted optical flow features are visualized as images and used as input to the subsequent stages.
[0113] In some optional embodiments, continue to refer to Figure 2 , the optical strain is calculated based on the horizontal and vertical components as follows:
[0114]
[0115] It can be understood that from the above formula, the magnitude of the optical strain can be calculated as follows:
[0116]
[0117] in, is the optical strain, is the horizontal component, is the vertical component, and is the space coordinate.
[0118] In some optional embodiments, referring to Figure 3 , Figure 3 A schematic diagram of a process for generating a merged feature map based on a block multi-scale convolutional module according to a four-dimensional optical flow feature vector. The block multi-scale convolutional module based on a block multi-scale convolutional neural network generates a recognition result based on a four-dimensional optical flow feature vector, including:
[0119] The four-dimensional optical flow feature vector includes the optical flow field, the horizontal component, the vertical component and the optical strain, and the optical flow field, the horizontal component, the vertical component and the optical strain are all images;
[0120] The block multi-scale convolution module is set corresponding to the image, and the block multi-scale convolution module processes the image to obtain a merged feature map;
[0121] The four merged feature maps are concatenated to obtain the total feature map;
[0122] Perform 1×1 convolution operation on the total feature map to obtain the reduced dimension feature map;
[0123] Expand the dimension-reduced feature map to obtain the first deep feature;
[0124] The first deep feature is processed by two fully connected layers in sequence to obtain the third deep feature;
[0125] The recognition result is calculated based on the third deep feature.
[0126] It can be understood that the input of the Chunked Multiscale Convolutional Module (CMCM) is an image. The Chunked Multiscale Convolutional Module processes the image to obtain the corresponding merged feature map. The four merged feature maps are concatenated to obtain the total feature map, which is calculated as follows:
[0127]
[0128] in, is the total feature map, , , and Represent the merged feature maps corresponding to the optical flow field, horizontal component, vertical component and optical strain respectively.
[0129] Not all features in the total feature map are useful. In order to refine and retain relevant information, the dimensionality is reduced through a 1×1 convolution operation to obtain a more refined reduced-dimensional feature map, which is calculated as follows:
[0130]
[0131] in, is the dimension reduction feature map, It is a 1×1 convolution operation.
[0132] Expand the dimension reduction feature map Get the first deep feature , the third deep feature From the first deep features through two fully connected layers Each fully connected layer is followed by a dropout layer ( P = 0.5). Introducing the dropout layer is very beneficial, enabling the neural network to obtain a more robust feature representation and enhance the generalization ability of the model. The final classification decision is made by the third deep feature Determine, and calculate as follows:
[0133]
[0134] in, for The activation function, and denote weight and bias respectively.
[0135] This process involves the third deep feature The weighted sum of , plus the bias term, and then through The activation function performs nonlinear transformation to obtain the final processing result. The introduction of nonlinear factors enhances the model’s expressiveness, helps the model capture more complex data features, and improves recognition accuracy.
[0136] In some optional embodiments, continue to refer to Figure 3 , the block multi-scale convolution module processes the image to obtain a merged feature map, including:
[0137] The image is input into the block multi-scale convolution module, which divides the image into × blocks arranged in an array, is a positive integer, is a positive integer;
[0138] Perform a convolution operation on each block to obtain a single-block feature map, including: performing a 7×7 convolution on the block in the i-th row and j-th column and then performing a maximum pooling operation to obtain the first convolution feature map; performing a 5×5 convolution on the block in the i-th row and j-th column and then performing a maximum pooling operation to obtain the second convolution feature map; performing a 3×3 convolution on the block in the i-th row and j-th column and then performing a maximum pooling operation to obtain the third convolution feature map; splicing the first convolution feature map, the second convolution feature map and the third convolution feature map to obtain a single-block feature map corresponding to the block in the i-th row and j-th column;
[0139] Will × The single-block feature maps are spliced to obtain the merged feature map.
[0140] Understandably, , , is the height of the block, is the width of the block, is the height of the image frame, The width of the image frame.
[0141] By dividing the original input optical flow image into blocks, it is subdivided into small units that are easier to process and analyze, making it easier to grasp the image features. This division is not only conducive to the subsequent feature extraction work, but also provides convenience for in-depth understanding of the image content, improving processing efficiency and accuracy. Each input is converted into a set of multiple small image blocks, and the blocks can be represented as follows:
[0142]
[0143] in, is the input image, is the block at the i-th row and j-th column. In order to keep the size of the feature map consistent when using different convolution kernels, corresponding padding operations are used before each different convolution.
[0144] Each block performs a single convolution with multiple filters, followed by a max pooling operation, calculated as follows:
[0145]
[0146] in, For blocks passing through s Sub-convolution feature map, For the s convolution operation, It is the maximum pooling operation.
[0147] The information of each block is extracted through convolution operation, and the key features are further streamlined and strengthened through maximum pooling, effectively retaining the most important information for subsequent processing. Through such steps, the details and features in the image are accurately captured, providing high-quality data input for the training of deep learning models.
[0148] For each block, the feature maps obtained by different convolution kernels are concatenated and calculated as follows:
[0149]
[0150] in, is the single block feature map corresponding to the block in the i-th row and j-th column, is the first convolution feature map of the block in row i and column j, is the second convolution feature map of the block in the i-th row and j-th column, It is the third convolution feature map of the block in the i-th row and j-th column.
[0151] Will × The single-block feature maps are spliced to obtain the merged feature map, which is calculated as follows:
[0152]
[0153] in, is the merged feature map corresponding to the input image.
[0154] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0155] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0156] 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 replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A micro-expression recognition method based on block multi-scale convolutional neural network, characterized in that: include: A data set is provided, including a plurality of video sequences, wherein the video sequence includes a start frame and a vertex frame, and the start frame and the vertex frame are determined in the following manner: The video sequence includes C frames of face images arranged in time order, the first frame of face image is the starting frame, C is an integer and C≥3; Performing region of interest detection on the face images of C frames respectively, wherein each face image of each frame includes at least two regions of interest; Performing optical flow intensity calculation for C-1 optical flow estimations, comprising: calculating the optical flow intensity of the region of interest corresponding to the first frame of face image and the t+1th frame of face image during the optical flow intensity calculation for the t-th optical flow estimation, where t is an integer and 1≤t≤C-1; Performing C-1 times of combined optical flow intensity calculation, including: in the t-th combined optical flow intensity calculation, performing weighted merging calculation on the optical flow intensities of all the regions of interest obtained in the optical flow intensity calculation of the t-th optical flow estimation, to obtain the t-th combined optical flow intensity; the t-th combined optical flow intensity calculation is calculated in the following manner: in, is the t-th combined optical flow intensity, is the weight of the optical flow intensity of the ith region of interest in the tth optical flow estimation, is the optical flow intensity of the i-th region of interest estimated by the t-th optical flow, is the total volume of the region of interest; When the t-th combined optical flow intensity is the maximum value among the C-1 combined optical flow intensities, the face image of the non-starting frame corresponding to the optical flow intensity of the t-th optical flow estimation is the vertex frame; Selecting one of the video sequences from the data set as a sample to be tested; Provides a block-based multi-scale convolutional neural network; The sample to be tested is input into the block-based multi-scale convolutional neural network, and the optical flow feature extraction module based on the block-based multi-scale convolutional neural network generates a four-dimensional optical flow feature vector according to the sample to be tested; the block-based multi-scale convolution module based on the block-based multi-scale convolutional neural network generates a recognition result according to the four-dimensional optical flow feature vector.
2. The micro-expression recognition method based on block multi-scale convolutional neural network according to claim 1, characterized in that: After providing a block-based multi-scale convolutional neural network, it also includes: Dividing a training set from the data set, wherein the training set does not include the sample to be tested; Performing sample distribution correction on the training set to obtain a sample set; The sample set is used to train the block-based multi-scale convolutional neural network.
3. The micro-expression recognition method based on block multi-scale convolutional neural network according to claim 2, characterized in that: The sample distribution of the training set is corrected, including: Dividing the training set into a plurality of training subsets according to categories, and counting the number of video sequences in each of the training subsets to obtain the maximum number of video sequences; Each of the training subsets is traversed, and if the number of video sequences in the ith training subset is less than half of the maximum number of video sequences, the ith training subset is expanded, and the number of video sequences in the ith training subset after expansion is greater than or equal to half of the maximum number of video sequences and less than or equal to the maximum number of video sequences.
4. The micro-expression recognition method based on block multi-scale convolutional neural network according to claim 2, characterized in that: The sample set is used to train the block-based multi-scale convolutional neural network, including: The implicit semantic data enhancement loss function is used for training, and the implicit semantic data enhancement loss function is calculated as follows: in, is the total number of samples in the training set, is the total number of categories in the training set, is the category label, is a positive coefficient, is the weight difference, is the bias difference, is the deep feature vector.
5. The micro-expression recognition method based on block multi-scale convolutional neural network according to claim 1, characterized in that: The optical flow feature extraction module based on the block multi-scale convolutional neural network generates a four-dimensional optical flow feature vector according to the sample to be tested, including: Calculating an optical flow field according to a starting frame of the sample to be tested and a vertex frame of the sample to be tested; Processing the optical flow field in a horizontal direction to obtain a horizontal component, and processing the optical flow field in a vertical direction to obtain a vertical component; calculating optical strain based on the horizontal component and the vertical component; The optical flow field, the horizontal component, the vertical component and the optical strain constitute the four-dimensional optical flow feature vector.
6. The micro-expression recognition method based on block multi-scale convolutional neural network according to claim 5, characterized in that: The optical strain is calculated based on the horizontal component and the vertical component in the following manner: in, is the optical strain, is the horizontal component, is the vertical component, and is the space coordinate.
7. The micro-expression recognition method based on block multi-scale convolutional neural network according to claim 1, characterized in that: The block multi-scale convolution module based on the block multi-scale convolutional neural network generates a recognition result according to the four-dimensional optical flow feature vector, including: The four-dimensional optical flow feature vector includes an optical flow field, a horizontal component, a vertical component and an optical strain, and the optical flow field, the horizontal component, the vertical component and the optical strain are all images; The block multi-scale convolution module is set corresponding to the image, and the block multi-scale convolution module processes the image to obtain a merged feature map; The four merged feature maps are concatenated to obtain a total feature map; Performing a 1×1 convolution operation on the total feature map to obtain a reduced-dimensional feature map; Expanding the dimension reduction feature map to obtain a first deep feature; Processing the first deep feature through two fully connected layers in sequence to obtain a third deep feature; The recognition result is calculated according to the third deep feature.
8. The micro-expression recognition method based on block multi-scale convolutional neural network according to claim 7, characterized in that: The block multi-scale convolution module processes the image to obtain a merged feature map, including: The image is input into the block multi-scale convolution module, and the block multi-scale convolution module divides the image into × blocks arranged in an array, is a positive integer, is a positive integer; Performing a convolution operation on each of the blocks to obtain a single-block feature map, including: performing a 7×7 convolution on the block in the i-th row and j-th column and then performing a maximum pooling operation to obtain a first convolution feature map; performing a 5×5 convolution on the block in the i-th row and j-th column and then performing a maximum pooling operation to obtain a second convolution feature map; performing a 3×3 convolution on the block in the i-th row and j-th column and then performing a maximum pooling operation to obtain a third convolution feature map; splicing the first convolution feature map, the second convolution feature map, and the third convolution feature map to obtain a single-block feature map corresponding to the block in the i-th row and j-th column; Will × The single-block feature maps are spliced to obtain the merged feature map.
