Speech classification method based on speech corpus alignment and adaptive fusion

Through voice corpus alignment and adaptive fusion technology, the correlation and importance of speech signals are captured, and the problem of neglected speech signal connections in the prior art is solved, and the accuracy and efficiency of speech classification are improved.

CN118571216BActive Publication Date: 2024-11-01NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411060512.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-11-01
Estimated Expiration
2044-08-05

AI Technical Summary

Technical Problem

The existing speech classification methods ignore the interconnection between different time periods of speech signals, resulting in negative interference in model optimization, and equidistant cutting will split coherent pronunciation and be disturbed by irrelevant fragments, affecting the classification accuracy.

Method used

Using a method based on the alignment and adaptive fusion of speech corpus, the speech data is divided and feature extracted through the alignment construction module, the speech correlation construction module is used to capture the interconnection between segments, and the importance coefficient is obtained by combining the segment importance mining module to form Global features and input into the classifier to reduce the impact of irrelevant information.

Benefits of technology

It improves the accuracy and efficiency of speech classification, can better utilize the information in the speech signal, reduce the negative impact of irrelevant information on classification, and achieve higher classification accuracy and rapid classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118571216B_ABST
    Figure CN118571216B_ABST
Patent Text Reader

Abstract

The present invention discloses a speech classification method based on speech corpus alignment and adaptive fusion, the method comprising: constructing a speech classification data set and dividing it into a training set and a test set; constructing a speech classification network model, including an alignment construction module, a speech relevance construction module, a segment importance mining module, and a fusion detection module; inputting the output features of the fusion detection module into a classifier to obtain a prediction result; designing a loss function for optimizing network model parameters, and using an Adam optimizer on a training set according to the loss function to implement iterative optimization and updating of model parameters; the trained speech classification network model can implement end-to-end classification of speech signals. The present invention utilizes deep learning technology to achieve automatic classification through speech signals, and can be applied to different scenarios, such as the recognition of features such as emotion, gender, and age, which helps enterprises analyze users' emotions, gender, and age, thereby providing more humane and targeted services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of audio processing, and in particular to a speech classification method based on speech corpus alignment and adaptive fusion. Background Art

[0002] Speech classification is of great significance for enterprises to understand the real situation of users and build user portraits. Traditional speech classification methods are mainly based on Gaussian mixture models and hidden Markov models. With the development of computer technology, speech classification through deep networks is regarded as a new, feasible and efficient method. Existing methods usually divide long signals into multiple segments and send them to the network for training independently, or cut the speech equidistantly and extract features separately before sending them to time series models such as RNN and LSTM. The practice of using multiple segments belonging to the same speech signal as independent samples ignores the mutual connection between signals in different time periods in the complete speech, and there are some segments that are irrelevant to speech classification, which will have a negative impact on the optimization of the model; obtaining segments by equidistant cutting will cause the coherent pronunciation to be forcibly split, and will also be interfered by irrelevant segments.

[0003] Therefore, the present invention proposes a speech classification method based on speech corpus alignment and adaptive fusion, which aims to make full use of various parts of speech, reduce the negative impact of irrelevant information on speech classification, build correlation between various parts of samples, and adaptively extract information with high relevance to speech classification from long sequence signals. First, the original speech is divided based on speech alignment technology and hidden features are independently obtained on each segment to ensure that the content of the segments at the same position of different samples is consistent, reducing the impact of content differences; secondly, the relationship between different segments and complete speech is modeled using an attention mechanism to make full use of information of different granularities; finally, by mining the importance of each segment to the classification result, the impact of irrelevant parts of speech on classification efficiency is reduced. Summary of the invention

[0004] The purpose of the present invention is to provide a speech classification method based on speech corpus alignment and adaptive fusion, which can effectively extract information from speech signals and accurately classify them.

[0005] To achieve the above functions, the present invention designs a speech classification method based on speech corpus alignment and adaptive fusion, and executes the following steps S1 to S5 to complete speech data classification:

[0006] Step S1: obtaining original speech data, and dividing the original speech data into a training set and a test set according to a preset ratio;

[0007] Step S2: constructing a speech classification network model based on speech corpus alignment and adaptive fusion, the speech classification network model including an alignment construction module, a speech relevance construction module, a segment importance mining module, and a fusion detection module;

[0008] The original speech data is input into the alignment construction module, the original speech data is separated into speech segments, and deep features are extracted from the obtained speech segments and the original speech data respectively; the speech relevance construction module is used to capture the mutual connection between speech segments and obtain relevance features; the segment importance mining module is used to perform corpus importance adaptive learning based on the obtained relevance features to obtain the importance coefficient of each speech segment; in the fusion detection module, the features are combined according to the importance coefficients to form a total embedded feature; and the features are input into the classifier to obtain the predicted speech data classification result;

[0009] Step S3: designing a loss function for optimizing the speech classification network model and presetting training hyperparameters of the speech classification network model;

[0010] Step S4: sending the original speech data in the training set into the speech classification network model, and using the Adam optimizer to iteratively optimize and update the parameters of the speech classification network model according to the loss function;

[0011] Step S5: Train and test the speech classification network model until the speech classification network model reaches a preset convergence condition, and use the trained speech classification network model to implement end-to-end speech data classification.

[0012] Beneficial effects: Compared with the prior art, the advantages of the present invention include:

[0013] The present invention proposes a speech classification method based on speech corpus alignment and adaptive fusion, which makes full use of various parts of speech, reduces the negative impact of irrelevant information on speech classification, builds correlation between various parts of the sample, and can adaptively extract information with high correlation with speech classification from long sequence signals. The speech feature alignment construction module is used to align and learn features of the corpus according to the speech text content; the speech correlation construction module is used to capture the mutual connection between fragments and model the correlation between corpora; the fragment importance mining module is used to adaptively learn the importance of the corpus based on the obtained features; in the fusion detection module, the features are combined according to the obtained importance coefficients to form global features, and input into the classifier to obtain the prediction results. The classification accuracy is high, the classification process is fast, and better speech classification can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 is a flow chart of a speech classification method based on speech corpus alignment and adaptive fusion provided according to an embodiment of the present invention;

[0015] Figure 2 is a schematic diagram of a speech classification network model provided according to an embodiment of the present invention;

[0016] Figure 3 is a schematic diagram of speech segment separation according to an embodiment of the present invention;

[0017] Figure 4 is a schematic diagram of a speech relevance building module provided according to an embodiment of the present invention;

[0018] Figure 5 is a schematic diagram of a fragment importance mining module provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0020] The speech classification method based on speech corpus alignment and adaptive fusion provided by the embodiment of the present invention refers to Figure 1 , perform the following steps S1 to S5 to complete the voice data classification:

[0021] Step S1: obtaining original speech data, and dividing the original speech data into a training set and a test set according to a preset ratio;

[0022] The original speech data is divided into multiple categories according to its difference characteristics; then the original speech data of each category is divided into training set and test set in the ratio of 0.9:0.1.

[0023] Step S2: Construct a speech classification network model based on speech corpus alignment and adaptive fusion, referring to Figure 2 ,The speech classification network model includes an alignment construction module, a speech ,relevance building module, a segment importance mining module, and a fusion detection module;

[0024] The original speech data is input into the alignment construction module, the original speech data is separated into speech segments, and deep features are extracted from the obtained speech segments and the original speech data respectively; the speech relevance construction module is used to capture the mutual connection between speech segments and obtain relevance features; the segment importance mining module is used to perform corpus importance adaptive learning based on the obtained relevance features to obtain the importance coefficient of each speech segment; in the fusion detection module, the features are combined according to the importance coefficients to form a total embedded feature; and the features are input into the classifier to obtain the predicted speech data classification result;

[0025] The specific steps of step S2 are as follows:

[0026] Step S2.1: Long sequence signals contain a lot of irrelevant information. Segment processing can solve this problem well. In order to reduce the interference of content differences on classification effects, in the alignment construction module, the speech alignment tool Montreal ForcedAligner (MFA) is used to obtain the timestamps of each word in the original speech data, and the original speech data is divided into N speech segments, so that for samples A and B with the same text content, their i Clips A i and B i The text content remains the same; the diagram of voice segment separation is shown in Figure 3 , use the pre-trained wav2vec2.0 feature extractor to extract features from the complete original speech data and each speech segment to obtain the feature vector of the original speech data and the feature vector of each speech segment , where L2 represents the feature length of the speech segment, L1 represents the global feature length, and C is the number of feature vector channels; N Each voice segment is set up N A separate Transformer encoder captures deep features within the speech fragment ;

[0027] Step S2.2: Reference Figure 4 In the speech correlation construction module, since different speech segments come from the same sample, there is correlation. In order to establish the mutual connection between different speech segments, the attention mechanism is used to fuse the information of each speech segment to obtain the speech segment interaction feature. , the calculation formula is as follows:

[0028] ;

[0029] in, Represents a splicing operation, is a learnable parameter, Represents multi-head attention, for speech fragments i , its deep features As a query Q , the rest of the voice clips j The result of deep feature concatenation As a key K Sum V ;

[0030] In order to obtain multi-granular features, it is necessary to interact between speech fragments and complete speech data to obtain global deep features. Interaction features of each speech segment Using cross attention respectively, the calculation formula is as follows:

[0031] ;

[0032] in, represents bidirectional cross attention, is a learnable parameter; contains two alternating cross-attention operations. When performing an attention operation, the parameter x As a query Q ,parameter y As a key K Sum V ; When performing another attention operation, make the parameter y As a query Q ,parameter x As a key K Sum V ;

[0033] In the formula, For voice clips i The correlation characteristics of It is a global correlation feature;

[0034] Step S2.3: Reference Figure 5 , the relevance features of the speech segments and the global relevance features are input into the segment importance mining module to obtain the importance information of each speech segment. The calculation formula is as follows:

[0035] ;

[0036] ;

[0037] in, and is the learnable parameter matrix, C is the number of feature vector channels, represents the importance score matrix of speech segments, L2 represents the feature length of speech segments, and L1 represents the global feature length; Indicates the importance of the speech segment. For its u elements;

[0038] In order to introduce sparsity to effectively save computing resources, the importance information of speech segments is H The output of the fully connected layer is N dimensional vector TopK Operation, assign a very large negative number to NK values ​​other than the largest K values ​​and perform SoftMax Processing, get the importance coefficient G, the calculation formula is as follows:

[0039] ;

[0040] In the formula, Representation and N The importance coefficients corresponding to the speech segments, of which only K importance coefficients are not zero, and the remaining NK importance coefficients are all zero; represents the fully connected layer, is a learnable parameter;

[0041] Step S2.4: To integrate the speech segment information, global audio information, and speech segment importance information, a fusion detection module is constructed at the end of the network. In the fusion detection module, the correlation features of each speech segment are Perform average pooling to obtain , and weighted addition of the importance coefficients, the calculation formula is as follows:

[0042] ;

[0043] in, Represents the sum of the embedded features after the fusion of speech segments, and the global correlation feature Perform average pooling to obtain and compare it with After splicing, it is sent to the classifier to get the prediction result:

[0044] ;

[0045] in, represents the fully connected layer, is a learnable parameter; prediction The predicted speech data classification results.

[0046] Step S3: designing a loss function for optimizing the speech classification network model and presetting training hyperparameters of the speech classification network model;

[0047] The loss function in step S3 includes segment importance balance loss and weighted cross entropy loss, where segment importance balance loss The calculation formula is as follows:

[0048] ;

[0049] ;

[0050] ;

[0051] in, Indicates the first jThe first i The importance coefficient corresponding to the speech segment is Represents the first i The sum of the importance coefficients of the speech segments, is an intermediate variable; batchsize is the training batch size;

[0052] The purpose of the segment importance balance loss is to make the importance coefficients of each speech segment in a training batch relatively balanced.

[0053] Weighted Cross Entropy Loss The calculation formula is as follows:

[0054] ;

[0055] in, ω c It is c The weight of each type of speech data is a hyperparameter; if the number of each type of speech data in the dataset is balanced, ω c Will be set to 1, otherwise set according to the actual situation; M is the number of speech data categories; y c For the c The label of the voice data of the first c The class is 1, otherwise it is 0; p c The speech classification network model predicts that the current speech data is c Probability of class;

[0056] The total loss function is: , is the coefficient of the importance balance loss, which is a hyperparameter. The other training hyperparameters of the speech classification network model include the model learning rate, the number of iterations epoch, and the number of layers of the speech classification network model.

[0057] Step S4: sending the original speech data in the training set into the speech classification network model, and using the Adam optimizer to iteratively optimize and update the parameters of the speech classification network model according to the loss function;

[0058] The specific steps of step S4 are as follows:

[0059] Step S4.1: Use pre-trained parameters for the feature extractor in the speech classification network model and initialize the remaining parameters; select S original speech data in the training set Send it to the speech classification network model and get the corresponding output vector ;

[0060] Step S4.2: Update the remaining parameters through the back-propagation algorithm. , where Adam represents the Adam optimizer, which is one of the gradient descent algorithms; ω are the parameters that are not frozen; α is the learning rate; d ω is the gradient;

[0061] Step S4.3: For all the original speech data in the entire training set, perform steps S4.1 and S4.2 in sequence for a total of 50 iterations.

[0062] Step S5: Train and test the speech classification network model until the speech classification network model reaches a preset convergence condition, and use the trained speech classification network model to implement end-to-end speech data classification.

[0063] The specific steps of step S5 are as follows:

[0064] Step S5.1: input the original speech data into the speech classification network model and calculate the loss function value;

[0065] Step S5.2: If the loss function value decreases to a preset value, it is determined that the speech classification network model has converged; proceed to step S5.3, otherwise return to step S4;

[0066] Step S5.3: Input the speech data to be classified into the converged speech classification network model, and output the classification result of the speech data.

[0067] In order to demonstrate the effectiveness of the present invention, comparative experiments and ablation experiments were conducted. First, the dataset and training details are introduced, and then the comparative experimental results of different algorithms on the dataset are given. A series of ablation experiments are implemented to evaluate the effectiveness of the speech relevance building module and the importance mining module. The initial learning rate of the model is set to 1e-5, which is gradually reduced to 1e-6 through cosine annealing, and the batch size is set to 4. Since different speech segments contribute to different degrees to speech classification and their importance objectively differs, the importance balance loss is only used at the beginning of training, and the coefficient of the importance balance loss is set to Set it to 0.1, so that the speech classification network model corresponding to each speech segment can be optimized evenly in the early stage of training, and after 5 epochs, Set it to 0 to reflect the difference in importance of each speech segment.

[0068] The method of the present invention is compared with other currently popular advanced methods in the field of speech classification, and comparative experiments are conducted on speech datasets MODMA and SEARCH datasets. In the experiment, the features input to the Speechformer series model are wav2vec2 features, and the model parameter settings are the same as the default settings of the code provided in the paper. The pre-trained model used in the experiment of xlsr-Wav2Vec2.0 is the Chinese pre-trained model provided by the huggingface website. The comparative experimental results are shown in Table 1:

[0069]

[0070] In order to verify the effectiveness of each module in the speech classification network model, ablation experiments were conducted on the MODMA dataset and the SEARCH dataset. The speech relevance building module and the fragment importance mining module in the speech classification network model were removed to verify their effectiveness. To ensure that the model structure does not change, when verifying the effectiveness of the fragment importance mining module, the fragment importance mining module is replaced by the maximum pooling. The features of the final output of each speech segment are max-pooled and then concatenated with the corresponding features of the complete audio and sent to the classifier. The ablation experiment results are shown in Table 2. Indicates that the corresponding module is retained in the speech classification network model:

[0071]

[0072] Among the evaluation indicators, WA and UA represent weighted accuracy and unweighted accuracy respectively, and Macro F1 is the macro average F1 score, which is equal to the average of the F1 scores of each category. WA reflects the overall prediction effect of the speech classification network model on the dataset, but it will be greatly affected when the number of class samples is unbalanced, and will tend to be in the category with a large number of samples. In UA and MacroF1, each category is considered equally important in the calculation, so it is less affected by the imbalance of the number of class samples.

[0073] As can be seen from Table 1, in the MODMA dataset, the WA, UA, and Macro F1 of the method proposed in the present invention are 82.59%, 82.17%, and 82.23%, respectively, which are higher than the other compared methods. For the SEARCH dataset, due to the large difference in the number of category samples, WA will tend to be more inclined to the category with a large number of samples, so UA and Macro F1 are more suitable for reflecting the performance of the model. The WA, UA, and Macro F1 of the method proposed in the present invention in the SEARCH dataset are 74.44%, 68.33%, and 69.25%, respectively, which are better than the other compared methods. Compared with the current mainstream speech classification algorithm, the method proposed in the present invention has a significant performance improvement and effectively improves the accuracy of speech classification.

[0074] As can be seen from Table 2, after adding the speech relevance building module, the WA, UA, and Macro F1 of the proposed method on the MODMA dataset are improved by 0.74% (from 81.11% to 81.85%), 0.25% (from 80.83% to 81.08%), and 0.52% (from 80.50% to 81.04%), respectively. The length of a single sample in the SEARCH dataset is longer, and the speech relevance building module brings greater gains, with UA and Macro F1 increased by 4.17% (from 60.83% to 65.00%) and 4.21% (from 61.13% to 65.34%), respectively. It can be seen that the speech relevance building module plays a positive role in speech classification, and the improvement effect is particularly obvious for longer speech data. After adding the fragment importance mining module, the proposed method improves WA, UA, and Macro F1 by 0.74% (from 81.85% to 82.59%), 1.12% (from 81.08% to 82.17%), and 1.19% (from 81.04% to 82.23%) on the MODMA dataset. The improvement effect is more obvious on the SEARCH dataset with greater classification difficulty, with WA, UA, and Macro F1 increased by 4.44% (from 70.00% to 74.44%), 3.33% (from 65.00% to 68.33%), and 3.91% (from 65.34% to 69.25%), respectively. Based on the results in Table 2, each module in the proposed method brings stable improvement to the model on different datasets.

[0075] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. Speech classification method based on speech corpus alignment and adaptive fusion, It is characterized in that Execute the following steps S1 to S5 to complete the voice data classification: Step S1: obtaining original speech data, and dividing the original speech data into a training set and a test set according to a preset ratio; Step S2: constructing a speech classification network model based on speech corpus alignment and adaptive fusion, the speech classification network model including an alignment construction module, a speech relevance construction module, a segment importance mining module, and a fusion detection module; The original speech data is input into the alignment construction module, the original speech data is separated into speech segments, and deep features are extracted from the obtained speech segments and the original speech data respectively; The speech correlation building module is used to capture the mutual connection between speech segments and obtain correlation features; The segment importance mining module is used to perform corpus importance adaptive learning based on the obtained correlation features to obtain the importance coefficient of each speech segment; In the fusion detection module, the features are combined according to the importance coefficient to form the sum embedded feature; and input the classifier to obtain the predicted speech data classification result; Step S3: designing a loss function for optimizing the speech classification network model and presetting training hyperparameters of the speech classification network model; Step S4: sending the original speech data in the training set into the speech classification network model, and using the Adam optimizer to iteratively optimize and update the parameters of the speech classification network model according to the loss function; Step S5: Train and test the speech classification network model until the speech classification network model reaches a preset convergence condition, and use the trained speech classification network model to implement end-to-end speech data classification.

2. The speech classification method based on speech corpus alignment and adaptive fusion according to claim 1, It is characterized in that In step S1, the original speech data is divided into multiple categories according to its difference characteristics; then the original speech data of each category is divided into a training set and a test set according to a ratio of 0.9:0.

1.

3. The speech classification method based on speech corpus alignment and adaptive fusion according to claim 1, It is characterized in that The specific steps of step S2 are as follows: Step S2.1: In the alignment construction module, the speech alignment tool is used to obtain the timestamps of each word in the original speech data, and the original speech data is divided into N speech segments; use the pre-trained wav2vec2.0 feature extractor to extract features from the complete original speech data and each speech segment to obtain the feature vector of the original speech data and the feature vector of each speech segment , where L 2 Indicates the characteristic length of the speech segment, L 1 represents the global feature length, C is the number of feature vector channels; N Each voice segment is set up N A separate Transformer encoder captures deep features within the speech fragment ; Step S2.2: In the speech relevance construction module, the attention mechanism is used to fuse the information of each speech segment to obtain the speech segment interaction features , the calculation formula is as follows: ; in, Represents a splicing operation, is a learnable parameter, Represents multi-head attention, for speech fragments i , its deep features As a query Q , the rest of the voice clips j The result of deep feature concatenation As a key K Sum V ; Global deep features and the segment interaction features of each speech segment Using cross attention respectively, the calculation formula is as follows: ; in, represents bidirectional cross attention, is a learnable parameter; For voice clips i The correlation characteristics of It is a global correlation feature; Step S2.3: Input the relevance features of the speech segments and the global relevance features into the segment importance mining module, and the calculation formula is as follows: ; ; in, and is the learnable parameter matrix, C is the number of feature vector channels, Represents the importance score matrix of the speech segment, L 2 Indicates the characteristic length of the speech segment, L 1 represents the global characteristic length; Indicates the importance of the speech segment. For its u elements; Importance information of speech fragments H The output of the fully connected layer is N dimensional vector TopK Operation, get the importance coefficient G , the calculation formula is as follows: ; In the formula, Representation and N The importance coefficients corresponding to the speech segments, of which only K importance coefficients are not zero, and the remaining NK importance coefficients are all zero; represents the fully connected layer, is a learnable parameter; Step S2.4: In the fusion detection module, the correlation features of each speech segment are analyzed. Perform average pooling to obtain , and weighted addition of the importance coefficients, the calculation formula is as follows: ; in, Represents the sum of the embedded features after the fusion of speech segments, and the global correlation feature Perform average pooling to obtain and compare it with After splicing, it is sent to the classifier to get the prediction result: ; in, represents the fully connected layer, is a learnable parameter; prediction The predicted speech data classification results.

4. The speech classification method based on speech corpus alignment and adaptive fusion according to claim 1, It is characterized in that The loss function in step S3 includes segment importance balance loss and weighted cross entropy loss, where segment importance balance loss The calculation formula is as follows: ; ; ; in, Indicates the first j The first i The importance coefficient corresponding to the speech segment is Represents the first i The sum of the importance coefficients of the speech segments, is the intermediate variable, N is the number of speech segments; Weighted Cross Entropy Loss The calculation formula is as follows: ; in, ω c It is c The weight of the speech-like data is a hyperparameter; M is the number of speech data categories; y c For the c Labels for speech-like data; p c The speech classification network model predicts that the current speech data is c Probability of class; The total loss function is: , is the coefficient of the importance balance loss, which is a hyperparameter. The other training hyperparameters of the speech classification network model include the model learning rate, the number of iterations epoch, and the number of layers of the speech classification network model.

5. The speech classification method based on speech corpus alignment and adaptive fusion according to claim 1, It is characterized in that The specific steps of step S4 are as follows: Step S4.1: Use pre-trained parameters for the feature extractor in the speech classification network model and initialize the remaining parameters; select S original speech data in the training set Send it to the speech classification network model and get the corresponding output vector ; Step S4.2: Update the remaining parameters through the back propagation algorithm. , where Adam represents the Adam optimizer, which is one of the gradient descent algorithms; ω are the parameters that are not frozen; α is the learning rate; d ω is the gradient; Step S4.3: For all the original speech data in the entire training set, perform steps S4.1 and S4.2 in sequence for a total of 50 iterations.

6. The speech classification method based on speech corpus alignment and adaptive fusion according to claim 1, It is characterized in that The specific steps of step S5 are as follows: Step S5.1: input the original speech data into the speech classification network model and calculate the loss function value; Step S5.2: If the loss function value decreases to a preset value, it is determined that the speech classification network model has converged; proceed to step S5.3, otherwise return to step S4; Step S5.3: Input the speech data to be classified into the converged speech classification network model, and output the classification result of the speech data.