A synthesized speech detection method and apparatus, an electronic device, and a storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-05
- Publication Date
- 2026-08-11
AI Technical Summary
但由于任务特点和当前深度学习技术的局限性,目前基于深度学习的合成语音检测技术对数据集依赖性强,容易对已知数据的合成算法过拟合,在检测合成语音信号时,存在检测准确率低的技术问题
[0017] The synthesized speech detection method, apparatus, electronic device, and storage medium provided in the embodiments of the present invention can acquire a first speech signal from a first set; generate a first cross-entropy loss function based on the first speech signal and a preset classification model; generate posterior distribution features of data outside the first set approximating the current model parameters of the classification model; generate a second cross-entropy loss function based on the posterior distribution features; generate a total loss function based on the first cross-entropy loss function and the second cross-entropy loss function; perform gradient backpropagation using the total loss function to update the parameters of the classification model to obtain an updated classification model; and input the acoustic features of the speech signal to be detected into the updated classification model to obtain the detection result of the speech signal to be detected. In this way, by inputting the acoustic features of the first speech signal into the preset classification model, the likelihood values of the real speech and the synthesized speech output by the classification model can be obtained, and the first cross-entropy loss function can be generated accordingly. Then, the posterior distribution features of data outside the first set can be generated, and the second cross-entropy loss function can be generated accordingly. The total loss function can be generated based on the first and second cross-entropy loss functions. This allows the likelihood values of data outside the first set to be incorporated into the total loss function. By training the classification model using the total loss function, the classification model can be updated, thereby reducing the originally high likelihood value of the synthesized speech output by the updated classification model when recognizing speech signals. This can effectively improve the accuracy of synthesized speech detection.
Smart Images

Figure CN116758943B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of speech recognition technology, and in particular to a method, apparatus, electronic device, and storage medium for synthesized speech detection. Background Technology
[0002] With the rapid development of artificial intelligence technology, high-quality synthesized speech can be generated for specific individuals, bringing tremendous convenience to virtual humans, human-computer interaction, and content creation. However, synthesized speech technology can also be used maliciously, such as for telecommunications fraud, spreading malicious statements and false information, posing a significant threat to national and social stability and the safety of people's lives and property.
[0003] To address this, synthetic speech detection technology has emerged, using artificial intelligence to identify synthetic speech generated by various speech synthesis algorithms. In recent years, deep learning-based detection systems have gradually become mainstream. The front end extracts time-frequency features of speech using different methods (such as spectrogram features and Mel-spectrum features), while the back end learns high-level representations of these features through deep neural networks and determines whether the speech signal is synthetic. However, due to the characteristics of the task and the limitations of current deep learning technology, current deep learning-based synthetic speech detection technologies are highly dependent on datasets and prone to overfitting to synthesis algorithms on known data, resulting in low detection accuracy when detecting synthetic speech signals. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for detecting synthesized speech, which can improve the accuracy of detecting synthesized speech.
[0005] In a first aspect, embodiments of the present invention provide a synthetic speech detection method, comprising: acquiring a first speech signal from a first set; the first speech signal including a real speech signal and a synthetic speech signal; extracting acoustic features of the first speech signal; inputting the acoustic features of the first speech signal into a preset classification model to obtain the likelihood values of the real speech and the synthetic speech output by the classification model; generating a first cross-entropy loss function based on the likelihood values of the real speech and the synthetic speech; generating posterior distribution features of data approximating the data outside the first set under the current model parameters of the classification model, and generating a second cross-entropy loss function based on the posterior distribution features; performing a weighted summation operation on the first cross-entropy loss function and the second cross-entropy loss function to obtain a total loss function; using the total loss function for gradient backpropagation to update the parameters of the classification model to obtain an updated classification model; and inputting the acoustic features of the speech signal to be detected into the updated classification model to obtain the detection result of the speech signal to be detected.
[0006] Optionally, generating the posterior distribution features of data outside the first set under the current model parameters of the classification model includes: randomly sampling from the embedded feature cache and generating the posterior distribution features of data outside the first set under the current model parameters of the classification model through a stochastic gradient Langevin dynamic sampling process.
[0007] Optionally, generating the second cross-entropy loss function based on the posterior distribution features includes: inputting the posterior distribution features into the classification model to obtain a first likelihood value that the first speech signal is real speech, a second likelihood value that the first speech signal is synthesized speech, and a third likelihood value that the first speech signal is speech outside the first set; and determining the second cross-entropy loss function based on the first likelihood value, the second likelihood value, and the third likelihood value.
[0008] Optionally, the step of extracting the acoustic features of the first speech signal includes: preprocessing the first speech signal to obtain a preprocessing result; the preprocessing includes pre-emphasis processing, frame segmentation processing, and windowing processing; performing time-frequency analysis on the preprocessing result using the short-time Fourier transform method to obtain a time-frequency analysis result; calculating the logarithmic amplitude spectrum of the obtained time-frequency analysis result, and using the logarithmic amplitude spectrum as the acoustic feature of the first speech signal.
[0009] Optionally, the preprocessing of the first speech signal to obtain a preprocessing result includes: performing data enhancement processing on the first speech signal to obtain a first processing result; the data enhancement processing includes noise addition processing and reverberation processing; and performing preprocessing on the first processing result to obtain a preprocessing result.
[0010] Secondly, embodiments of the present invention provide a synthetic speech detection device, comprising: a first acquisition module for acquiring a first speech signal from a first set; the first speech signal including a real speech signal and a synthetic speech signal; an extraction module for extracting acoustic features of the first speech signal; a second acquisition module for inputting the acoustic features of the first speech signal into a preset classification model to obtain the likelihood values of the real speech and the synthetic speech output by the classification model; a first generation module for generating a first cross-entropy loss function based on the likelihood values of the real speech and the synthetic speech; a second generation module for generating posterior distribution features of data outside the first set approximating the current model parameters of the classification model, and generating a second cross-entropy loss function based on the posterior distribution features; a summation module for performing a weighted summation operation on the first cross-entropy loss function and the second cross-entropy loss function to obtain a total loss function; an update module for performing gradient backpropagation using the total loss function to update the parameters of the classification model to obtain an updated classification model; and a third acquisition module for inputting the acoustic features of the speech signal to be detected into the updated classification model to obtain the detection result of the speech signal to be detected.
[0011] Optionally, the second generation module is specifically used to: randomly sample from the embedded feature cache through the stochastic gradient Langevin dynamic sampling process and generate posterior distribution features of data outside the first set under the current model parameters of the classification model.
[0012] Optionally, the second generation module is specifically used to: input the posterior distribution features into the classification model to obtain a first likelihood value for the first speech signal as real speech, a second likelihood value for the first speech signal as synthesized speech, and a third likelihood value for the first speech signal as speech outside the first set; and determine a second cross-entropy loss function based on the first likelihood value, the second likelihood value, and the third likelihood value.
[0013] Optionally, the extraction module includes: a preprocessing submodule, used to preprocess the first speech signal to obtain a preprocessing result; the preprocessing includes pre-emphasis processing, frame segmentation processing, and windowing processing; an analysis submodule, used to perform time-frequency analysis on the preprocessing result using a short-time Fourier transform device to obtain a time-frequency analysis result; and a calculation submodule, used to calculate the logarithmic amplitude spectrum of the obtained time-frequency analysis result, and use the logarithmic amplitude spectrum as the acoustic feature of the first speech signal.
[0014] Optionally, the preprocessing submodule includes: an enhancement processing unit, used to perform data enhancement processing on the first speech signal to obtain a first processing result; the data enhancement processing includes noise addition processing and reverberation processing; and a preprocessing unit, used to preprocess the first processing result to obtain a preprocessing result.
[0015] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed within the space enclosed by the housing, and the processor and the memory are disposed on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing any of the synthesized speech detection methods provided in the embodiments of the present invention.
[0016] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement any of the synthesized speech detection methods provided in the embodiments of the present invention.
[0017] The synthesized speech detection method, apparatus, electronic device, and storage medium provided in the embodiments of the present invention can acquire a first speech signal from a first set; generate a first cross-entropy loss function based on the first speech signal and a preset classification model; generate posterior distribution features of data outside the first set approximating the current model parameters of the classification model; generate a second cross-entropy loss function based on the posterior distribution features; generate a total loss function based on the first cross-entropy loss function and the second cross-entropy loss function; perform gradient backpropagation using the total loss function to update the parameters of the classification model to obtain an updated classification model; and input the acoustic features of the speech signal to be detected into the updated classification model to obtain the detection result of the speech signal to be detected. In this way, by inputting the acoustic features of the first speech signal into the preset classification model, the likelihood values of the real speech and the synthesized speech output by the classification model can be obtained, and the first cross-entropy loss function can be generated accordingly. Then, the posterior distribution features of data outside the first set can be generated, and the second cross-entropy loss function can be generated accordingly. The total loss function can be generated based on the first and second cross-entropy loss functions. This allows the likelihood values of data outside the first set to be incorporated into the total loss function. By training the classification model using the total loss function, the classification model can be updated, thereby reducing the originally high likelihood value of the synthesized speech output by the updated classification model when recognizing speech signals. This can effectively improve the accuracy of synthesized speech detection. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, 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.
[0019] Figure 1 This is a flowchart illustrating a synthetic speech detection method provided in an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of a synthesized speech detection device provided in an embodiment of the present invention;
[0021] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0022] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0023] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0024] Firstly, such as Figure 1 As shown, the synthesized speech detection method provided in the embodiments of the present invention may include:
[0025] S11, acquire the first speech signal from the first set; the first speech signal includes real speech signal and synthesized speech signal;
[0026] In this step, the first set can be a pre-established set, which includes both real speech signals and synthesized speech signals. The embodiments of the present invention do not limit the specific method for generating synthesized speech signals.
[0027] S12, extract the acoustic features of the first speech signal;
[0028] S13, input the acoustic features of the first speech signal into a preset classification model to obtain the likelihood value of the real speech and the likelihood value of the synthesized speech output by the classification model.
[0029] S14, Generate a first cross-entropy loss function based on the likelihood value of the real speech and the likelihood value of the synthesized speech;
[0030] In this step, the preset classification model can be a convolutional neural network (CNN), which is a deep learning model or a multilayer perceptron similar to an artificial neural network. The loss function is a metric that measures how well the classification model predicts the desired output given a specific input.
[0031] After acquiring the first speech signal, acoustic features of the first speech signal (including both real and synthesized speech) can be extracted. For example, the acoustic features can be a speech spectrogram. After inputting the extracted acoustic features into a classification model, the likelihood values of the first speech signal being real speech and the likelihood values of the first speech signal being synthesized speech can be obtained, and their sum is 1. Based on these two likelihood values, a first cross-entropy loss function can be generated.
[0032] For example, the aforementioned acoustic features are fed into a convolutional neural network classification model, and the classification loss is calculated. The neural network used here is WideResNet22, where 22 represents 22 trainable layers. From shallow to deep, it consists of a head convolutional layer, 16 residual blocks with squeezed activation modules, and a final fully connected layer. The head convolutional layer has a kernel size of 3, a span of 1, padding of 1, and 16 output channels. Each residual block contains two 2D convolutional layers with identical parameters except for the span. The kernel size is 3, and residual connections are performed, along with Leakey ReLU activation and batch regularization. All residual blocks are divided into three groups according to the number of (2, 2, 2), with spans of (2, 1, 2) and output channels of (32, 64, 128), respectively. Residual connections deepen the network while mitigating the gradient vanishing problem. The embedded features output by the convolutional neural network are passed through a linear classification layer to obtain the likelihood values of real speech and synthesized speech. Finally, the cross-entropy loss function (i.e., the first cross-entropy loss function) is calculated using the likelihood values. The formula for calculating the cross-entropy loss function is as follows: Where K is the total number of categories, which is 2 here (i.e., real speech type and synthesized speech type, a total of two categories), p is the category label, and q is the corresponding likelihood value.
[0033] S15, Generate the posterior distribution features of the data outside the first set under the current model parameters of the classification model, and generate the second cross-entropy loss function based on the posterior distribution features;
[0034] In this step, the data outside the first set refers to speech signals that do not belong to the first set. Based on the posterior distribution characteristics of the data outside the first set, a second cross-entropy loss function can be generated, thus including the likelihood values of the data outside the first set.
[0035] S16, perform a weighted summation operation on the first cross-entropy loss function and the second cross-entropy loss function to obtain the total loss function;
[0036] In this step, different weights can be assigned to the first cross-entropy loss function and the second cross-entropy loss function, and the two can be weighted and added together to obtain the total loss function. For example, the weight value of the first cross-entropy loss function is 1, and the weight value of the second cross-entropy loss function is 0.1.
[0037] S17, Gradient backpropagation is performed using the total loss function to update the parameters of the classification model, so as to obtain the updated classification model;
[0038] In this step, the gradient of the loss function is used to represent the direction in which the weights and biases of the classification model should be adjusted to improve performance. Gradient backpropagation is the foundation of the Adam optimizer algorithm, a popular optimization algorithm. During the training of the classification model, the Adam optimizer calculates the gradient of the total loss function with respect to the classification model parameters and updates the classification model parameters in a way that minimizes the loss, thereby completing the training of the classification model.
[0039] For example, gradient backpropagation is performed using the loss function, and the Adam optimizer is used to update the parameters of the convolutional neural network and the linear classification layer to obtain a speech synthesis forgery detection model. The formula for the Adam optimizer can be:
[0040]
[0041] m t =β1m t-1 +(1-β1)g t
[0042]
[0043]
[0044]
[0045]
[0046] Where g(t) is the loss function For model parameters θ t The partial derivative, To find the partial derivative. m t With v t These are the first and second moment estimates of the gradient at time t in momentum form, respectively. and These are the bias-corrected estimates, and β1 and β2 are the exponential decays controlling the first and second moment estimates, respectively. The last term is the parameter update formula, where η is the learning rate. The optimizer parameters can be: β1 = 0.9, β2 = 0.999, ∈ = 10. -8 The weight decays to 10. -4 During training, the learning rate is first increased to 10% as a warm-up. -3 After that, the negative exponent decreased, and a total of 100 training cycles were completed.
[0047] S18, input the acoustic features of the speech signal to be detected into the updated classification model to obtain the detection result of the speech signal to be detected.
[0048] In this step, because the updated classification model incorporates the likelihood values of data outside the first set, it reduces the originally high likelihood value of synthesized speech output by the updated classification model when detecting the speech signal, effectively improving the accuracy of synthesized speech detection. For example, the output of an out-of-set real speech signal processed by an untrained classification model is: 4% probability of being real speech and 96% probability of being synthesized speech. Both probabilities are higher than the actual situation, meaning the untrained classification model has a low accuracy in detecting synthesized speech. After training the classification model using the method in this embodiment, out-of-set speech signals are introduced, changing the previous binary classification model to a ternary classification model. The classification result of the aforementioned out-of-set real speech signal after processing by the ternary model is: a probability (likelihood value) of 2% for real speech, a probability of 60% for synthesized speech, and a probability of 38% for out-of-set speech. This reduces the originally high likelihood value of synthesized speech output when recognizing the speech signal, effectively improving the accuracy of synthesized speech detection.
[0049] The synthesized speech detection method provided in this invention inputs the acoustic features of a first speech signal into a preset classification model to obtain the likelihood values of the real speech and the synthesized speech output by the classification model, thereby generating a first cross-entropy loss function. Then, posterior distribution features of data outside the first set are generated, and a second cross-entropy loss function is generated accordingly. A total loss function is generated based on the first and second cross-entropy loss functions. This incorporates the likelihood values of data outside the first set into the total loss function. Training the classification model using the total loss function updates the model, reducing the previously high likelihood value of synthesized speech output by the updated model when recognizing speech signals, thus effectively improving the accuracy of synthesized speech detection.
[0050] Optionally, in one embodiment of the present invention, the step of generating the posterior distribution features of the data outside the first set under the current model parameters of the classification model (step S15) may include: randomly sampling from the embedded feature cache through the stochastic gradient Langevin dynamic sampling process and generating the posterior distribution features of the data outside the first set under the current model parameters of the classification model.
[0051] In this embodiment of the invention, the Langevin dynamic sampling process features fast sampling speed, high sampling quality, and wide applicability. Random sampling can be performed using the Langevin dynamic sampling process, and based on the sampling results, a posterior distribution feature approximating data outside the first set can be generated.
[0052] For example, the approximation of the posterior distribution of out-of-set data can be achieved through a stochastic gradient Langevin dynamic sampling process. First, the embedded feature cache is randomly initialized, and then the out-of-set distribution is approximated using stochastic gradient Langevin dynamic sampling. The Langevin dynamic sampling formula is:
[0053]
[0054] Where z t Let be the embedded feature, t be the iteration step, α be the step size, and ∈ be Gaussian random noise. Then, the approximately obtained out-of-set data distribution embedded feature is fed into the penultimate convolutional layer of the classification model's convolutional neural network, and the cross-entropy loss of the approximate out-of-set data feature output likelihood is calculated.
[0055] Optionally, in one embodiment of the present invention, generating the second cross-entropy loss function based on the posterior distribution features includes: inputting the posterior distribution features into the classification model to obtain a first likelihood value that the first speech signal is real speech, a second likelihood value that the first speech signal is synthesized speech, and a third likelihood value that the first speech signal is speech outside the first set; and determining the second cross-entropy loss function based on the first likelihood value, the second likelihood value, and the third likelihood value.
[0056] In this embodiment of the invention, the posterior distribution features obtained in the aforementioned process are input into the classification model. The classification model can output a first likelihood value indicating that the first speech signal is real speech, a second likelihood value indicating that the first speech signal is synthesized speech, and a third likelihood value indicating that the first speech signal is speech outside the first set. Based on these three likelihood values, a second cross-entropy loss function can be obtained, thus incorporating the likelihood values of data outside the first set into the second cross-entropy loss function.
[0057] Optionally, in one embodiment of the present invention, the extraction of acoustic features of the first speech signal includes: preprocessing the first speech signal to obtain a preprocessing result; the preprocessing includes pre-emphasis processing, frame segmentation processing, and windowing processing; performing time-frequency analysis on the preprocessing result using the short-time Fourier transform method to obtain a time-frequency analysis result; calculating the logarithmic amplitude spectrum of the obtained time-frequency analysis result, and using the logarithmic amplitude spectrum as the acoustic feature of the first speech signal.
[0058] In this embodiment of the invention, when extracting the acoustic features of the first speech signal, the first speech signal can first undergo pre-emphasis processing, frame segmentation processing, and windowing processing to obtain the corresponding processing results. For example, the pre-emphasis formula can be: y(n) = x(n) - 0.97·x(n-1). The frame length and window length during frame segmentation and windowing processing can be 25ms, and the window function is a Hamming window, with the following formula: Then, by performing time-frequency analysis on the above processing results using the short-time Fourier transform method, the time-frequency analysis results can be obtained; the short-time Fourier transform is defined as: Where x(τ) is a single-frame speech signal, h(τ-t) is the analysis window function, and τ is the offset. N is the window length, n is the currently calculated sampling point, f is the frequency, and t is the currently calculated sampling point. Finally, the logarithmic amplitude spectrum of the aforementioned time-frequency analysis results can be calculated, and this logarithmic amplitude spectrum can be used as the acoustic feature of the first speech signal.
[0059] Optionally, in one embodiment of the present invention, the preprocessing of the first speech signal to obtain a preprocessing result may include: performing data enhancement processing on the first speech signal to obtain a first processing result; the data enhancement processing includes noise addition processing and reverberation processing; and performing preprocessing on the first processing result to obtain a preprocessing result.
[0060] In this embodiment of the invention, the first speech signal can first undergo data enhancement processing operations such as noise addition and reverberation processing to obtain the data enhancement processing result. Then, the data enhancement processing result is subjected to pre-emphasis processing, frame segmentation processing, and windowing processing operations.
[0061] Specifically, the noise addition process can be as follows: Noise is randomly selected from the noise dataset; therefore, the frequency and signal-to-noise ratio (SNR) of the selected noise are completely random. The selected noise is then energy-normalized according to the SNR parameter, and finally, the energy-normalized noise is superimposed on the first speech signal. The reverberation addition process can be as follows: Reverberation impulse response and SNR are randomly selected from the room reverberation dataset. The reverberated audio is energy-normalized according to the SNR parameter and then convolved with the first speech signal.
[0062] Secondly, such as Figure 2 As shown, the synthetic speech detection device 2 provided in the embodiments of the present invention may include: a first acquisition module 21, used to acquire a first speech signal in a first set; the first speech signal includes a real speech signal and a synthetic speech signal; an extraction module 22, used to extract acoustic features of the first speech signal; a second acquisition module 23, used to input the acoustic features of the first speech signal into a preset classification model to obtain the likelihood values of the real speech and the synthetic speech output by the classification model; a first generation module 24, used to generate a first cross-entropy loss function based on the likelihood values of the real speech and the synthetic speech; and a second generation module 25. Block 25 is used to generate posterior distribution features of data outside the first set under the current model parameters of the classification model, and generate a second cross-entropy loss function based on the posterior distribution features; Summation module 26 is used to perform a weighted summation operation on the first cross-entropy loss function and the second cross-entropy loss function to obtain a total loss function; Update module 27 is used to perform gradient backpropagation using the total loss function to update the parameters of the classification model to obtain an updated classification model; Third acquisition module 28 is used to input the acoustic features of the speech signal to be detected into the updated classification model to obtain the detection result of the speech signal to be detected.
[0063] The synthesized speech detection device provided in this embodiment of the invention inputs the acoustic features of a first speech signal into a preset classification model to obtain the likelihood values of the real speech and the synthesized speech output by the classification model, and then generates a first cross-entropy loss function based on these values. Next, it generates the posterior distribution features of data outside the first set, and generates a second cross-entropy loss function based on these features. A total loss function is generated based on the first and second cross-entropy loss functions. This incorporates the likelihood values of data outside the first set into the total loss function. Training the classification model using the total loss function updates the model, reducing the previously high likelihood value of the synthesized speech output by the updated model when recognizing speech signals, thereby effectively improving the accuracy of synthesized speech detection.
[0064] Optionally, in one embodiment of the present invention, the second generation module 25 is specifically used to: randomly sample from the embedded feature cache through the stochastic gradient Langevin dynamic sampling process and generate posterior distribution features of data outside the first set under the current model parameters of the classification model.
[0065] Optionally, in one embodiment of the present invention, the second generation module 25 is specifically used to: input the posterior distribution features into the classification model to obtain a first likelihood value for the first speech signal as real speech, a second likelihood value for the first speech signal as synthesized speech, and a third likelihood value for the first speech signal as speech outside the first set; and determine a second cross-entropy loss function based on the first likelihood value, the second likelihood value, and the third likelihood value.
[0066] Optionally, in one embodiment of the present invention, the extraction module 22 includes: a preprocessing submodule, used to preprocess the first speech signal to obtain a preprocessing result; the preprocessing includes pre-emphasis processing, frame segmentation processing, and windowing processing; an analysis submodule, used to perform time-frequency analysis on the preprocessing result using a short-time Fourier transform device to obtain a time-frequency analysis result; and a calculation submodule, used to calculate the logarithmic amplitude spectrum of the obtained time-frequency analysis result, and use the logarithmic amplitude spectrum as the acoustic feature of the first speech signal.
[0067] Optionally, in one embodiment of the present invention, the preprocessing submodule includes: an enhancement processing unit, configured to perform data enhancement processing on the first speech signal to obtain a first processing result; the data enhancement processing includes noise addition processing and reverberation processing; and a preprocessing unit, configured to preprocess the first processing result to obtain a preprocessing result.
[0068] Thirdly, embodiments of the present invention also provide an electronic device capable of improving the accuracy of detecting synthesized speech.
[0069] like Figure 3 As shown, the electronic device provided in the embodiments of the present invention may include: a housing 51, a processor 52, a memory 53, a circuit board 54, and a power supply circuit 55, wherein the circuit board 54 is disposed inside the space enclosed by the housing 51, and the processor 52 and the memory 53 are disposed on the circuit board 54; the power supply circuit 55 is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory 53 is used to store executable program code; the processor 52 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 53, for executing the synthesized speech detection method provided in any of the foregoing embodiments.
[0070] For details on the specific execution process of the above steps by the processor 52 and the steps further executed by the processor 52 by running executable program code, please refer to the description of the foregoing embodiments, which will not be repeated here.
[0071] The aforementioned electronic devices exist in various forms, including but not limited to:
[0072] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include: smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones, etc.
[0073] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.
[0074] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes: audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
[0075] (4) Server: A device that provides computing services. The components of a server include a processor, hard disk, memory, system bus, etc. Servers are similar to general computer architectures, but because they need to provide highly reliable services, they have higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0076] (5) Other electronic devices with data interaction functions.
[0077] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement any of the synthesized speech detection methods provided in the foregoing embodiments, thus achieving the corresponding technical effects. This has been described in detail above and will not be repeated here.
[0078] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0079] The various embodiments in this specification are described in a related manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0080] In particular, the device embodiment is basically similar to the method embodiment, so the description is relatively simple. For relevant details, please refer to the description of the method embodiment.
[0081] For ease of description, the above apparatus is described by dividing it into various functional units / modules. Of course, in implementing this invention, the functions of each unit / module can be implemented in one or more software and / or hardware.
[0082] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0083] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A synthesized speech detection method characterized by, include: Acquire a first speech signal from a first set; the first speech signal includes real speech signals and synthesized speech signals; Extract the acoustic features of the first speech signal; The acoustic features of the first speech signal are input into a preset classification model to obtain the likelihood values of the real speech and the synthetic speech output by the classification model. A first cross-entropy loss function is generated based on the likelihood values of the real speech and the synthesized speech. Generate posterior distribution features of data approximating the first set under the current model parameters of the classification model; generate a second cross-entropy loss function based on the posterior distribution features; generating the second cross-entropy loss function based on the posterior distribution features includes: inputting the posterior distribution features into the classification model to obtain a first likelihood value that the first speech signal is real speech, a second likelihood value that the first speech signal is synthesized speech, and a third likelihood value that the first speech signal is speech outside the first set; and determining the second cross-entropy loss function based on the first likelihood value, the second likelihood value, and the third likelihood value. The first cross-entropy loss function and the second cross-entropy loss function are weighted and summed to obtain the total loss function. Gradient backpropagation is performed using the total loss function to update the parameters of the classification model, thereby obtaining the updated classification model. The acoustic features of the speech signal to be detected are input into the updated classification model to obtain the detection result of the speech signal to be detected.
2. The method of claim 1, wherein, The posterior distribution features of the data outside the first set, approximating the current model parameters used to generate the classification model, include: The classification model uses a stochastic gradient Langevin dynamic sampling process to randomly sample from the embedded feature cache and generate approximate posterior distribution features of data outside the first set under the current model parameters.
3. The method of claim 1, wherein, The extraction of acoustic features from the first speech signal includes: The first speech signal is preprocessed to obtain a preprocessing result; the preprocessing includes pre-emphasis processing, frame segmentation processing, and windowing processing. The preprocessed results are subjected to time-frequency analysis using the short-time Fourier transform method to obtain the time-frequency analysis results. The logarithmic amplitude spectrum of the obtained time-frequency analysis result is calculated, and the logarithmic amplitude spectrum is used as the acoustic feature of the first speech signal.
4. The method of claim 3, wherein, The preprocessing of the first speech signal to obtain a preprocessing result includes: The first speech signal is subjected to data enhancement processing to obtain a first processing result; the data enhancement processing includes noise addition processing and reverberation processing. The first processing result is preprocessed to obtain a preprocessed result.
5. A synthesized voice detection apparatus characterized by comprising: include: The first acquisition module is used to acquire a first speech signal from a first set; the first speech signal includes real speech signals and synthesized speech signals. An extraction module is used to extract the acoustic features of the first speech signal; The second acquisition module is used to input the acoustic features of the first speech signal into a preset classification model to obtain the likelihood value of the real speech and the likelihood value of the synthesized speech output by the classification model. The first generation module is used to generate a first cross-entropy loss function based on the likelihood value of the real speech and the likelihood value of the synthesized speech. The second generation module is used to generate posterior distribution features of data outside the first set approximating the current model parameters of the classification model, and to generate a second cross-entropy loss function based on the posterior distribution features; the second generation module is specifically used for: The posterior distribution features are input into the classification model to obtain a first likelihood value that the first speech signal is real speech, a second likelihood value that the first speech signal is synthesized speech, and a third likelihood value that the first speech signal is speech outside the first set. The second cross-entropy loss function is determined based on the first likelihood value, the second likelihood value, and the third likelihood value. The summation module is used to perform a weighted summation operation on the first cross-entropy loss function and the second cross-entropy loss function to obtain the total loss function; The update module is used to perform gradient backpropagation using the total loss function to update the parameters of the classification model, so as to obtain the updated classification model. The third acquisition module is used to input the acoustic features of the speech signal to be detected into the updated classification model to obtain the detection result of the speech signal to be detected.
6. The apparatus of claim 5, wherein, The second generation module is specifically used to: randomly sample from the embedded feature cache through the stochastic gradient Langevin dynamic sampling process and generate the posterior distribution features of the data outside the first set under the current model parameters of the classification model.
7. An electronic device, comprising: The electronic device includes: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside the space enclosed by the housing, and the processor and the memory are disposed on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the synthesized speech detection method according to any one of claims 1-4.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the synthetic speech detection method according to any one of claims 1-4.
Citation Information
Patent Citations
Artificially synthesized speech detection method and device, computer equipment and storage medium
CN112185417A
Speech recognition model training method and device, electronic equipment and storage medium
CN116343770A