APNet2: High-quality and High-efficiency Neural Vocoder with Direct Prediction of Amplitude and Phase Spectra

Hui-Peng Du, Ye-Xin Lu, Yang Ai, Zhen-Hua LingarXiv 2023 · DOI

TL;DR

APNet2 is a next-generation neural vocoder that reconstructs high-quality speech by predicting amplitude and phase spectra in parallel. By leveraging the ConvNeXt v2 architecture and a multi-resolution discriminator, it achieves speech quality comparable to state-of-the-art models like HiFi-GAN while delivering significantly faster inference speeds—up to 47x real-time on a single CPU core.

What Problem Does This Paper Address?

Neural vocoders are the "voice box" of modern speech synthesis, converting abstract acoustic features (like mel-spectrograms) into audible waveforms. Traditionally, researchers faced a grueling trade-off between quality and efficiency.

Autoregressive models produce great audio but are painfully slow. GAN-based models like HiFi-GAN improved speed by using transposed convolutions to upsample features, but this upsampling remains computationally expensive. Recent "all-frame-level" vocoders (like the original APNet and Vocos) try to skip upsampling by predicting spectra directly at the input resolution and using the Inverse Short-Time Fourier Transform (ISTFT) to generate audio. However, the original APNet struggled with higher sampling rates (22.05 kHz) and longer frame shifts, largely because modeling the "phase" of a speech signal is notoriously difficult and sensitive to temporal discontinuities.

Methods

APNet2 introduces several structural and mathematical upgrades to solve these stability and quality issues:

  • ConvNeXt v2 Backbone: The researchers replaced the standard ResNet blocks with ConvNeXt v2. This architecture includes a Global Response Normalization (GRN) layer, which enhances feature diversity and modeling capacity, allowing the network to better capture the complexities of speech spectra.
  • Explicit Phase Modeling: Unlike some competitors that treat phase as a "black box," APNet2 uses a dedicated Phase Spectrum Predictor (PSP). It employs a parallel estimation architecture to directly output "wrapped" phase spectra.
  • Linear Anti-Wrapping Loss: To train the phase predictor, the authors moved from a negative cosine loss to a linear anti-wrapping function. This change helps the model more accurately mitigate errors caused by the cyclical nature of phase (where $0$ and $2\pi$ are the same point).
  • Multi-Resolution Discriminator (MRD): During training, the authors replaced the traditional Multi-Scale Discriminator (MSD) with an MRD. The MRD analyzes the audio at various temporal and spectral resolutions, which helps the generator produce more realistic textures and reduces overfitting.
  • Hinge GAN Loss: The model shifts from least-squares GAN loss to a hinge formulation, which is often more stable for high-fidelity audio synthesis.

Datasets

The model was trained and evaluated using the LJSpeech dataset, a standard benchmark consisting of approximately 24 hours of 22.05 kHz English speech from a single female speaker. The authors used 12,000 clips for training, 100 for validation, and 500 for testing.

Key Insights and Ideas

  • Upsampling is the Enemy of Speed: By predicting spectra at the exact same temporal resolution as the input mel-spectrogram, APNet2 avoids the heavy computational tax of transposed convolutions used in models like HiFi-GAN.
  • Phase Matters: The paper reinforces that explicit phase modeling is crucial. While other models (like Vocos) perform well, they can struggle with pitch accuracy (F0-RMSE) because they don't constrain the phase prediction as strictly as APNet2 does.
  • The "Aha" of Linear Loss: One of the more subtle but vital findings was that a linear anti-wrapping function is more suitable for phase prediction than the trigonometric (cosine) functions used in earlier iterations, leading to more precise spectral reconstruction.

Key Results

APNet2 strikes an impressive balance between performance and resource usage:

  • Quality: In Mean Opinion Score (MOS) tests, APNet2 achieved a score of 3.83 for analysis-synthesis, making it statistically comparable to HiFi-GAN (3.88) and iSTFTNet (3.93), while significantly outperforming the original APNet and Vocos.
  • Inference Speed:
    • On GPU: APNet2 runs at 665x real-time, nearly 20x faster than HiFi-GAN.
  • On CPU: It runs at 47x real-time, making it highly viable for on-device applications where GPUs aren't available.
  • Pitch Accuracy: APNet2 showed a much lower F0-RMSE (44.33) compared to Vocos (148.33), indicating it is far more reliable at maintaining the correct melody and intonation of speech.

Limitations and Future Work

While APNet2 is a powerhouse for single-speaker synthesis, the paper notes a few areas for growth:

  • Speaker Diversity: The current results are limited to the LJSpeech dataset. Testing on multi-speaker or noisy datasets would be the next logical step to prove its robustness.
  • Application Expansion: The authors plan to adapt the APNet2 architecture for other speech tasks, such as Speech Enhancement (SE) and Voice Conversion (VC), where high-efficiency spectral prediction is equally valuable.

Summary updated

Abstract

In our previous work, we proposed a neural vocoder called APNet, which directly predicts speech amplitude and phase spectra with a 5 ms frame shift in parallel from the input acoustic features, and then reconstructs the 16 kHz speech waveform using inverse short-time Fourier transform (ISTFT). APNet demonstrates the capability to generate synthesized speech of comparable quality to the HiFi-GAN vocoder but with a considerably improved inference speed. However, the performance of the APNet vocoder is constrained by the waveform sampling rate and spectral frame shift, limiting its practicality for high-quality speech synthesis. Therefore, this paper proposes an improved iteration of APNet, named APNet2. The proposed APNet2 vocoder adopts ConvNeXt v2 as the backbone network for amplitude and phase predictions, expecting to enhance the modeling capability. Additionally, we introduce a multi-resolution discriminator (MRD) into the GAN-based losses and optimize the form of certain losses. At a common configuration with a waveform sampling rate of 22.05 kHz and spectral frame shift of 256 points (i.e., approximately 11.6ms), our proposed APNet2 vocoder outperformed the original APNet and Vocos vocoders in terms of synthesized speech quality. The synthesized speech quality of APNet2 is also comparable to that of HiFi-GAN and iSTFTNet, while offering a significantly faster inference speed.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
LJSpeech · test set, analysis-synthesis taskAPNet2RTF (CPU)0.021-0.28 vs baselinesplit: test · device=Intel Xeon E5-2620 CPU · cpu-cores=1 · evaluation=analysis-synthesis
Source quote
L236: {APNet2} │ 3.84 │ 6.34 │ 1.73 │ 44.33 │ 5.31 │ 0.0015 (665.05×) │ 0.021(47.73×)
Reported baseline / comparator measurements (1)
BenchmarkMethodMetricScoreProtocol / Evidence
LJSpeech · test set, analysis-synthesis taskHiFi-GAN baselineRTF (CPU)0.297split: test · device=Intel Xeon E5-2620 CPU · cpu-cores=1 · evaluation=analysis-synthesis
Source quote
L231: {HiFi-GAN} │ 3.93 │ 6.44 │ 1.62 │ 45.08 │ 5.20 │ 0.0296 (33.75×) │ 0.297 (3.36×)
BibTeX
@misc{du2023apnet,
  author = {Hui-Peng Du and Ye-Xin Lu and Yang Ai and Zhen-Hua Ling},
  title = {{APNet2: High-quality and High-efficiency Neural Vocoder with Direct Prediction of Amplitude and Phase Spectra}},
  year = {2023},
  eprint = {2311.11545},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.11545},
}
Figure