Voice detection model training method and device, equipment and storage medium
Through iterative training of the speech detection model and loss value calculation, the problem of inaccurate speech detection is solved, and high accuracy verification and security guarantee of speech authenticity are achieved.
Patent Information
- Application Number
- CN202411333777.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-07
AI Technical Summary
In the detection of forged speech, the prior art has inaccurate voice detection due to the high natural authenticity of forged speech, resulting in inaccurate voice detection and ineffective distinction between true voice and forged voice.
The speech detection model is adopted, including the speech feature extraction sub-model, the speech enhancer model and the feature extraction sub-model. By obtaining the characteristics and object identification features of the trained speech, the loss value is calculated and iteratively trained, and the embedded identification features are generated to verify the authenticity of the speech. .
It improves the accuracy of voice authenticity detection, avoids misauthorization problems caused by forgery of voice, and enhances the security of voice verification.
Smart Images

Figure CN119274583A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and specifically to a speech detection model training method, apparatus, device and storage medium. Background Art
[0002] With the development and widespread application of artificial intelligence technology, some artificial intelligence models can now generate fake voices by acquiring people's real voices and then learning. As fake voices become more and more natural and realistic, even close to real voices, fake voices bring many security issues, such as the spread of negative information caused by the abuse of fake voices.
[0003] In the related art, the voice detection method is often through traditional voice feature analysis, such as obtaining the voice's timbre, frequency and other information, and then matching it with the timbre, frequency and other information recorded in the database, and then determining whether the voice is real or forged. However, when the forged voice is more natural and realistic, the voice detection method in the related art will make it impossible to accurately identify the forged voice.
[0004] Therefore, there is a technical problem in the related art that the detection of speech authenticity is inaccurate. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, device and storage medium for training a speech detection model. The trained speech detection model can detect the authenticity of speech.
[0006] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a speech detection model training method, wherein the speech detection model includes a speech feature extraction sub-model, a speech enhancement sub-model and a feature extraction sub-model, and the method includes:
[0007] Acquire training speech, input the training speech into the trained speech feature extraction sub-model, output a first speech feature corresponding to the training speech, and determine a first loss value between the first speech feature and the training speech;
[0008] Obtaining an object identification feature corresponding to the training speech, inputting the object identification feature and the first speech feature into a trained speech enhancement sub-model, outputting a second speech feature, and determining a second loss value between the second speech feature and the first speech feature;
[0009] Inputting the second speech feature into the feature extraction sub-model, outputting a target object identification feature, and determining a third loss value between the target object identification feature and the object identification feature;
[0010] A total loss value is determined according to the first loss value, the second loss value and the third loss value, and the feature extraction sub-model in the speech detection model is iteratively trained according to the total loss value to obtain a trained speech detection model.
[0011] In some implementations, inputting the second speech feature into the feature extraction sub-model and outputting the target object identification feature includes:
[0012] Performing voice interference on the second voice feature to generate a target second voice feature;
[0013] The target second speech feature is input into the feature extraction sub-model, and a target object identification feature is output.
[0014] In some implementations, inputting the object identification feature and the first speech feature into a trained speech enhancement sub-model to output a second speech feature includes:
[0015] Determine each sub-first speech feature in the first speech feature;
[0016] Inputting each of the sub-first speech features and the object identification feature into the trained speech enhancement sub-model, and outputting the sub-second speech feature corresponding to each of the sub-first speech features;
[0017] The second voice feature is generated according to the second voice sub-feature corresponding to each first voice sub-feature.
[0018] In some implementations, determining a third loss value between the target object identification feature and the object identification feature includes:
[0019] determining a sub-loss value between the target object identification feature and the object identification feature for each sub-second speech feature;
[0020] The number of all the sub-second voice features is determined, and the sub-loss values corresponding to all the sub-second voice features are added and divided by the number to obtain a third loss value between the target object identification feature and the object identification feature.
[0021] In some implementations, determining a total loss value according to the first loss value, the second loss value, and the third loss value includes:
[0022] Multiplying the first loss value by a first preset coefficient to obtain a first result;
[0023] Multiplying the second loss value by a second preset coefficient to obtain a second result;
[0024] Multiplying the third loss value by a third preset coefficient to obtain a third result;
[0025] The first result, the second result and the third result are added together to obtain a total loss value.
[0026] In some implementations, before inputting the training speech into the trained speech feature extraction sub-model and outputting the first speech feature corresponding to the training speech, the method further includes:
[0027] Acquire sample speech, input the sample speech into the speech feature extraction submodel, and output the extracted speech features;
[0028] Inputting the extracted speech features into the speech enhancement sub-model and outputting enhanced speech features;
[0029] Determining a first target loss value between the extracted speech feature and the sample speech, and a second target loss value between the extracted speech feature and the enhanced speech feature;
[0030] Determine a third target loss value according to the first target loss value and the second target loss value;
[0031] When the third target loss value is greater than the preset target loss value, the parameters of the speech feature extraction submodel and the speech enhancement submodel are adjusted to iterate the speech feature extraction submodel and the speech enhancement submodel, and return to execute to obtain sample speech until the third target loss value is no greater than the preset target loss value, thereby obtaining a trained speech feature extraction submodel and a trained speech enhancement submodel.
[0032] In some implementations, after obtaining the trained speech detection model, the method further includes:
[0033] Acquire an input speech of an object, input the input speech into the trained speech feature extraction sub-model, and output a target first speech feature;
[0034] Inputting the object signature feature sent by the server and the first speech into the trained speech enhancement sub-model, and outputting the target second speech feature;
[0035] The target second voice feature is sent to the server so that the server inputs the received target second voice feature into the trained feature extraction sub-model to obtain the target signature feature, and verifies the authenticity of the received target second voice feature through the target signature feature and the object signature feature.
[0036] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a speech detection model training device, wherein the speech detection model includes a speech feature extraction sub-model, a speech enhancement sub-model and a feature extraction sub-model, and the device includes:
[0037] A first acquisition module, used to acquire training speech, input the training speech into the trained speech feature extraction sub-model, output a first speech feature corresponding to the training speech, and determine a first loss value between the first speech feature and the training speech;
[0038] a second acquisition module, configured to acquire an object identification feature corresponding to the training speech, input the object identification feature and the first speech feature into a trained speech enhancement sub-model, output a second speech feature, and determine a second loss value between the second speech feature and the first speech feature;
[0039] a determination module, configured to input the second speech feature into the feature extraction sub-model, output a target object identification feature, and determine a third loss value between the target object identification feature and the object identification feature;
[0040] An iterative module is used to determine a total loss value according to the first loss value, the second loss value and the third loss value, and iteratively train the feature extraction sub-model in the speech detection model according to the total loss value to obtain a trained speech detection model.
[0041] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores multiple instructions, and the instructions are suitable for a processor to load to execute the speech detection model training method provided in the embodiment of the present application.
[0042] To achieve the above-mentioned objectives, the fourth aspect of an embodiment of the present application proposes a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the speech detection model training method provided in the embodiment of the present application when executing the computer program.
[0043] In an embodiment of the present application, the speech detection model includes a speech feature extraction sub-model, a speech enhancement sub-model and a feature extraction sub-model. By obtaining training speech, the training speech is input into the trained speech feature extraction sub-model, the first speech feature corresponding to the training speech is output, and the first loss value between the first speech feature and the training speech is determined; the object identification feature corresponding to the training speech is obtained, the object identification feature and the first speech feature are input into the trained speech enhancement sub-model, the second speech feature is output, and the second loss value between the second speech feature and the first speech feature is determined; the second speech feature is input into the feature extraction sub-model, the target object identification feature is output, and the third loss value between the target object identification feature and the object identification feature is determined; the total loss value is determined according to the first loss value, the second loss value and the third loss value, and the feature extraction sub-model in the speech detection model is iteratively trained according to the total loss value to obtain the trained speech detection model. In this way, a trained speech enhancement sub-model is set in the trained speech detection model, which can realize the embedding of identification features into the speech. Subsequently, the extracted identification features in the received speech are obtained through the trained feature extraction sub-model. The authenticity of the received speech can be verified through the identification features and the extracted identification features.
[0044] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 is a schematic diagram of a scene of speech detection provided in an embodiment of the present application;
[0047] Figure 2 It is a flowchart of the speech detection model training method provided in the embodiment of the present application;
[0048] Figure 3 It is a flowchart of training a speech feature extraction sub-model and a speech enhancement sub-model provided in an embodiment of the present application;
[0049] Figure 4 is a schematic diagram of the process after step 140 provided in an embodiment of the present application;
[0050] Figure 5 is another flow chart of the speech detection model training method provided in an embodiment of the present application;
[0051] Figure 6 It is a structural diagram of a speech detection model training device provided in an embodiment of the present application;
[0052] Figure 7 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0055] 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.
[0056] First, some nouns involved in this application are analyzed:
[0057] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0058] A vocoder is a device or algorithm that can analyze and process speech signals, extract key characteristic parameters, and resynthesize speech based on these parameters. It decomposes the input speech signal into specific acoustic features, such as fundamental frequency, formant, etc., and then achieves speech compression, transmission, storage or synthesis through encoding, transmission or storage of these features, as well as subsequent decoding and synthesis operations. Vocoders are widely used in communications, speech synthesis, speech recognition, music production and other fields.
[0059] Mel Spectrogram is a method of representing sound signals based on the auditory characteristics of the human ear. It filters the spectrum of the sound through a set of Mel-scale filter groups, converts the frequency axis to the Mel scale, and then performs logarithmic operations on the output of each filter. Mel spectrum can better reflect the difference in the human ear's perception sensitivity to sounds of different frequencies. It has a higher frequency resolution in the low-frequency area and a lower resolution in the high-frequency area. This representation method is widely used in many fields such as speech processing and music analysis. It is used as an important feature of sound signals for analysis, processing and modeling of various audio-related tasks.
[0060] Secondly, describe the technical problems existing in related technologies:
[0061] With the development and widespread application of artificial intelligence technology, some artificial intelligence models can now generate fake voices by acquiring people's real voices and then learning. As fake voices become more and more natural and realistic, even close to real voices, fake voices bring many security issues, such as the spread of negative information caused by the abuse of fake voices.
[0062] In the related art, the voice detection method is often through traditional voice feature analysis, such as obtaining the voice's timbre, frequency and other information, and then matching it with the timbre, frequency and other information recorded in the database, and then determining whether the voice is real or forged. However, when the forged voice is more natural and realistic, the voice detection method in the related art will make it impossible to accurately identify the forged voice.
[0063] Therefore, there is a technical problem in the related art that the detection of speech authenticity is inaccurate.
[0064] In order to solve the above technical problems, the present application proposes a scheme for performing authenticity detection on the speech itself through a trained speech detection model, so as to determine whether the speech is real speech. A trained speech enhancement sub-model is set in the trained speech detection model, which can realize the embedding of identification features in the speech. Subsequently, the extracted identification features in the received speech are obtained through the trained feature extraction sub-model. The authenticity of the received speech can be verified through the identification features and the extracted identification features.
[0065] See also Figure 1 , Figure 1 It is a schematic diagram of the scene of voice detection provided in an embodiment of the present application.
[0066] In the scenario of voice detection, the authenticity of the voice needs to be detected to determine whether the voice is uttered by a real person or a false voice generated by a computer device. For example, in some authorization scenarios, authorization is performed by voice, and the authenticity of the received voice needs to be analyzed to determine whether the voice is uttered by a real person or a false voice generated by a computer device.
[0067] The trained speech detection model may include a trained speech feature extraction sub-model, a trained speech enhancement sub-model and a trained feature extraction sub-model. The trained speech detection model may be distributed, for example, the trained speech feature extraction sub-model and the trained speech enhancement sub-model are set on the client, while the trained feature extraction sub-model may be set on the server.
[0068] The trained speech detection model can also be set on the client or server, which can be set according to actual needs.
[0069] exist Figure 1 In the scenario shown, the trained speech feature extraction sub-model and the trained speech enhancement sub-model can be set on the client, while the trained feature extraction sub-model can be set on the server.
[0070] First, the client can receive the voice uttered by the user as the input voice, and then input the input voice into the trained voice feature extraction sub-model. The trained voice feature extraction sub-model can extract the voice features in the input voice, thereby obtaining the target first voice feature. The target first voice feature can be understood as an important feature that can highlight the input voice and can be used to represent the input voice.
[0071] Then the user's object signature feature and the first speech are input into the trained speech enhancement sub-model, and the target second speech feature is output. The user's object signature feature can be a unique identifier generated by the server for the user, which can be used to represent the identity of the user. The target second speech feature can be understood as a kind of speech data, but the object signature feature is added to it.
[0072] The client can send the target second voice feature to the server, but in the process of the client sending the target second voice feature to the server, the target second voice feature may be intercepted and then tampered, so the server needs to verify the received target second voice feature. Specifically, the server can input the received target second voice feature into the trained feature extraction sub-model to output the target signature feature. Then compare the target signature feature with the object signature feature to obtain a comparison result, and finally determine the authenticity of the received target second voice feature based on the comparison result.
[0073] For example, if the comparison result indicates that the target signature feature and the object signature feature do not match, then the target second voice feature received by the server is not authentic. It may be that the target second voice feature was intercepted and tampered with after the client sent the target second voice feature. At this time, the authorization verification of the received target second voice feature is refused, and any operation indicated by the received target second voice feature is refused. If the comparison result indicates that the target signature feature and the object signature feature match, then the target second voice feature received by the server is authentic, and the corresponding task can be performed according to the received target second voice feature, such as further authorization verification of the received target second voice feature. When the authorization verification passes, the operation indicated by the received target second voice feature is executed, such as accessing a file.
[0074] From the above content, it can be seen that compared with the voice detection method in the related art, in this application, the authenticity of the voice can be verified first, and then the authority of the voice can be verified. This can avoid the false authorization caused by the virtually generated voice of the computer device, thereby ensuring the security of the voice verification.
[0075] Regarding the trained speech detection model described in the above scenario, the specific training method of the speech detection model will be described in detail below.
[0076] The embodiments of the present application provide a method, apparatus, device and storage medium for training a speech detection model. The trained speech detection model can detect the authenticity of speech.
[0077] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0078] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0079] The speech detection model training method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The speech detection model training method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the speech detection model training method, etc., but is not limited to the above forms.
[0080] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0081] It should be noted that in each specific implementation of the present application, when it comes to relevant processing of voice data such as sample voice, training voice and input voice, the user's permission or consent will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0082] See also Figure 2 , Figure 2 : is a flow chart of the speech detection model training method provided in the embodiment of the present application. The speech detection model training method provided in the embodiment of the present application may include the following steps:
[0083] Step 110: obtain training speech, input the training speech into the trained speech feature extraction sub-model, output a first speech feature corresponding to the training speech, and determine a first loss value between the first speech feature and the training speech;
[0084] Step 120: Obtain an object identification feature corresponding to the training speech, input the object identification feature and the first speech feature into the trained speech enhancement sub-model, output a second speech feature, and determine a second loss value between the second speech feature and the first speech feature;
[0085] Step 130: input the second speech feature into the feature extraction sub-model, output the target object identification feature, and determine a third loss value between the target object identification feature and the object identification feature;
[0086] Step 140: determine a total loss value according to the first loss value, the second loss value and the third loss value, and iteratively train the feature extraction sub-model in the speech detection model according to the total loss value to obtain a trained speech detection model.
[0087] Before describing steps 110 to 140 in detail, the general training method of the speech detection model provided in this application is first described. Figure 1It can be known that the overall structure of the speech detection model after training in the present application, the speech detection model has the same structure as the trained speech detection model, and the speech detection model includes three parts: a speech feature extraction sub-model, a speech enhancement sub-model and a feature extraction sub-model. When training the speech detection model, the speech feature extraction sub-model and the speech enhancement sub-model can be trained first to obtain a trained speech feature extraction sub-model and a trained speech enhancement sub-model. At this time, the parameters of the trained speech feature extraction sub-model are fixed, and the main parameters of the trained speech enhancement sub-model are fixed. Then, the feature extraction sub-model is trained by the trained speech feature extraction sub-model and the trained speech enhancement sub-model to obtain a trained feature extraction sub-model, and finally a trained speech detection model is obtained. The trained speech detection model includes a trained speech feature extraction sub-model, a trained speech enhancement sub-model and a trained feature extraction sub-model.
[0088] See also Figure 3 , Figure 3 It is a flowchart of the training of the speech feature extraction sub-model and the speech enhancement sub-model provided in the embodiment of the present application.
[0089] Wherein, before inputting the training speech into the trained speech feature extraction sub-model and outputting the first speech feature corresponding to the training speech, the method further includes:
[0090] Step 201: Obtain sample speech, input the sample speech into the speech feature extraction sub-model, and output the extracted speech features;
[0091] Step 202: input the extracted speech features into the speech enhancement sub-model, and output the enhanced speech features;
[0092] Step 203, determining a first target loss value between the extracted speech feature and the sample speech, and a second target loss value between the extracted speech feature and the enhanced speech feature;
[0093] Step 204: determining a third target loss value according to the first target loss value and the second target loss value;
[0094] Step 205. When the third target loss value is greater than the preset target loss value, the parameters of the speech feature extraction submodel and the speech enhancement submodel are adjusted to iterate the speech feature extraction submodel and the speech enhancement submodel, and return to execute to obtain sample speech until the third target loss value is no greater than the preset target loss value, thereby obtaining the trained speech feature extraction submodel and the trained speech enhancement submodel.
[0095] Steps 201 to 205 will be described in detail below.
[0096] In step 201, sample speech is obtained, the sample speech is input into the speech feature extraction sub-model, and the extracted speech features are output.
[0097] The sample speech is the speech for training the speech feature extraction sub-model and the speech enhancement sub-model. The sample speech can be the speech corresponding to different speakers. The speech feature extraction sub-model can be any common speech model, such as a deep neural network model (DNN), an attention mechanism model, a Mel-cepstrum model, etc.
[0098] Taking the speech feature extraction submodel as a Mel spectrum generation model as an example, the sample speech is input into the speech feature extraction submodel, and the speech feature extraction submodel can output the extracted speech features, which are specifically Mel spectrum features. Mel spectrum features are speech features based on the auditory characteristics of the human ear. Mel spectrum features can better reflect the perception characteristics of the human ear to speech, and have a certain robustness to speech from different speakers and in different environments. It retains important information of speech, such as resonance peaks, fundamental frequencies, etc., while removing some unnecessary details, reducing feature dimensions, and facilitating subsequent processing and analysis.
[0099] In step 202, the extracted speech features are input into the speech enhancement sub-model, and the enhanced speech features are output.
[0100] The extracted speech feature can be understood as a kind of speech data including time domain features and frequency domain features. In different speech time periods, the frequency domain features of the extracted speech features are different. For example, the total time period for extracting speech features can be determined, and then the extracted speech features can be divided into a plurality of sub-extracted speech features according to the preset division time length and the total time period, and then each sub-extracted speech feature is sorted according to the time sequence of the time period, thereby obtaining a sub-extracted speech feature sequence.
[0101] Then, the identification feature corresponding to the sample speech can be obtained, and the identification feature corresponding to the sample speech is unique, that is, a unique identification feature can be set for each sample speech. Then, the identification feature corresponding to the sample speech and the sub-extracted speech feature sequence are input into the speech enhancement sub-model, so as to output the enhanced speech feature.
[0102] Specifically, the speech enhancement sub-model can combine the identification feature corresponding to the sample speech with each sub-extracted speech feature in the sub-extracted speech feature sequence to generate a sub-enhanced speech feature, and then all the sub-enhanced speech features constitute the enhanced speech feature corresponding to the extracted speech feature.
[0103] In step 203, a first target loss value between the extracted speech feature and the sample speech, and a second target loss value between the extracted speech feature and the enhanced speech feature are determined.
[0104] In the above content, the extracted speech features and the sample speech can be input into the loss function corresponding to the speech feature extraction sub-model to obtain a first target loss value between the extracted speech features and the sample speech. The first target loss value can be used to measure the degree of approximation between the extracted speech features and the sample speech.
[0105] The extracted speech features and the enhanced speech features are input into the loss function corresponding to the speech enhancement sub-model, thereby obtaining a second target loss value between the extracted speech features and the enhanced speech features. The second target loss value can be used to measure the degree of similarity between the extracted speech features and the enhanced speech features.
[0106] In step 204, a third target loss value is determined according to the first target loss value and the second target loss value.
[0107] For example, the first target loss value and the second target loss value can be added to determine the third target loss value. Alternatively, the first target loss value is multiplied by the first ratio to obtain a first product, and the second target loss value is multiplied by the second ratio to obtain a second product. Finally, the first product and the second product are added to obtain the third target loss value. The third target loss value can be understood as the total target loss in the training process corresponding to the speech feature extraction sub-model and the speech enhancement sub-model.
[0108] In step 205, when the third target loss value is greater than the preset target loss value, the parameters of the speech feature extraction submodel and the speech enhancement submodel are adjusted to iterate the speech feature extraction submodel and the speech enhancement submodel, and return to execute to obtain sample speech until the third target loss value is no greater than the preset target loss value, thereby obtaining the trained speech feature extraction submodel and the trained speech enhancement submodel.
[0109] Among them, when the third target loss value is greater than the preset target loss value, it means that the speech feature extraction sub-model and the speech enhancement sub-model are not trained well at this time, and there is a large difference between the enhanced speech features finally outputted and the sample speech, and the enhanced speech features cannot be used to represent the sample speech. At this time, the parameters of the speech feature extraction sub-model and the speech enhancement sub-model can be adjusted to achieve the iteration of the speech feature extraction sub-model and the speech enhancement sub-model.
[0110] Then return to execute to obtain sample speech, that is, return to step 201, and continue to perform the next round of iterative training on the iterated speech feature extraction sub-model and the speech enhancement sub-model until the third target loss value is no greater than the preset target loss value. At this time, it is considered that the enhanced speech features finally output can be used to represent the sample speech, and the speech feature extraction sub-model and the speech enhancement sub-model converge to obtain the trained speech feature extraction sub-model and the trained speech enhancement sub-model.
[0111] It can be seen from steps 201 to 205 that in the embodiment of the present application, by training the speech feature extraction sub-model and the speech enhancement sub-model together, the speech feature extraction sub-model can more accurately extract the features of the sample speech, and at the same time, the speech enhancement sub-model can more accurately enhance the features output by the speech feature extraction sub-model, that is, it can more accurately embed the identification features of the sample speech into the extracted speech features, and the enhanced speech features finally outputted can not only include the identification features of the sample speech, but also accurately represent the sample speech, that is, can accurately represent the sample speech.
[0112] The above is the specific training process of the speech feature extraction sub-model and the speech enhancement sub-model. After training, the model parameters of the speech feature extraction sub-model are solidified, and at the same time, the main model parameters of the speech enhancement sub-model are solidified or the model parameters of the speech enhancement sub-model are solidified.
[0113] Steps 110 to 140 will be described in detail below.
[0114] In step 110, a training speech is obtained, the training speech is input into a trained speech feature extraction sub-model, a first speech feature corresponding to the training speech is output, and a first loss value between the first speech feature and the training speech is determined.
[0115] The training speech is the speech for training the feature extraction sub-model. The training speech can be input into the trained speech feature extraction sub-model to output the first speech feature corresponding to the training speech. The first speech feature can be a Mel-frequency cepstrum feature. At this time, the parameters of the trained speech feature extraction sub-model have been solidified. After the above training, the features in the speech can be accurately extracted, that is, the first speech feature can represent the main features of the training speech.
[0116] However, since the trained speech feature extraction sub-model has a certain model loss, there will be a certain loss between the first speech feature and the training speech, and the first loss value between the first speech feature and the training speech can be determined.
[0117] In step 120, an object identification feature corresponding to the training speech is obtained, the object identification feature and the first speech feature are input into the trained speech enhancement sub-model, a second speech feature is output, and a second loss value between the second speech feature and the first speech feature is determined.
[0118] The object identification feature corresponding to the training speech may be obtained, and the object identification feature may be a unique identification feature corresponding to the training speech, or a unique identification feature of the speaking object of the training speech.
[0119] Then the first speech feature is input into the trained speech enhancement sub-model, and the second speech feature is output.
[0120] In some implementations, inputting the object identification feature and the first speech feature into a trained speech enhancement sub-model and outputting the second speech feature comprises:
[0121] (1.1) determining each sub-first speech feature in the first speech feature;
[0122] (1.2) inputting each sub-first speech feature and the object identification feature into the trained speech enhancement sub-model, and outputting the sub-second speech feature corresponding to each sub-first speech feature;
[0123] (1.3) Generate a second voice feature according to the sub-second voice feature corresponding to each sub-first voice feature.
[0124] The first voice feature can be understood as a voice data including time domain features and frequency domain features. In different voice time periods, the frequency domain features of the first voice feature are different. For example, the total time period of the first voice feature can be determined, and then the first voice feature can be divided into a plurality of sub-first voice features according to the preset division time length and the total time period, and then each sub-first voice feature is sorted according to the time sequence of the time period, so as to obtain a sub-first voice feature sequence.
[0125] Then, the object identification feature and the sub-first speech feature sequence corresponding to the training speech are input into the trained speech enhancement sub-model, thereby outputting the second speech feature.
[0126] Specifically, the trained speech enhancement sub-model can combine the object identification feature corresponding to the training speech with each sub-first speech feature in the sub-first speech feature sequence to generate a sub-second speech feature, and then all the sub-second speech features constitute the second speech feature corresponding to the first speech feature.
[0127] By embedding the object identification feature in each sub-first voice feature, the security of the entire second voice feature can be greatly improved, avoiding the problem of constructing false voice by randomly using identification features after the object identification features are cracked, as the identification features of the object are only set at the head or tail of the voice.
[0128] However, since the trained speech enhancement sub-model has a certain model loss, there will be a certain loss between the first speech feature and the second speech feature, and the second loss value between the second speech feature and the first speech feature can be determined.
[0129] In step 130, the second speech feature is input into the feature extraction sub-model, the target object identification feature is output, and a third loss value between the target object identification feature and the object identification feature is determined.
[0130] After obtaining the second speech feature, the second speech feature can be input into the feature extraction sub-model to output the target object identification feature. The object identification feature is embedded in the second speech feature, and the extraction sub-model can extract the object identification feature in the second speech.
[0131] In some implementations, inputting the second speech feature into a feature extraction submodel and outputting a target object identification feature includes:
[0132] (1.1) performing voice interference on the second voice feature to generate a target second voice feature;
[0133] (1.2) Input the target second speech feature into the feature extraction sub-model and output the target object identification feature.
[0134] Among them, the feature extraction sub-model is mainly used to extract the object identification feature in the second voice feature. In order to enable the extraction sub-model to more accurately extract the object identification feature in the second voice feature, some voice interference can be applied to the second voice feature, and then the target second voice feature is generated. For example, the second voice feature can be input into a vocoder, and the vocoder can obtain the target second voice feature by changing some waveforms in the second voice feature.
[0135] The target second speech feature is then input into the feature extraction sub-model, and the target object identification feature is output.
[0136] After obtaining the target object identification feature, a third loss value between the target object identification feature and the object identification feature can be determined. For example, the target object identification feature and the object identification feature are input into the loss function corresponding to the feature extraction sub-model to determine the third loss value between the target object identification feature and the object identification feature.
[0137] In some implementations, determining a third loss value between the target object identification feature and the object identification feature includes:
[0138] (2.1) determining a sub-loss value between a target object identification feature and an object identification feature of each sub-second speech feature;
[0139] (2.2) Determine the number of all sub-second speech features, add up the sub-loss values corresponding to all sub-second speech features and divide by the number to obtain a third loss value between the target object identification feature and the object identification feature.
[0140] The second voice feature includes multiple sub-second voice features, which have been described in detail above and will not be repeated here. An object identification feature is embedded in each sub-second voice feature, so the sub-loss value between the target object identification feature and the object identification feature of each sub-second voice feature can be obtained.
[0141] Assuming that at least one sub-second voice feature is tampered with, the object identification features of these tampered sub-second voice features will also change or be eliminated, and then the sub-loss value between the target object identification feature and the object identification feature will be obtained. The sub-loss value will be very large, far exceeding the sub-loss value under normal levels.
[0142] However, if the extraction sub-model does not extract the object identification feature in a sub-second speech feature comprehensively enough, and then obtains the sub-loss value between the target object identification feature and the object identification feature, the sub-loss value will be slightly higher than the sub-loss value at the normal level, but will not be far higher than the sub-loss value at the normal level.
[0143] Then determine the number of all sub-second voice features, add up the sub-loss values corresponding to all sub-second voice features and divide by the number to obtain the third loss value between the target object identification feature and the object identification feature. The advantage of this is that even if the object identification feature in a sub-second voice feature is not fully extracted by the extraction sub-model, the effect of the incomplete extraction of the object identification feature in the individual sub-second voice features can be alleviated to a certain extent by adding each sub-loss value and then calculating the average. This will not result in the feature extraction sub-model having to adjust parameters significantly each time it is trained, which can improve the stability of the feature extraction sub-model during training, thereby improving the training efficiency of the feature extraction sub-model.
[0144] In step 140, a total loss value is determined according to the first loss value, the second loss value and the third loss value, and the feature extraction sub-model in the speech detection model is iteratively trained according to the total loss value to obtain a trained speech detection model.
[0145] It can be understood that when the training speech is input into the speech detection model, the trained speech feature extraction sub-model, the trained speech feature enhancement sub-model and the feature extraction sub-model will produce certain losses each time due to model loss. Therefore, it is necessary to consider the first loss value, the second loss value and the third loss value, and finally determine the total loss value through the first loss value, the second loss value and the third loss value, that is, the total loss value of the speech detection model. The total loss value determined in this way is more accurate.
[0146] In some implementations, determining a total loss value based on the first loss value, the second loss value, and the third loss value includes:
[0147] (1.1) multiplying the first loss value by a first preset coefficient to obtain a first result;
[0148] (1.2) multiplying the second loss value by a second preset coefficient to obtain a second result;
[0149] (1.3) multiplying the third loss value by a third preset coefficient to obtain a third result;
[0150] (1.4) Add the first result, the second result, and the third result to get the total loss value.
[0151] The sum of the first preset coefficient, the second preset coefficient and the third preset coefficient is 1, and the first preset coefficient, the second preset coefficient and the third preset coefficient are different. For example, since the feature extraction submodel is untrained, the third preset coefficient is larger than the first preset coefficient and the second preset coefficient. For example, the third preset coefficient is 0.7, the second preset coefficient is 0.2, and the first preset coefficient is 0.1.
[0152] Finally, multiply the first loss value by the first preset coefficient to obtain the first result; multiply the second loss value by the second preset coefficient to obtain the second result; multiply the third loss value by the third preset coefficient to obtain the third result; add the first result, the second result and the third result to obtain the total loss value.
[0153] The advantage of this is that it can reduce the influence of the trained speech feature extraction sub-model and the trained speech enhancement sub-model on the feature extraction sub-model training process, but it will not ignore the influence of the trained speech feature extraction sub-model and the trained speech enhancement sub-model on the feature extraction sub-model training process. This can improve the training efficiency of the feature extraction sub-model and the subsequent feature extraction sub-model's ability to extract identification features from the input speech.
[0154] Finally, determine whether the total loss value is greater than the preset total loss threshold. If the total loss value is greater than the preset total loss threshold, it means that the feature extraction sub-model extracts the object identification features inaccurately. At this time, it is necessary to continue training the feature extraction sub-model. First, adjust the model parameters of the feature extraction sub-model according to the total loss value to iterate the feature extraction sub-model, and then return to execute to obtain the training speech, that is, return to step 110, and start the next training of the iterated feature extraction sub-model. Until the total loss value is not greater than the preset total loss threshold, it is considered that the feature extraction sub-model training is completed, and the trained feature extraction sub-model is obtained, thereby obtaining the trained speech detection model.
[0155] It can be understood that because the trained speech feature extraction sub-model and the trained speech enhancement sub-model have been trained, there is no need to adjust the parameters of the trained speech feature extraction sub-model and the trained speech enhancement sub-model when adjusting the model parameters of the feature extraction sub-model to achieve iteration of the feature extraction sub-model.
[0156] See also Figure 4 , Figure 4 It is a flowchart after step 140 provided in an embodiment of the present application.
[0157] In some implementations, after obtaining the trained speech detection model, the method further includes:
[0158] Step 301: Obtain an input speech of an object, input the input speech into a trained speech feature extraction sub-model, and output a target first speech feature;
[0159] Step 302: Input the object signature feature and the first speech sent by the server into the trained speech enhancement sub-model, and output the target second speech feature;
[0160] Step 303: Send the target second voice feature to the server, so that the server inputs the received target second voice feature into the trained feature extraction sub-model to obtain the target signature feature, and verifies the authenticity of the received target second voice feature through the target signature feature and the object signature feature.
[0161] Steps 301 to 303 will be described in detail below.
[0162] In step 301, an input speech of an object is obtained, the input speech is input into a trained speech feature extraction sub-model, and a target first speech feature is output.
[0163] The trained speech feature extraction sub-model and the trained speech enhancement sub-model may be set on the client side, and the trained feature extraction sub-model may be set on the server side.
[0164] The client can receive the speech uttered by the user as input speech, and then input the input speech into the trained speech feature extraction sub-model. The trained speech feature extraction sub-model can extract the speech features in the input speech, thereby obtaining the target first speech feature. The target first speech feature can be understood as an important feature that can highlight the input speech and can be used to represent the input speech.
[0165] In step 302, the object signature features and the first speech sent by the server are input into the trained speech enhancement sub-model, and the target second speech features are output.
[0166] The server can send the object signature feature to the client, and in the client, the user's object signature feature and the first voice are input into the trained voice enhancement sub-model, and the target second voice feature is output. The user's object signature feature can be a unique identifier generated by the server for the user, which can be used to represent the identity of the user. The target second voice feature can be understood as a kind of voice data, but the object signature feature is added to it.
[0167] In step 303, the target second voice feature is sent to the server, so that the server inputs the received target second voice feature into the trained feature extraction sub-model to obtain the target signature feature, and verifies the authenticity of the received target second voice feature through the target signature feature and the object signature feature.
[0168] The client can send the target second voice feature to the server, but in the process of the client sending the target second voice feature to the server, the target second voice feature may be intercepted and then tampered, so the server needs to verify the received target second voice feature. Specifically, the server can input the received target second voice feature into the trained feature extraction sub-model to output the target signature feature. Then compare the target signature feature with the object signature feature to obtain a comparison result, and finally determine the authenticity of the received target second voice feature based on the comparison result.
[0169] For example, if the comparison result indicates that the target signature feature and the object signature feature do not match, then the target second voice feature received by the server is not authentic. It may be that the target second voice feature was intercepted and tampered with after the client sent the target second voice feature. At this time, the authorization verification of the received target second voice feature is refused, and any operation indicated by the received target second voice feature is refused. If the comparison result indicates that the target signature feature and the object signature feature match, then the target second voice feature received by the server is authentic, and the corresponding task can be performed according to the received target second voice feature, such as further authorization verification of the received target second voice feature. When the authorization verification passes, the operation indicated by the received target second voice feature is executed, such as accessing a file.
[0170] From the above content, it can be seen that compared with the voice detection method in the related art, in this application, the authenticity of the voice can be verified first, and then the authority of the voice can be verified. This can avoid the false authorization caused by the virtually generated voice of the computer device, thereby ensuring the security of the voice verification.
[0171] It can be seen from step 301 to step 303 that in the implementation of the present application, the client can combine the input voice and the object signature feature through the trained voice feature extraction sub-model and the trained voice enhancement sub-model, which can enhance the security of the target second voice feature sent to the server. The server can extract the target signature feature from the received target second voice feature through the trained feature extraction sub-model, and then verify the authenticity of the received target second voice feature according to the object signature feature and the target signature feature, so as to determine whether the received target second voice feature is forged.
[0172] As can be seen from the above, in an embodiment of the present application, the speech detection model includes a speech feature extraction sub-model, a speech enhancement sub-model and a feature extraction sub-model, and the training speech is obtained, the training speech is input into the trained speech feature extraction sub-model, the first speech feature corresponding to the training speech is output, and the first loss value between the first speech feature and the training speech is determined; the object identification feature corresponding to the training speech is obtained, the object identification feature and the first speech feature are input into the trained speech enhancement sub-model, the second speech feature is output, and the second loss value between the second speech feature and the first speech feature is determined; the second speech feature is input into the feature extraction sub-model, the target object identification feature is output, and the third loss value between the target object identification feature and the object identification feature is determined; the total loss value is determined according to the first loss value, the second loss value and the third loss value, and the feature extraction sub-model in the speech detection model is iteratively trained according to the total loss value to obtain the trained speech detection model. In this way, a trained speech enhancement sub-model is set in the trained speech detection model, which can realize the embedding of identification features into the speech. Subsequently, the extracted identification features in the received speech are obtained through the trained feature extraction sub-model. The authenticity of the received speech can be verified through the identification features and the extracted identification features.
[0173] See also Figure 5 , Figure 5 1 is another flow chart of the speech detection model training method provided in the embodiment of the present application. The speech detection model training method may include the following steps:
[0174] Step 401: Obtain sample speech, input the sample speech into the speech feature extraction sub-model, and output the extracted speech features;
[0175] Step 402: input the extracted speech features into the speech enhancement sub-model, and output the enhanced speech features;
[0176] Step 403, determining a first target loss value between the extracted speech feature and the sample speech, and a second target loss value between the extracted speech feature and the enhanced speech feature;
[0177] Step 404: determining a third target loss value according to the first target loss value and the second target loss value;
[0178] Step 405: When the third target loss value is greater than the preset target loss value, the parameters of the speech feature extraction sub-model and the speech enhancement sub-model are adjusted to iterate the speech feature extraction sub-model and the speech enhancement sub-model, and the sample speech is obtained by returning to the execution until the third target loss value is not greater than the preset target loss value, thereby obtaining the trained speech feature extraction sub-model and the trained speech enhancement sub-model;
[0179] Step 406: obtain training speech, input the training speech into the trained speech feature extraction sub-model, output the first speech feature corresponding to the training speech, and determine a first loss value between the first speech feature and the training speech;
[0180] Step 407: Obtain an object identification feature corresponding to the training speech, input the object identification feature and the first speech feature into the trained speech enhancement sub-model, output a second speech feature, and determine a second loss value between the second speech feature and the first speech feature;
[0181] Step 408: input the second speech feature into the feature extraction sub-model, and output the target object identification feature;
[0182] Step 409: obtain training speech, input the training speech into the trained speech feature extraction sub-model, output the first speech feature corresponding to the training speech, and determine a first loss value between the first speech feature and the training speech;
[0183] Step 410: Obtain an object identification feature corresponding to the training speech, input the object identification feature and the first speech feature into the trained speech enhancement sub-model, output a second speech feature, and determine a second loss value between the second speech feature and the first speech feature;
[0184] Step 411: input the second speech feature into the feature extraction sub-model, output the target object identification feature, and determine a third loss value between the target object identification feature and the object identification feature;
[0185] Step 412: determine a total loss value according to the first loss value, the second loss value and the third loss value, and iteratively train the feature extraction sub-model in the speech detection model according to the total loss value to obtain a trained speech detection model.
[0186] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the speech detection model training method above, which will not be repeated here.
[0187] See also Figure 6 , Figure 6 It is a structural diagram of the speech detection model training device provided in an embodiment of the present application.
[0188] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0189] like Figure 6 As shown, the speech detection model includes a speech feature extraction sub-model, a speech enhancement sub-model and a feature extraction sub-model, and the speech detection model training device 500 may include:
[0190] A first acquisition module 510 is used to acquire training speech, input the training speech into the trained speech feature extraction sub-model, output a first speech feature corresponding to the training speech, and determine a first loss value between the first speech feature and the training speech;
[0191] A second acquisition module 520, for acquiring an object identification feature corresponding to the training speech, inputting the object identification feature and the first speech feature into the trained speech enhancement sub-model, outputting a second speech feature, and determining a second loss value between the second speech feature and the first speech feature;
[0192] A determination module 530, configured to input the second speech feature into a feature extraction sub-model, output a target object identification feature, and determine a third loss value between the target object identification feature and the object identification feature;
[0193] The iteration module 540 is used to determine the total loss value according to the first loss value, the second loss value and the third loss value, and iteratively train the feature extraction sub-model in the speech detection model according to the total loss value to obtain a trained speech detection model.
[0194] In some implementations, the second acquisition module 520 is configured to perform voice interference on the second voice feature to generate a target second voice feature;
[0195] The target second speech feature is input into the feature extraction sub-model, and the target object identification feature is output.
[0196] In some implementations, the second acquisition module 520 is configured to determine each sub-first speech feature in the first speech feature;
[0197] Inputting each sub-first speech feature and the object identification feature into the trained speech enhancement sub-model, and outputting the sub-second speech feature corresponding to each sub-first speech feature;
[0198] The second voice feature is generated according to the second voice sub-feature corresponding to each first voice sub-feature.
[0199] In some implementations, the determination module 530 is configured to determine a sub-loss value between a target object identification feature and an object identification feature of each sub-second speech feature;
[0200] The number of all the sub-second voice features is determined, and the sub-loss values corresponding to all the sub-second voice features are added and divided by the number to obtain a third loss value between the target object identification feature and the object identification feature.
[0201] In some embodiments, the determination module 530 is configured to multiply the first loss value by a first preset coefficient to obtain a first result;
[0202] Multiplying the second loss value by a second preset coefficient to obtain a second result;
[0203] Multiplying the third loss value by a third preset coefficient to obtain a third result;
[0204] Add the first, second, and third results together to get the total loss value.
[0205] In some embodiments, the speech detection model training device 500 further includes a training module 550, which is used to obtain a sample speech, input the sample speech into the speech feature extraction submodel, and output the extracted speech feature before inputting the training speech into the trained speech feature extraction submodel and outputting the first speech feature corresponding to the training speech;
[0206] Input the extracted speech features into the speech enhancement sub-model and output the enhanced speech features;
[0207] Determining a first target loss value between the extracted speech feature and the sample speech, and a second target loss value between the extracted speech feature and the enhanced speech feature;
[0208] Determining a third target loss value according to the first target loss value and the second target loss value;
[0209] When the third target loss value is greater than the preset target loss value, the parameters of the speech feature extraction submodel and the speech enhancement submodel are adjusted to iterate the speech feature extraction submodel and the speech enhancement submodel, and return to execute to obtain sample speech until the third target loss value is no greater than the preset target loss value, thereby obtaining the trained speech feature extraction submodel and the trained speech enhancement submodel.
[0210] In some embodiments, the speech detection model training device 500 further includes a verification module 560, which is used to obtain an input speech of the object after obtaining the trained speech detection model, input the input speech into the trained speech feature extraction sub-model, and output the target first speech feature;
[0211] Input the object signature feature and the first speech sent by the server into the trained speech enhancement sub-model, and output the target second speech feature;
[0212] The target second voice feature is sent to the server so that the server inputs the received target second voice feature into the trained feature extraction sub-model to obtain the target signature feature, and verifies the authenticity of the received target second voice feature through the target signature feature and the object signature feature.
[0213] In the above embodiments, the description of each embodiment has its own focus. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the speech detection model training method above, which will not be repeated here.
[0214] As can be seen from the above, in an embodiment of the present application, the speech detection model includes a speech feature extraction submodel, a speech enhancement submodel and a feature extraction submodel, and the first acquisition module 510 is used to obtain training speech, input the training speech into the trained speech feature extraction submodel, output the first speech feature corresponding to the training speech, and determine the first loss value between the first speech feature and the training speech; the second acquisition module 520 is used to obtain the object identification feature corresponding to the training speech, input the object identification feature and the first speech feature into the trained speech enhancement submodel, output the second speech feature, and determine the second loss value between the second speech feature and the first speech feature; the determination module 530 is used to input the second speech feature into the feature extraction submodel, output the target object identification feature, and determine the third loss value between the target object identification feature and the object identification feature; the iteration module 540 is used to determine the total loss value according to the first loss value, the second loss value and the third loss value, and iteratively train the feature extraction submodel in the speech detection model according to the total loss value to obtain the trained speech detection model. In this way, a trained speech enhancement sub-model is set in the trained speech detection model, which can realize the embedding of identification features into the speech. Subsequently, the extracted identification features in the received speech are obtained through the trained feature extraction sub-model. The authenticity of the received speech can be verified through the identification features and the extracted identification features.
[0215] See also Figure 7 , Figure 7 It is a structural diagram of a computer device provided by the implementation of this application.
[0216] The embodiment of the present application also provides a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned speech detection model training method when executing the computer program. The computer device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0217] See also Figure 7 , Figure 7 The hardware structure of a computer device according to another embodiment is shown, and the computer device includes:
[0218] The processor 601 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0219] The memory 602 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 602, and the processor 601 calls and executes the speech detection model training method of the embodiment of this application;
[0220] Input / output interface 603, used to implement information input and output;
[0221] Communication interface 604, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0222] Bus 605 , which transmits information between various components of the device (e.g., processor 601 , memory 602 , input / output interface 603 , and communication interface 604 );
[0223] The processor 601 , the memory 602 , the input / output interface 603 and the communication interface 604 are connected to each other in communication within the device via a bus 605 .
[0224] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned speech detection model training method is implemented.
[0225] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0226] The speech detection model training method, speech detection model training device, computer equipment and storage medium provided in the embodiment of the present application obtain training speech, input the training speech into the trained speech feature extraction sub-model, output the first speech feature corresponding to the training speech, and determine the first loss value between the first speech feature and the training speech; obtain the object identification feature corresponding to the training speech, input the object identification feature and the first speech feature into the trained speech enhancement sub-model, output the second speech feature, and determine the second loss value between the second speech feature and the first speech feature; input the second speech feature into the feature extraction sub-model, output the target object identification feature, and determine the third loss value between the target object identification feature and the object identification feature; determine the total loss value according to the first loss value, the second loss value and the third loss value, and iteratively train the feature extraction sub-model in the speech detection model according to the total loss value to obtain the trained speech detection model. In this way, the trained speech enhancement sub-model is set in the trained speech detection model, which can realize the embedding of identification features into speech, and the extracted identification features in the received speech are subsequently obtained through the trained feature extraction sub-model, and the authenticity of the received speech can be verified through the identification features and the extracted identification features.
[0227] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0228] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0229] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0230] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0231] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0232] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0233] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0234] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0235] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0236] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0237] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A speech detection model training method, characterized in that: The speech detection model includes a speech feature extraction sub-model, a speech enhancement sub-model and a feature extraction sub-model, and the method includes: Acquire training speech, input the training speech into the trained speech feature extraction sub-model, output a first speech feature corresponding to the training speech, and determine a first loss value between the first speech feature and the training speech; Obtaining an object identification feature corresponding to the training speech, inputting the object identification feature and the first speech feature into a trained speech enhancement sub-model, outputting a second speech feature, and determining a second loss value between the second speech feature and the first speech feature; Inputting the second speech feature into the feature extraction sub-model, outputting a target object identification feature, and determining a third loss value between the target object identification feature and the object identification feature; A total loss value is determined according to the first loss value, the second loss value and the third loss value, and the feature extraction sub-model in the speech detection model is iteratively trained according to the total loss value to obtain a trained speech detection model.
2. The speech detection model training method according to claim 1, characterized in that: The step of inputting the second speech feature into the feature extraction sub-model and outputting the target object identification feature comprises: Performing voice interference on the second voice feature to generate a target second voice feature; The target second speech feature is input into the feature extraction sub-model, and a target object identification feature is output.
3. The speech detection model training method according to claim 1, characterized in that: The step of inputting the object identification feature and the first speech feature into a trained speech enhancement sub-model and outputting a second speech feature comprises: Determine each sub-first speech feature in the first speech feature; Inputting each of the sub-first speech features and the object identification feature into the trained speech enhancement sub-model, and outputting the sub-second speech feature corresponding to each of the sub-first speech features; The second voice feature is generated according to the second voice sub-feature corresponding to each first voice sub-feature.
4. The speech detection model training method according to claim 3, characterized in that: The determining a third loss value between the target object identification feature and the object identification feature comprises: determining a sub-loss value between the target object identification feature and the object identification feature for each sub-second speech feature; The number of all the sub-second voice features is determined, and the sub-loss values corresponding to all the sub-second voice features are added and divided by the number to obtain a third loss value between the target object identification feature and the object identification feature.
5. The speech detection model training method according to claim 1, characterized in that: The determining a total loss value according to the first loss value, the second loss value and the third loss value comprises: Multiplying the first loss value by a first preset coefficient to obtain a first result; Multiplying the second loss value by a second preset coefficient to obtain a second result; Multiplying the third loss value by a third preset coefficient to obtain a third result; The first result, the second result and the third result are added together to obtain a total loss value.
6. The speech detection model training method according to claim 1, characterized in that: Before inputting the training speech into the trained speech feature extraction sub-model and outputting the first speech feature corresponding to the training speech, the method further includes: Acquire sample speech, input the sample speech into the speech feature extraction submodel, and output the extracted speech features; Inputting the extracted speech features into the speech enhancement sub-model and outputting enhanced speech features; Determining a first target loss value between the extracted speech feature and the sample speech, and a second target loss value between the extracted speech feature and the enhanced speech feature; Determine a third target loss value according to the first target loss value and the second target loss value; When the third target loss value is greater than the preset target loss value, the parameters of the speech feature extraction submodel and the speech enhancement submodel are adjusted to iterate the speech feature extraction submodel and the speech enhancement submodel, and return to execute to obtain sample speech until the third target loss value is no greater than the preset target loss value, thereby obtaining a trained speech feature extraction submodel and a trained speech enhancement submodel.
7. The speech detection model training method according to any one of claims 1 to 6, characterized in that: After obtaining the trained speech detection model, it also includes: Acquire an input speech of an object, input the input speech into the trained speech feature extraction sub-model, and output a target first speech feature; Inputting the object signature feature sent by the server and the first speech into the trained speech enhancement sub-model, and outputting the target second speech feature; The target second voice feature is sent to the server so that the server inputs the received target second voice feature into the trained feature extraction sub-model to obtain the target signature feature, and verifies the authenticity of the received target second voice feature through the target signature feature and the object signature feature.
8. A speech detection model training device, characterized in that: The speech detection model includes a speech feature extraction sub-model, a speech enhancement sub-model and a feature extraction sub-model, and the device includes: A first acquisition module, used to acquire training speech, input the training speech into the trained speech feature extraction sub-model, output a first speech feature corresponding to the training speech, and determine a first loss value between the first speech feature and the training speech; a second acquisition module, configured to acquire an object identification feature corresponding to the training speech, input the object identification feature and the first speech feature into a trained speech enhancement sub-model, output a second speech feature, and determine a second loss value between the second speech feature and the first speech feature; a determination module, configured to input the second speech feature into the feature extraction sub-model, output a target object identification feature, and determine a third loss value between the target object identification feature and the object identification feature; An iterative module is used to determine a total loss value according to the first loss value, the second loss value and the third loss value, and iteratively train the feature extraction sub-model in the speech detection model according to the total loss value to obtain a trained speech detection model.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, which are suitable for loading by a processor to execute the speech detection model training method described in any one of claims 1 to 7.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the speech detection model training method described in any one of claims 1 to 7 is implemented.