Adversarial audio sample detection method and system based on pre-training model
Through the adversarial audio detection method based on the pre-trained model, multi-view audio features are extracted and feature fused, which solves the problem of the voiceprint authentication model being vulnerable to adversarial attacks and improves the accuracy and robustness of recognition.
Patent Information
- Application Number
- CN202410942156.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-09-27
AI Technical Summary
Existing voiceprint authentication models are vulnerable to adversarial attacks, leading to recognition failure. Current solutions have poor generalization or reduce the accuracy of non-adversarial samples.
The adversarial audio detection method based on the pre-trained model is used to obtain the audio data to be detected, extract multi-view audio features, and use the multi-view adversarial audio detector to perform feature fusion and classification to detect whether it is an adversarial sample and avoid the impact of adversarial attacks.
It improves the effectiveness of voiceprint recognition, enhances the ability to resist audio data detection, avoids recognition failures caused by adversarial attacks, and improves the generalization ability and robustness of the model.
Smart Images

Figure CN118711596A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of audio sample detection, and in particular to an adversarial audio sample detection method, system, computer device and storage medium based on a pre-training model. Background Art
[0002] Voiceprint authentication is a method of using human voice for identity authentication. Currently, voiceprint authentication models based on deep learning are the most effective methods for detecting voiceprint authentication. However, these models are easily affected by adversarial attacks, which can cause the voiceprint authentication system to output incorrect results without being perceived by the human ear.
[0003] There are two main ways to solve this problem. One is to use a small amount of self-generated adversarial sample data to train the model, but this method is not very generalizable and is less effective when facing unknown adversarial attack samples. The other is to remove the impact of adversarial attacks by making small perturbations to the samples to be tested based on the imperceptible characteristics of adversarial samples, but this method will reduce the accuracy of the voiceprint authentication model for non-adversarial samples. Therefore, there is an urgent need for a method that can effectively solve the problem that the voiceprint recognition system is vulnerable to adversarial attacks and causes it to fail. Summary of the invention
[0004] Based on this, it is necessary to provide an adversarial audio sample detection method, device, computer equipment and storage medium based on a pre-trained model to address the above technical problems, so as to solve at least one of the above problems.
[0005] In a first aspect, the embodiment of the present application is implemented by providing an adversarial audio detection method based on a pre-trained model, comprising the following steps:
[0006] Get the audio data to be detected;
[0007] Extracting features of the audio data to be detected by using a pre-trained model to obtain multi-view audio features;
[0008] The multi-view audio features are fused through a pre-trained multi-view adversarial audio detector to obtain a comprehensive feature vector, and the comprehensive feature vector is classified to obtain a classification detection result of the audio data to be detected.
[0009] In one embodiment, the trained multi-view adversarial audio detector is obtained by:
[0010] Acquire a training sample data set, wherein the training sample data set includes a plurality of training adversarial sample data and a plurality of training real sample data;
[0011] Performing feature extraction on the training adversarial sample data and a plurality of training real sample data through the pre-trained model to obtain multi-view audio features of the training sample data;
[0012] The multi-view adversarial audio detector is iteratively trained based on the multi-view audio features of the training sample data until convergence, thereby obtaining the trained multi-view adversarial audio detector.
[0013] In one embodiment, the iterative training of the multi-view adversarial audio detector based on the multi-view audio features of the training sample data until convergence to obtain the trained multi-view adversarial audio detector includes:
[0014] Step a: randomly initializing the parameters of the multi-view adversarial audio detector;
[0015] Step b: inputting the multi-view audio features of the training sample data into the multi-view adversarial audio detector to obtain the prediction results of the training sample data;
[0016] Step c: Calculate the loss value between the predicted result and the true label;
[0017] Step d: Based on the loss value, calculating the loss gradient by back propagation algorithm;
[0018] Step e: Based on the loss gradient, updating the parameters of the multi-view adversarial audio detector by gradient descent method;
[0019] Repeat steps be until the updated multi-view adversarial audio detector meets the convergence condition, thereby obtaining the trained multi-view adversarial audio detector.
[0020] In one embodiment, obtaining the trained multi-view adversarial audio detector includes:
[0021] Obtain a test set, wherein the test set includes a plurality of test adversarial sample data and a plurality of test real sample data;
[0022] Performing feature extraction on the test adversarial sample data and the test real sample data through the pre-trained model to obtain multi-view audio features of the test sample data;
[0023] Inputting the multi-view audio features of the test sample data into the trained multi-view adversarial audio detector for classification processing to obtain a prediction result for each test sample data;
[0024] Calculate an equal error rate based on the prediction result of each test sample data;
[0025] Based on the equal error rate, the trained multi-view adversarial audio detector is evaluated.
[0026] In one embodiment, the calculation of the error rate based on the prediction result of each test sample data includes:
[0027] Calculate the false positive error rate and false negative error rate at different thresholds;
[0028] When the false positive error rate is equal to the false negative error rate, the equal error rate is obtained.
[0029] In one embodiment, the pre-trained model is obtained by:
[0030] Acquire a training sample data set, wherein the training sample data set includes a plurality of unlabeled audio sample data;
[0031] Performing random masking processing on the unlabeled audio sample data to obtain masked audio sample data;
[0032] Inputting the masked audio sample data into an initial pre-training model for iterative training;
[0033] When the preset convergence conditions are met, the pre-trained model is obtained.
[0034] In one embodiment, the pre-trained model includes an input layer, a plurality of feature extraction layers, and an output layer connected in sequence, and the feature extraction of the audio data to be detected by the pre-trained model is performed to obtain multi-view audio features, including:
[0035] Extracting acoustic features through a shallow feature extraction layer, wherein the shallow feature extraction layer is a preset feature extraction layer close to the input layer;
[0036] High-level semantic features are extracted through a deep feature extraction layer, where the deep feature extraction layer is a preset feature extraction layer close to the output layer.
[0037] In a second aspect, a pre-trained model-based adversarial audio sample detection system is provided, comprising:
[0038] An audio data acquisition unit to be detected, used to acquire the audio data to be detected;
[0039] A multi-view audio feature acquisition unit, used to extract features from the audio data to be detected by using a pre-trained model to obtain multi-view audio features;
[0040] The classification detection result acquisition unit is used to perform feature fusion on the multi-view audio features through a pre-trained multi-view adversarial audio detector to obtain a comprehensive feature vector, and classify the comprehensive feature vector to obtain the classification detection result of the audio data to be detected.
[0041] In a third aspect, a computer device is provided, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein when the processor executes the computer-readable instructions, the adversarial audio sample detection steps based on the pre-trained model as described above are implemented.
[0042] In a fourth aspect, a readable storage medium is provided, wherein the readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the adversarial audio sample detection method based on the pre-trained model as described above are implemented.
[0043] The above-mentioned adversarial audio sample detection method, system, computer device and storage medium based on the pre-trained model, the method implementation includes: obtaining the audio data to be detected; extracting features of the audio data to be detected through the pre-pre-trained model to obtain multi-perspective audio features; performing feature fusion on the multi-perspective audio features through the pre-trained multi-perspective adversarial audio detector to obtain a comprehensive feature vector, and classifying the comprehensive feature vector to obtain the classification detection result of the audio data to be detected. In the embodiment of the present application, features including rich information are extracted at different levels through the pre-pre-trained model and input into the multi-perspective adversarial audio detector. The multi-perspective adversarial audio detector integrates the detection results of each perspective and finally outputs the classification result. It can effectively detect the adversarial audio data and avoid being affected by the adversarial attack, which may cause failure in subsequent voiceprint authentication, and improve the effectiveness of voiceprint recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0045] Figure 1 is a flow chart of a method for detecting adversarial audio samples based on a pre-trained model in one embodiment of the present invention;
[0046] Figure 2 is a network architecture diagram of a pre-trained model in one embodiment of the present invention;
[0047] Figure 3 is a schematic diagram of an application environment of an adversarial audio sample detection method based on a pre-trained model in one embodiment of the present invention;
[0048] Figure 4 is a network architecture diagram of a multi-view adversarial detector in one embodiment of the present invention;
[0049] Figure 5 is a structural schematic diagram of an adversarial audio sample detection system based on a pre-training model in one embodiment of the present invention;
[0050] Figure 6 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] In one embodiment, if Figure 1 As shown, a method for detecting adversarial audio samples based on a pre-trained model is provided, comprising the following steps:
[0053] In step S110, the audio data to be detected is obtained;
[0054] In an embodiment of the present application, the audio data to be detected may be an audio clip containing the user's voice that is collected in advance by the user, such as a music clip, a speech clip, a lecture clip, etc.
[0055] In an embodiment of the present application, after obtaining the audio data to be detected, the audio data to be detected can be preprocessed, which may specifically include: filtering invalid audio frames, reducing noise, removing background sounds, unifying audio duration, etc., and the processed audio data can be divided into audio frame data of a preset size, so that the audio frame data can meet the input of a subsequent pre-trained model.
[0056] Optionally, audio quality detection can be performed on the audio data to be detected, and the segments with the clearest main voice and the least noise can be determined and segmented, and used as input of the pre-trained model to improve the confidence of the model detection.
[0057] In step S120, feature extraction is performed on the audio data to be detected by using a pre-trained model to obtain multi-view audio features;
[0058] like Figure 2As shown, in an embodiment of the present application, the pre-trained model is constructed by stacking TransformerLayer. Exemplary examples may include Transformer Layer1-Transformer LayerN, where N is a positive integer greater than 1, and multiple Transformer Layers can be connected in sequence. The audio data to be detected can pass through each layer of TransformerLayer in sequence, and the features corresponding to this layer are extracted, so multiple audio features can be collected, that is, multi-layer audio feature representation, and the feature expression granularity of outputs at different levels is different, which can reflect audio features from multiple perspectives.
[0059] Among them, the pre-training model can adopt open source pre-training models such as Wav2vec2.0, HuBERT, and WavLM.
[0060] In an embodiment of the present application, after the pre-trained model is constructed by stacking Transformer Layers, sample data is collected and a training sample data set is constructed. Based on the training sample data set, the pre-trained model is iteratively trained until the preset convergence conditions are met to obtain the pre-trained model.
[0061] In step S130, the multi-view audio features are fused by a pre-trained multi-view adversarial audio detector to obtain a comprehensive feature vector, and the comprehensive feature vector is classified to obtain a classification detection result of the audio data to be detected.
[0062] See also Figure 3 In an embodiment of the present application, the multi-view adversarial audio detector may include a multi-view audio feature fuser Transformer Encoder and a classifier module FC. The multi-view audio feature fuser may be connected to a data loading module, which can be used to load and preprocess training sample audio data and test sample audio data during the training and testing stages, and then perform multi-view audio feature extraction through a pre-trained model, that is, a pre-trained model. The multi-view audio feature fuser can be used to fuse the audio features extracted from each layer of the pre-trained model to obtain a comprehensive feature vector, and then classify the comprehensive feature vector based on the classifier model to obtain a classification detection result. Based on the classification detection result, it can be determined whether the audio data to be detected is an adversarial sample. For example, the classification detection result may include a prediction score. If the prediction score is greater than a threshold value, the audio data to be detected can be considered to be an adversarial sample, otherwise it is a real sample.
[0063] Optionally, the multi-view audio feature fuser Transformer Encoder may include a multi-layer self-attention mechanism and a feed-forward neural network layer. The multi-layer self-attention mechanism can be used to fuse the audio features of each view, and the fused audio features can be integrated to obtain the comprehensive feature vector.
[0064] In an embodiment of the present application, a method for detecting adversarial audio samples based on a pre-trained model is provided, and the method implementation includes: obtaining audio data to be detected; extracting features of the audio data to be detected through a pre-trained model to obtain multi-perspective audio features; performing feature fusion on the multi-perspective audio features through a pre-trained multi-perspective adversarial audio detector to obtain a comprehensive feature vector, and classifying the comprehensive feature vector to obtain a classification detection result of the audio data to be detected. In an embodiment of the present application, features including rich information are extracted at different levels through a pre-trained model and input into a multi-perspective adversarial audio detector. The multi-perspective adversarial audio detector integrates the detection results of each perspective and finally outputs the classification result, which can effectively detect adversarial audio data and avoid being affected by adversarial attacks, which may lead to failure in subsequent voiceprint authentication, thereby improving the effectiveness of voiceprint recognition.
[0065] In one embodiment of the present application, the pre-trained model is obtained by:
[0066] Acquire a training sample data set, wherein the training sample data set includes a plurality of unlabeled audio sample data;
[0067] Performing random masking processing on the unlabeled audio sample data to obtain masked audio sample data;
[0068] Inputting the masked audio sample data into an initial pre-training model for iterative training;
[0069] When the preset convergence condition is met, the pre-trained model is obtained.
[0070] Specifically, a large amount of unlabeled audio data can be collected as audio sample data, and then the audio sample data can be randomly masked to obtain masked audio sample data, which is then input into the initial pre-trained model for iterative training until the preset convergence conditions are met. The pre-trained model can be obtained by using the information of the part not blocked by the mask and the predicted blocked part, so that the pre-trained model can learn key features and achieve better performance in subsequent supervised tasks. This can reduce the dependence on labeled data, reduce the cost of data labeling, and improve the generalization ability of the model in various audio tasks. The powerful modeling ability of the pre-trained model helps to identify adversarial audio data.
[0071] It should be noted that the unoccluded part can be used as the input of the pre-trained model, and the occluded part can be used as the self-supervised target.
[0072] Optionally, after the audio sample data is obtained, the audio sample data can be framed and Fourier transformed to obtain the spectrum information of each frame of audio. A mask can then be randomly calculated and applied to the spectrum information. For example, the mask can be applied to the spectrum information by point-by-point multiplication. The spectrum information after mask processing can then be inverse Fourier transformed to obtain a time domain audio signal. The time domain audio signal can be overlapped and added to obtain the masked audio sample data.
[0073] In an embodiment of the present application, the pre-trained model may include an input layer, a plurality of feature extraction layers, and an output layer connected in sequence, and the feature extraction of the audio data to be detected by the pre-trained model to obtain multi-view audio features includes:
[0074] Extracting acoustic features through a shallow feature extraction layer, wherein the shallow feature extraction layer is a preset feature extraction layer close to the input layer;
[0075] High-level semantic features are extracted through a deep feature extraction layer, where the deep feature extraction layer is a preset feature extraction layer close to the output layer.
[0076] Specifically, after training, the pre-trained model can be used to extract acoustic features through a shallow feature extraction layer, which is a feature extraction layer close to the input layer, and then when it passes through a deep feature extraction layer, which is a feature extraction layer close to the output layer, it can extract high-level semantic information related to human understanding, such as word-level information. It should be noted that the model can also extract paralinguistic information, such as the speaker's voiceprint information, emotional information, etc.
[0077] It can be understood that the feature extraction layer is Figure 2 Transformer Layer in .
[0078] In one embodiment of the present application, the trained multi-view adversarial audio detector is obtained by:
[0079] Acquire a training sample data set, wherein the training sample data set includes a plurality of training adversarial sample data and a plurality of training real sample data;
[0080] Performing feature extraction on the training adversarial sample data and the training real sample data through the pre-training model to obtain multi-view audio features of the training sample data;
[0081] The multi-view adversarial audio detector is iteratively trained based on the multi-view audio features of the training sample data until convergence, thereby obtaining the trained multi-view adversarial audio detector.
[0082] Specifically, a training sample data set, a test data set, and a validation set can be pre-constructed, and then the parameters of the pre-trained model can be fixed so that feature extraction is performed each time through a pre-trained model with the same parameters. Multi-view audio features are extracted through the pre-trained model and input into a multi-view adversarial audio detector for iterative training until convergence. It should be noted that the training sample data set may include adversarial sample audio data and real sample audio data. And a corresponding label is assigned to each sample audio data, wherein the label of the real sample audio data may be a positive label, and the label of the adversarial sample audio data may be a negative label.
[0083] In an embodiment of the present application, the multi-view audio feature based on the training sample data is iteratively trained on the multi-view adversarial audio detector until convergence to obtain the trained multi-view adversarial audio detector, including:
[0084] Step a: randomly initializing the parameters of the multi-view adversarial audio detector;
[0085] Step b: inputting the multi-view audio features of the training sample data into the multi-view adversarial audio detector to obtain the prediction results of the training sample data;
[0086] Step c: Calculate the loss value between the predicted result and the true label;
[0087] Step d: Based on the loss value, calculating the loss gradient by back propagation algorithm;
[0088] Step e: Based on the loss gradient, updating the parameters of the multi-view adversarial audio detector by gradient descent method;
[0089] Repeat steps be until the updated multi-view adversarial audio detector meets the convergence condition, thereby obtaining the trained multi-view adversarial audio detector.
[0090] Specifically, a multi-view adversarial audio detector can be constructed, and then the parameters of the multi-view adversarial audio detector are randomly initialized. The multi-view audio features collected by the pre-trained model with fixed parameters are input into the initialized multi-view adversarial audio detector by the forward propagation method to obtain the prediction results of each training sample data, and then the loss value between the prediction result and the true label is calculated by a preset loss function, such as cross entropy, and the loss gradient of the loss value is calculated by the back propagation method. Based on the loss gradient, the parameters of the multi-view adversarial audio detector are updated by the gradient descent method to reduce the loss value, and then the multi-view audio features of the remaining training sample data are input into the updated multi-view adversarial audio detector again, and the parameters of the multi-view adversarial audio detector are updated again by forward propagation, back propagation, gradient descent and other methods. Repeat the above steps, continuously update the parameters of the multi-view adversarial audio detector until convergence, and obtain the trained multi-view adversarial audio detector. At this time, the trained multi-view adversarial audio detector can correctly classify the real audio data and the adversarial audio data.
[0091] It should be noted that at the end of each training cycle, the validation set can be used to evaluate the performance of the multi-view adversarial audio detector, thereby ensuring that the detector not only performs well on the training set, but can also effectively detect adversarial samples on the unseen validation set.
[0092] See also Figure 4 The network architecture of the trained multi-view adversarial audio detector may specifically include an attention layer, a layer normalization, a pre-feedback layer, a layer normalization, and a fully connected layer connected in sequence. The multi-view audio features extracted by the pre-trained model may be respectively input into the attention layer and the layer normalization through the input layer, and attention processing and normalization processing may be performed respectively, and the features after attention processing may be input into the layer normalization for normalization processing, and then the features processed by the layer normalization layer may be respectively input into the pre-feedback layer and the next layer normalization for processing, and the features processed in the pre-feedback layer may be input into the layer normalization for processing, and then output to the fully connected layer for classification processing to obtain a prediction result.
[0093] In one embodiment of the present application, obtaining the trained multi-view adversarial audio detector includes:
[0094] Obtain a test set, wherein the test set includes a plurality of test adversarial sample data and a plurality of test real sample data;
[0095] Performing feature extraction on the test adversarial sample data and a plurality of test real sample data by using the pre-trained model to obtain multi-view audio features of the test sample data;
[0096] Inputting the multi-view audio features of the test sample data into the trained multi-view adversarial audio detector for classification processing to obtain a prediction result for each test sample data;
[0097] Calculate an equal error rate based on the prediction result of each test sample data;
[0098] Based on the equal error rate, the trained multi-view adversarial audio detector is evaluated.
[0099] Specifically, a pre-built sample test set can be used to evaluate the trained multi-view adversarial audio detector, such as the test set in the AdvSV dataset. Since the test set contains many adversarial samples that have not been seen during the training process, the test results can reflect the generalization ability of the model to unknown adversarial attack samples. The test set includes multiple test adversarial sample data and multiple test real sample data.
[0100] Furthermore, the test sample data in the test set can be feature extracted through a pre-trained model with fixed parameters to obtain the multi-view audio features of the test samples, and input into the trained multi-view audio detector for classification processing, and obtain the prediction results of each test sample, which may include the predicted labels of the test real sample data and the test adversarial sample. Then, based on the comparison between the prediction result and the real label, the prediction error rate can be statistically calculated, and the prediction error rate may specifically include false positives (False Positive, FP), that is, the true sample is mistakenly identified as an adversarial sample, and false negatives (False Negative, FN), that is, the adversarial sample is mistakenly identified as a true sample. Therefore, based on the false positive error rate and the false negative error rate, an equal error rate can be obtained to measure the model performance.
[0101] In an embodiment of the present application, the calculation of the error rate based on the prediction result of each test sample data includes:
[0102] Based on the prediction results, the false positive error rate and the false negative error rate corresponding to different thresholds are calculated;
[0103] When the false positive error rate is equal to the false negative error rate, the equal error rate is obtained.
[0104] Specifically, the prediction result can be a prediction score. When the prediction score is greater than a preset threshold, the audio data to be detected can be considered to be an adversarial audio sample, otherwise it is a real audio sample. Since the false positive error rate and the false negative error rate ratio are different under different thresholds. Therefore, multiple thresholds can be set, and the prediction score of each test sample data is compared with each threshold respectively, and the false positive error rate and the false negative error rate of each test sample data under different thresholds are obtained, and then the threshold when the false positive error rate and the false negative error rate are the same is determined, and the error rate at this time is obtained, that is, the equal error rate. And the threshold at this time is used as the final threshold.
[0105] The false positive error rate and false negative error rate can be used to determine the performance of the model on different types of artifacts in order to further optimize the model. Based on these error rates, the detection performance of the trained multi-view adversarial detector on unknown adversarial samples can be evaluated. The lower the error rate, the stronger the generalization ability of the trained multi-view adversarial detector.
[0106] It should be noted that based on the test results, the model can be optimized, such as adjusting the model structure, improving the training strategy, or introducing more data enhancement methods, to further reduce the EER and improve the robustness and accuracy of adversarial sample detection. Through the above test process, the performance of the multi-view adversarial audio detector in practical applications can be fully evaluated to ensure that it has good generalization ability and robustness when dealing with unknown adversarial attack samples.
[0107] In an embodiment of the present application, features containing rich information are extracted at different levels through a pre-trained model and input into a multi-view adversarial audio detector. The multi-view adversarial audio detector integrates the detection results of each view and finally outputs the classification result. This can effectively detect adversarial audio data and avoid being affected by adversarial attacks, which may cause failure in subsequent voiceprint authentication, thereby improving the effectiveness of voiceprint recognition.
[0108] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0109] In one embodiment, a pre-trained model-based adversarial audio sample detection system is provided, and the pre-trained model-based adversarial audio sample detection system corresponds to the pre-trained model-based adversarial audio sample detection method in the above embodiment. Figure 5 As shown, the adversarial audio sample detection system based on the pre-trained model includes an audio data acquisition unit 10 to be detected, a multi-view audio feature acquisition unit 20 and a classification detection result acquisition unit 30. The functional modules are described in detail as follows:
[0110] The audio data acquisition unit 10 is used to acquire the audio data to be detected;
[0111] A multi-view audio feature acquisition unit 20, configured to extract features from the audio data to be detected by using a pre-trained model to obtain multi-view audio features;
[0112] The classification detection result acquisition unit 30 is used to perform feature fusion on the multi-view audio features through a pre-trained multi-view adversarial audio detector to obtain a comprehensive feature vector, and classify the comprehensive feature vector to obtain the classification detection result of the audio data to be detected.
[0113] In one embodiment of the present application, the system includes a multi-view adversarial audio detector training unit, configured to:
[0114] Acquire a training sample data set, wherein the training sample data set includes a plurality of training adversarial sample data and a plurality of training real sample data;
[0115] Performing feature extraction on the training adversarial sample data and a plurality of training real sample data through the pre-trained model to obtain multi-view audio features of the training sample data;
[0116] The multi-view adversarial audio detector is iteratively trained based on the multi-view audio features of the training sample data until convergence, thereby obtaining the trained multi-view adversarial audio detector.
[0117] In one embodiment of the present application, the multi-view adversarial audio detector training unit is further used to:
[0118] Step a: Randomly initialize the parameters of the multi-view adversarial audio detector;
[0119] Step b: inputting the multi-view audio features of the training sample data into the multi-view adversarial audio detector to obtain the prediction results of the training sample data;
[0120] Step c: Calculate the loss value between the predicted result and the true label;
[0121] Step d: Based on the loss value, calculating the loss gradient by back propagation algorithm;
[0122] Step e: Based on the loss gradient, updating the parameters of the multi-view adversarial audio detector by gradient descent method;
[0123] Repeat steps be until the updated multi-view adversarial audio detector meets the convergence condition, thereby obtaining the trained multi-view adversarial audio detector.
[0124] In one embodiment of the present application, the system further includes a multi-view adversarial audio detector testing unit, which is used to:
[0125] Obtain a test set, wherein the test set includes a plurality of test adversarial sample data and a plurality of test real sample data;
[0126] Performing feature extraction on the test adversarial sample data and a plurality of test real sample data by using the pre-trained model to obtain multi-view audio features of the test sample data;
[0127] Inputting the multi-view audio features of the test sample data into the trained multi-view adversarial audio detector for classification processing to obtain a prediction result for each test sample data;
[0128] Calculate an equal error rate based on the prediction result of each test sample data;
[0129] Based on the equal error rate, the trained multi-view adversarial audio detector is evaluated.
[0130] In one embodiment of the present application, the system further includes a multi-view adversarial audio detector testing unit, further configured to:
[0131] Calculate the false positive error rate and false negative error rate at different thresholds;
[0132] When the false positive error rate is equal to the false negative error rate, the equal error rate is obtained.
[0133] In one embodiment of the present application, the system further includes: a pre-training model training unit, which is used to:
[0134] Acquire a training sample data set, wherein the training sample data set includes a plurality of unlabeled audio sample data;
[0135] Performing random masking processing on the unlabeled audio sample data to obtain masked audio sample data;
[0136] Inputting the masked audio sample data into an initial pre-training model for iterative training;
[0137] When the preset convergence conditions are met, the pre-trained model is obtained.
[0138] In one embodiment of the present application, the pre-trained model includes an input layer, a plurality of feature extraction layers and an output layer connected in sequence, and the multi-view audio feature acquisition unit 20 is used to:
[0139] Extracting acoustic features through a shallow feature extraction layer, wherein the shallow feature extraction layer is a preset feature extraction layer close to the input layer;
[0140] High-level semantic features are extracted through a deep feature extraction layer, where the deep feature extraction layer is a preset feature extraction layer close to the output layer.
[0141] In an embodiment of the present application, features containing rich information are extracted at different levels through a pre-trained model and input into a multi-view adversarial audio detector. The multi-view adversarial audio detector integrates the detection results of each view and finally outputs the classification result. This can effectively detect adversarial audio data and avoid being affected by adversarial attacks, which may cause failure in subsequent voiceprint authentication, thereby improving the effectiveness of voiceprint recognition.
[0142] For the specific limitations of the adversarial audio sample detection system based on the pre-trained model, please refer to the limitations of the adversarial audio sample detection method based on the pre-trained model above, which will not be repeated here. Each module in the above-mentioned adversarial audio sample detection system based on the pre-trained model can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0143] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a method for detecting adversarial audio samples based on a pre-trained model is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0144] In an embodiment of the present application, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the adversarial audio sample detection method based on the pre-trained model as described above are implemented.
[0145] In an embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the steps of the adversarial audio sample detection method based on the pre-trained model as described above are implemented.
[0146] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0147] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0148] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for detecting adversarial audio samples based on a pre-trained model, characterized in that: The method comprises: Get the audio data to be detected; Extracting features of the audio data to be detected by using a pre-trained model to obtain multi-view audio features; The multi-view audio features are subjected to feature fusion through a pre-trained multi-view adversarial audio detector to obtain a comprehensive feature vector, and the comprehensive feature vector is classified to obtain a classification detection result of the audio data to be detected.
2. The method for detecting adversarial audio samples based on a pre-trained model according to claim 1, characterized in that: The trained multi-view adversarial audio detector is obtained in the following manner: Acquire a training sample data set, wherein the training sample data set includes a plurality of training adversarial sample data and a plurality of training real sample data; Performing feature extraction on the training adversarial sample data and a plurality of training real sample data through the pre-trained model to obtain multi-view audio features of the training sample data; The multi-view adversarial audio detector is iteratively trained based on the multi-view audio features of the training sample data until convergence, thereby obtaining the trained multi-view adversarial audio detector.
3. The method for detecting adversarial audio samples based on a pre-trained model as claimed in claim 2, characterized in that: The iterative training of the multi-view adversarial audio detector based on the multi-view audio features of the training sample data until convergence to obtain the trained multi-view adversarial audio detector includes: Step a: randomly initializing the parameters of the multi-view adversarial audio detector; Step b: inputting the multi-view audio features of the training sample data into the multi-view adversarial audio detector to obtain the prediction results of the training sample data; Step c: Calculate the loss value between the predicted result and the true label; Step d: Based on the loss value, calculating the loss gradient by back propagation algorithm; Step e: Based on the loss gradient, updating the parameters of the multi-view adversarial audio detector by gradient descent method; Repeat steps be until the updated multi-view adversarial audio detector meets the convergence condition, thereby obtaining the trained multi-view adversarial audio detector.
4. The method for detecting adversarial audio samples based on a pre-trained model according to claim 2 or 3, characterized in that: The step of obtaining the trained multi-view adversarial audio detector comprises: Obtain a test set, wherein the test set includes a plurality of test adversarial sample data and a plurality of test real sample data; Performing feature extraction on the test adversarial sample data and the test real sample data through the pre-trained model to obtain multi-view audio features of the test sample data; Inputting the multi-view audio features of the test sample data into the trained multi-view adversarial audio detector for classification processing to obtain a prediction result for each test sample data; Calculate an equal error rate based on the prediction result of each test sample data; Based on the equal error rate, the trained multi-view adversarial audio detector is evaluated.
5. The method for detecting adversarial audio samples based on a pre-trained model as claimed in claim 4, characterized in that: The calculation of the error rate based on the prediction result of each test sample data includes: Calculate the false positive error rate and false negative error rate at different thresholds; When the false positive error rate is equal to the false negative error rate, the equal error rate is obtained.
6. The method for detecting adversarial audio samples using a pre-trained model as claimed in claim 1, wherein: The pre-trained model is obtained in the following way: Acquire a training sample data set, wherein the training sample data set includes a plurality of unlabeled audio sample data; Performing random masking processing on the unlabeled audio sample data to obtain masked audio sample data; Inputting the masked audio sample data into an initial pre-training model for iterative training; When the preset convergence condition is met, the pre-trained model is obtained.
7. The method for detecting adversarial audio samples using a pre-trained model according to claim 1 or 6, wherein: The pre-trained model includes an input layer, a plurality of feature extraction layers and an output layer connected in sequence, and extracting features from the audio data to be detected by the pre-trained model to obtain multi-view audio features includes: Extracting acoustic features through a shallow feature extraction layer, wherein the shallow feature extraction layer is a preset feature extraction layer close to the input layer; High-level semantic features are extracted through a deep feature extraction layer, where the deep feature extraction layer is a preset feature extraction layer close to the output layer.
8. A pre-trained model-based adversarial audio sample detection system, characterized in that: The system comprises: An audio data acquisition unit to be detected, used to acquire the audio data to be detected; A multi-view audio feature acquisition unit, used to extract features from the audio data to be detected by using a pre-trained model to obtain multi-view audio features; The classification detection result acquisition unit is used to perform feature fusion on the multi-view audio features through a pre-trained multi-view adversarial audio detector to obtain a comprehensive feature vector, and classify the comprehensive feature vector to obtain the classification detection result of the audio data to be detected.
9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer-readable instructions, the adversarial audio sample detection step based on the pre-trained model as described in any one of claims 1 to 7 is implemented.
10. A readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the steps of the adversarial audio sample detection method based on a pre-trained model are implemented as described in any one of claims 1 to 7.
