Papers
Topics
Authors
Recent
Search
2000 character limit reached

Music Adversarial Inpainting Attack (MAIA)

Updated 10 July 2026
  • The paper introduces MAIA, a framework that identifies and inpaints decision-critical music segments using generative models to mislead MIR systems.
  • MAIA replaces global noise perturbations with localized edits, utilizing Grad-CAM in white-box and CMA-ES in black-box settings for precise targeting.
  • Empirical results on cover song identification and genre classification demonstrate higher attack success and lower perceptual distortion compared to additive methods.

Music Adversarial Inpainting Attack (MAIA) is an adversarial attack framework for Music Information Retrieval (MIR) systems that replaces diffuse additive perturbation with localized content reconstruction. It first identifies decision-critical regions of a music signal, then masks and inpaints those regions with a generative model while guiding the reconstruction so that the attacked MIR model changes its prediction. The framework is defined for both white-box and black-box settings and is evaluated on cover song identification and music genre classification, where it is reported to achieve high attack success rates while maintaining lower perceptual distortion than additive baselines (Liu et al., 5 Sep 2025).

1. Conceptual basis and attack formulation

MAIA is motivated by the observation that many MIR attacks are noise-based: they add small perturbations directly to the waveform or spectrogram, often over the entire signal. MAIA instead assumes that MIR decisions are often driven by specific local patterns, such as timbral events, harmonic fragments, or short motifs, rather than every sample equally. On that basis, it edits only a few highly influential segments, removes or masks them, and reconstructs them with a generative inpainting model so that the resulting audio remains contextually plausible and musically coherent (Liu et al., 5 Sep 2025).

The framework is defined for both white-box and black-box threat models. In the white-box case, the attacker knows the target model’s architecture and parameters and has gradient access. In the black-box case, the attacker can only query the model and observe outputs such as predicted labels, logits, or confidence-based feedback. The adversarial goal described in the method is untargeted: given original music xx, original or true label yy, attacked MIR model MM, binary mask m\mathbf{m}, and inpainting model Gθ\mathcal{G}_\theta, MAIA seeks an edited signal xadvx_{\mathrm{adv}} such that

M(xadv)y.M(x_{\mathrm{adv}}) \neq y.

MAIA does not formulate this objective as a classic LpL_p-bounded perturbation problem. Instead, it constrains the attack through localized masking of only a few important segments, reconstruction consistency, and evaluation-time perceptual metrics such as FAD and LSD. In that sense, the method shifts the adversarial variable from “small perturbation everywhere” to “plausible replacement in selected regions.” This is the defining distinction between MAIA and earlier global additive music attacks (Liu et al., 5 Sep 2025).

2. Localization of decision-critical regions

The first stage of MAIA is importance analysis. Its purpose is to identify a small set of regions that most strongly support the model’s original decision and to use those regions as candidate adversarial zones.

In the white-box variant, importance is estimated with Grad-CAM on an internal convolutional layer of the target model. Let FklF_k^l denote the kk-th feature map at layer yy0, and let yy1 denote the class score or logit for class yy2. The Grad-CAM weights are

yy3

and the class activation map is

yy4

The paper states that, for the attacked MIR model yy5, the analyzed layer is

yy6

The resulting heatmap is mapped back to spectrogram coordinates and normalized, or thresholded by taking the top yy7 most active bins, and those regions are selected for masking and later inpainting (Liu et al., 5 Sep 2025).

In the black-box variant, MAIA uses a query-based coarse-to-fine segment search. The audio is first partitioned into coarse non-overlapping chunks

yy8

with an example chunk length of yy9 second. For each chunk MM0, the method constructs a modified signal MM1 by zero-masking that chunk. To reduce boundary artifacts, the masked region is tapered with a Tukey window with shape parameter MM2. Importance is then defined as the increase in loss per unit duration:

MM3

The most important coarse segment MM4 is subdivided,

MM5

rescored in the same way, and the refined segmentation is updated iteratively until round MM6. Finally, the top MM7 segments by importance are selected:

MM8

This yields a query-efficient localization stage that searches for where to edit before searching how to edit (Liu et al., 5 Sep 2025).

3. White-box and black-box inpainting procedures

Once the mask MM9 has been determined, MAIA edits only those regions. The generative model used in the experiments is GACELA, a Generative Adversarial Context Encoder for Long Audio Inpainting. In the MAIA description, GACELA is characterized as a conditional GAN for long-gap music inpainting with a generator operating on log-magnitude mel spectrogram context, a convolutional encoder-decoder structure, latent variables to model multimodal completion, and five discriminators at multiple time/frequency scales (Liu et al., 5 Sep 2025).

In the white-box setting, the masked region is first inpainted normally:

m\mathbf{m}0

At iteration m\mathbf{m}1, the total loss is

m\mathbf{m}2

with untargeted attack term

m\mathbf{m}3

where m\mathbf{m}4 can be cross-entropy. The masked region is then updated by sign-gradient descent:

m\mathbf{m}5

After the gradient step, MAIA re-inpaints the masked region,

m\mathbf{m}6

which the paper explicitly describes as projecting the perturbed content back towards a realistic data manifold. The white-box implementation uses a maximum iteration count of m\mathbf{m}7 and a grid search over

m\mathbf{m}8

(Liu et al., 5 Sep 2025)

In the black-box setting, no gradient from m\mathbf{m}9 is available, so MAIA combines importance-guided localization with gradient-free latent search using CMA-ES. Initial inpainting for a selected segment is

Gθ\mathcal{G}_\theta0

The latent code is then updated by

Gθ\mathcal{G}_\theta1

where Gθ\mathcal{G}_\theta2 denotes feedback obtained from querying the target model on the current inpainted sample. Candidate latent codes Gθ\mathcal{G}_\theta3 are sampled from the current CMA-ES distribution; for each candidate,

Gθ\mathcal{G}_\theta4

Candidates are ranked by whether they increase adversarial effect or cause

Gθ\mathcal{G}_\theta5

The next sample is formed as

Gθ\mathcal{G}_\theta6

The attack processes high-importance segments sequentially and is capped at Gθ\mathcal{G}_\theta7 queries (Liu et al., 5 Sep 2025).

4. Tasks, metrics, and reported results

MAIA is evaluated on two MIR tasks. For Cover Song Identification (CSI), the target model is CoverHunter and the dataset is the SHS100K test set. For Music Genre Classification (MGC), the target model is IDS-NMR and the dataset is GTZAN. White-box baselines are PGD and C&W; black-box baselines are NES and ZOO. The reported metrics are Attack Success Rate (ASR), task degradation measured by post-attack mAP for CSI and post-attack accuracy for MGC, FAD computed using MERT-V0 features, LSD, and a MOS-like listening score from a human listening test on a 5-point scale (Liu et al., 5 Sep 2025).

In white-box CSI, PGD achieves ASR Gθ\mathcal{G}_\theta8, mAP Gθ\mathcal{G}_\theta9, FAD xadvx_{\mathrm{adv}}0, LSD xadvx_{\mathrm{adv}}1, and MOS xadvx_{\mathrm{adv}}2; C&W achieves ASR xadvx_{\mathrm{adv}}3, mAP xadvx_{\mathrm{adv}}4, FAD xadvx_{\mathrm{adv}}5, LSD xadvx_{\mathrm{adv}}6, and MOS xadvx_{\mathrm{adv}}7. MAIA-White Box reports ASR xadvx_{\mathrm{adv}}8, mAP xadvx_{\mathrm{adv}}9, FAD M(xadv)y.M(x_{\mathrm{adv}}) \neq y.0, LSD M(xadv)y.M(x_{\mathrm{adv}}) \neq y.1, and MOS M(xadv)y.M(x_{\mathrm{adv}}) \neq y.2. In white-box MGC, PGD achieves ASR M(xadv)y.M(x_{\mathrm{adv}}) \neq y.3, accuracy M(xadv)y.M(x_{\mathrm{adv}}) \neq y.4, FAD M(xadv)y.M(x_{\mathrm{adv}}) \neq y.5, LSD M(xadv)y.M(x_{\mathrm{adv}}) \neq y.6, and MOS M(xadv)y.M(x_{\mathrm{adv}}) \neq y.7; C&W achieves ASR M(xadv)y.M(x_{\mathrm{adv}}) \neq y.8, accuracy M(xadv)y.M(x_{\mathrm{adv}}) \neq y.9, FAD LpL_p0, LSD LpL_p1, and MOS LpL_p2. MAIA-White Box reports ASR LpL_p3, accuracy LpL_p4, FAD LpL_p5, LSD LpL_p6, and MOS LpL_p7 (Liu et al., 5 Sep 2025).

In black-box CSI, NES achieves ASR LpL_p8, mAP LpL_p9, FAD FklF_k^l0, LSD FklF_k^l1, and MOS FklF_k^l2; ZOO achieves ASR FklF_k^l3, mAP FklF_k^l4, FAD FklF_k^l5, LSD FklF_k^l6, and MOS FklF_k^l7. MAIA-Black Box reports ASR FklF_k^l8, mAP FklF_k^l9, FAD kk0, LSD kk1, and MOS kk2. In black-box MGC, NES achieves ASR kk3, accuracy kk4, FAD kk5, LSD kk6, and MOS kk7; ZOO achieves ASR kk8, accuracy kk9, FAD yy00, LSD yy01, and MOS yy02. MAIA-Black Box reports ASR yy03, accuracy yy04, FAD yy05, LSD yy06, and MOS yy07 (Liu et al., 5 Sep 2025).

The listening test involves yy08 participants who rate perturbation noticeability on a 5-point scale, where yy09 means highly noticeable and yy10 means no perceivable difference. Across all reported settings, MAIA receives higher listener scores than the additive baselines. The paper presents this as evidence that localized inpainting produces more natural edits than direct adversarial noise injection (Liu et al., 5 Sep 2025).

One textual inconsistency is explicitly noted in the reported results. The narrative paragraph states “93.5% for CSI and 94.5% for MGC” for white-box MAIA, whereas the quantitative table reports yy11 for CSI and yy12 for MGC. The table is identified as the more reliable source (Liu et al., 5 Sep 2025).

5. Relation to prior adversarial music and audio inpainting research

MAIA sits at the intersection of two earlier research lines: adversarial attacks on MIR systems and generative audio inpainting. Earlier music-adversarial work typically optimized global additive perturbations rather than localized replacement. One early example attacked magnitude-spectral deep genre classifiers with projected gradient descent and a Griffin–Lim-style consistency projection to obtain valid audio (Kereliuk et al., 2015). Later work on music instrument classification moved the optimization to the raw waveform and introduced end-to-end white-box attacks through differentiable torchaudio preprocessing, including a Multi-Scale C&W objective with

yy13

over FFT sizes yy14 (Prinz et al., 2020). Copyright-detection attacks likewise relied on global additive perturbations and demonstrated transfer from a differentiable Shazam-like surrogate to AudioTag and YouTube Content ID (Saadatpanah et al., 2019). A perception-aware attack on YouTube copyright detection replaced norm minimization with a learned perceptual proxy, qDev, trained from human ratings over pitch, rhythm, timbre, and loudness deviations (Duan et al., 2022).

The inpainting side of the lineage is different. GACELA addressed long-gap audio inpainting with conditioning on context before and after the gap, a yy15-dimensional latent variable, and five parallel discriminators with increasing receptive fields; it was evaluated on gap durations from yy16 ms to yy17 ms and found that inpaintings were often detectable but usually between “not disturbing” and “mildly disturbing” in severity (Marafioti et al., 2020). Other generative work studied raw-waveform WGAN inpainting for approximately yy18–yy19 ms gaps with short-range and long-range border conditioning (Ebner et al., 2020), while AIRGen recast MusicGen as a token-space inpainting editor using EnCodec tokens, a prefix/prediction sequence design, heterogeneous adapters, and mask ratios sampled uniformly from yy20 (Lin et al., 2024).

Against that background, MAIA’s novelty is not merely the use of a generator. Its distinguishing move is to combine decision-focused localization with generative replacement inside selected segments, then couple that replacement to the attacked model’s outputs in either gradient-guided or query-guided form. Earlier adversarial music work had already shown that MIR systems were vulnerable to imperceptible or high-SNR perturbations, but those systems were predominantly in the global additive regime; earlier inpainting work had shown that context-aware replacement was possible, but without adversarial objectives. MAIA combines the two strands into an attack in which the manipulated content is sparse, local, and generator-produced rather than globally noise-like (Liu et al., 5 Sep 2025).

6. Limitations, perceptual evaluation, and implications

Several limitations are explicit. MAIA depends on a pretrained inpainting model such as GACELA; if the generator produces poor completions, the attack may create audible artifacts or fail. The method is also computationally heavier than simple PGD or C&W because it must perform importance analysis, iterative re-inpainting in white-box mode, and CMA-ES-based latent search in black-box mode. The black-box variant is capped at yy21 queries, which is more structured than naive zeroth-order search but still substantial (Liu et al., 5 Sep 2025).

Reproducibility is incomplete in several places. The paper leaves underspecified the number of selected segments yy22, exact refinement depth yy23, subdivision factor yy24, the precise form of yy25, and the exact black-box feedback function yy26. The evaluation scope is also limited to CSI and genre classification; tasks such as tagging, transcription, recommendation, or source-oriented MIR are not tested (Liu et al., 5 Sep 2025).

Perceptual evaluation raises a separate issue. MAIA reports FAD and LSD, together with listener studies, as its principal perceptual indicators. However, later work on adversarial music perception argues that common metrics such as yy27, SNR, LSD, PEMO-Q, and FAD correlate poorly with human judgments in music adversarial settings, and introduces PAMT, a Perceptually-Aligned MERT Transformer, which achieves a Spearman correlation coefficient of yy28 with subjective scores (Liu et al., 5 Sep 2025). This suggests that FAD and LSD, while operationally useful, may not fully characterize imperceptibility for MAIA-style local replacement attacks.

The broader implication is that MIR systems may be vulnerable not only to low-amplitude additive perturbation but also to semantically coherent local content replacement. The defense consequence drawn in the MAIA paper is correspondingly broad: robustness methods aimed only at small additive noise are likely incomplete if they ignore localized content replacement, semantically coherent adversarial edits, and black-box query-guided manipulation. A plausible implication is that future defenses will need both locality-aware threat models and more human-aligned perceptual criteria than conventional signal-space distortion alone (Liu et al., 5 Sep 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Music Adversarial Inpainting Attack (MAIA).