WO2021031817A1 - 情绪识别方法、装置、计算机装置及存储介质 - Google Patents

情绪识别方法、装置、计算机装置及存储介质 Download PDF

Info

Publication number
WO2021031817A1
WO2021031817A1 PCT/CN2020/105630 CN2020105630W WO2021031817A1 WO 2021031817 A1 WO2021031817 A1 WO 2021031817A1 CN 2020105630 W CN2020105630 W CN 2020105630W WO 2021031817 A1 WO2021031817 A1 WO 2021031817A1
Authority
WO
WIPO (PCT)
Prior art keywords
training sample
user
features
training
sample set
Prior art date
Application number
PCT/CN2020/105630
Other languages
English (en)
French (fr)
Inventor
刘利
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2021031817A1 publication Critical patent/WO2021031817A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/174Facial expression recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/20Movements or behaviour, e.g. gesture recognition

Definitions

  • This application relates to the field of artificial intelligence technology, in particular to an emotion recognition method, device, computer device, and storage medium.
  • emotion recognition has become one of the most active research topics in the field of artificial intelligence. Its purpose is to detect, track and identify human image sequences and explain human behavior more scientifically. Emotion recognition can be applied to all aspects of life: game manufacturers can intelligently analyze the player’s emotions, interact with players in a targeted manner according to different expressions, and improve the game experience; camera manufacturers can use this technology to capture human expressions, such as when a photo is needed When you are smiling or angry, you can capture the facial expressions of the person being photographed and quickly complete the photographing work; the government or sociologists can install cameras in public places to analyze the facial expressions and body movements of the entire social group to understand people's life and work pressure; Commercial buildings can conduct relevant market research on products based on the actions and facial expression videos of customers when shopping for products.
  • the first aspect of the present application provides an emotion recognition method, wherein the method includes:
  • each training sample in the training sample set is a time series of the acceleration of the user walking, each training sample has a label, and the label marks the emotion category corresponding to the training sample;
  • the second aspect of the present application provides a computer device, wherein the computer device includes a processor configured to execute computer-readable instructions stored in a memory to implement the following steps:
  • each training sample in the training sample set is a time series of the acceleration of the user walking, each training sample has a label, and the label marks the emotion category corresponding to the training sample;
  • a third aspect of the present application provides a storage medium with computer-readable instructions stored on the storage medium, where the computer-readable instructions implement the following steps when executed by a processor:
  • each training sample in the training sample set is a time series of the acceleration of the user walking, each training sample has a label, and the label marks the emotion category corresponding to the training sample;
  • a fourth aspect of the present application provides an emotion recognition device, wherein the device includes:
  • An obtaining module configured to obtain a training sample set, each training sample in the training sample set is a time series of the acceleration of a user's walking, each training sample has a label, and the label marks the emotion category corresponding to the training sample;
  • An extraction module for extracting multiple features for each training sample in the training sample set
  • a construction module for constructing multiple classification regression trees according to multiple characteristics of each training sample in the training sample set
  • the recognition module is configured to input multiple characteristics of the user to be recognized into the random forest, and determine the emotion category of the user to be recognized according to the output of the random forest, wherein the multiple characteristics of the user to be recognized are based on the Obtained by identifying the time series of the acceleration of the user walking.
  • a user’s walking acceleration time series with emotion category labels are used as training samples, a random forest is generated according to each training sample, and the acceleration time series of the user to be identified are identified using the random forest.
  • the application realizes the recognition of the user's emotions based on the acceleration data during the user's walking process.
  • Fig. 1 is a flowchart of an emotion recognition method provided by an embodiment of the present application.
  • Fig. 2 is a structural diagram of an emotion recognition device provided by an embodiment of the present application.
  • Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present application.
  • the emotion recognition method of the present application is applied in one or more computer devices.
  • the computer device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions.
  • Its hardware includes, but is not limited to, a microprocessor and an application specific integrated circuit (ASIC) , Field-Programmable Gate Array (FPGA), Digital Processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • ASIC application specific integrated circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Processor
  • embedded equipment etc.
  • the computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the computer device can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device.
  • FIG. 1 is a flowchart of the emotion recognition method provided by Embodiment 1 of the present application.
  • the emotion recognition method is applied to a computer device.
  • the emotion recognition method of the present application involves machine learning, which is used to recognize the user's emotion according to the acceleration data during the walking process of the user.
  • the emotion recognition method includes:
  • each training sample in the training sample set is a time series of a user's walking acceleration, and each training sample has a label, and the label marks the emotion category corresponding to the training sample.
  • the acceleration data during the walking process of the user can be collected through acceleration sensors on the wrist and/or ankle of the user within a preset time, and the acceleration time series can be obtained according to the acceleration data.
  • Each acceleration time series may include a preset number of acceleration data, for example, 100 acceleration data.
  • each acceleration time series may include acceleration data within a preset time (for example, 60 seconds).
  • the acceleration data may be acceleration data in the X-axis, Y-axis or Z-axis directions, so as to obtain the acceleration time series in the X-axis, Y-axis or Z-axis directions.
  • the acceleration sensor on the user's wrist collects a preset number (for example, 100) acceleration data in the X-axis direction, and the collected acceleration data in the X-axis direction composes an acceleration time series to obtain A training sample.
  • the acceleration sensor on the user’s ankle during the user’s walk collects acceleration data in the X-axis direction for a preset time interval (for example, 60 seconds), and composes the collected acceleration data in the X-axis direction during the preset time period An acceleration time series, get a training sample.
  • Each training sample corresponds to a label, which is used to identify the emotion category.
  • the emotion category may include positive emotions (excited, happy), neutral emotions (calm) or negative emotions (sadness, sadness).
  • the label may be a number, such as 1, 2, 3. For example, if the user’s emotion is positive, the corresponding label is 3; if the user’s emotion is neutral, the corresponding label is 2; if the user’s emotion is negative, the corresponding label is 1.
  • the acceleration data of the user's walking is different.
  • the user's acceleration data can be collected when the user has different emotions, and training samples with different labels can be obtained.
  • a plurality of training samples obtained by collecting acceleration data of a user's walking constitute the training sample set.
  • the training sample set may include training samples of multiple users, that is, a time series of accelerations of multiple users walking.
  • the training sample set may include a training sample of a user, that is, a time series of acceleration of a user's walking.
  • Extracting multiple features for each training sample in the training sample set is extracting multiple identical features for each training sample.
  • the multiple features may include the standard deviation, average value, peak value, skewness coefficient, FFT coefficient, power spectral density average, power spectral density standard deviation, and coordinate axis coefficient of the acceleration time series.
  • the skewness coefficient of the acceleration time series is a measure of the asymmetry of the acceleration time series distribution. If a training sample is symmetric, the skewness coefficient is equal to 0; if a training sample is left-biased, the skewness coefficient is less than 0; if a training sample is right-biased, then the skewness coefficient Greater than 0.
  • the FFT coefficients of the acceleration time series are coefficients obtained by performing FFT (Fast Fourier Transform, Fast Fourier Transform) transformation on the acceleration time series, and the FFT coefficients from the 2nd dimension to the 32nd dimension can be taken.
  • FFT Fast Fourier Transform, Fast Fourier Transform
  • the training sample is an acceleration time series in the X-axis direction
  • the corresponding coordinate axis coefficients are:
  • cov(Y,Z) is the covariance of the acceleration time series in the Y-axis direction of the training sample and the acceleration time series in the Z-axis direction of the training sample
  • D(Y) is the acceleration in the Y-axis direction of the training sample
  • the variance of the time series, D(Z) is the variance of the acceleration time series in the Z-axis direction of the training sample
  • the coordinate axis coefficient is ⁇ XZ , and the calculation formula of ⁇ XZ can refer to the above ⁇ YZ ;
  • the coordinate axis coefficient is ⁇ XY
  • the calculation formula of ⁇ XY can refer to the above ⁇ YZ .
  • the multiple features of each training sample in the training sample set may be normalized to obtain multiple normalized features of each training sample.
  • the normalizing the multiple features of each training sample in the training sample set may include:
  • B ij is the normalized value of the j-th feature of the i-th training sample
  • b ij is the value before normalization of the j-th feature of the i-th training sample.
  • i 1, 2,..., N
  • N is the number of training samples in the training sample set.
  • j 1, 2, ..., M; M is the number of features of each training sample.
  • the j-th feature of the i-th training sample refers to the j-th feature among the multiple features of the i-th training sample.
  • the method further includes:
  • Preprocessing is performed on each training sample in the training sample set.
  • the preprocessing of each training sample in each training sample set includes:
  • performing noise reduction on the training samples may include: performing a moving average noise reduction on the training samples.
  • the training samples can be denoised by moving average according to the following formula:
  • output[i] is the output corresponding to the i-th acceleration data in the training sample (ie acceleration time series)
  • w is a constant and the value is 3 or 5
  • input[i+j] is the output in the training sample The i+jth acceleration data.
  • wavelet noise reduction can be performed on the training samples.
  • the filling in the missing values in the training sample may include: taking several pieces of acceleration data before and after the missing value in the training sample (for example, the first 5 and last 5 acceleration data of the missing value) , Filling the missing value with an average value of several acceleration data before and after the missing value.
  • the K-nearest neighbor algorithm can be used to determine the K training samples closest to the training sample with missing values (for example, the K training samples closest to the training sample with missing values are determined according to Euclidean distance), and the K training samples The weighted average of the data is used to estimate the missing value of the training sample.
  • other methods can be used to fill in the missing values.
  • the missing value can be filled by regression fitting method or interpolation method.
  • the method of correcting the outliers in the training sample can be the same as the method of filling in missing values.
  • several acceleration data before and after the abnormal value in the training sample can be taken (for example, the first 5 acceleration data and the last 5 acceleration data of the abnormal value), and the average value of several acceleration data before and after the abnormal value can be used for correction.
  • the abnormal value can be used to determine the K training samples closest to the training sample with outliers (for example, the K training samples closest to the training sample with outliers are determined according to Euclidean distance), and the K training samples The weighted average of the data is used to estimate the outliers of the training sample.
  • other methods can be used to correct the abnormal value.
  • the abnormal value can be corrected by regression fitting method or interpolation method.
  • the constructing multiple classification regression trees according to multiple characteristics of each training sample of the training sample set may include:
  • the optimal segmentation feature and segmentation point can be determined according to the following objective function:
  • the above formula means to traverse all the feature values (ie, the segmentation point s) of the K features (ie segmentation feature j) of the sample to be classified, and find the optimal segmentation feature and segmentation point according to the minimum square error criterion.
  • x i is the i-th training sample in the sample to be classified
  • yi is the label of x i.
  • x (j) ⁇ s ⁇ , R 2 (j,s) ⁇ x
  • R 1 (j,s) is the set of samples to be classified with the feature value of the jth feature less than or equal to s
  • R 2 (j,s) ⁇ x
  • N 1 is the number of samples to be classified in the subset R 1
  • N 2 is the number of samples to be classified in the subset R 2 .
  • the meeting the preset stop condition may include:
  • the preset stop condition is met
  • the preset stopping condition is satisfied.
  • a classification regression tree is obtained.
  • the root node of the classification regression tree corresponds to the initial sample to be classified, and each leaf node of the classification regression tree corresponds to a subset that is no longer divided.
  • the output of the classification regression tree is the output corresponding to the leaf node, that is, the average value of the label of the sample to be classified into the leaf node.
  • Multiple classification regression trees are formed into the random forest, and different classification regression trees are independent of each other.
  • the input of the random forest is the input of each classification regression tree in the random forest; the output of the random forest is the average value of the outputs of all classification regression trees in the random forest.
  • the generating a random forest according to the multiple classification regression trees includes:
  • the random forest is generated according to the multiple classification regression trees after the pruning process.
  • Pruning the multiple classification regression trees includes:
  • T t represents the subtree with t as the root node
  • C(t) is the prediction error obtained according to the sample to be classified into the internal node t
  • C(Tt) is the sample to be classified according to the subtree T t
  • the obtained prediction error, C(t) is the prediction error obtained according to the sample to be classified into the t node
  • is the number of leaf nodes of the subtree T t;
  • the cross-validation method is used to select the optimal subtree T ⁇ in the subtree sequence T 0 , T 1 , ..., T n .
  • each classification regression tree in the random forest takes multiple characteristics of the user to be identified as input, and classifies the user to be identified according to the multiple characteristics of the user to be identified to obtain the classification regression tree Calculate the average value of the output of all classification regression trees in the random forest to obtain the output of the random forest; determine the emotion category of the user to be identified according to the output of the random forest.
  • the emotion category corresponding to the label with the smallest output difference of the random forest may be selected as the emotion category of the user to be identified.
  • the user to be identified can be included in the user corresponding to the training sample.
  • the training sample set includes training samples of user A, and the user to be identified is user A.
  • the training sample set includes training samples of user A, user B, user C, and user D, and the user to be identified is user A.
  • the user to be identified may not be included in the user corresponding to the training sample.
  • the training sample set includes training samples of user A, user B, user C, and user D, and the user to be identified is user E.
  • the emotion recognition method of the first embodiment takes the acceleration time series of the user walking with emotion category tags as training samples, generates a random forest according to each training sample, and uses the random forest to recognize the acceleration time series of the user to be identified.
  • the first embodiment realizes the recognition of the user's emotion according to the acceleration data of the user during walking.
  • FIG. 2 is a structural diagram of an emotion recognition device provided in Embodiment 2 of the present application.
  • the emotion recognition device 20 is applied to a computer device.
  • the emotion recognition device 20 recognizes the emotion of the user according to the acceleration data during the walking process of the user.
  • the emotion recognition device 20 may include an acquisition module 201, an extraction module 202, a construction module 203, a generation module 204, and an identification module 205.
  • the obtaining module 201 is configured to obtain a training sample set.
  • Each training sample in the training sample set is a time series of the acceleration of a user's walking.
  • Each training sample has a label, and the label marks the emotion category corresponding to the training sample.
  • the acceleration data during the walking process of the user can be collected through acceleration sensors on the wrist and/or ankle of the user within a preset time, and the acceleration time series can be obtained according to the acceleration data.
  • Each acceleration time series may include a preset number of acceleration data, for example, 100 acceleration data.
  • each acceleration time series may include acceleration data within a preset time (for example, 60 seconds).
  • the acceleration data may be acceleration data in the X-axis, Y-axis or Z-axis directions, so as to obtain the acceleration time series in the X-axis, Y-axis or Z-axis directions.
  • the acceleration sensor on the user's wrist collects a preset number (for example, 100) acceleration data in the X-axis direction, and the collected acceleration data in the X-axis direction composes an acceleration time series to obtain A training sample.
  • the acceleration sensor on the user’s ankle during the user’s walk collects acceleration data in the X-axis direction for a preset time interval (for example, 60 seconds), and composes the collected acceleration data in the X-axis direction during the preset time period An acceleration time series, get a training sample.
  • Each training sample corresponds to a label, which is used to identify the emotion category.
  • the emotion category may include positive emotions (excited, happy), neutral emotions (calm) or negative emotions (sadness, sadness).
  • the label may be a number, such as 1, 2, 3. For example, if the user’s emotion is positive, the corresponding label is 3; if the user’s emotion is neutral, the corresponding label is 2; if the user’s emotion is negative, the corresponding label is 1.
  • the acceleration data of the user's walking is different.
  • the user's acceleration data can be collected when the user has different emotions, and training samples with different labels can be obtained.
  • a plurality of training samples obtained by collecting acceleration data of a user's walking constitute the training sample set.
  • the training sample set may include training samples of multiple users, that is, a time series of accelerations of multiple users walking.
  • the training sample set may include a training sample of a user, that is, a time series of acceleration of a user's walking.
  • the extraction module 202 is configured to extract multiple features for each training sample in the training sample set.
  • Extracting multiple features for each training sample in the training sample set is extracting multiple identical features for each training sample.
  • the multiple features may include the standard deviation, average value, peak value, skewness coefficient, FFT coefficient, power spectral density average, power spectral density standard deviation, and coordinate axis coefficient of the acceleration time series.
  • the skewness coefficient of the acceleration time series is a measure of the asymmetry of the acceleration time series distribution. If a training sample is symmetric, the skewness coefficient is equal to 0; if a training sample is left-biased, the skewness coefficient is less than 0; if a training sample is right-biased, then the skewness coefficient Greater than 0.
  • the FFT coefficients of the acceleration time series are coefficients obtained by performing FFT (Fast Fourier Transform, Fast Fourier Transform) transformation on the acceleration time series, and can take the FFT coefficients from the 2nd dimension to the 32nd dimension.
  • FFT Fast Fourier Transform, Fast Fourier Transform
  • the training sample is an acceleration time series in the X-axis direction
  • the corresponding coordinate axis coefficients are:
  • cov(Y,Z) is the covariance of the acceleration time series in the Y-axis direction of the training sample and the acceleration time series in the Z-axis direction of the training sample
  • D(Y) is the acceleration in the Y-axis direction of the training sample
  • the variance of the time series, D(Z) is the variance of the acceleration time series in the Z-axis direction of the training sample
  • the coordinate axis coefficient is ⁇ XZ , and the calculation formula of ⁇ XZ can refer to the above ⁇ YZ ;
  • the coordinate axis coefficient is ⁇ XY
  • the calculation formula of ⁇ XY can refer to the above ⁇ YZ .
  • the multiple features of each training sample in the training sample set may be normalized to obtain multiple normalized features of each training sample.
  • the normalizing the multiple features of each training sample in the training sample set may include:
  • B ij is the normalized value of the j-th feature of the i-th training sample
  • b ij is the value before normalization of the j-th feature of the i-th training sample.
  • i 1, 2,..., N
  • N is the number of training samples in the training sample set.
  • j 1, 2, ..., M; M is the number of features of each training sample.
  • the j-th feature of the i-th training sample refers to the j-th feature among the multiple features of the i-th training sample.
  • the method further includes:
  • Preprocessing is performed on each training sample in the training sample set.
  • the preprocessing of each training sample in each training sample set includes:
  • performing noise reduction on the training samples may include: performing a moving average noise reduction on the training samples.
  • the training samples can be denoised by moving average according to the following formula:
  • output[i] is the output corresponding to the i-th acceleration data in the training sample (ie acceleration time series)
  • w is a constant and the value is 3 or 5
  • input[i+j] is the output in the training sample The i+jth acceleration data.
  • wavelet noise reduction can be performed on the training samples.
  • the filling in the missing values in the training sample may include: taking several pieces of acceleration data before and after the missing value in the training sample (for example, the first 5 and last 5 acceleration data of the missing value) , Filling the missing value with an average value of several acceleration data before and after the missing value.
  • the K-nearest neighbor algorithm can be used to determine the K training samples closest to the training sample with missing values (for example, the K training samples closest to the training sample with missing values are determined according to Euclidean distance), and the K training samples The weighted average of the data is used to estimate the missing value of the training sample.
  • other methods can be used to fill in the missing values.
  • the missing value can be filled in by regression fitting method or interpolation method.
  • the method of correcting the outliers in the training sample can be the same as the method of filling in missing values.
  • several acceleration data before and after the abnormal value in the training sample can be taken (for example, the first 5 acceleration data and the last 5 acceleration data of the abnormal value), and the average value of several acceleration data before and after the abnormal value can be used for correction.
  • the abnormal value can be used to determine the K training samples closest to the training sample with outliers (for example, the K training samples closest to the training sample with outliers are determined according to Euclidean distance), and the K training samples The weighted average of the data is used to estimate the outliers of the training sample.
  • other methods can be used to correct the abnormal value.
  • the abnormal value can be corrected by regression fitting method or interpolation method.
  • the construction module 203 is configured to construct multiple classification regression trees according to multiple characteristics of each training sample in the training sample set.
  • the constructing multiple classification regression trees according to multiple characteristics of each training sample of the training sample set may include:
  • the optimal segmentation feature and segmentation point can be determined according to the following objective function:
  • the above formula means to traverse all the feature values (ie, the segmentation point s) of the K features (ie segmentation feature j) of the sample to be classified, and find the optimal segmentation feature and segmentation point according to the minimum square error criterion.
  • x i is the i-th training sample in the sample to be classified
  • yi is the label of x i.
  • x (j) ⁇ s ⁇ , R 2 (j,s) ⁇ x
  • R 1 (j,s) is the set of samples to be classified with the feature value of the jth feature less than or equal to s
  • R 2 (j,s) ⁇ x
  • N 1 is the number of samples to be classified in the subset R 1
  • N 2 is the number of samples to be classified in the subset R 2 .
  • the meeting the preset stop condition may include:
  • the preset stop condition is met
  • the preset stopping condition is satisfied.
  • a classification regression tree is obtained.
  • the root node of the classification regression tree corresponds to the initial sample to be classified, and each leaf node of the classification regression tree corresponds to a subset that is no longer divided.
  • the output of the classification regression tree is the output corresponding to the leaf node, that is, the average value of the label of the sample to be classified into the leaf node.
  • the generating module 204 is configured to generate a random forest according to the multiple classification regression trees.
  • Multiple classification regression trees are formed into the random forest, and different classification regression trees are independent of each other.
  • the input of the random forest is the input of each classification regression tree in the random forest; the output of the random forest is the average value of the outputs of all classification regression trees in the random forest.
  • the generating a random forest according to the multiple classification regression trees includes:
  • the random forest is generated according to the multiple classification regression trees after the pruning process.
  • Pruning the multiple classification regression trees includes:
  • T t represents the subtree with t as the root node
  • C(t) is the prediction error obtained according to the sample to be classified into the internal node t
  • C(Tt) is the sample to be classified according to the subtree T t
  • the obtained prediction error, C(t) is the prediction error obtained according to the sample to be classified into the t node
  • is the number of leaf nodes of the subtree T t;
  • the cross-validation method is used to select the optimal subtree T ⁇ in the subtree sequence T 0 , T 1 , ..., T n .
  • the recognition module 205 is configured to input multiple characteristics of the user to be recognized into the random forest, and determine the emotional category of the user to be recognized according to the output of the random forest, wherein the multiple characteristics of the user to be recognized are based on the The acceleration time series of the user to be recognized walking is obtained.
  • each classification regression tree in the random forest takes multiple characteristics of the user to be identified as input, and classifies the user to be identified according to the multiple characteristics of the user to be identified to obtain the classification regression tree Calculate the average value of the output of all classification regression trees in the random forest to obtain the output of the random forest; determine the emotion category of the user to be identified according to the output of the random forest.
  • the emotion category corresponding to the label with the smallest output difference of the random forest may be selected as the emotion category of the user to be identified.
  • the user to be identified can be included in the user corresponding to the training sample.
  • the training sample set includes training samples of user A, and the user to be identified is user A.
  • the training sample set includes training samples of user A, user B, user C, and user D, and the user to be identified is user A.
  • the user to be identified may not be included in the user corresponding to the training sample.
  • the training sample set includes training samples of user A, user B, user C, and user D, and the user to be identified is user E.
  • the emotion recognition device 20 of the second embodiment uses the acceleration time series of the user walking with emotion category tags as training samples, generates a random forest according to each training sample, and uses the random forest to recognize the acceleration time series of the user to be identified.
  • the second embodiment realizes the recognition of the user's emotion according to the acceleration data of the user during walking.
  • This embodiment provides a storage medium that stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps in the foregoing embodiment of the emotion recognition method are implemented, such as 101-105 shown in FIG. 1 :
  • each training sample in the training sample set is a time series of a user's walking acceleration, and each training sample has a label, and the label marks the emotion category corresponding to the training sample;
  • the obtaining module 201 is configured to obtain a training sample set, each training sample in the training sample set is a time series of the acceleration of the user's walking, each training sample has a label, and the label marks the emotion category corresponding to the training sample;
  • the extraction module 202 is configured to extract multiple features for each training sample in the training sample set
  • the construction module 203 is configured to construct multiple classification regression trees according to multiple characteristics of each training sample in the training sample set;
  • a generating module 204 configured to generate a random forest according to the multiple classification regression trees
  • the recognition module 205 is configured to input multiple characteristics of the user to be recognized into the random forest, and determine the emotional category of the user to be recognized according to the output of the random forest, wherein the multiple characteristics of the user to be recognized are based on the The acceleration time series of the user to be recognized walking is obtained.
  • FIG. 3 is a schematic diagram of a computer device provided in Embodiment 4 of this application.
  • the computer device 30 includes a memory 301, a processor 302, and a computer program 303 stored in the memory 301 and running on the processor 302, such as an emotion recognition program.
  • the processor 302 executes the computer program 303, the steps in the foregoing embodiment of the emotion recognition method are implemented, for example, 101-105 shown in Fig. 1:
  • each training sample in the training sample set is a time series of a user's walking acceleration, and each training sample has a label, and the label marks the emotion category corresponding to the training sample;
  • each module in the above device embodiment is realized, for example, the modules 201-205 in FIG. 2:
  • the obtaining module 201 is configured to obtain a training sample set, each training sample in the training sample set is a time series of the acceleration of the user's walking, each training sample has a label, and the label marks the emotion category corresponding to the training sample;
  • the extraction module 202 is configured to extract multiple features for each training sample in the training sample set
  • the construction module 203 is configured to construct multiple classification regression trees according to multiple characteristics of each training sample in the training sample set;
  • a generating module 204 configured to generate a random forest according to the multiple classification regression trees
  • the recognition module 205 is configured to input multiple characteristics of the user to be recognized into the random forest, and determine the emotional category of the user to be recognized according to the output of the random forest, wherein the multiple characteristics of the user to be recognized are based on the The acceleration time series of the user to be recognized walking is obtained.
  • the computer program 303 may be divided into one or more modules, and the one or more modules are stored in the memory 301 and executed by the processor 302 to complete the method.
  • the one or more modules may be a series of computer-readable instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 303 in the computer device 30.
  • the computer program 303 may be divided into an acquisition module 201, an extraction module 202, a construction module 203, a generation module 204, and an identification module 205 in FIG. 2.
  • an acquisition module 201 For specific functions of each module, refer to the second embodiment.
  • the computer device 30 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the schematic diagram 3 is only an example of the computer device 30 and does not constitute a limitation on the computer device 30. It may include more or less components than those shown in the figure, or combine certain components, or be different.
  • the computer device 30 may also include input and output devices, network access devices, buses, etc.
  • the so-called processor 302 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor can be a microprocessor or the processor 302 can also be any conventional processor, etc.
  • the processor 302 is the control center of the computer device 30 and connects the entire computer device 30 with various interfaces and lines. Various parts.
  • the memory 301 may be used to store the computer program 303, and the processor 302 implements the computer device by running or executing the computer program or module stored in the memory 301 and calling data stored in the memory 301 30 various functions.
  • the memory 301 may mainly include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data (such as audio data) created according to the use of the computer device 30 and the like are stored.
  • the memory 301 may include volatile and non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card ( Flash Card), at least one disk storage device, flash memory device or other storage device.
  • volatile and non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card ( Flash Card), at least one disk storage device, flash memory device or other storage device.
  • the integrated modules of the computer device 30 are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through a computer program.
  • the computer program can be stored in a storage medium, and the computer program is When executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer readable instruction code, and the computer readable instruction code may be in the form of source code, object code, executable file, or some intermediate form.
  • the computer-readable storage medium may include: any entity or device capable of carrying the computer-readable instruction code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), etc.
  • the computer-readable storage medium may be non-volatile or volatile.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, or in the form of hardware plus software functional modules.
  • the above-mentioned integrated modules implemented in the form of software functional modules may be stored in a computer-readable storage medium.
  • the above-mentioned software function module is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute the method described in each embodiment of the present application Part of the steps.

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

本申请提供了一种情绪识别方法、装置、计算机装置及存储介质。所述情绪识别方法包括:获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;对所述训练样本集中的每个训练样本提取多个特征;根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;根据所述多个分类回归树生成随机森林;将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。本申请实现了根据用户步行过程中的加速度数据识别用户情绪。

Description

情绪识别方法、装置、计算机装置及存储介质
本申请要求于2019年8月21日提交中国专利局、申请号为201910775783.3、发明名称为“情绪识别方法、装置、计算机装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,具体涉及一种情绪识别方法、装置、计算机装置及存储介质。
背景技术
随着人工智能技术的进步,情绪识别已是目前人工智能领域中最活跃的研究课题之一。其目的是对人类的图像序列进行检测、跟踪和识别,更科学地解释人类行为。情绪识别可以应用于生活的各个方面:游戏厂商可以智能分析玩家的情绪,根据不同表情针对性地和玩家交互,提高游戏的体验;相机厂商可以利用该项技术捕捉人类表情,比如当需要一张微笑或者生气的照片时,可以捕获被拍人员的面部表情并快速完成拍照工作;政府或社会学家可以在公共场合安装摄像头,分析整个社会群体的表情和肢体动作以了解人们的生活工作压力;商厦可以根据顾客对商品的购物时的动作及表情视频,对产品做相关的市场调查。
在实际应用中,发明人意识到单纯基于人脸表情的情绪识别研究已遇到瓶颈,一方面,基于实验室视角的正面人脸表情识别已达到极高识别率,但相关算法在应用于自然态人脸表情识别时却识别率较低;另一方面,在运动中人的肢体动作和情绪也有着强相关关系,肢体动作同样是人们获取情绪的重要线索,在很多应用场合中,能够为情绪识别提供有效的帮助。因此,如果能从人的肢体动作识别出人的情绪变化,是对情绪识别技术的一个重大补充,并对今后人类情感智能识别相关应用的发展具有重要价值。
发明内容
鉴于以上内容,有必要提出一种情绪识别方法、装置、计算机装置及存储介质,其可以提高情绪识别的场景适应性。
本申请的第一方面提供一种情绪识别方法,其中,所述方法包括:
获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
对所述训练样本集中的每个训练样本提取多个特征;
根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
根据所述多个分类回归树生成随机森林;
将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
本申请的第二方面提供一种计算机装置,其中,所述计算机装置包括处理器,所述处理器用于执行存储器中存储的计算机可读指令以实现以下步骤:
获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
对所述训练样本集中的每个训练样本提取多个特征;
根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
根据所述多个分类回归树生成随机森林;
将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
本申请的第三方面提供一种存储介质,所述存储介质上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时实现以下步骤:
获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
对所述训练样本集中的每个训练样本提取多个特征;
根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
根据所述多个分类回归树生成随机森林;
将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
本申请的第四方面提供一种情绪识别装置,其中,所述装置包括:
获取模块,用于获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
提取模块,用于对所述训练样本集中的每个训练样本提取多个特征;
构建模块,用于根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
生成模块,用于根据所述多个分类回归树生成随机森林;
识别模块,用于将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
本申请以带有情绪类别标签的用户步行的加速度时间序列为训练样本,根据各个训练样本生成随机森林,利用所述随机森林对待识别用户的加速度时间序列进行识别。本申请实现了根据用户步行过程中的加速度数据识别用户的情绪。
附图说明
图1是本申请实施例提供的情绪识别方法的流程图。
图2是本申请实施例提供的情绪识别装置的结构图。
图3是本申请实施例提供的计算机装置的示意图。
具体实施方式
为了能够更清楚地理解本申请的上述目的、特征和优点,下面结合附图和具体实施例对本申请进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本申请,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。
优选地,本申请的情绪识别方法应用在一个或者多个计算机装置中。所述计算机装置是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。
所述计算机装置可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机装置可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。
实施例一
图1是本申请实施例一提供的情绪识别方法的流程图。所述情绪识别方法应用于计算机装置。
本申请情绪识别方法涉及机器学习,用于根据用户步行过程中的加速度数据识别所述用户的情绪。
如图1所示,所述情绪识别方法包括:
101,获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别。
可以在预设时间内,通过用户的手腕和/或脚踝上的加速度传感器采集用户步行过程中加速度数据,根据所述加速度数据得到所述加速度时间序列。每个加速度时间序列可以包括预设数量的加速度数据,例如100个加速度数据。或者,每个加速度时间序列可以包括预设时间(例如60秒)内的加速度数据。所述加速度数据可以是X轴、Y轴或Z轴方向的加速度数据,从而得到X轴、Y轴或Z轴方向的加速度时间序列。
例如,通过用户步行过程中用户手腕上的加速度传感器采集预设数量(例如100个)的X轴方向的加速度数据,将采集的预设数量的X轴方向的加速度数据组成一个加速度时间序列,得到一个训练样本。又如,通过用户步行过程中用户脚踝上的加速度传感器按照预设时间间隔采集预设时长(例如60秒)内X轴方向的加速度数据,将采集的预设时长内X轴方向的加速度数据组成一个加速度时间序列,得到一个训练样本。
每个训练样本对应一个标签,用于标识情绪类别。所述情绪类别可以包括正面情绪(激动、开心)、中性情绪(平静)或负面情绪(悲伤、哀愁)。所述标签可以是数字,例如1、2、3。例如,若用户的情绪为正面情绪,对应的标签为3;若用户的情绪为中性情绪,对应的标签为2;若用户的情绪为负面情绪,对应的标签为1。
用户处于不同情绪时,用户步行的加速度数据不同。可以在用户不同情绪时采集用户的加速度数据,得到带有不同标签的训练样本。
通过采集用户步行的加速度数据获得的多个训练样本组成所述训练样本集。
所述训练样本集可以包括多个用户的训练样本,即多个用户步行的加速度时间序列。或者,所述训练样本集可以包括一个用户的训练样本,即一个用户步行的加速度时间序列。
102,对所述训练样本集中的每个训练样本提取多个特征。
对所述训练样本集中的每个训练样本提取多个特征是对每个训练样本提取多个相同的特征。
所述多个特征可以包括加速度时间序列的标准差、平均值、峰值、偏态系数、FFT系数、功率谱密度平均值、功率谱密度标准偏差、坐标轴系数。
加速度时间序列的偏态系数是加速度时间序列分布不对称的度量值。若一个训练样本是对称的,则所述偏态系数等于0;若一个训练样本是左偏的,则所述偏态系数小于0;若一个训练样本是右偏的,则所述偏态系数大于0。
加速度时间序列的FFT系数是对所述加速度时间序列进行FFT(Fast Fourier  Transform,快速傅里叶变换)变换得到的系数,可以取第2维到第32维的FFT系数。
若训练样本为X轴方向的加速度时间序列,则对应的坐标轴系数为:
Figure PCTCN2020105630-appb-000001
其中,cov(Y,Z)为所述训练样本Y轴方向的加速度时间序列与所述训练样本Z轴方向的加速度时间序列的协方差,D(Y)为所述训练样本Y轴方向的加速度时间序列的方差,D(Z)为所述训练样本Z轴方向的加速度时间序列的方差;
若所述训练样本为Y轴方向的加速度时间序列,则所述坐标轴系数为ρ XZ,ρ XZ的计算公式可以参照上述ρ YZ
若所述训练样本为Z轴方向的加速度时间序列,则所述坐标轴系数为ρ XY,ρ XY的计算公式可以参照上述ρ YZ
在本实施例中,可以对所述训练样本集中的每个训练样本的多个特征进行归一化处理,得到每个训练样本归一化后的多个特征。
所述对所述训练样本集中的每个训练样本的多个特征进行归一化处理可以包括:
选择所述训练样本集中的第i个训练样本;
选择所述第i个训练样本的第j个特征;
计算所述训练样本集中所述第j个特征的均值U j和方差σ j
对所述第i个训练样本的第j个特征进行归一化计算:
Figure PCTCN2020105630-appb-000002
其中,B ij为所述第i个训练样本的第j个特征归一化后的值,b ij为所述第i个训练样本的第j个特征归一化前的值。i=1,2,…,N,N为所述训练样本集中训练样本的数量。j=1,2,…,M;M为每个训练样本的特征的数量。
所述第i个训练样本的第j个特征是指所述第i个训练样本的多个特征中的第j个特征。
在对所述训练样本集中的每个训练样本提取多个特征之前,所述方法还包括:
对所述训练样本集中的每个训练样本进行预处理。
所述对每个训练样本集中的每个训练样本进行预处理包括:
对所述训练样本进行降噪;和/或
对所述训练样本中的缺失值进行填充;和/或
对所述训练样本中的异常值进行修正。
具体地,对所述训练样本进行降噪可以包括:对所述训练样本进行移动平均降噪。
可以按照以下公式对训练样本进行移动平均降噪:
Figure PCTCN2020105630-appb-000003
其中,output[i]是所述训练样本(即加速度时间序列)中第i个加速度数据对应的输出,w为常量,取值为3或5,input[i+j]是所述训练样本中第i+j个加速度数据。
还可以采用其他方法对所述训练样本进行降噪。例如,可以对所述训练样本进行小波降噪。
具体地,所述对所述训练样本中的缺失值进行填充可以包括:取所述训练样本中所述缺失值的前后若干个加速度数据(例如缺失值的前5个和后5个加速度数据),用所述缺失值的前后若干个加速度数据的平均值填充所述缺失值。或者,可以采用K-最近邻算法,确定距离有缺失值的训练样本最近的K个训练样本(例如根据欧式距离确定距离有缺失值的训练样本最近的K个训练样本),将K个训练样本的数据加权平均来估计该训练样本的缺失值。或者,可以采用其他方法填补所述缺失值。例如,可以通过回归拟合 的方法或者插值法对所述缺失值进行填补。
对所述训练样本中的异常值进行修正的方法可以与填补缺失值的方法相同。例如,可以取所述训练样本中所述异常值的前后若干个加速度数据(例如异常值的前5个和后5个加速度数据),用所述异常值的前后若干个加速度数据的平均值修正所述异常值。或者,可以采用K-最近邻算法,确定距离有异常值的训练样本最近的K个训练样本(例如根据欧式距离确定距离有异常值的训练样本最近的K个训练样本),将K个训练样本的数据加权平均来估计该训练样本的异常值。或者,可以采用其他方法修正所述异常值。例如,可以通过回归拟合的方法或者插值法对所述异常值进行修正。
可以理解,修正异常值的方法可以不同于填补缺失值的方法。
103,根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树。
在一具体实施例中,所述根据所述训练样本集的各个训练样本的多个特征构建多个分类回归树可以包括:
(1)从所述训练样本集中随机选取Q个训练样本作为待分类样本;
(2)从所述待分类样本的多个特征中随机选取K个特征;
(3)确定所述待分类样本的所述K个特征中最优的切分特征和切分点,根据所述最优的切分特征和切分点将所述待分类样本划分为两个子集;
(4)计算划分的每个子集中的待分类样本的标签的均值;
(5)对于划分的每个子集,重复执行步骤(2)-(4),直至满足预设停止条件。
所述最优的切分特征和切分点可以根据如下目标函数确定:
Figure PCTCN2020105630-appb-000004
上式表示遍历待分类样本的K个特征(即切分特征j)的所有特征值(即切分点s),根据平方误差最小准则找到最优的切分特征和切分点。
其中,x i是所述待分类样本中的第i个训练样本,y i是x i的标签。
R 1,R 2是根据待分类样本的K个特征中的一个切分特征和一个切分点得到的两个子集,R 1(j,s)={x|x (j)≤s},R 2(j,s)={x|x (j)>s},x (j)是待分类样本的第j个特征的特征值。也就是说,R 1(j,s)是第j个特征的特征值小于或等于s的待分类样本的集合,R 2(j,s)={x|x (j)>s}是第j个特征的特征值大于s的待分类样本的集合。
Figure PCTCN2020105630-appb-000005
其中,N 1是子集R 1中待分类样本的个数,N 2是子集R 2中待分类样本的个数。
所述满足预设停止条件可以包括:
若所述子集中待分类样本的数量小于或等于第一预设值,则满足预设停止条件;或者
若所述最优的切分特征和切分点对应的平方误差小于第二预设值,则满足预设停止条件,其中
Figure PCTCN2020105630-appb-000006
或者
若随机选取的所有K个特征中不同特征的数量大于或等于第三预设值,则满足预设停止条件。
执行一次上述步骤(1)-(5),可以得到一个分类回归树。也就是说,每次从所有训练样本中随机选取Q个训练样本作为待分类样本(即执行步骤(1)),对所述待分类样本进行逐层划分(即执行步骤(2)-(5)),根据各次划分的切分特征和切分点,得到一个分类回归树。分类回归树的根节点对应初始的待分类样本,分类回归树的每个叶子节点对应一个不再划分的子集。分类回归树的输出为叶子节点对应的输出,即划分到叶子节点的待分类样本的标签的均值。
重复执行上述步骤(1)-(5),即可得到多个分类回归树。
104,根据所述多个分类回归树生成随机森林。
将多个分类回归树组成所述随机森林,不同分类回归树之间相互独立。所述随机森林的输入就是所述随机森林中每个分类回归树的输入;所述随机森林的输出为所述随机森林中所有分类回归树的输出的平均值。
在本实施例中,所述根据所述多个分类回归树生成随机森林包括:
对所述多个分类回归树进行剪枝处理;
根据剪枝处理后的所述多个分类回归树生成所述随机森林。
对所述多个分类回归树进行剪枝处理包括:
(1)从所述多个分类回归树选择一个分类回归树记为T 0
(2)初始化参数:k=0,T=T 0,α=+∞;
(3)在分类回归树T中自下而上地对各内部节点(非叶子节点)t计算C(T t),|T t|以及
Figure PCTCN2020105630-appb-000007
α=min(α,g(t))
其中,T t表示以t为根节点的子树,C(t)是根据划分到内部节点t的待分类样本得到的预测误差,C(Tt)是根据划分到子树T t的待分类样本得到的预测误差,C(t)是根据划分到t节点的待分类样本得到的预测误差,|T t|是所述子树T t的叶子节点的数量;
(4)自上而下地遍历内部节点t,若g(t)=α,进行剪枝,剪去所述节点t的子树,t变为叶子节点,剔除剪去的子树的g(t),α=min(g(t)),并计算叶子节点t对应区域中的待分类样本的标签的均值,得到分类回归树T;
(5)对参数进行赋值:k=k+1,T k=T;
(6)若T不是由根节点单独构成的树,则回到步骤(4);
(7)采用交叉验证法在子树序列T 0,T 1,…,T n中选择最优子树T α
105,将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
具体地,所述随机森林中的每个分类回归树以待识别用户的多个特征作为输入,根据所述待识别用户的多个特征对所述待识别用户进行分类,得到所述分类回归树的输出;计算所述随机森林中所有分类回归树的输出的平均值,得到所述随机森林的输出;根据所述随机森林的输出确定所述待识别用户的情绪类别。
可以选择与所述随机森林的输出差值最小的标签对应的情绪类别作为所述待识别用户的情绪类别。
待识别用户可以包含在训练样本对应的用户中。例如,所述训练样本集包括用户A的训练样本,所述待识别用户为用户A。或者,所述训练样本集包括用户A、用户B、用户C、用户D的训练样本,所述待识别用户为用户A。
或者,待识别用户可以不包含在训练样本对应的用户中。例如,所述训练样本集包括用户A、用户B、用户C、用户D的训练样本,所述待识别用户为用户E。
实施例一的情绪识别方法以带有情绪类别标签的用户步行的加速度时间序列为训练样本,根据各个训练样本生成随机森林,利用所述随机森林对待识别用户的加速度时间序列进行识别。实施例一实现了根据用户步行过程中的加速度数据识别所述用户的情绪。
实施例二
图2是本申请实施例二提供的情绪识别装置的结构图。所述情绪识别装置20应用于计算机装置。所述情绪识别装置20根据用户步行过程中的加速度数据识别所述用户的情绪。如图2所示,所述情绪识别装置20可以包括获取模块201、提取模块202、构建 模块203、生成模块204、识别模块205。
获取模块201,用于获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别。
可以在预设时间内,通过用户的手腕和/或脚踝上的加速度传感器采集用户步行过程中加速度数据,根据所述加速度数据得到所述加速度时间序列。每个加速度时间序列可以包括预设数量的加速度数据,例如100个加速度数据。或者,每个加速度时间序列可以包括预设时间(例如60秒)内的加速度数据。所述加速度数据可以是X轴、Y轴或Z轴方向的加速度数据,从而得到X轴、Y轴或Z轴方向的加速度时间序列。
例如,通过用户步行过程中用户手腕上的加速度传感器采集预设数量(例如100个)的X轴方向的加速度数据,将采集的预设数量的X轴方向的加速度数据组成一个加速度时间序列,得到一个训练样本。又如,通过用户步行过程中用户脚踝上的加速度传感器按照预设时间间隔采集预设时长(例如60秒)内X轴方向的加速度数据,将采集的预设时长内X轴方向的加速度数据组成一个加速度时间序列,得到一个训练样本。
每个训练样本对应一个标签,用于标识情绪类别。所述情绪类别可以包括正面情绪(激动、开心)、中性情绪(平静)或负面情绪(悲伤、哀愁)。所述标签可以是数字,例如1、2、3。例如,若用户的情绪为正面情绪,对应的标签为3;若用户的情绪为中性情绪,对应的标签为2;若用户的情绪为负面情绪,对应的标签为1。
用户处于不同情绪时,用户步行的加速度数据不同。可以在用户不同情绪时采集用户的加速度数据,得到带有不同标签的训练样本。
通过采集用户步行的加速度数据获得的多个训练样本组成所述训练样本集。
所述训练样本集可以包括多个用户的训练样本,即多个用户步行的加速度时间序列。或者,所述训练样本集可以包括一个用户的训练样本,即一个用户步行的加速度时间序列。
提取模块202,用于对所述训练样本集中的每个训练样本提取多个特征。
对所述训练样本集中的每个训练样本提取多个特征是对每个训练样本提取多个相同的特征。
所述多个特征可以包括加速度时间序列的标准差、平均值、峰值、偏态系数、FFT系数、功率谱密度平均值、功率谱密度标准偏差、坐标轴系数。
加速度时间序列的偏态系数是加速度时间序列分布不对称的度量值。若一个训练样本是对称的,则所述偏态系数等于0;若一个训练样本是左偏的,则所述偏态系数小于0;若一个训练样本是右偏的,则所述偏态系数大于0。
加速度时间序列的FFT系数是对所述加速度时间序列进行FFT(Fast Fourier Transform,快速傅里叶变换)变换得到的系数,可以取第2维到第32维的FFT系数。
若训练样本为X轴方向的加速度时间序列,则对应的坐标轴系数为:
Figure PCTCN2020105630-appb-000008
其中,cov(Y,Z)为所述训练样本Y轴方向的加速度时间序列与所述训练样本Z轴方向的加速度时间序列的协方差,D(Y)为所述训练样本Y轴方向的加速度时间序列的方差,D(Z)为所述训练样本Z轴方向的加速度时间序列的方差;
若所述训练样本为Y轴方向的加速度时间序列,则所述坐标轴系数为ρ XZ,ρ XZ的计算公式可以参照上述ρ YZ
若所述训练样本为Z轴方向的加速度时间序列,则所述坐标轴系数为ρ XY,ρ XY的计算公式可以参照上述ρ YZ
在本实施例中,可以对所述训练样本集中的每个训练样本的多个特征进行归一化处理,得到每个训练样本归一化后的多个特征。
所述对所述训练样本集中的每个训练样本的多个特征进行归一化处理可以包括:
选择所述训练样本集中的第i个训练样本;
选择所述第i个训练样本的第j个特征;
计算所述训练样本集中所述第j个特征的均值U j和方差σ j
对所述第i个训练样本的第j个特征进行归一化计算:
Figure PCTCN2020105630-appb-000009
其中,B ij为所述第i个训练样本的第j个特征归一化后的值,b ij为所述第i个训练样本的第j个特征归一化前的值。i=1,2,…,N,N为所述训练样本集中训练样本的数量。j=1,2,…,M;M为每个训练样本的特征的数量。
所述第i个训练样本的第j个特征是指所述第i个训练样本的多个特征中的第j个特征。
在对所述训练样本集中的每个训练样本提取多个特征之前,所述方法还包括:
对所述训练样本集中的每个训练样本进行预处理。
所述对每个训练样本集中的每个训练样本进行预处理包括:
对所述训练样本进行降噪;和/或
对所述训练样本中的缺失值进行填充;和/或
对所述训练样本中的异常值进行修正。
具体地,对所述训练样本进行降噪可以包括:对所述训练样本进行移动平均降噪。
可以按照以下公式对训练样本进行移动平均降噪:
Figure PCTCN2020105630-appb-000010
其中,output[i]是所述训练样本(即加速度时间序列)中第i个加速度数据对应的输出,w为常量,取值为3或5,input[i+j]是所述训练样本中第i+j个加速度数据。
还可以采用其他方法对所述训练样本进行降噪。例如,可以对所述训练样本进行小波降噪。
具体地,所述对所述训练样本中的缺失值进行填充可以包括:取所述训练样本中所述缺失值的前后若干个加速度数据(例如缺失值的前5个和后5个加速度数据),用所述缺失值的前后若干个加速度数据的平均值填充所述缺失值。或者,可以采用K-最近邻算法,确定距离有缺失值的训练样本最近的K个训练样本(例如根据欧式距离确定距离有缺失值的训练样本最近的K个训练样本),将K个训练样本的数据加权平均来估计该训练样本的缺失值。或者,可以采用其他方法填补所述缺失值。例如,可以通过回归拟合的方法或者插值法对所述缺失值进行填补。
对所述训练样本中的异常值进行修正的方法可以与填补缺失值的方法相同。例如,可以取所述训练样本中所述异常值的前后若干个加速度数据(例如异常值的前5个和后5个加速度数据),用所述异常值的前后若干个加速度数据的平均值修正所述异常值。或者,可以采用K-最近邻算法,确定距离有异常值的训练样本最近的K个训练样本(例如根据欧式距离确定距离有异常值的训练样本最近的K个训练样本),将K个训练样本的数据加权平均来估计该训练样本的异常值。或者,可以采用其他方法修正所述异常值。例如,可以通过回归拟合的方法或者插值法对所述异常值进行修正。
可以理解,修正异常值的方法可以不同于填补缺失值的方法。
构建模块203,用于根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树。
在一具体实施例中,所述根据所述训练样本集的各个训练样本的多个特征构建多个分类回归树可以包括:
(1)从所述训练样本集中随机选取Q个训练样本作为待分类样本;
(2)从所述待分类样本的多个特征中随机选取K个特征;
(3)确定所述待分类样本的所述K个特征中最优的切分特征和切分点,根据所述最优的切分特征和切分点将所述待分类样本划分为两个子集;
(4)计算划分的每个子集中的待分类样本的标签的均值;
(5)对于划分的每个子集,重复执行步骤(2)-(4),直至满足预设停止条件。
所述最优的切分特征和切分点可以根据如下目标函数确定:
Figure PCTCN2020105630-appb-000011
上式表示遍历待分类样本的K个特征(即切分特征j)的所有特征值(即切分点s),根据平方误差最小准则找到最优的切分特征和切分点。
其中,x i是所述待分类样本中的第i个训练样本,y i是x i的标签。
R 1,R 2是根据待分类样本的K个特征中的一个切分特征和一个切分点得到的两个子集,R 1(j,s)={x|x (j)≤s},R 2(j,s)={x|x (j)>s},x (j)是待分类样本的第j个特征的特征值。也就是说,R 1(j,s)是第j个特征的特征值小于或等于s的待分类样本的集合,R 2(j,s)={x|x (j)>s}是第j个特征的特征值大于s的待分类样本的集合。
Figure PCTCN2020105630-appb-000012
其中,N 1是子集R 1中待分类样本的个数,N 2是子集R 2中待分类样本的个数。
所述满足预设停止条件可以包括:
若所述子集中待分类样本的数量小于或等于第一预设值,则满足预设停止条件;或者
若所述最优的切分特征和切分点对应的平方误差小于第二预设值,则满足预设停止条件,其中
Figure PCTCN2020105630-appb-000013
或者
若随机选取的所有K个特征中不同特征的数量大于或等于第三预设值,则满足预设停止条件。
执行一次上述步骤(1)-(5),可以得到一个分类回归树。也就是说,每次从所有训练样本中随机选取Q个训练样本作为待分类样本(即执行步骤(1)),对所述待分类样本进行逐层划分(即执行步骤(2)-(5)),根据各次划分的切分特征和切分点,得到一个分类回归树。分类回归树的根节点对应初始的待分类样本,分类回归树的每个叶子节点对应一个不再划分的子集。分类回归树的输出为叶子节点对应的输出,即划分到叶子节点的待分类样本的标签的均值。
重复执行上述步骤(1)-(5),即可得到多个分类回归树。
生成模块204,用于根据所述多个分类回归树生成随机森林。
将多个分类回归树组成所述随机森林,不同分类回归树之间相互独立。所述随机森林的输入就是所述随机森林中每个分类回归树的输入;所述随机森林的输出为所述随机森林中所有分类回归树的输出的平均值。
在本实施例中,所述根据所述多个分类回归树生成随机森林包括:
对所述多个分类回归树进行剪枝处理;
根据剪枝处理后的所述多个分类回归树生成所述随机森林。
对所述多个分类回归树进行剪枝处理包括:
(1)从所述多个分类回归树选择一个分类回归树记为T 0
(2)初始化参数:k=0,T=T 0,α=+∞;
(3)在分类回归树T中自下而上地对各内部节点(非叶子节点)t计算C(T t),|T t|以及
Figure PCTCN2020105630-appb-000014
α=min(α,g(t))
其中,T t表示以t为根节点的子树,C(t)是根据划分到内部节点t的待分类样本得到的预测误差,C(Tt)是根据划分到子树T t的待分类样本得到的预测误差,C(t)是根据划分到t节点的待分类样本得到的预测误差,|T t|是所述子树T t的叶子节点的数量;
(4)自上而下地遍历内部节点t,若g(t)=α,进行剪枝,剪去所述节点t的子树,t变为叶子节点,剔除剪去的子树的g(t),α=min(g(t)),并计算叶子节点t对应区域中的待分类样本的标签的均值,得到分类回归树T;
(5)对参数进行赋值:k=k+1,T k=T;
(6)若T不是由根节点单独构成的树,则回到步骤(4);
(7)采用交叉验证法在子树序列T 0,T 1,…,T n中选择最优子树T α
识别模块205,用于将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
具体地,所述随机森林中的每个分类回归树以待识别用户的多个特征作为输入,根据所述待识别用户的多个特征对所述待识别用户进行分类,得到所述分类回归树的输出;计算所述随机森林中所有分类回归树的输出的平均值,得到所述随机森林的输出;根据所述随机森林的输出确定所述待识别用户的情绪类别。
可以选择与所述随机森林的输出差值最小的标签对应的情绪类别作为所述待识别用户的情绪类别。
待识别用户可以包含在训练样本对应的用户中。例如,所述训练样本集包括用户A的训练样本,所述待识别用户为用户A。或者,所述训练样本集包括用户A、用户B、用户C、用户D的训练样本,所述待识别用户为用户A。
或者,待识别用户可以不包含在训练样本对应的用户中。例如,所述训练样本集包括用户A、用户B、用户C、用户D的训练样本,所述待识别用户为用户E。
实施例二的情绪识别装置20以带有情绪类别标签的用户步行的加速度时间序列为训练样本,根据各个训练样本生成随机森林,利用所述随机森林对待识别用户的加速度时间序列进行识别。实施例二实现了根据用户步行过程中的加速度数据识别所述用户的情绪。
实施例三
本实施例提供一种存储介质,该存储介质上存储有计算机可读指令,该计算机可读指令被处理器执行时实现上述情绪识别方法实施例中的步骤,例如图1所示的101-105:
101,获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
102,对所述训练样本集中的每个训练样本提取多个特征;
103,根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
104,根据所述多个分类回归树生成随机森林;
105,将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
或者,该计算机可读指令被处理器执行时实现上述装置实施例中各模块的功能,例如图2中的模块201-205:
获取模块201,用于获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
提取模块202,用于对所述训练样本集中的每个训练样本提取多个特征;
构建模块203,用于根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
生成模块204,用于根据所述多个分类回归树生成随机森林;
识别模块205,用于将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
实施例四
图3为本申请实施例四提供的计算机装置的示意图。所述计算机装置30包括存储器301、处理器302以及存储在所述存储器301中并可在所述处理器302上运行的计算机程序303,例如情绪识别程序。所述处理器302执行所述计算机程序303时实现上述情绪识别方法实施例中的步骤,例如图1所示的101-105:
101,获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
102,对所述训练样本集中的每个训练样本提取多个特征;
103,根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
104,根据所述多个分类回归树生成随机森林;
105,将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
或者,该计算机程序被处理器执行时实现上述装置实施例中各模块的功能,例如图2中的模块201-205:
获取模块201,用于获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
提取模块202,用于对所述训练样本集中的每个训练样本提取多个特征;
构建模块203,用于根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
生成模块204,用于根据所述多个分类回归树生成随机森林;
识别模块205,用于将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
示例性的,所述计算机程序303可以被分割成一个或多个模块,所述一个或者多个模块被存储在所述存储器301中,并由所述处理器302执行,以完成本方法。所述一个或多个模块可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机程序303在所述计算机装置30中的执行过程。例如,所述计算机程序303可以被分割成图2中的获取模块201、提取模块202、构建模块203、生成模块204、识别模块205,各模块具体功能参见实施例二。
所述计算机装置30可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。本领域技术人员可以理解,所述示意图3仅仅是计算机装置30的示例,并不构成对计算机装置30的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述计算机装置30还可以包括输入输出设备、网络接入设备、总线等。
所称处理器302可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array, FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器302也可以是任何常规的处理器等,所述处理器302是所述计算机装置30的控制中心,利用各种接口和线路连接整个计算机装置30的各个部分。
所述存储器301可用于存储所述计算机程序303,所述处理器302通过运行或执行存储在所述存储器301内的计算机程序或模块,以及调用存储在存储器301内的数据,实现所述计算机装置30的各种功能。所述存储器301可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机装置30的使用所创建的数据(比如音频数据)等。此外,存储器301可以包括易失性和非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件或其他存储器件。
所述计算机装置30集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、存储器、只读存储器(ROM,Read-Only Memory)、随机存储器(RAM,Random Access Memory)等。所述计算机可读存储介质可以是非易失性,也可以是易失性的。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
上述以软件功能模块的形式实现的集成的模块,可以存储在一个计算机可读存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的部分步骤。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他模块或步骤,单数不排除复数。系统权利要求中陈述的多个模块或装置也可以由一个模块或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的 技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种情绪识别方法,其中,所述方法包括:
    获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
    对所述训练样本集中的每个训练样本提取多个特征;
    根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
    根据所述多个分类回归树生成随机森林;
    将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
  2. 如权利要求1所述的情绪识别方法,其中,所述多个特征包括如下各项的任意组合:
    加速度时间序列的标准差、平均值、峰值、偏态系数、FFT系数、功率谱密度平均值、功率谱密度标准偏差、坐标轴系数。
  3. 如权利要求1所述的情绪识别方法,其中,所述方法还包括:
    对所述训练样本集中的每个训练样本的多个特征进行归一化处理,得到每个训练样本归一化后的多个特征;
    所述根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树包括:
    根据每个训练样本归一化后的多个特征构建所述多个分类回归树。
  4. 如权利要求1所述的情绪识别方法,其中,所述对所述训练样本集中的每个训练样本提取多个特征之前,所述方法还包括:
    对所述训练样本进行降噪;和/或
    对所述训练样本中的缺失值进行填充;和/或
    对所述训练样本中的异常值进行修正。
  5. 如权利要求4所述的情绪识别方法,其中,所述对所述训练样本进行降噪包括:
    按照以下公式对所述训练样本进行移动平均降噪:
    Figure PCTCN2020105630-appb-100001
    其中,output[i]是所述训练样本中第i个加速度数据对应的输出,w为常量,取值为3或5,input[i+j]是所述训练样本中第i+j个加速度数据。
  6. 如权利要求1所述的情绪识别方法,其中,所述根据所述训练样本集的各个训练样本的多个特征构建多个分类回归树包括:
    从所述训练样本集中随机选取Q个训练样本作为待分类样本;
    从所述待分类样本的多个特征中随机选取K个特征;
    确定所述待分类样本的所述K个特征中最优的切分特征和切分点,根据所述最优的切分特征和切分点将所述待分类样本划分为两个子集;
    计算划分的每个子集中的待分类样本的标签的均值;
    对于划分的每个子集,重复执行所述从所述待分类样本的多个特征中随机选取K个特征至所述计算划分的每个子集中的待分类样本的标签的均值,直至满足预设停止条件。
  7. 如权利要求1所述的情绪识别方法,其中,所述根据所述多个分类回归树生成随机森林包括:
    对所述多个分类回归树进行剪枝处理;
    根据剪枝处理后的所述多个分类回归树生成所述随机森林。
  8. 一种计算机装置,其中,所述计算机装置包括处理器,所述处理器用于执行存储器中存储的计算机可读指令以实现以下步骤:
    获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
    对所述训练样本集中的每个训练样本提取多个特征;
    根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
    根据所述多个分类回归树生成随机森林;
    将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
  9. 如权利要求8所述的计算机装置,其中,所述多个特征包括如下各项的任意组合:
    加速度时间序列的标准差、平均值、峰值、偏态系数、FFT系数、功率谱密度平均值、功率谱密度标准偏差、坐标轴系数。
  10. 如权利要求8所述的计算机装置,其中,所述处理器执行所述计算机可读指令还用以实现以下步骤:
    对所述训练样本集中的每个训练样本的多个特征进行归一化处理,得到每个训练样本归一化后的多个特征;
    所述处理器执行所述计算机可读指令以实现所述根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树时,具体包括:
    根据每个训练样本归一化后的多个特征构建所述多个分类回归树。
  11. 如权利要求8所述的计算机装置,其中,所述处理器执行所述计算机可读指令以实现所述对所述训练样本集中的每个训练样本提取多个特征之前,还用以实现以下步骤:
    对所述训练样本进行降噪;和/或
    对所述训练样本中的缺失值进行填充;和/或
    对所述训练样本中的异常值进行修正。
  12. 如权利要求11所述的计算机装置,其中,所述处理器执行所述计算机可读指令以实现所述对所述训练样本进行降噪时,具体包括:
    按照以下公式对所述训练样本进行移动平均降噪:
    Figure PCTCN2020105630-appb-100002
    其中,output[i]是所述训练样本中第i个加速度数据对应的输出,w为常量,取值为3或5,input[i+j]是所述训练样本中第i+j个加速度数据。
  13. 如权利要求8所述的计算机装置,其中,所述处理器执行所述计算机可读指令以实现所述根据所述训练样本集的各个训练样本的多个特征构建多个分类回归树时,具体包括:
    从所述训练样本集中随机选取Q个训练样本作为待分类样本;
    从所述待分类样本的多个特征中随机选取K个特征;
    确定所述待分类样本的所述K个特征中最优的切分特征和切分点,根据所述最优的切分特征和切分点将所述待分类样本划分为两个子集;
    计算划分的每个子集中的待分类样本的标签的均值;
    对于划分的每个子集,重复执行所述从所述待分类样本的多个特征中随机选取K个特征至所述计算划分的每个子集中的待分类样本的标签的均值,直至满足预设停止条件。
  14. 如权利要求8所述的计算机装置,其中,所述处理器执行所述计算机可读指令以实现所述根据所述多个分类回归树生成随机森林时,具体包括:
    对所述多个分类回归树进行剪枝处理;
    根据剪枝处理后的所述多个分类回归树生成所述随机森林。
  15. 一种存储介质,所述存储介质上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时实现以下步骤:
    获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
    对所述训练样本集中的每个训练样本提取多个特征;
    根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
    根据所述多个分类回归树生成随机森林;
    将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
  16. 如权利要求15所述的存储介质,其中,所述计算机可读指令被所述处理器执行还实现以下步骤:
    对所述训练样本集中的每个训练样本的多个特征进行归一化处理,得到每个训练样本归一化后的多个特征;
    所述计算机可读指令被所述处理器执行以实现所述根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树时,具体包括:
    根据每个训练样本归一化后的多个特征构建所述多个分类回归树。
  17. 如权利要求15所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述对所述训练样本集中的每个训练样本提取多个特征之前,还实现以下步骤:
    对所述训练样本进行降噪;和/或
    对所述训练样本中的缺失值进行填充;和/或
    对所述训练样本中的异常值进行修正。
  18. 如权利要求17所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述对所述训练样本进行降噪时,具体包括:
    按照以下公式对所述训练样本进行移动平均降噪:
    Figure PCTCN2020105630-appb-100003
    其中,output[i]是所述训练样本中第i个加速度数据对应的输出,w为常量,取值为3或5,input[i+j]是所述训练样本中第i+j个加速度数据。
  19. 如权利要求15所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述根据所述训练样本集的各个训练样本的多个特征构建多个分类回归树时,具体包括:
    从所述训练样本集中随机选取Q个训练样本作为待分类样本;
    从所述待分类样本的多个特征中随机选取K个特征;
    确定所述待分类样本的所述K个特征中最优的切分特征和切分点,根据所述最优的切分特征和切分点将所述待分类样本划分为两个子集;
    计算划分的每个子集中的待分类样本的标签的均值;
    对于划分的每个子集,重复执行所述从所述待分类样本的多个特征中随机选取K个特征至所述计算划分的每个子集中的待分类样本的标签的均值,直至满足预设停止条件。
  20. 一种情绪识别装置,其中,所述装置包括:
    获取模块,用于获取训练样本集,所述训练样本集中的每个训练样本为用户步行的加速度时间序列,每个训练样本带有标签,所述标签标记所述训练样本对应的情绪类别;
    提取模块,用于对所述训练样本集中的每个训练样本提取多个特征;
    构建模块,用于根据所述训练样本集中的各个训练样本的多个特征构建多个分类回归树;
    生成模块,用于根据所述多个分类回归树生成随机森林;
    识别模块,用于将待识别用户的多个特征输入所述随机森林,根据所述随机森林的输出确定所述待识别用户的情绪类别,其中所述待识别用户的多个特征根据所述待识别用户步行的加速度时间序列得到。
PCT/CN2020/105630 2019-08-21 2020-07-29 情绪识别方法、装置、计算机装置及存储介质 WO2021031817A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910775783.3 2019-08-21
CN201910775783.3A CN110705584A (zh) 2019-08-21 2019-08-21 情绪识别方法、装置、计算机装置及存储介质

Publications (1)

Publication Number Publication Date
WO2021031817A1 true WO2021031817A1 (zh) 2021-02-25

Family

ID=69193369

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/105630 WO2021031817A1 (zh) 2019-08-21 2020-07-29 情绪识别方法、装置、计算机装置及存储介质

Country Status (2)

Country Link
CN (1) CN110705584A (zh)
WO (1) WO2021031817A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113569482A (zh) * 2021-07-29 2021-10-29 石家庄铁道大学 隧道服役性能的评估方法、装置、终端及存储介质
CN115919313A (zh) * 2022-11-25 2023-04-07 合肥工业大学 一种基于时空特征的面部肌电情绪识别方法

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110705584A (zh) * 2019-08-21 2020-01-17 深圳壹账通智能科技有限公司 情绪识别方法、装置、计算机装置及存储介质
CN111643098A (zh) * 2020-06-09 2020-09-11 深圳大学 一种基于智能声学设备的步态识别与情绪感知方法和系统
CN111881972B (zh) * 2020-07-24 2023-11-07 腾讯音乐娱乐科技(深圳)有限公司 一种黑产用户识别方法及装置、服务器、存储介质
CN114334090B (zh) * 2022-03-02 2022-07-12 博奥生物集团有限公司 一种数据分析方法、装置及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120308971A1 (en) * 2011-05-31 2012-12-06 Hyun Soon Shin Emotion recognition-based bodyguard system, emotion recognition device, image and sensor control apparatus, personal protection management apparatus, and control methods thereof
CN109447324A (zh) * 2018-09-30 2019-03-08 深圳个人数据管理服务有限公司 行为活动预测方法、装置、设备及情绪预测方法
CN109492682A (zh) * 2018-10-30 2019-03-19 桂林电子科技大学 一种多分枝随机森林数据分类方法
CN110705584A (zh) * 2019-08-21 2020-01-17 深圳壹账通智能科技有限公司 情绪识别方法、装置、计算机装置及存储介质

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103400123A (zh) * 2013-08-21 2013-11-20 山东师范大学 基于三轴加速度传感器及神经网络的步态类型鉴别方法
US9786299B2 (en) * 2014-12-04 2017-10-10 Microsoft Technology Licensing, Llc Emotion type classification for interactive dialog system
CN105306703A (zh) * 2015-09-30 2016-02-03 西安沧海网络科技有限公司 一种基于智能手机的情绪识别可穿戴装置
CN106097360A (zh) * 2016-06-17 2016-11-09 中南大学 一种带钢表面缺陷识别方法及装置
JP7083809B2 (ja) * 2016-08-02 2022-06-13 アトラス5ディー, インコーポレイテッド プライバシーの保護を伴う人物の識別しおよび/または痛み、疲労、気分、および意図の識別および定量化のためのシステムおよび方法
CN107220591A (zh) * 2017-04-28 2017-09-29 哈尔滨工业大学深圳研究生院 多模态智能情绪感知系统
CN107582037A (zh) * 2017-09-30 2018-01-16 深圳前海全民健康科技有限公司 基于脉搏波设计医疗产品的方法
CN109846496B (zh) * 2017-11-30 2022-06-10 昆山光微电子有限公司 智能可穿戴设备情绪感知功能的硬件实现方法及组合
CN108537123A (zh) * 2018-03-08 2018-09-14 四川大学 基于多特征提取的心电识别方法
CN109255391B (zh) * 2018-09-30 2021-07-23 武汉斗鱼网络科技有限公司 一种识别恶意用户的方法、装置及存储介质
CN109480780B (zh) * 2018-11-14 2021-08-24 重庆三峡医药高等专科学校 一种脑卒中预警系统的评估方法及系统
CN109933782B (zh) * 2018-12-03 2023-11-28 创新先进技术有限公司 用户情绪预测方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120308971A1 (en) * 2011-05-31 2012-12-06 Hyun Soon Shin Emotion recognition-based bodyguard system, emotion recognition device, image and sensor control apparatus, personal protection management apparatus, and control methods thereof
CN109447324A (zh) * 2018-09-30 2019-03-08 深圳个人数据管理服务有限公司 行为活动预测方法、装置、设备及情绪预测方法
CN109492682A (zh) * 2018-10-30 2019-03-19 桂林电子科技大学 一种多分枝随机森林数据分类方法
CN110705584A (zh) * 2019-08-21 2020-01-17 深圳壹账通智能科技有限公司 情绪识别方法、装置、计算机装置及存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113569482A (zh) * 2021-07-29 2021-10-29 石家庄铁道大学 隧道服役性能的评估方法、装置、终端及存储介质
CN113569482B (zh) * 2021-07-29 2024-02-06 石家庄铁道大学 隧道服役性能的评估方法、装置、终端及存储介质
CN115919313A (zh) * 2022-11-25 2023-04-07 合肥工业大学 一种基于时空特征的面部肌电情绪识别方法
CN115919313B (zh) * 2022-11-25 2024-04-19 合肥工业大学 一种基于时空特征的面部肌电情绪识别方法

Also Published As

Publication number Publication date
CN110705584A (zh) 2020-01-17

Similar Documents

Publication Publication Date Title
WO2021031817A1 (zh) 情绪识别方法、装置、计算机装置及存储介质
Xia et al. Multi-stage feature constraints learning for age estimation
US10776470B2 (en) Verifying identity based on facial dynamics
CN106295313B (zh) 对象身份管理方法、装置和电子设备
WO2019119505A1 (zh) 人脸识别的方法和装置、计算机装置及存储介质
JP6517681B2 (ja) 映像パターン学習装置、方法、及びプログラム
WO2016110005A1 (zh) 基于灰度和深度信息的多层融合的多模态人脸识别装置及方法
WO2022105118A1 (zh) 基于图像的健康状态识别方法、装置、设备及存储介质
CN109145766A (zh) 模型训练方法、装置、识别方法、电子设备及存储介质
WO2015070764A1 (zh) 一种人脸定位的方法与装置
CN113313053B (zh) 图像处理方法、装置、设备、介质及程序产品
Santhalingam et al. Sign language recognition analysis using multimodal data
CN108985133B (zh) 一种人脸图像的年龄预测方法及装置
Yi et al. Multi-modal learning for affective content analysis in movies
CN111401339A (zh) 识别人脸图像中的人的年龄的方法、装置及电子设备
WO2023151237A1 (zh) 人脸位姿估计方法、装置、电子设备及存储介质
Sayed Biometric Gait Recognition Based on Machine Learning Algorithms.
CN111340213A (zh) 神经网络的训练方法、电子设备、存储介质
CN114519401B (zh) 一种图像分类方法及装置、电子设备、存储介质
CN110516638B (zh) 一种基于轨迹和随机森林的手语识别方法
CN113987188B (zh) 一种短文本分类方法、装置及电子设备
CN111666976A (zh) 基于属性信息的特征融合方法、装置和存储介质
Verma et al. Estimation of sex through morphometric landmark indices in facial images with strength of evidence in logistic regression analysis
CN111753583A (zh) 一种识别方法及装置
Travieso et al. Using a discrete Hidden Markov Model Kernel for lip-based biometric identification

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20854168

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20854168

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 25.08.22)

122 Ep: pct application non-entry in european phase

Ref document number: 20854168

Country of ref document: EP

Kind code of ref document: A1