Generative confrontation-based song emotion recognition method and device
Through the generator-based sparse adversarial method, migratory adversarial perturbation is generated, which solves the problem of time-consuming and lack of migration in the prior art, and achieves efficient attack effect and robustness of the song emotion recognition model.
Patent Information
- Application Number
- CN202410848158.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-11-15
AI Technical Summary
In the prior art, in the recognition of song emotions, the gradient iteration method is time-consuming and prone to overfitting, and lacks concealment and migration in the anti-perturbation. Manual feature selection has subjectivity and deviation, making it difficult to fully capture audio information.
Using a generator-based sparse adversarial method, sparsity perturbation is generated through the Wave-U-Net network, sparse loss function and transfer learning are introduced, and attack intensity, sparseness and quantization error are balanced using Carlini and Wagner loss functions to generate migratory adversarial Disturbance.
It improves the robustness and attack effect of the song emotion recognition model, reduces training time, and the generated adversarial perturbation is highly mobility and difficult to detect on different models.
Smart Images

Figure CN118969024A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a song emotion recognition method and device based on generative adversarial technology. Background Art
[0002] Songs contain rich information about human emotions, and song emotion recognition has always been an important topic in the field of human-computer interaction. Music is a powerful tool for expressing emotions, and song emotion recognition models can analyze and understand how music conveys and evokes specific emotions from a quantitative perspective. The robustness of song emotion recognition models is crucial, especially in fields with high reliability requirements such as music education and music recommendation systems. In recent years, people have become increasingly interested in deep neural networks (DNNs) that can directly process raw audio signals, because DNNs bypass the need for manual feature extraction and have the potential to provide a more comprehensive representation for song emotion recognition tasks. On this basis, how to improve the robustness of audio in the face of deep neural network adversarial has also become a hot research area. In this paper, we propose an end-to-end generator-based sparse and transferable method that can efficiently generate successful sparse adversarial samples, which has important practical significance for improving the robustness and security of song emotion recognition models.
[0003] Among the existing fully trained methods, Tzirakis et al. initially proposed a convolutional recurrent neural network structure Emo18 for continuous emotion recognition. Emo18 consists of 3 convolutional layers for extracting features from raw audio signals and 2 layers of long short-term memory (LSTM) modules for contextual dependencies. Zhao et al. (denoted as Zhao19) proposed a similar discrete emotion recognition network consisting of 4 convolutional layers and 2 stacked LSTM layers. The audio modalities of Emo18 and Zhao19 were also utilized and compared. Zhang et al. adopted an attention mechanism and a multi-task learning strategy to enhance the stability of audio representation for emotion recognition. In addition to the residual content-neutral network block (CNNBLOCK), Sun et al. also used gender information blocks to improve recognition accuracy.
[0004] In existing pre-training methods, by pre-training on a large amount of data, the base model can learn a stable representation that captures the acoustic and linguistic characteristics of the song, enabling it to effectively transfer knowledge to various song processing tasks. For example, Wav2vec 2.0 contains a convolutional neural network module that serves as a latent feature encoder speech representation, and a Transformer module that captures global contextual dependencies. Wav2vec 2.0 uses a self-supervised learning approach, where the model is trained on a large amount of speech data with the goal of learning discriminative representations. The Wav2vec 2.0 model is widely used in music emotion recognition research due to its superior ability to extract representations. Hidden Unit Transformers Dual Encoder Representations (HuBERT) uses a similar architecture to wav2vec 2.0. HuBERT also applies self-supervised learning, but with additional auxiliary tasks, such as frame-by-frame feature prediction, which improves the model's ability to learn combined acoustic and linguistic features on raw speech data. Morais et al. fine-tuned HuBERT as an upstream model to provide generated utterance embeddings for emotion classification. WavLM builds on the success of self-supervised pre-training in speech processing and aims to solve full-stack speech processing tasks by leveraging large-scale unlabeled data. To better capture sequence information in audio, WavLM further extends the HuBERT approach by adopting gated relative position bias in the Transformer structure and enhancing training data through a discourse mixture strategy. Feng et al. applied WavLM for embedding extraction and explored its credibility.
[0005] First, generative adversarial techniques in the audio field mainly rely on gradient iteration-based techniques, which are very time-consuming and prone to overfitting specific adversarial models. The characteristic of this technique is that through multiple iterations, the perturbations are gradually optimized according to the gradient information of the victim model (adversarial model), so that these perturbations can successfully deceive the model. However, this method is very time-consuming. The gradient iteration-based method requires multiple calculations of the gradient of the model and gradually adjusts the perturbations in each iteration. This iterative process takes up a lot of computing resources and time, especially when processing high-dimensional audio data. The amount of calculation will be even larger. Secondly, since the gradient-based method is to optimize the gradient information of a specific model, these perturbations tend to be overly dependent on the characteristics of the attacked model. As a result, these perturbations may work well on this specific model, but they work poorly on other models or data sets, showing low transferability. This phenomenon is called overfitting.
[0006] At the same time, the above technologies have limited exploration of sparse fluctuations in the audio field, which have the potential for better concealment. Sparse fluctuations are an adversarial attack technology in the field of speech. By making subtle modifications to a few locations in the audio signal, they successfully deceive machine learning models while maintaining the naturalness of the audio. It is concealed, efficient, and transferable, making the attack difficult for humans or automatic detection systems to detect. At the same time, it can effectively generate adversarial samples, and these samples have good versatility between different models.
[0007] Finally, although many song emotion recognition systems adopting traditional machine learning techniques utilize hand-crafted acoustic features such as Mel-Frequency Cepstral Coefficient (MFCC) features as input, the selection of these features may introduce bias and take extra time.
[0008] For gradient iteration, each iteration needs to calculate and update the perturbation, and each calculation of the gradient involves the forward and backward propagation of the entire model, which is a computationally intensive task for deep neural networks, especially when processing high-dimensional audio signals, the computational complexity is further increased. At the same time, the gradient update in the iterative process is based on the parameters and structure of a specific model, which means that the optimization direction of the perturbation depends entirely on the internal state of the model. When changing a model or data set, these perturbations may no longer be effective because they do not have generalization capabilities and only fine-tune a specific model. In addition, the gradient iteration method is prone to falling into local optimality, that is, a seemingly effective perturbation is found on the current model, but this perturbation is not globally optimal. On other models, this perturbation may not be able to deceive the model very well, showing low transferability.
[0009] Handcrafted acoustic features such as MFCC require experts to select and design them based on their experience and knowledge. This process is inevitably subjective, and different experts may choose different features, resulting in differences in model performance. In addition, manually selected features may not fully capture all useful information in the audio signal. For example, MFCC mainly reflects spectral envelope information, but may ignore other important audio features such as time domain information and phase information, which may cause the model to fail to fully utilize all information in the audio, thereby introducing bias. Summary of the invention
[0010] The purpose of the present invention is to provide a song emotion recognition method and device based on generative adversarial technology to solve the technical problems mentioned in the background technology.
[0011] The generator-based method focuses on learning the distribution of training data, thereby generating more transferable sparse fluctuations, avoiding the introduction of bias, and saving a lot of learning and training time. By introducing a sparsity loss function, sparse adversarial perturbations can be generated, thereby improving the effect and generalization ability of the attack. At the same time, the idea of transfer learning is introduced, so that the generated adversarial perturbations can successfully attack different target models, improving the transferability of the attack.
[0012] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0013] A song emotion recognition method based on generative adversarial learning is proposed. The original song audio is input into a generator to generate disturbance amplitude and disturbance position. The disturbance amplitude is multiplied by the disturbance position to calculate the sparse disturbance. The sparse disturbance is added to the original song audio sample to create an adversarial audio sample. A threat song emotion recognition model is set to guide the generator network training to generate specific adversarial disturbances to attack a specific speech emotion recognition model. A loss function is set to balance the attack intensity, sparsity and quantization error to improve the effect and transferability of the attack and realize song emotion category recognition.
[0014] Furthermore, the original song audio includes a leading tone, a tonic tone and a dominant tone, and the dominant tone includes musical elements with emotional expression functions such as legato, glissando, tremolo and trill.
[0015] Furthermore, the perturbation amplitude is used to limit the perturbation value of each frame, and the perturbation position is used to achieve sparsity. The training of the generator is designed to deceive the local adversarial song emotion recognition model. At the same time, the generated adversarial audio samples can be transferred to adversarial another unknown target song emotion recognition model.
[0016] Furthermore, the generator is a Wave-U-Net network, which includes a downsampling stage and an upsampling stage. In the downsampling stage, the Wave-U-Net neural network reduces the temporal resolution by discarding the features of every other time step. In the upsampling stage, linear interpolation is used to upsample the feature map, and high-level features are connected to local features. The perturbation amplitude is performed in the first upsampling module, and a clipping operation is applied to limit the perturbation value to {-∈, +∈}, where ∈ is a predefined hyperparameter used to constrain l ∞ norm, where the disturbance amplitude can be obtained after clipping operation;
[0017] The perturbation position is performed in the second upsampling module to generate sparse perturbations. The output of the second upsampling module is converted into binary form using quantization to represent the perturbation position. If the output of the second upsampling module is represented as Convert to a discrete vector m∈{0,1} N, processed by binary quantization, the formula is expressed as follows:
[0018]
[0019] Among them, γ is a custom hyperparameter, setting the randomization method to ensure Gradually converge to 1 or 0. Specifically, a random number is generated according to a uniform distribution on the interval [0, 1). If t ≥ 0.5, a binary quantization operation is applied, otherwise, no binary quantization operation is performed.
[0020] Furthermore, the specific process of generator network training is:
[0021] The training process consists of passing adversarial examples X adv The input is fed into the adversarial song emotion recognition model f for emotion classification. During this process, the parameters of the generator are optimized to identify and manipulate important patterns in the training data. The patterns are universal, which promotes the model independence of the generated adversarial examples. By leveraging the universal patterns, the generated adversarial audio X adv Effectively deceive and counter other models.
[0022] Furthermore, the loss function uses Carlini loss and Wagner loss as the main objective function for making adversarial audio examples. Carlini loss and Wagner loss are used to increase the probability of samples being misclassified, so as to guide the successful attack on the song emotion recognition model. The formula is expressed as follows:
[0023]
[0024] Where φ is a predefined hyperparameter of confidence that controls the strength of the attack, X adv is the adversarial example input,
[0025] Setting Amplitude Loss Amplitude loss Incorporate an L2 norm regularization term to ensure that the generated adversarial perturbations are always imperceptible, while also allowing control over the strength of the adversarial, which is achieved by adding the L2 norm to the clipping perturbation operation, as follows:
[0026]
[0027] Setting the sparse loss Sparse loss In the above example, it is not possible to directly constrain the L0 norm on the additional perturbation δ. By decomposing the perturbation amplitude v and perturbation position m of δ, the L1 norm of m is used to control the sparsity of δ, which only contains values 0 and 1, where 1 indicates that the value is perturbed. The sparse loss formula is expressed as follows:
[0028]
[0029] The sparsity of the final perturbation is determined by the convergence of the generator;
[0030] Setting the quantization loss Quantifying the loss In the training phase, whether to perform binary quantization is determined by random numbers sampled from a uniform distribution. On the contrary, during inference, binary quantization is used. There is a performance difference between the generators during training and inference. To narrow the gap, a quantization loss is set, which is expressed as follows:
[0031]
[0032] Total loss, total loss It is calculated as the weighted sum of all losses and is expressed as follows:
[0033]
[0034] where λ m , s and λ q They represent the weights assigned to the amplitude loss, sparsity loss, and quantization loss, respectively. The weights allow fine-tuning the impact of each component on the overall loss function. By optimizing the overall loss, the local threat model guides the training of the generator and generates sparse and imperceptible perturbations, thereby achieving a high adversarial success rate.
[0035] A device for a song emotion recognition method based on generative adversarial technology includes a generator, a training network and a loss function calculation module. The generator is connected to the loss function calculation module via the training network. The generator includes a downsampling module, a first upsampling module and a second upsampling module. The downsampling module is connected to the first upsampling module and the second upsampling module respectively.
[0036] The present invention has the following beneficial effects due to the adoption of the above technical solution:
[0037] The present invention effectively reduces the introduction of bias and deceives the speech emotion recognition model by adding minimized disturbances, while maintaining the sparsity and transferability of the disturbances. The generator-based method focuses on learning the distribution of training data, thereby generating more transferable sparse fluctuations, avoiding the introduction of bias, and saving a lot of learning and training time. By introducing a sparsity loss function, sparse adversarial disturbances can be generated, thereby improving the effect and generalization ability of the attack. At the same time, the idea of transfer learning is introduced, so that the generated adversarial disturbances can successfully attack on different target models, improving the transferability of the attack. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of the process flow of the method of the present invention;
[0039] Figure 2 It is a diagram of the structure of the generator of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many details listed in the specification are only for the purpose of enabling the reader to have a thorough understanding of one or more aspects of the present invention, and these aspects of the present invention can be implemented even without these specific details.
[0041] like Figure 1-2 As shown in the figure, a song emotion recognition method based on generative adversarial model uses a generator network to generate adversarial audio perturbations. The generator network generates sparse adversarial perturbations by minimizing the difference between the generated perturbations and the original audio and controlling the location of the perturbations through sparsity constraints. Secondly, the present invention introduces a threat model to guide the generator network to generate specific adversarial perturbations to attack a specific speech emotion recognition model. At the same time, the present invention designs and uses a series of loss functions to balance the attack strength, sparsity and quantization error to improve the effect and transferability of the attack. Finally, the end-to-end song emotion recognition model based on the generator-generated adversarial model is evaluated through a large number of experiments, and the experimental results prove that it can efficiently generate successful sparse adversarial examples. In addition, the adversarial examples we generated in the experiment show model-independent transferability, thereby enabling effective adversarial attacks on advanced victim models.
[0042] The method effectively reduces the introduction of bias and deceives the speech emotion recognition model by adding minimized disturbances, while maintaining the sparsity and transferability of the disturbances. The present invention is implemented by the following scheme:
[0043] 1. Overall architecture
[0044] The framework proposed by the present invention is as follows Figure 1 As shown. Since the framework of the present invention runs on an end-to-end basis, the original song audio (including its leading tone, tonic and dominant tone, as well as musical elements with emotional expression functions such as legato, glissando, tremolo, and trill) is input into the generator to generate perturbation amplitude and position. The perturbation amplitude is intended to limit the perturbation value of each frame, while the perturbation position aims to achieve sparsity. Next, the sparse perturbation is calculated by multiplying the perturbation amplitude by the position. The sparse perturbation is then added to the original song audio sample to create an adversarial audio sample. The training of the generator is designed to deceive the local adversarial song emotion recognition model, and the generated adversarial audio samples can also be migrated to combat other unknown target song emotion recognition models.
[0045] 2. U-Net Network
[0046] U-Net was originally developed for accurate and efficient biomedical image segmentation tasks. It utilizes a symmetric encoder-decoder structure with skip connections. WaveNet, on the other hand, is a deep generative model designed specifically for song synthesis. It utilizes repeated applications of dilated convolutions, where the dilation factor increases exponentially, to model long-term dependencies in audio signals. However, due to the high audio sampling rate, its memory consumption is high, which limits its application in real-time scenarios. Wave-U-Net extends the U-Net architecture to handle audio source separation tasks. It combines the advantages of the U-Net encoder-decoder structure and the ability of WaveNet to capture long-term dependencies.
[0047] like Figure 2 As shown in the figure, in the downsampling stage, Wave-U-Net reduces the temporal resolution by discarding the features of every other time step; in the upsampling stage, linear interpolation is used to upsample the feature map while connecting high-level features with local features. This approach enables Wave-U-Net to capture long-term dependencies in audio signals. Many previous studies on audio adversarial attacks mainly rely on models, which will indicate the powerful capabilities of the adversary. At the same time, this also provides insights into the vulnerability and robustness of advanced models in the face of adversarial attacks, demonstrating the importance of developing defense mechanisms against such adversaries.
[0048] 5. Loss function design
[0049] The training of the generator is guided by a combination of multiple loss functions. Specifically, the adversarial loss is used to guide the successful attack on the song emotion recognition model; the amplitude loss aims to make the adversarial perturbations imperceptible to humans; the sparsity loss is conducive to generating sparse perturbations; and the quantization loss bridges the performance gap between training and inference.
[0050] Fighting Losses This paper adopts Carlini and Wagner (C&W) loss as the main objective function for making adversarial audio examples. C&W loss aims to increase the probability of samples being misclassified, thereby guiding the successful attack on the song emotion recognition model. The formula is expressed as follows:
[0051]
[0052] Where φ is a predefined hyperparameter of confidence that controls the strength of the attack, X adv is the adversarial example input.
[0053] Amplitude loss Following the previous approach, we incorporate an L2 norm regularization term to ensure that the generated adversarial perturbations are always imperceptible, while also allowing control over the strength of the adversarial. This is achieved by adding the L2 norm to the clipping perturbation operation, as expressed in the following formula:
[0054]
[0055] Sparse loss The study found that it is difficult to directly constrain the L0 norm on the additional perturbation δ. By decomposing the perturbation amplitude v and perturbation position m of δ, the present invention can use the L1 norm of m to control the sparsity of δ, because it only contains values 0 and 1, where 1 indicates that the value is perturbed. Therefore, the sparse loss formula of the present invention is expressed as follows:
[0056]
[0057] In this way, the sparsity of the final perturbation is determined by the convergence of the generator.
[0058] Quantifying the loss During the training phase, whether to perform binary quantization is determined by random numbers sampled from a uniform distribution. In contrast, during inference, the present invention always uses binary quantization. Therefore, there may be performance differences between generators during training and inference. To narrow this gap, the present invention introduces a quantization loss, which is expressed as follows:
[0059]
[0060] Total loss. Total loss It is calculated as the weighted sum of all the losses mentioned above, expressed as follows:
[0061]
[0062] where λ m , s and λ q denote the weights assigned to the amplitude loss, sparsity loss, and quantization loss, respectively. These weights allow fine-tuning the impact of each component on the overall loss function. By optimizing the overall loss, the local threat model guides the training of the generator and generates sparse, imperceptible perturbations, thereby achieving high adversarial success rate (ASR).
[0063] The generator focuses on learning the distribution of training data, thereby generating more transferable sparse fluctuations while avoiding the introduction of additional biases, saving a lot of learning and training time.
[0064] Comparative Example:
[0065] Existing technologies SparseFool is a sparse attack method based on geometry inspiration, which was originally proposed in the field of image classification. It aims to achieve adversarial attacks with minimal pixel modifications, so that the generated adversarial samples are not only difficult to detect, but also can effectively deceive the target model. The core idea of SparseFool is to estimate the impact of each pixel on the model decision boundary through geometric methods. Although SparseFool was originally applied to the field of image classification, its principles and methods can also be extended to other fields, such as audio signal processing. In these fields, effective adversarial attacks can also be achieved by selecting the features that have the greatest impact on model decisions for sparse perturbations.
[0066] First, SparseFool performs a preliminary perturbation on the input audio to find a direction that can cross the decision boundary. This step usually uses a linear approximation method. Its formula is as follows:
[0067]
[0068] In formula (7), x is the input audio, f(x) is the output of the target model (usually a classification score), is the gradient of the target model relative to the input. According to the target classification boundary, the initial perturbation direction is determined by the formula as follows:
[0069]
[0070] In formula (8), r is the initial perturbation vector, and f(x) is the output value of the target model on the current input audio. After the initial perturbation direction is determined, SparseFool estimates the impact of each pixel on the model decision boundary through linear approximation. Specifically, by calculating the gradient information of the input audio, the projection of the perturbation of each sampling point on the decision boundary is estimated. According to the results of linear approximation, those sampling points that have the greatest impact on the decision boundary are selected. These sampling points will be the targets for actual perturbation. In each iteration, perturbations are applied to the selected pixels while maintaining the sparsity constraint of the perturbation, that is, only a small number of sampling points are changed in each modification. The formula is expressed as follows:
[0071] x i =x i +∈·sign(g i (x))#(9)
[0072] Among them, ∈ is a predefined sparsity constraint parameter that controls the amplitude of the perturbation, sign(g i(x)) is the sign of the gradient at the i-th sample point. The magnitude of the perturbation is usually limited by a hyperparameter ∈ to ensure that the modification is as small as possible. Repeat the above steps to gradually modify the selected target until the input audio successfully crosses the decision boundary, causing the model to misclassify.
[0073] Although SparseFool aims to reduce the amount of computation through sparse perturbations, in practical applications, estimating the impact of each sample on the decision boundary still requires a lot of computing resources, especially when processing complex audio. This makes SparseFool potentially inefficient in resource-constrained environments. At the same time, the adversarial samples generated by SparseFool feel very close to the original samples, but some advanced adversarial sample detection methods can identify these perturbations. Especially in scenarios with high security requirements, the ability to detect adversarial samples continues to improve, making SparseFool's attacks easier to detect and defend. At the same time, SparseFool uses an iterative optimization method to perturb only high-impact pixels each time. This step-by-step optimization method is prone to falling into local optimal solutions, and may not be able to find the global optimal perturbation method, resulting in unsatisfactory attack results.
[0074] In the method proposed in the present invention, by introducing a gradient-based optimization strategy, the optimal perturbation direction can be found more quickly, solving the limitation of the existing model that it is easy to fall into the local optimal solution during the iterative optimization process. At the same time, the generator network generates sparse adversarial perturbations by minimizing the difference between the generated perturbation and the original audio and controlling the position of the perturbation through sparsity constraints. In this way, the introduction of additional deviations is greatly reduced, and the training and learning time of the model is effectively shortened. The present invention significantly improves the speed of generating adversarial samples, reaching a generation time of 0.01 seconds, which is significantly faster than SparseFool. At the same time, by adopting adversarial training and defense mechanism evaluation, the method proposed in the present invention can enhance the robustness of the model during the training process, solving the problem that the attack effect of the prior art decreases when facing an adversarially trained model. In addition, unlike previous methods, the present invention introduces a multi-objective loss function, taking into account adversarial, sparsity and quantization performance in the optimization process, solving the problem that the current existing technology is difficult to balance between different objectives.
[0075] There is a lack of sufficient research on adversarial methods in the field of song emotion recognition. Most existing adversarial methods in the audio field focus on L2 or L ∞norm constraint. In order to solve this problem, the present invention proposes a song emotion recognition model, which is a generator-based method that can effectively generate transferable sparse adversarial perturbations in an end-to-end manner. The present invention first uses a generator network to generate adversarial audio perturbations. The generator network generates sparse adversarial perturbations by minimizing the difference between the generated perturbations and the original audio and controlling the location of the perturbations through sparsity constraints. In this way, the introduction of additional deviations is greatly reduced, and the training and learning time of the model is effectively shortened. Secondly, the present invention introduces a threat model to guide the generator network to generate specific adversarial perturbations to attack specific song emotion recognition models. Finally, the present invention uses a series of loss functions to balance the attack intensity, sparsity, and quantization error, and ultimately effectively improves the effect of the attack and the transferability of the model.
[0076] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A song emotion recognition method based on generative adversarial learning, characterized by: The original song audio is input into the generator to generate the perturbation amplitude and perturbation position, the perturbation amplitude is multiplied by the perturbation position to calculate the sparse perturbation, and the sparse perturbation is added to the original song audio sample to create an adversarial audio sample. A threat song emotion recognition model is set to guide the generator network training to generate specific adversarial perturbations to attack a specific speech emotion recognition model. The loss function is set to balance the attack intensity, sparsity and quantization error to improve the effect and transferability of the attack and realize song emotion category recognition.
2. The song emotion recognition method based on generative adversarial according to claim 1, characterized in that: The original song audio includes the leading tone, the tonic tone and the dominant tone. The dominant tone includes musical elements with emotional expression functions such as legato, glissando, tremolo and trill.
3. The song emotion recognition method based on generative adversarial according to claim 1, characterized in that: The perturbation amplitude is used to limit the perturbation value of each frame, and the perturbation position is used to achieve sparsity. The training of the generator is designed to deceive the local adversarial song emotion recognition model. At the same time, the generated adversarial audio samples can be transferred to adversarial another unknown target song emotion recognition model.
4. The song emotion recognition method based on generative adversarial according to claim 1, characterized in that: The generator is a Wave-U-Net network, which includes a downsampling stage and an upsampling stage. In the downsampling stage, the Wave-U-Net neural network reduces the temporal resolution by discarding the features of every other time step. In the upsampling stage, linear interpolation is used to upsample the feature map, and high-level features are connected to local features. The perturbation amplitude is performed in the first upsampling module, and the clipping operation is applied to limit the perturbation value to {-∈, +∈}, where ∈ is a predefined hyperparameter used to constrain l ∞ norm, where the disturbance amplitude can be obtained after clipping operation; The perturbation position is performed in the second upsampling module to generate sparse perturbations. The output of the second upsampling module is converted into binary form using quantization to represent the perturbation position. If the output of the second upsampling module is represented as Convert to a discrete vector m∈{0,1} N , processed by binary quantization, the formula is expressed as follows: Among them, γ is a custom hyperparameter, setting the randomization method to ensure Gradually converge to 1 or 0. Specifically, a random number is generated according to a uniform distribution on the interval [0, 1). If t ≥ 0.5, a binary quantization operation is applied, otherwise, no binary quantization operation is performed.
5. The song emotion recognition method based on generative adversarial according to claim 1, characterized in that: The specific process of generator network training is: The training process consists of passing adversarial examples X adv The input is fed into the adversarial song emotion recognition model f for emotion classification. During this process, the parameters of the generator are optimized to identify and manipulate important patterns in the training data. The patterns are universal, which promotes the model independence of the generated adversarial examples. By leveraging the universal patterns, the generated adversarial audio X adv Effectively deceive and counter other models.
6. The song emotion recognition method based on generative adversarial according to claim 1, characterized in that: The loss function uses Carlini loss and Wagner loss as the main objective function for making adversarial audio examples. Carlini loss and Wagner loss are used to increase the probability of samples being misclassified, so as to guide the successful attack on the song emotion recognition model. The formula is expressed as follows: Where φ is a predefined hyperparameter of confidence that controls the strength of the attack, X adv is the adversarial example input, Setting Amplitude Loss Amplitude loss Incorporate an L2 norm regularization term to ensure that the generated adversarial perturbations are always imperceptible, while also allowing control over the strength of the adversarial, which is achieved by adding the L2 norm to the clipping perturbation operation, as follows: Setting the sparse loss Sparse loss In the above example, it is not possible to directly constrain the L0 norm on the additional perturbation δ. By decomposing the perturbation amplitude v and perturbation position m of δ, the L1 norm of m is used to control the sparsity of δ, which only contains values 0 and 1, where 1 indicates that the value is perturbed. The sparse loss formula is expressed as follows: The sparsity of the final perturbation is determined by the convergence of the generator; Setting the quantization loss Quantifying the loss In the training phase, whether to perform binary quantization is determined by random numbers sampled from a uniform distribution. On the contrary, during inference, binary quantization is used. There is a performance difference between the generators during training and inference. To narrow the gap, a quantization loss is set, which is expressed as follows: Total loss, total loss It is calculated as the weighted sum of all losses and is expressed as follows: where λ m , s and λ q They represent the weights assigned to the amplitude loss, sparsity loss, and quantization loss, respectively. The weights allow fine-tuning the impact of each component on the overall loss function. By optimizing the overall loss, the local threat model guides the training of the generator and generates sparse and imperceptible perturbations, thereby achieving a high adversarial success rate.
7. A device for a song emotion recognition method based on generative adversarial methods according to any one of claims 1 to 6, characterized in that: It includes a generator, a training network and a loss function calculation module. The generator is connected to the loss function calculation module via the training network. The generator includes a downsampling module, a first upsampling module and a second upsampling module. The downsampling module is connected to the first upsampling module and the second upsampling module respectively.
