Artificial intelligence-based speech detection methods, devices, equipment, and media
By combining multi-dimensional convolutional processing with feature extraction, context modeling, and channel attention modules, the problem of insufficient accuracy of existing speech detection models in financial transactions is solved, achieving higher speech detection accuracy and financial transaction security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2026-04-03
AI Technical Summary
Existing end-to-end speech detection models have low accuracy in financial transactions, making it difficult to effectively distinguish between real and fake speech, resulting in insufficient security for financial transactions.
An AI-based speech detection method is adopted, which combines a feature extraction module, a context modeling module, a channel attention module, and a fully connected layer to perform multi-dimensional convolutional processing, extracting global contextual features and channel attention weights of speech, thereby improving the accuracy of speech detection.
It significantly improves the accuracy of speech detection, enhances the security of financial transactions, effectively distinguishes between real and synthesized speech, and reduces the risks of financial transactions.
Smart Images

Figure CN116543788B_ABST
Abstract
Description
Technical Field
[0001] This invention is applicable to the field of financial technology, and in particular relates to a speech detection method, device, equipment and medium based on artificial intelligence. Background Technology
[0002] With the continuous development of artificial intelligence technology, text-to-speech technology, particularly in voice spoofing, plays a positive role in voice assistants, navigation voice systems, and smart speakers. However, the security of current voiceprint recognition systems is not high. Simple voice spoofing attacks can easily bypass voiceprint login and authentication systems, amplifying the risks of privacy leaks and financial losses. For example, in the fintech field, business personnel need to verify the authenticity of customers' voices during telephone conversations to reduce the risk of financial transactions. However, because spoofed and genuine voices sound similar, the human ear struggles to distinguish them, leading to lower security for financial transactions. Therefore, voice authenticity detection plays a crucial supporting role in financial transactions.
[0003] Detecting the authenticity of speech relies on speech detection systems. Early speech detection systems typically consisted of a front-end feature extractor and a back-end binary classifier. The discriminative features of the front-end usually employed carefully designed handcrafted features, such as spectral and phase features. Meanwhile, the design of the network structure, loss function, and training methods could improve the performance of the speech detection model. However, since the model's potential fundamentally depends on the information captured in the initial features, the creation of handcrafted features inevitably results in the loss of some information, significantly reducing the accuracy of speech detection.
[0004] Therefore, many teams have proposed end-to-end speech detection. Existing end-to-end speech detection uses convolutional layers to extract speech features and serves as the basis for speech detection. However, since convolutional operations can only perform contextual modeling of local regions, the receptive field is limited, resulting in poor ability of existing end-to-end speech detection to extract global features. The extracted speech features are relatively simple, which reduces the accuracy of speech detection and makes it difficult to meet the security requirements of financial transactions.
[0005] Therefore, improving the accuracy of voice detection in financial transaction scenarios within the fintech field has become an urgent problem to be solved. Summary of the Invention
[0006] In view of this, embodiments of the present invention provide a speech detection method, apparatus, computer equipment, and medium based on artificial intelligence to solve the problem of low accuracy in speech detection.
[0007] In a first aspect, embodiments of the present invention provide an artificial intelligence-based speech detection method, the speech detection method comprising:
[0008] A trained speech detection model is obtained, which includes a feature extraction module, a context modeling module, a channel attention module, and a fully connected layer. The speech to be detected is input into the feature extraction module to obtain a speech feature map.
[0009] The speech feature map is input into the context modeling module for convolution to obtain the phoneme attention weights of each phoneme feature in the speech feature map. The phoneme features in the speech feature map and the corresponding phoneme attention weights are fused to obtain the global context features of the speech to be detected.
[0010] The global context features are input into the channel attention module for convolution, and the convolution result is mapped using a preset function to obtain the channel attention weights of each channel in the global context features. The speech feature map and the channel attention weights of each channel are fused to obtain the global speech features of the speech to be detected.
[0011] The global speech features are input into the fully connected layer to obtain the speech detection result of the speech to be detected.
[0012] Secondly, embodiments of the present invention provide an artificial intelligence-based speech detection device, the speech detection device comprising:
[0013] The feature extraction module is used to obtain a trained speech detection model. The speech detection model includes a feature extraction module, a context modeling module, a channel attention module, and a fully connected layer. The speech to be detected is input into the feature extraction module to obtain a speech feature map.
[0014] The phoneme attention weight determination module is used to input the speech feature map into the context modeling module for convolution to obtain the phoneme attention weight of each phoneme feature in the speech feature map, and to fuse each phoneme feature in the speech feature map and the corresponding phoneme attention weight to obtain the global context features of the speech to be detected.
[0015] The channel attention weight determination module is used to input the global context features into the channel attention module for convolution, map the convolution result using a preset function to obtain the channel attention weights of each channel in the global context features, and fuse the speech feature map and the channel attention weights of each channel to obtain the global speech features of the speech to be detected.
[0016] The speech detection module is used to input the global speech features into the fully connected layer to obtain the speech detection result of the speech to be detected.
[0017] Thirdly, embodiments of the present invention provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the speech detection method as described in the first aspect.
[0018] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the speech detection method as described in the first aspect.
[0019] The beneficial effects of this invention compared to existing technologies are as follows: By acquiring a trained speech detection model and inputting the speech to be detected into a feature extraction module to obtain a speech feature map, the speech feature map is input into a context modeling module for convolution to obtain the phoneme attention weights of each phoneme feature in the speech feature map. The various phoneme features and their corresponding phoneme attention weights in the speech feature map are then fused to obtain the global context features of the speech to be detected. Furthermore, by fusing the various phoneme features and their corresponding phoneme attention weights, context features are extracted based on the speech feature map, resulting in richer speech features. The global context features are then input into a... The attention module performs convolution, and a preset function is used to map the convolution result to obtain the channel attention weights of each channel in the global context features. The speech feature map and the channel attention weights of each channel are fused to obtain the global speech features of the speech to be detected. Finally, the global speech features are input into the fully connected layer to obtain the speech detection result of the speech to be detected. The channel attention weights of each channel in the global context features are further obtained and fused with the speech feature map. Multi-dimensional convolution is performed on the speech to be detected to obtain richer features, improve the accuracy of speech detection, and greatly improve the security of financial transactions in the fintech field. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of an application environment for an artificial intelligence-based speech detection method provided in Embodiment 1 of the present invention;
[0022] Figure 2 This is a flowchart illustrating an artificial intelligence-based speech detection method provided in Embodiment 1 of the present invention.
[0023] Figure 3 This is a schematic diagram of the structure of an artificial intelligence-based voice detection device provided in Embodiment 2 of the present invention;
[0024] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Detailed Implementation
[0025] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0026] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0027] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0028] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0029] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0030] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0031] The embodiments of this invention can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0032] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0033] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0034] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0035] The first embodiment of this invention provides an artificial intelligence-based speech detection method, which can be applied to, for example... Figure 1 In this application environment, the client communicates with the server. Clients include, but are not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0036] See Figure 2This is a flowchart illustrating an artificial intelligence-based speech detection method provided in Embodiment 1 of the present invention. The speech detection method described above can be applied to... Figure 1 In a client application, the speech detection method may include the following steps:
[0037] Step S201: Obtain the trained speech detection model. The speech detection model includes a feature extraction module, a context modeling module, a channel attention module, and a fully connected layer. Input the speech to be detected into the feature extraction module to obtain a speech feature map.
[0038] The trained speech detection model is used to extract features from the speech to be detected, and these extracted features serve as the basis for speech detection to obtain the speech detection result. In the financial transaction scenario of the fintech field, the speech to be detected can be obtained by acquiring the telephone communication between business personnel and customers, and extracting the customer's corresponding voice from the telephone communication. By using the trained speech detection model to detect the speech to be detected, the detection result can be obtained. The detection result can be that the speech to be detected is the voice of a real speaker, or it can be the voice synthesized by computer equipment, thereby completing the judgment of the authenticity of the customer's speech to be detected. As the basis for judging customer risk in financial transactions, it greatly improves the security of financial transactions.
[0039] Because existing convolutional operations for speech detection can only perform contextual modeling on local regions of the speech to be detected, the receptive field is limited, resulting in poor ability to extract global features of the speech to be detected and relatively simple speech features.
[0040] In this embodiment, to improve the accuracy of speech detection, the speech detection model includes a feature extraction module, a context modeling module, a channel attention module, and a fully connected layer. The feature extraction module, context modeling module, and channel attention module perform multi-dimensional convolution on the speech to be detected, so that the receptive field can cover the entire feature map, thereby improving the ability to extract global features of the speech to be detected and extracting richer features to improve the accuracy of speech detection.
[0041] Specifically, the speech to be detected is first input into the feature extraction module for feature extraction to obtain a speech feature map. This speech feature map can be used to represent the semantic information contained in the speech to be detected and serve as the basis for subsequent speech detection.
[0042] The above-mentioned process of obtaining a trained speech detection model includes a feature extraction module, a context modeling module, a channel attention module, and a fully connected layer. The step of inputting the speech to be detected into the feature extraction module to obtain a speech feature map involves setting up a feature extraction module, a context modeling module, and a channel attention module to perform multi-dimensional convolutions on the speech to be detected, so that the receptive field can cover the entire feature map, thereby improving the ability to extract global features of the speech to be detected and extracting richer features to improve the accuracy of speech detection.
[0043] Step S202: Input the speech feature map into the context modeling module for convolution to obtain the phoneme attention weights of each phoneme feature in the speech feature map. Then, fuse each phoneme feature in the speech feature map with the corresponding phoneme attention weights to obtain the global context features of the speech to be detected.
[0044] In order to improve the feature extraction capability of the speech to be detected, this embodiment obtains richer features by extracting the contextual features of the speech feature map based on the obtained speech feature map, thereby improving the accuracy of speech detection.
[0045] In this embodiment, the speech feature map includes several phoneme features. After inputting the speech feature map into the context modeling module for convolution, the phoneme attention weights of each phoneme feature in the speech feature map can be obtained. Correspondingly, the larger the phoneme attention weight of the phoneme feature, the greater the feature contribution of the phoneme feature in the fusion to generate global context features. Therefore, by fusing each phoneme feature and its corresponding phoneme attention weight, the global context features of the speech to be detected can be obtained.
[0046] Optionally, the speech feature map includes N phoneme features, and the context modeling module includes a first convolutional submodule and a first normalization submodule, where N is a positive integer;
[0047] The speech feature map is input into the context modeling module to obtain the phoneme attention weights for each phoneme feature in the speech feature map, including:
[0048] The speech feature map is input into the first convolutional submodule. The N phoneme features in the speech feature map are convolved according to the convolution kernel in the first convolutional submodule to obtain the context vector of the speech feature map. The context vector includes N feature values.
[0049] The context vector is normalized according to the first normalization submodule to obtain the N phoneme attention weights of the N phoneme features in the speech feature map.
[0050] The speech feature map includes N phoneme features. The context modeling module includes a first convolution submodule and a first normalization submodule. The first convolution submodule is used to convolve the input speech feature map to extract the phoneme attention weights of each phoneme feature. The first normalization submodule is used to normalize the N phoneme attention weights to reduce data complexity and improve the efficiency of the model.
[0051] Specifically, the speech feature map is input into the first convolutional submodule. The N phoneme features in the speech feature map are convolved according to the convolution kernel in the first convolutional submodule to obtain the context vector of the speech feature map. The convolution kernel size is 1*1 and the number of convolution kernels is 1.
[0052] The first convolutional submodule performs convolution on the input speech feature map, which essentially involves a linear transformation of the speech feature map using a linear transformation matrix. In this embodiment, the first linear transformation matrix of the first convolutional submodule can be denoted as W. k Then the attention weights for each phoneme feature are:
[0053]
[0054] In the formula, N is the number of phoneme features in the speech feature map, and α j Let x be the attention weight of the j-th (j = 1, 2, ..., N) phoneme feature in the speech feature map. j Let x be the j-th phoneme feature in the speech feature map. m For the m-th (m = 1, 2, ..., N) phoneme feature in the speech feature map, W k is the first linear transformation matrix of the first convolutional submodule.
[0055] Then, the context vector is normalized according to the first normalization submodule to obtain N phoneme attention weights corresponding to N phoneme features. Among them, the phoneme attention weights of phoneme features at the same position are the same in different channels of the speech feature map. For example, the phoneme attention weight corresponding to the i-th (i=1,2,...,N) phoneme feature in the first channel of the speech feature map is the same as the phoneme attention weight corresponding to the i-th phoneme feature in the second channel.
[0056] Optionally, the phoneme features and corresponding phoneme attention weights in the speech feature map are fused to obtain the global contextual features of the speech to be detected, including:
[0057] The phoneme attention weights of N phoneme features are concatenated to determine the concatenated result as a phoneme attention vector;
[0058] The phoneme attention vector and the speech feature map are multiplied together, and the result of the multiplication is determined as the global contextual features of the speech to be detected.
[0059] In this process, after obtaining the phoneme attention weights of each phoneme feature in the speech feature map, the N phoneme attention weights are concatenated in the order of each phoneme feature. The concatenation result is used as the phoneme attention vector. Then, the phoneme attention vector is multiplied by the speech feature map to obtain the global context features of the speech to be detected.
[0060] The above steps involve inputting the speech feature map into the context modeling module for convolution to obtain the phoneme attention weights of each phoneme feature in the speech feature map, and fusing each phoneme feature and its corresponding phoneme attention weight to obtain the global context features of the speech to be detected. By determining the phoneme attention weights of each phoneme feature in the speech feature map and fusing each phoneme feature and its corresponding phoneme attention weight, context features are extracted based on the speech feature map, resulting in richer speech features and improving the accuracy of speech detection.
[0061] Step S203: Input the global context features into the channel attention module for convolution, use a preset function to map the convolution result to obtain the channel attention weights of each channel in the global context features, and fuse the speech feature map and the channel attention weights of each channel to obtain the global speech features of the speech to be detected.
[0062] In this embodiment, the speech feature map may include several channel features. In order to further improve the feature extraction capability of the speech to be detected, based on the global context features, this embodiment obtains richer features by determining the channel attention weights of each channel feature in the global context features, thereby improving the accuracy of speech detection.
[0063] Specifically, the global context features are first input into the channel attention module for convolution, and then a preset function is used to map the convolution result to obtain the channel attention weights of each channel feature in the global context features. The preset function can be an activation function to improve the nonlinear representation ability of the convolution result. In this embodiment, the ReLU function can be used for mapping.
[0064] The greater the channel attention weight corresponding to a channel feature, the greater the feature contribution of that channel feature when fusing to generate global speech features. Therefore, each channel feature and its corresponding channel attention weight in the speech feature map are fused to obtain the global speech features of the speech to be detected.
[0065] Optionally, the channel attention module includes a second convolution submodule, a second normalization submodule, and a third convolution submodule;
[0066] The global context features are input into the channel attention module for convolution. A preset function is used to map the convolution result to obtain the channel attention weights of each channel in the global context features, including:
[0067] The global context features are input into the second convolutional submodule for dimensionality reduction to obtain the first channel attention weight features;
[0068] The first channel attention weight features are input into the second normalization submodule for feature normalization processing to obtain the second channel attention weight features.
[0069] The second channel attention weight feature is input into the third convolutional submodule for dimensionality increase, resulting in the channel attention weight feature of the global context feature. The channel attention weight feature includes the channel attention weight of each channel in the global context feature.
[0070] The second convolutional submodule can be used to reduce the dimensionality of the global context features. The second convolutional submodule can use a 1*1 convolutional kernel for convolution calculation. The first channel attention weight feature can refer to the feature representation of the global context features after dimensionality reduction.
[0071] The second normalization submodule may include layer normalization and preset function mapping. Layer normalization can be used to normalize the attention weight features of the first channel. The attention weight features of the second channel can be the feature representation obtained by mapping the layer normalization result through the preset function.
[0072] The third convolutional submodule can be used to increase the dimensionality of the second channel attention weight features. The third convolutional submodule can also use a 1*1 convolutional kernel for convolution calculation. The channel attention weight features of the global context features can refer to the feature representation of the second channel attention weight features after dimensionality increase. The channel attention weight features are obtained from the attention weights of each channel.
[0073] Specifically, the global context features are input into the second convolutional submodule for dimensionality reduction. Dimensionality reduction can be used to reduce model complexity. In this embodiment, a 1*1 convolutional kernel is used for convolution to achieve dimensionality reduction. This can reduce the number of channels of the features while keeping the feature size unchanged, thereby enhancing the information interaction between channels and increasing the nonlinear representation capability of the attention weight feature of the first channel after dimensionality reduction.
[0074] Layer normalization can be implemented using a standard normal distribution, i.e., by calculating the mean μ and variance σ of the attention weight features of the first channel, the layer normalization result z is obtained. ′ It can be represented as Layer normalization can be used to reduce the difficulty of parameter optimization and improve the generalization of the model as a regularization. After obtaining the layer normalization result, a preset activation function is used for mapping processing.
[0075] The second channel attention weight feature is input into the third convolutional submodule for dimensionality increase. The dimensionality increase process can also be performed using a 1*1 convolution kernel. The dimensionality increase process can keep the number of channels of the second channel attention weight feature consistent with that of the global context feature, which facilitates the subsequent feature fusion of the second channel attention weight feature and the global context feature.
[0076] In this embodiment, a 1*1 convolutional kernel is used to reduce the dimensionality of the global context features, which can reduce the number of parameters that the model needs to compute, thereby reducing the complexity of the model. At the same time, the feature information between channels is integrated, which improves the ability of the dimensionality reduction result to represent the correlation between channels and realizes the representation of channel attention. Normalizing the dimensionality reduction result and mapping it with a preset function can reduce the difficulty of model optimization and improve generalization as regularization, while enhancing the nonlinear representation ability of the model.
[0077] Optionally, the global context features are input into the second convolutional submodule for dimensionality reduction to obtain the first channel attention weight features, including:
[0078] The first target dimension is determined based on the channel dimension of the speech feature map and the preset dimensionality reduction coefficient;
[0079] The global context features are input into the second convolutional submodule to obtain the first channel attention weight features that satisfy the first objective dimension.
[0080] Among them, the channel dimension of the speech feature map can refer to the number of channels in the speech feature map, the preset dimensionality reduction coefficient can refer to the scaling ratio of the channel dimension, the first target dimension can refer to the channel dimension after dimensionality reduction, and the first channel attention weight feature that satisfies the first target dimension can refer to the first channel attention weight feature whose channel dimension is the first target dimension.
[0081] Specifically, let the channel dimension of the speech feature map be c, and the preset dimensionality reduction coefficient be r. Then the first target dimension can be expressed as c / r. It should be noted that the first target dimension needs to be an integer. In this embodiment, the first target dimension can be expressed as [c / r], that is, the c / r is rounded down to ensure that the first target dimension is an integer.
[0082] In this embodiment, the first target dimension is determined based on the channel dimension of the speech feature map and the preset dimensionality reduction coefficient. Then, the first channel attention weight feature that satisfies the first target dimension is obtained through dimensionality reduction operation. This can effectively reduce the model complexity, fully extract the dependencies between feature channels, and improve the representation ability of the dimensionality reduction result.
[0083] Optionally, the second channel attention weight features are input into the third convolutional submodule for dimensionality upscaling to obtain the channel attention weight features of the global context features, including:
[0084] The second target dimension is determined based on the channel dimension of the speech feature map;
[0085] The second channel attention weight features are input into the third convolutional submodule for dimensionality increase, resulting in channel attention weight features that satisfy the second objective dimension.
[0086] The second objective dimension can refer to the channel dimension after dimensionality upgrade.
[0087] Specifically, the channel dimension of the speech feature map is used as the second target dimension to ensure that the dimensionality increase result can be directly used to perform feature interaction calculation with the speech feature map. The second target dimension can be represented as c, which is the channel dimension of the speech feature map.
[0088] In this embodiment, the channel dimension of the speech feature map is used as the second target dimension. The channel dimension of the second channel attention weight feature is increased to the same dimension as the speech feature map, which facilitates the subsequent feature fusion of the speech feature map and the increased channel attention weight feature, thereby improving the model's computational efficiency and saving the model's computational resources.
[0089] Optionally, the speech feature map and the channel attention weights of each channel are fused to obtain the global speech features of the speech to be detected, including:
[0090] Broadcast element addition is used to unify the dimensions of the speech feature map and the channel attention weights of each channel, resulting in a dimension-unified speech feature map and channel attention weight features.
[0091] The speech feature map with unified dimensions and the channel attention weights of each channel are fused according to their corresponding positions to obtain the global speech features of the speech to be detected.
[0092] In this process, attention weight features are determined based on the channel attention weights of each channel. Broadcast element addition expands the matrix with fewer rows so that the two matrices can be added together. Therefore, broadcast element addition is first used to unify the dimensions of the speech feature map and the channel attention weight features, resulting in dimension-unified speech feature map and channel attention weight features. Then, the dimension-unified speech feature map and channel attention weight features are fused according to their corresponding positions to obtain the global speech features of the speech to be detected. This global speech feature incorporates factor attention weights and channel attention weights on the basis of the speech feature map, resulting in richer features and improving the accuracy of speech detection.
[0093] The above steps involve inputting global context features into the channel attention module for convolution, mapping the convolution result using a preset function to obtain the channel attention weights of each channel in the global context features, and fusing the speech feature map and the channel attention weights of each channel to obtain the global speech features of the speech to be detected. Based on the global context features that have been fused with factor attention weights, the channel attention weights of each channel in the global context features are further obtained and fused with the speech feature map. Multi-dimensional convolution is performed on the speech to be detected, so that the speech feature map simultaneously incorporates factor attention weights and channel attention weights, resulting in richer features and improving the accuracy of speech detection.
[0094] Step S204: Input the global speech features into the fully connected layer to obtain the speech detection result of the speech to be detected.
[0095] The fully connected layer can be used to classify global speech features. The input of the fully connected layer can be global speech features, and the output of the fully connected layer can be the classification result, which is the speech detection result of the speech to be detected.
[0096] Specifically, in this embodiment, the classification result may include two categories: one is the real speech category, and the other is the synthesized speech category. The real speech category can be used to indicate that the input speech to be detected is the speech of a real speaker, and the synthesized speech category can be used to indicate that the input speech to be detected is the speech synthesized by a computer device.
[0097] After inputting the global speech features into the fully connected layer, the predicted values for each classification category are first output. In this embodiment, the classification result is binary classification, that is, there are two predicted values for two classification categories. The two predicted values are normalized using a normalized exponential function to obtain the predicted probabilities of the two classification categories. The classification category corresponding to the larger predicted probability of the two classification categories is determined as the classification result.
[0098] The steps described above, which input global speech features into a fully connected layer to obtain the speech detection result of the speech to be detected, use the fully connected layer as a classifier to achieve the binary classification task of the speech to be detected and obtain the speech detection result of the speech to be detected. This can effectively improve the recognition accuracy of synthesized speech, thereby better resisting synthesized speech attacks in practical application scenarios, such as voice unlocking scenarios and telephone communication scenarios.
[0099] This invention employs a pre-trained speech detection model. The speech to be detected is input into a feature extraction module to obtain a speech feature map. This feature map is then input into a context modeling module for convolution to obtain phoneme attention weights for each phoneme feature in the speech feature map. The phoneme features and their corresponding attention weights are fused to obtain global context features of the speech to be detected. Further, the global context features are input into a channel attention module for convolution. A preset function maps the convolution results to obtain channel attention weights for each channel within the global context features. The speech feature map and these channel attention weights are then fused to obtain global speech features for the speech to be detected. Finally, the global speech features are input into a fully connected layer to obtain the speech detection result. This process further refines the global context features by obtaining the channel attention weights for each channel and fusing them with the speech feature map. This multi-dimensional convolution of the speech to be detected yields richer features, improves the accuracy of speech detection, and significantly enhances the security of financial transactions in the fintech field.
[0100] Corresponding to the speech detection method in the above embodiments, Figure 3 A structural block diagram of the artificial intelligence-based speech detection device provided in Embodiment 2 of the present invention is given. For ease of explanation, only the parts related to the embodiments of the present invention are shown.
[0101] See Figure 3 The voice detection device includes:
[0102] Feature extraction module 31 is used to obtain a trained speech detection model. The speech detection model includes a feature extraction module, a context modeling module, a channel attention module, and a fully connected layer. The speech to be detected is input into the feature extraction module to obtain a speech feature map.
[0103] The phoneme attention weight determination module 32 is used to input the speech feature map into the context modeling module for convolution to obtain the phoneme attention weight of each phoneme feature in the speech feature map, and to fuse each phoneme feature and the corresponding phoneme attention weight in the speech feature map to obtain the global context features of the speech to be detected.
[0104] The channel attention weight determination module 33 is used to input the global context features into the channel attention module for convolution, and to map the convolution result using a preset function to obtain the channel attention weights of each channel in the global context features. The speech feature map and the channel attention weights of each channel are fused to obtain the global speech features of the speech to be detected.
[0105] The speech detection module 34 is used to input global speech features into the fully connected layer to obtain the speech detection result of the speech to be detected.
[0106] Optionally, the aforementioned phoneme attention weight determination module 32 includes:
[0107] The context vector determination submodule is used to input the speech feature map into the first convolution submodule. The N phoneme features in the speech feature map are convolved according to the convolution kernel in the first convolution submodule to obtain the context vector of the speech feature map. The context vector includes N feature values.
[0108] The phoneme attention weight determination submodule is used to normalize the context vector according to the first normalization submodule to obtain the N phoneme attention weights of N phoneme features in the speech feature map.
[0109] Optionally, the aforementioned phoneme attention weight determination module 32 includes:
[0110] The phoneme attention vector determination submodule is used to concatenate the phoneme attention weights of N phoneme features and determine the concatenation result as a phoneme attention vector.
[0111] The context feature determination submodule is used to multiply the phoneme attention vector and the speech feature map to determine the multiplication result as the global context features of the speech to be detected.
[0112] Optionally, the channel attention weight determination module 33 mentioned above includes:
[0113] The first channel attention weight feature determination submodule is used to input the global context features into the second convolution submodule for dimensionality reduction to obtain the first channel attention weight features;
[0114] The normalization submodule is used to input the first channel attention weight features into the second normalization submodule, perform feature normalization processing, and obtain the second channel attention weight features.
[0115] The channel attention weight feature determination submodule is used to input the second channel attention weight feature into the third convolution submodule for dimensionality increase, so as to obtain the channel attention weight feature of the global context feature. The channel attention weight feature includes the channel attention weight of each channel in the global context feature.
[0116] Optionally, the aforementioned first-channel attention weight feature determination submodule includes:
[0117] The first target dimension determination unit is used to determine the first target dimension based on the channel dimension of the speech feature map and the preset dimensionality reduction coefficient.
[0118] The first channel attention weight feature determination unit is used to input the global context features into the second convolutional submodule to obtain the first channel attention weight features that satisfy the first target dimension.
[0119] Optionally, the aforementioned channel attention weight feature determination submodule includes:
[0120] The second target dimension determination unit is used to determine the second target dimension based on the channel dimension of the speech feature map;
[0121] The channel attention weight feature determination unit is used to input the second channel attention weight feature into the third convolutional submodule for dimensionality increase, so as to obtain the channel attention weight feature that satisfies the second target dimension.
[0122] Optionally, the channel attention weight determination module 33 mentioned above includes:
[0123] The dimension unification submodule is used to perform dimension unification processing on the speech feature map and the channel attention weights of each channel using broadcast element addition, so as to obtain the dimension-unified speech feature map and channel attention weights.
[0124] The feature fusion submodule is used to fuse the unified speech feature map and the channel attention weights of each channel according to their corresponding positions to obtain the global speech features of the speech to be detected.
[0125] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0126] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Figure 4 As shown, the computer device of this embodiment includes: at least one processor ( Figure 4 Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor, which, when executed by the processor, implements the steps in any of the above-described embodiments of the speech detection methods.
[0127] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 4 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0128] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0129] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of a computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0130] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the functions described above can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0131] The present invention can implement all or part of the processes in the methods of the above embodiments, or it can be accomplished by a computer program product. When the computer program product is run on a computer device, the computer device executes the steps in the above method embodiments.
[0132] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0133] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0134] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0135] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0136] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A speech detection method based on artificial intelligence, characterized in that, The speech detection method includes: A trained speech detection model is obtained, which includes a feature extraction module, a context modeling module, a channel attention module, and a fully connected layer. The speech to be detected is input into the feature extraction module to obtain a speech feature map, which is used to represent the semantic information contained in the speech to be detected. The speech feature map is input into the context modeling module for convolution to obtain the phoneme attention weights of each phoneme feature in the speech feature map. The phoneme features in the speech feature map and the corresponding phoneme attention weights are fused to obtain the global context features of the speech to be detected. The global context features are input into the channel attention module for convolution. A preset function is used to map the convolution result to obtain the channel attention weights of each channel in the global context features. The speech feature map and the channel attention weights of each channel are fused to obtain the global speech features of the speech to be detected. The global speech features are input into the fully connected layer to obtain the speech detection result of the speech to be detected; The speech feature map includes N phoneme features, and the context modeling module includes a first convolution submodule and a first normalization submodule, where N is a positive integer. The step of inputting the speech feature map into the context modeling module for convolution to obtain the phoneme attention weights of each phoneme feature in the speech feature map includes: The speech feature map is input into the first convolutional submodule, and the N phoneme features in the speech feature map are convolved according to the convolution kernel in the first convolutional submodule to obtain the context vector of the speech feature map, the context vector including N feature values; The context vector is normalized according to the first normalization submodule to obtain the N phoneme attention weights of the N phoneme features in the speech feature map. The channel attention module includes a second convolution submodule, a second normalization submodule, and a third convolution submodule; The step of inputting the global context features into the channel attention module for convolution, and mapping the convolution result using a preset function to obtain the channel attention weights of each channel in the global context features includes: The global context features are input into the second convolutional submodule for dimensionality reduction to obtain the first channel attention weight features; The first channel attention weight feature is input into the second normalization submodule for feature normalization processing to obtain the second channel attention weight feature. The second channel attention weight feature is input into the third convolutional submodule for dimensionality increase to obtain the channel attention weight feature of the global context feature, wherein the channel attention weight feature includes the channel attention weight of each channel in the global context feature.
2. The speech detection method according to claim 1, characterized in that, The step of fusing each phoneme feature in the speech feature map with the corresponding phoneme attention weight to obtain the global context features of the speech to be detected includes: The phoneme attention weights of the N phoneme features are concatenated to determine the concatenation result as a phoneme attention vector; The phoneme attention vector and the speech feature map are multiplied together, and the result of the multiplication is determined as the global contextual feature of the speech to be detected.
3. The speech detection method according to claim 1, characterized in that, The step of inputting the global context features into the second convolutional submodule for dimensionality reduction to obtain the first channel attention weight features includes: The first target dimension is determined based on the channel dimension of the speech feature map and the preset dimensionality reduction coefficient; The global context features are input into the second convolutional submodule to obtain the first channel attention weight features that satisfy the first target dimension.
4. The speech detection method according to claim 1, characterized in that, The step of inputting the second channel attention weight feature into the third convolutional submodule for dimensionality increase to obtain the channel attention weight feature of the global context feature includes: The second target dimension is determined based on the channel dimension of the speech feature map; The second channel attention weight feature is input into the third convolutional submodule for dimensionality upscaling to obtain channel attention weight features that satisfy the second target dimension.
5. The speech detection method according to any one of claims 1 to 4, characterized in that, The step of fusing the speech feature map and the channel attention weights of each channel to obtain the global speech features of the speech to be detected includes: The speech feature map and the channel attention weights of each channel are subjected to dimension unification processing by broadcast element addition to obtain the dimension-unified speech feature map and channel attention weights. The unified speech feature map and channel attention weights are fused according to their corresponding positions to obtain the global speech features of the speech to be detected.
6. A speech detection device based on artificial intelligence, characterized in that, The voice detection device includes: The feature extraction module is used to obtain a trained speech detection model. The speech detection model includes a feature extraction module, a context modeling module, a channel attention module, and a fully connected layer. The speech to be detected is input into the feature extraction module to obtain a speech feature map. The speech feature map is used to represent the semantic information contained in the speech to be detected. The phoneme attention weight determination module is used to input the speech feature map into the context modeling module for convolution to obtain the phoneme attention weight of each phoneme feature in the speech feature map, and to fuse each phoneme feature in the speech feature map and the corresponding phoneme attention weight to obtain the global context features of the speech to be detected. The channel attention weight determination module is used to input the global context features into the channel attention module for convolution, map the convolution result using a preset function to obtain the channel attention weights of each channel in the global context features, and fuse the speech feature map and the channel attention weights of each channel to obtain the global speech features of the speech to be detected. The speech detection module is used to input the global speech features into the fully connected layer to obtain the speech detection result of the speech to be detected; The speech feature map includes N phoneme features, the context modeling module includes a first convolutional submodule and a first normalization submodule, where N is a positive integer, and the phoneme attention weight determination module includes: The context vector determination submodule is used to input the speech feature map into the first convolution submodule, and to perform convolution on N phoneme features in the speech feature map according to the convolution kernel in the first convolution submodule to obtain the context vector of the speech feature map, wherein the context vector includes N feature values; The phoneme attention weight determination submodule is used to normalize the context vector according to the first normalization submodule to obtain the N phoneme attention weights of the N phoneme features in the speech feature map. The channel attention module includes a second convolution submodule, a second normalization submodule, and a third convolution submodule. The channel attention weight determination module includes: The first channel attention weight feature determination submodule is used to input the global context features into the second convolution submodule for dimensionality reduction to obtain the first channel attention weight features; The normalization submodule is used to input the first channel attention weight features into the second normalization submodule, perform feature normalization processing, and obtain the second channel attention weight features. The channel attention weight feature determination submodule is used to input the second channel attention weight feature into the third convolution submodule for dimensionality increase to obtain the channel attention weight feature of the global context feature. The channel attention weight feature includes the channel attention weight of each channel in the global context feature.
7. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the speech detection method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the speech detection method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Speech emotion recognition method and device based on complementary feature learning framework
CN113593537A