Counterfeit voice detection method and electronic equipment
By performing mute frame detection and zero-value masking on the voice signal, the problem of insufficient robustness of the fake speech detection technology based on deep learning in complex scenarios is solved, and higher detection accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202310496296.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-05
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2043-05-05
AI Technical Summary
The fake speech detection technology based on deep learning is poorly robust in complex scenarios and cross-channel situations, especially in the face of unknown algorithms, and the performance declines are severe.
By mute frame detection of training speech and target speech and zero-value masking, mute content is removed, thereby preventing deep neural network from overfitting the mute content and improving the robustness of the fake speech detection system.
It effectively improves the robustness of the forged speech detection system in complex scenarios, prevents the model from overfitting the silent content, and improves the accuracy of detection of forged speech.
Smart Images

Figure CN119559964A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of acoustics, and more specifically, to a forged voice detection method and electronic device. Background Art
[0002] With the rapid development of speech synthesis and speech conversion technology, high-quality forged speech can be easily generated through deep generation methods. Speech generation and other technologies have brought convenience in areas such as voice interaction, but these technologies can also be maliciously used for telecommunications fraud, propaganda, rumors and slander, etc., posing a threat to social stability and the safety of people's lives and property. The main goal of forged speech detection technology is to automatically identify forged speech efficiently and accurately. A typical forged speech detection system generally consists of two parts: front-end feature extraction and back-end classifier. The front-end extracts discriminative features by analyzing speech signals, and the back-end uses classifiers to determine whether the speech is real or forged. In recent years, systems based on deep learning have gradually become mainstream. The front-end of the system extracts high-dimensional speech features such as spectrograms, and the back-end learns advanced representations of features through deep neural networks to make classification decisions. However, the current forged speech detection technology based on deep learning has poor robustness, especially in the face of cross-channel and unknown algorithm scenarios, the performance is seriously degraded. Summary of the invention
[0003] The purpose of the embodiments of the present application is to enhance the robustness of the current forged speech detection system based on deep neural networks in complex scenarios.
[0004] In a first aspect, an embodiment of the present application provides a robust forged speech detection method for complex scenarios, comprising: a training phase, collecting data for training a first speech signal; determining silent frames and speech frames in the first speech signal; performing zero-value masking on the silent frames of the first speech signal; obtaining features of the masked first speech signal; inputting the features into a forged speech detection model for training to obtain a trained forged speech detection model; an inference phase, the inference phase comprising: collecting data for testing a target speech, performing zero-value masking on the target speech, and obtaining features of the target speech; inputting the features of the target speech into the trained forged speech detection model, and outputting a detection result of the target speech, the detection result comprising whether the target speech is a forged speech or a true speech.
[0005] In this way, the embodiment of the present application detects silent frames for the training speech and the target speech and masks the silent frames, so that the silent content is removed while retaining the silence duration, thereby preventing the deep neural network from overfitting the silent content and improving the robustness of the fake speech detection system.
[0006] In some feasible implementations, determining silence frames and speech frames in a first speech signal includes: dividing the first speech signal into multiple frames, dividing each frame into multiple sub-bands; calculating the logarithmic energy of each sub-band; calculating the sum of the logarithmic energy of each sub-band to obtain the total energy of each frame; determining that the current frame is a silence frame when the total energy of the current frame is less than a first threshold; and performing local and global decisions based on the logarithmic energy of each sub-band of the current frame when the total energy of the current frame is greater than the first threshold, and determining that the current frame is a speech frame based on the local and global decisions.
[0007] In this way, the embodiment of the present application performs silence detection on speech to distinguish between silence frames and speech frames.
[0008] In some feasible implementations, determining silent frames and speech frames in a first speech signal includes: dividing the first speech signal with a Nyquist frequency of 4 kHz to obtain six sub-bands of 80-250 Hz, 250-500 Hz, 500-1 kHz, 1k-2 kHz, 2k-3 kHz, and 3k-4 kHz.
[0009] In this way, the embodiment of the present application obtains effective information of speech based on the Nyquist sampling theorem.
[0010] In some achievable implementations, local and global decisions are made based on the logarithmic energy of each subband of the current frame, including: calculating the logarithmic likelihood ratio of each subband energy of the current frame through a Gaussian mixture model, making a local decision based on the logarithmic likelihood ratio of each subband and a second threshold, the result of the local decision being a speech frame or a silent frame; calculating the weighted sum of the logarithmic likelihood ratios of each subband of the current frame, making a global decision based on the weighted sum and a third threshold, the result of the global decision being a speech frame or a silent frame; when the result of the local decision is a speech frame or the result of the global decision is a speech frame, determining that the decision result of the current frame is a speech frame.
[0011] In this way, through local analysis and global analysis of speech energy distribution, the decision result of the current speech frame can be accurately determined as a speech frame.
[0012] In some achievable implementations, performing zero-value time-domain masking on the silence frames of the first speech signal includes: performing smoothing according to the decision result of each frame and setting the value of the silence frame to 0.
[0013] In this way, the embodiment of the present application directly optimizes the speech signal by detecting and masking silent frames, forcing the model to pay more attention to the non-silent part of the forged speech.
[0014] In some achievable implementations, the feature is a spectrogram feature, and the feature of the first speech signal is obtained, including: obtaining a second speech signal by pre-emphasis and masking the first speech signal; and performing a short-time Fourier transform on the second speech signal to obtain a spectrogram feature.
[0015] In this way, the embodiment of the present application optimizes the voice signal while obtaining information such as the voice rhythm contained in the silence duration, which can effectively improve the robustness of the system.
[0016] In some feasible implementations, the feature is a linear frequency cepstral coefficient feature, and the feature of the first speech signal is obtained, including: passing the spectrogram feature through a set of linearly distributed filters to obtain a filter group feature; and obtaining a linear frequency cepstral coefficient feature by taking the logarithm and discrete cosine transform based on the filter group feature.
[0017] In this way, the embodiments of the present application can extract more effective features and alleviate overfitting.
[0018] In some achievable implementations, the features are spectrogram features, and the features are input into a fake speech detection model for training to obtain a trained fake speech detection model, including: inputting the spectrogram features into a squeeze-excitation network, using residual connections to deepen the network depth, and obtaining embedded features; sending the embedded features into a binary classification linear layer to obtain a classification result; and training the squeeze-excitation network and the binary classification linear layer using an Adam optimizer and an angular loss function to obtain a trained fake speech detection model.
[0019] Therefore, the embodiment of the present application sends the spectrogram features into the Squeeze-Excitation Network (SENet), uses residual connections to deepen the network depth, and at the same time alleviates the problem of gradient vanishing. The squeeze-excitation operation increases the weight of the effective channel features.
[0020] In some achievable implementations, the feature is a linear frequency cepstral coefficient feature, and the feature is input into a forged speech detection model for training to obtain a trained forged speech detection model, including: inputting the linear frequency cepstral coefficient feature into a light convolutional neural network; the light convolutional neural network outputs embedded features through a maximum feature mapping operation; the embedded features are sent to a binary classification linear layer to obtain a classification result; the light convolutional neural network and the binary classification linear layer are trained using an Adam optimizer and an angular loss function to obtain a trained forged speech detection model.
[0021] In this way, the embodiments of the present application can reduce model parameters and alleviate overfitting while extracting effective features.
[0022] In the second aspect, the embodiment of the present application provides a forged speech detection device, which includes: a training module and an inference module. The training module collects the first speech signal for training; determines the silent frames and speech frames in the first speech signal; performs zero-value masking on the silent frames of the first speech signal; obtains the features of the masked first speech signal; inputs the features into a forged speech detection model for training to obtain a trained forged speech detection model; the inference module collects the target speech and obtains the features of the target speech; inputs the features of the target speech into the trained forged speech detection model, and outputs the detection result of the target speech, and the detection result includes whether the target speech is a forged speech or a true speech. Its beneficial effects are as described in the first aspect and will not be repeated here.
[0023] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one memory for storing programs; and at least one processor for executing programs stored in the memory, wherein when the program stored in the memory is executed, the processor is used to execute a method as described in any one of the first aspects.
[0024] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a computer program is stored; the computer program is used to implement the method described in any embodiment of the first aspect above.
[0025] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, the computer executes any embodiment method of the above-mentioned first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the multiple embodiments disclosed in this specification, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only the multiple embodiments disclosed in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] The following is a brief introduction to the drawings required for describing the embodiments or prior art.
[0028] Figure 1 A flowchart of a method for detecting forged speech is provided for an embodiment of the present application;
[0029] Figure 2 A flow chart of the training phase of the forged voice detection method is provided for the embodiment of the present application;
[0030] Figure 3 A schematic diagram of a method and device for detecting forged voice is provided for an embodiment of the present application;
[0031] Figure 4A schematic diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0033] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.
[0034] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "multiple" means two or more. For example, multiple systems refers to two or more systems, and multiple terminals refers to two or more terminals.
[0035] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0036] In the description of the embodiments of the present application, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0037] In the description of the embodiments of the present application, the terms "first\second\third, etc." or module A, module B, module C, etc. are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0038] In the description of the embodiments of the present application, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps will be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or they can be executed simultaneously.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0040] Figure 1 A flowchart of a method for detecting fake voice is provided for an embodiment of the present application. Figure 1 As shown, it includes: a training stage, the steps of the training stage include: S11, collecting a first speech signal for training; S12, determining the silence frames and speech frames in the first speech signal, and masking the silence frames of the first speech signal with zero values; S13, obtaining the features of the masked first speech signal; S14, inputting the features into a forged speech detection model for training to obtain a trained forged speech detection model; an inference stage, the steps of the inference stage include: S15, collecting a target speech and obtaining the features of the target speech; S16, inputting the features of the target speech into the trained forged speech detection model, and outputting the detection result of the target speech, the detection result including whether the target speech is a forged speech or a true speech.
[0041] The following is a description of a forged voice detection method provided in accordance with an embodiment of the present application.
[0042] S11, in the training stage, collecting the first speech signal for training.
[0043] In real applications, the common channel speech such as telephone is 8kHz, so the training and test speech can be downsampled to 8k for easy application.
[0044] In the embodiment of the present application, it can be determined that the sampling frequency of the training speech is 8 kHz. If the sampling frequency is higher than 8 kHz, the sampling frequency is reduced to 8 kHz, and down-sampling is performed to obtain the first speech signal for training.
[0045] S12, determining silence frames and speech frames in the first speech signal, and performing zero-value masking on the silence frames.
[0046] In the embodiment of the present application, silence detection is performed on the training speech to distinguish between silence frames and speech frames, and zero-value masking is performed on the silence frames. Figure 2 As shown, silence detection can be performed through the following steps S121-S128.
[0047] S121, dividing the training speech acquired by the downsampling frequency into frames, wherein the training speech is divided into multiple frames.
[0048] Exemplarily, a 20 ms training speech is divided into 5 frames, each frame having a duration of 4 ms.
[0049] S122, frequency-divide each frame to obtain multiple sub-bands.
[0050] Based on the Nyquist sampling theorem, the frequency of effective information of the 8kHz signal is lower than half of the sampling rate. In the embodiment of the present application, each frame of the training speech is divided into six sub-bands: 80-250Hz, 250-500Hz, 500-1kHz, 1k-2kHz, 2k-3kHz, and 3k-4kHz.
[0051] S123, calculating the logarithmic energy of each sub-band; calculating the sum of the logarithmic energy of each sub-band to obtain the total energy of each frame.
[0052] Exemplarily, the logarithmic energy of each of the six sub-bands of 80-250 Hz, 250-500 Hz, 500-1 kHz, 1 k-2 kHz, 2 k-3 kHz, and 3 k-4 kHz is calculated respectively, and the sum of the logarithmic energies of the six sub-bands is calculated to obtain the total energy of each frame.
[0053] S124, judging the total energy of each frame, when the total energy of the current frame is greater than the first threshold, executing S125, when the total energy of the current frame is less than the first threshold, determining that the current frame is a silent frame.
[0054] S125, when the total energy of the current frame is greater than the first threshold, perform local and global decisions based on the logarithmic energy of each subband of the current frame, and determine whether the current frame is a speech frame based on the local and global decision results.
[0055] In the embodiment of the present application, a Gaussian mixture model representing the two distributions of noise and speech is used to calculate the log-likelihood ratio of each subband energy of the current frame through the Gaussian mixture model, and a local decision is made based on the log-likelihood ratio of each subband and the second threshold, and the local decision result is a speech frame or a silent frame. A global decision is made based on the weighted sum of multiple subband log-likelihood ratios and the third threshold, and the global decision result is a speech frame or a silent frame.
[0056] Perform an OR operation on the local decision result and the global decision result to obtain the decision result of the current frame.
[0057] Exemplarily, if the local decision result is a silent frame and the global decision result is a speech frame, then the current frame is a speech frame; if the local decision result is a speech frame and the global decision result is a silent frame, then the current frame is a speech frame; if the local decision result is a speech frame and the global decision result is a speech frame, then the current frame is a speech frame; if the local decision result is a silent frame and the global decision result is a silent frame, then the current frame is a silent frame.
[0058] S126: Label each frame according to the judgment result to determine the silence frame and the speech frame in the first speech signal.
[0059] S127, smoothing is performed according to the judgment result of each frame to obtain a global silence detection result, and the value of the silence frame is set to 0.
[0060] In some implementations, the sliding window average of the decision results of five adjacent frames is taken and then rounded to obtain a global silence detection result.
[0061] S128, determining the minimum value of the logarithmic energies of multiple sub-bands of each frame, and updating the Gaussian mixture model parameters according to the minimum value.
[0062] In some implementations, the minimum values of the first 16 logarithmic energies in 100 frames may be obtained for each subband, and the mean and variance of the Gaussian mixture model may be updated by an expectation-maximization (EM) algorithm. Updating the Gaussian mixture model parameters may improve the accuracy of silence detection of the Gaussian mixture model.
[0063] S13, obtaining features of the masked first speech signal.
[0064] In some embodiments, training can be performed through the following steps.
[0065] S131, pre-emphasize the masked first speech signal to obtain a second speech signal, and the pre-emphasis formula is:
[0066] y(n)=x(n)-0.97·x(n-1) (1)
[0067] Among them, x(n) is the masked speech sampled at the nth time, x(n-1) is the masked speech sampled at the n-1th time, and y(n) is the pre-emphasized speech sampled at the nth time.
[0068] S132, transform the pre-emphasized speech y(n) to obtain features. In some implementations, the first speech signal after pre-emphasis masking can be obtained to obtain a second speech signal; and the second speech signal is subjected to a short-time Fourier transform to obtain a spectrogram feature.
[0069] In some implementations, the spectrogram features may be passed through a set of linearly distributed filters to obtain filter bank features; logarithms and discrete cosine transforms are performed based on the filter bank features to obtain linear frequency cepstrum coefficient features.
[0070] S14, inputting the features into a forged speech detection model for training to obtain a trained forged speech detection model.
[0071] In the embodiment of the present application, the features are input into a deep neural network, the embedded features are extracted, the embedded features are input into a binary classification linear layer, and the classification results are output, and the classification results are the likelihood values of silence and the likelihood values of speech. The Adam optimizer is used to update the parameters of the deep neural network and the binary classification linear layer, and training is performed to obtain a trained forged voice detection model.
[0072] In the verification phase, the labeled verification speech is collected for verification, and the speech features of the verification speech are obtained through silence detection and feature extraction. The speech features of the verification speech are input into the trained forged speech detection model to obtain the verification result.
[0073] S15, the steps of the inference stage include: collecting the target speech and obtaining the characteristics of the target speech; inputting the characteristics of the target speech into the trained forged speech detection model, and outputting the detection result of the target speech, the detection result includes whether the target speech is forged speech or the target speech is real speech or speech.
[0074] Example 1
[0075] Embodiment 1 of the present application provides a forged voice detection method for complex scenarios, including:
[0076] S21, collect a speech signal to obtain a training speech, wherein the sampling frequency of the training speech is 8 kHz, and if the sampling frequency is higher than 8 kHz, the sampling frequency is reduced to 8 kHz. The training speech can be used as the first speech signal.
[0077] S22, dividing the training speech with a Nyquist frequency of 4 kHz into two parts, 0-2 kHz and 2k-4 kHz, and further dividing the 2k-4 kHz part into two parts, 2k-3 kHz and 3k-4 kHz.
[0078] In the range of 0~2kHz, it is first divided into two parts: 0~1kHz and 1k~2kHz, then 0~250Hz and 250~500Hz are selected from 0~1kHz, and finally the 0~250Hz part is high-pass filtered to obtain the sub-band of 80~250Hz. So far, a total of six sub-bands are obtained: 80~250Hz, 250~500Hz, 500~1kHz, 1k~2kHz, 2k~3kHz, and 3k~4kHz.
[0079] S23, performing silence detection on the training speech, marking silence frames and speech frames in the training speech; performing zero-value time-domain masking on the silence frames in the training speech, and obtaining masked speech.
[0080] The specific implementation method refers to steps S121-S128 and will not be repeated here.
[0081] S24, extracting features of each frame of the masked speech.
[0082] In Example 1 of the present application, pre-emphasis processing is performed on the masked training speech, and the pre-emphasis formula can refer to formula (1).
[0083] The pre-emphasized training speech is subjected to short-time Fourier transform to obtain the spectrogram features. The short-time Fourier transform is defined as:
[0084]
[0085] Where x(τ) is a single-frame speech signal, h(τ-t) is the analysis window function, τ is the offset, and f is the sampling frequency.
[0086] In one implementation, the spectrogram features may be passed through a set of linearly distributed filters to obtain filter bank features, and then logarithm and discrete cosine transform may be performed based on the filter bank features to obtain linear frequency cepstrum coefficient features.
[0087] S25, inputting the spectrogram features or the linear frequency cepstral coefficient features into the deep neural network, outputting the embedded features, and sending the embedded features into the binary classification linear layer to obtain a classification result, which is a likelihood value of natural speech. Natural speech refers to non-forged speech.
[0088] Generally, the deep neural network with the original waveform as input is first filtered and feature extracted by SincNet, and then sent to the subsequent convolutional neural network or graph network to extract embedded features.
[0089] In one implementation, the spectrogram features may be input into a squeeze-excitation network, and the network depth may be deepened using residual connections to obtain embedded features, which are then sent into a binary classification linear layer to obtain a classification result, which is a likelihood value of natural speech.
[0090] During the training process, the squeeze-excitation network and the linear layer are trained using the Adam optimizer and the Angular Softmax (A-Softmax) loss function to obtain a fake speech detection model.
[0091] Among them, the formula of Adam optimizer is:
[0092]
[0093] m t =β1m t-1 +(1-β1)g t (4)
[0094]
[0095]
[0096]
[0097]
[0098] In formula (3), g(t) is the loss function For the model parameters θ t The gradient of To find the partial derivative. In formula (4), m t is the first-order moment estimate of the gradient at time t in momentum form, and β1 is the exponential decay that controls the first-order moment estimate. t is the second-order moment estimate of the gradient at time t in momentum form. In formula (6) is the first-order moment estimation bias corrected estimator. In formula (7) is the estimated value after the second-order moment estimation bias is corrected, and β2 is the exponential decay of the second-order moment estimation. Formula (8) is the update formula of the model parameters, and η is the learning rate.
[0099] The calculation formula of A-Softmax loss function is:
[0100]
[0101] where ||x I || is the modulus of the embedded feature, k∈[0,m-1], m is an integer and m≥1, here m=4 is selected.
[0102] The optimizer parameters are: β1 = 0.9, β2 = 0.999, ∈ = 10 -8 , weight decay is 10 -k During the training process, the learning rate was first increased to 1e-3 through warm-up, and then decreased exponentially, for a total of 12 cycles.
[0103] In Example 1 of the present application, the spectrogram features are sent to the Squeeze-Excitation Network (SENet), and residual connections are used to deepen the network depth, while alleviating the problem of gradient vanishing. The squeeze-excitation operation increases the weight of the effective channel features.
[0104] The squeezing operation in the squeeze-excitation network compresses features along the spatial dimension, converting each two-dimensional feature channel into a real number, characterizing the global distribution of responses on the feature channel, and allowing the layers close to the input to obtain a global receptive field.
[0105] The excitation operation is similar to the gate mechanism in a recurrent neural network. It explicitly models the correlation between feature channels by learning weight parameters, generates weights for each feature channel, and weights them channel by channel to the previous features through multiplication, thus completing the recalibration of the original features in the channel dimension.
[0106] In some embodiments, the linear frequency cepstral coefficient feature can be fed into a light convolutional neural network, which outputs embedded features through a maximum feature mapping operation. The embedded features are fed into a binary classification linear layer to obtain a classification result, which is a likelihood value of natural speech. During the training process, the light convolutional neural network and the binary classification linear layer are trained using an Adam optimizer and an angle loss function to obtain a trained forged speech detection model. In this way, while extracting effective features, the model parameters can be reduced to alleviate overfitting.
[0107] In the inference stage, the target speech used for the test is collected to determine the silent frames and speech frames in the target speech; the target speech is masked with zero values to obtain the features of the masked target speech; the features of the target speech are input into the trained forged speech detection model to obtain the detection result of whether the target speech is forged speech.
[0108] Among them, the implementation method of collecting the target speech used for the test can refer to step S11; the implementation method of determining the silent frames and speech frames in the target speech and masking the target speech with zero values can refer to steps S121-S128; the implementation method of obtaining the features of the masked target speech can refer to steps S131-S132; no further details will be given here.
[0109] The embodiment of the present application improves the robustness of the forged speech detection system to complex scenarios and unknown algorithms by performing zero-value masking on the silent frames of the training speech and the target speech.
[0110] The embodiment of the present application detects and masks silent frames, forcing the model to pay more attention to the non-silent part of the forged speech, while retaining information such as speech rhythm contained in the silence duration, effectively improving the robustness of the system. In addition, the embodiment of the present application directly optimizes the speech signal, which is independent of the subsequent feature extraction and model, and is therefore applicable to various forged speech detection systems and has good generalization.
[0111] Figure 3 This is a schematic diagram of a forged voice detection device provided by this application. Figure 3As shown, the device 30 includes: a training module 31 and an inference module 32. The training module 31 collects a first speech signal for training; determines a silent frame and a speech frame in the first speech signal; performs zero-value masking on the silent frame of the first speech signal; obtains the features of the masked first speech signal; inputs the features into a forged speech detection model for training to obtain a trained forged speech detection model; the inference module 32 collects a target speech and obtains the features of the target speech; inputs the features of the target speech into the trained forged speech detection model, and outputs a detection result of the target speech, the detection result including whether the target speech is a forged speech or a true speech.
[0112] In some embodiments, the training module 31 divides the first speech signal into multiple frames, divides the frequency of each frame to obtain multiple sub-bands; calculates the logarithmic energy of each sub-band; calculates the sum of the logarithmic energy of each sub-band to obtain the total energy of each frame; when the total energy of the current frame is less than a first threshold, determines that the current frame is a silent frame; when the total energy of the current frame is greater than the first threshold, performs local and global judgments based on the logarithmic energy of each sub-band of the current frame, and determines that the current frame is a speech frame based on the local and global judgment results.
[0113] In some implementations, the training module 31 divides the first speech signal with a Nyquist frequency of 4 kHz to obtain six sub-bands of 80-250 Hz, 250-500 Hz, 500-1 kHz, 1k-2 kHz, 2k-3 kHz, and 3k-4 kHz.
[0114] In some embodiments, the training module 31 performs local and global decisions based on the logarithmic energy of each subband of the current frame, including: calculating the log-likelihood ratio of each subband energy of the current frame through a Gaussian mixture model, performing local decisions based on the log-likelihood ratio of each subband and a second threshold, and the result of the local decision is a speech frame or a silent frame; calculating the weighted sum of the log-likelihood ratios of each subband of the current frame, performing global decisions based on the weighted sum and a third threshold, and the result of the global decision is a speech frame or a silent frame; when the result of the local decision is a speech frame or the result of the global decision is a speech frame, determining that the decision result of the current frame is a speech frame.
[0115] In some implementations, the training module 31 performs zero-value time-domain masking on the silence frames of the first speech signal, including: smoothing according to the decision result of each frame, and setting the value of the silence frame to 0.
[0116] In some embodiments, the feature is a spectrogram feature, and the training module obtains the feature of the first speech signal, including: obtaining a second speech signal by pre-emphasis and masking the first speech signal; and performing a short-time Fourier transform on the second speech signal to obtain a spectrogram feature.
[0117] In some embodiments, the feature is a linear frequency cepstral coefficient feature, and the training module obtains the feature of the first speech signal, including: passing the spectrogram feature through a set of linearly distributed filters to obtain a filter group feature; and obtaining a linear frequency cepstral coefficient feature by taking the logarithm and discrete cosine transform based on the filter group feature.
[0118] In some embodiments, the feature is a spectrogram feature, and the training module inputs the feature into a fake speech detection model for training to obtain a trained fake speech detection model, including: inputting the spectrogram feature into a squeeze-excitation network, using residual connections to deepen the network depth, and obtaining embedded features; sending the embedded features into a binary classification linear layer to obtain a classification result; training the squeeze-excitation network and the binary classification linear layer using an Adam optimizer and an angular loss function to obtain a trained fake speech detection model.
[0119] In some embodiments, the feature is a linear frequency cepstral coefficient feature, and the training module inputs the feature into a fake speech detection model for training to obtain a trained fake speech detection model, including: inputting the linear frequency cepstral coefficient feature into a light convolutional neural network; the light convolutional neural network outputs embedded features through a maximum feature mapping operation; the embedded features are sent to a binary classification linear layer to obtain a classification result; the light convolutional neural network and the binary classification linear layer are trained using an Adam optimizer and an angular loss function to obtain a trained fake speech detection model.
[0120] Figure 4 A schematic diagram of an electronic device provided in this application. Figure 4 As shown, the electronic device 100 includes: a bus 102, a processor 104, a memory 106 and a communication interface 108. The processor 104, the memory 106 and the communication interface 108 communicate with each other through the bus 102. The electronic device 100 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the electronic device 100.
[0121] The bus 102 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The bus 102 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 102 may include a path for transmitting information between various components of the electronic device 100 (eg, the memory 106, the processor 104, and the communication interface 108).
[0122] The processor 104 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0123] The memory 106 may include a volatile memory, such as a random access memory (RAM). The memory 106 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0124] The memory 106 stores executable program codes, and the processor 104 executes the executable program codes to respectively implement the functions of the aforementioned training module 31 and reasoning module 32 , that is, the memory 106 stores instructions for executing the container status detection method.
[0125] The communication interface 108 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the electronic device 100 and other devices or a communication network.
[0126] The electronic devices provided in the embodiments of the present application, such as mobile phones, computers, servers, smart homes, vehicles, etc., can execute the scheme shown in the above method embodiments. The implementation principles and beneficial effects are similar and will not be repeated here.
[0127] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
Claims
1. A method for detecting forged speech, characterized in that: The method comprises: The training phase includes: Collecting a first speech signal for training; Determining silence frames and speech frames in the first speech signal; Performing zero-value masking on the silence frames of the first speech signal; Acquire the features of the first speech signal after masking; Inputting the features into a forged speech detection model for training to obtain a trained forged speech detection model; The reasoning stage includes: The target speech is collected for testing, and the silence frames and speech frames in the target speech are determined; the target speech is masked with zero value to obtain the features of the masked target speech; the features of the target speech are input into the trained forged speech detection model, and the detection result of the target speech is output, and the detection result includes whether the target speech is forged speech or the target speech is real speech.
2. The forged voice detection method according to claim 1, characterized in that: The determining of silence frames and speech frames in the first speech signal includes: Dividing the first speech signal into multiple frames, and dividing the frequency of each frame to obtain multiple sub-bands; Calculating the logarithmic energy of each subband; calculating the sum of the logarithmic energy of each subband to obtain the total energy of each frame; When the total energy of the current frame is less than a first threshold, determining that the current frame is a silent frame; When the total energy of the current frame is greater than a first threshold, local and global decisions are made according to the logarithmic energy of each subband of the current frame, and the current frame is determined to be a speech frame according to the local and global decision results.
3. The forged voice detection method according to claim 1, characterized in that: The determining of silence frames and speech frames in the first speech signal includes: The first speech signal with a Nyquist frequency of 4 kHz is divided into six sub-bands of 80-250 Hz, 250-500 Hz, 500-1 kHz, 1k-2 kHz, 2k-3 kHz, and 3k-4 kHz.
4. The forged speech detection method according to claim 2 or 3, characterized in that: The performing local decision and global decision according to the logarithmic energy of each subband of the current frame comprises: Calculating a log-likelihood ratio of each subband energy of the current frame through a Gaussian mixture model, and performing a local decision according to the log-likelihood ratio of each subband and a second threshold, wherein the result of the local decision is a speech frame or a silence frame; Calculating a weighted sum of the log-likelihood ratios of each subband of the current frame, and making a global decision based on the weighted sum and a third threshold, wherein a result of the global decision is a speech frame or a silence frame; In the case where the result of the local decision is a speech frame or the result of the global decision is a speech frame, it is determined that the decision result of the current frame is a speech frame.
5. The forged voice detection method according to any one of claims 1 to 3, characterized in that: The performing zero-value time-domain masking on the silence frame of the first speech signal includes: Smoothing is performed according to the decision result of each frame, and the value of the silent frame is set to 0.
6. The forged voice detection method according to any one of claims 1 to 3, characterized in that: The feature is a spectrogram feature, and the step of obtaining the feature of the first speech signal includes: Pre-emphasizing the masked first speech signal to obtain a second speech signal; Perform short-time Fourier transform on the second speech signal to obtain a spectrogram feature.
7. The forged voice detection method according to claim 6, characterized in that: The feature is a linear frequency cepstral coefficient feature, and the step of acquiring the feature of the first speech signal includes: Passing the spectrogram features through a set of linearly distributed filters to obtain filter bank features; Logarithm and discrete cosine transform are calculated according to the filter bank characteristics to obtain the linear frequency cepstrum coefficient characteristics.
8. The forged voice detection method according to any one of claims 1 to 3, characterized in that: The feature is a spectrogram feature, and the feature is input into a forged speech detection model for training to obtain a trained forged speech detection model, including: Inputting the spectrogram features into a squeeze-excitation network, using residual connections to increase the depth of the network, and obtaining embedded features; Send the embedded features to a binary classification linear layer to obtain a classification result; The squeeze-excitation network and the binary linear layer are trained using an Adam optimizer and an angle loss function to obtain a trained forged speech detection model.
9. The forged speech detection method according to claims 1-3, characterized in that: The feature is a linear frequency cepstral coefficient feature, and the feature is input into a forged speech detection model for training to obtain a trained forged speech detection model, including: Inputting the linear frequency cepstral coefficient features into a light convolutional neural network; The light convolutional neural network outputs embedded features through a maximum feature mapping operation; Send the embedded features to a binary classification linear layer to obtain a classification result; The lightweight convolutional neural network and the binary linear layer are trained using an Adam optimizer and an angle loss function to obtain a trained forged speech detection model.
10. An electronic device, characterized in that: include: at least one memory for storing a program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Deep neural network-based multi-class acoustic feature integration method and system
CN111276131A
METHOD OF PROCESSING AN AUDIO STREAM FOR THE RECOGNITION OF VOICES AND / OR BACKGROUND SOUNDS AND RELATED SYSTEM
IT202100017513A1
Multi-type acoustic feature integration method and system based on deep neural networks
US20210233511A1