HyperSound: Generating Implicit Neural Representations of Audio Signals with Hypernetworks
Abstract
Implicit neural representations (INRs) are a rapidly growing research field, which provides alternative ways to represent multimedia signals.
Recent applications of
INRs include image super-resolution, compression of high-dimensional signals, or 3D rendering.
However, these solutions usually focus on visual data, and adapting them to the audio domain is not trivial.
Moreover, it requires a separately trained model for every data sample.
To address this limitation, we propose HyperSound, a meta-learning method leveraging hypernetworks to produce INRs for audio signals unseen at training time.
We show that our approach can reconstruct sound waves with quality comparable to other state-of-the-art models.
Introduction
Implicit neural representations (INRs) are coordinate-based representations of multimedia signals, where the signal is modeled with a neural network.
Such representations are decoupled from the spatial resolution so the signal can be resampled at any arbitrary frequency.
At the same time, the memory requirements for its storage remain constant.
The field of INRs is rapidly growing and their applications include super-resolution [1, 2], compression [1, 2] or 3D rendering [3].
However, in the audio domain, the evaluation of these approaches was so far limited to learning individual INRs of particular input recordings [1], which is highly ineffective.
Meta-learning methods, such as hypernetworks [4], can generate INRs for any arbitrary signal with a single model.
Hypernetworks learn to generate weights for smaller target networks, which can serve as INRs.
Hypernetworks were successfully applied in obtaining INRs for images [2, 5], point clouds [2, 6] and videos [2].
However, creating INRs for high-dimensional and high-variance data such as audio is difficult, and training hypernetworks for this task can be unstable.
In this work, we propose a meta-learning approach based on hypernetworks, where we learn a general recipe for creating INRs of arbitrary audio samples from outside of the training dataset.
To our knowledge, our model is the first application of hypernetwork-based INRs to the audio domain.
Related Works
Implicit neural representations (INRs) are applied across many multimedia domains.
NeRF [3]- based INRs are currently state-of-the-art for image-based rendering and view synthesis.
SIREN [1] shows how to produce good quality INRs for various signals, such as image, video, and sound signals, using neural networks with periodic activation functions and dedicated weight initialization
[Figure]
scheme. Modulated Periodic Activations [2] further improve the quality of SIREN-based INRs for high-resolution signals by introducing modulation and synthesis sub-networks.
However, in the audio domain, the evaluation of these approaches was so far limited to learning individual INRs of particular input recordings.
Hypernetworks [4] are a meta-learning framework, where one network (hypernetwork) generates the weights for another network (target network).
Hypernetworks can be used for a variety of tasks such as model compression [7], continual learning [8] or generating INRs .
In particular, hypernetworks were used to generate INRs for images [5], shapes [6] and videos [2].
To our knowledge, our work is the first application of hypernetworks for audio INRs generation.
First successful attempts at raw waveform processing with deep neural networks were models such as WaveNet [9] and SampleRNN [10], but their autoregressive nature makes them slow and prone to accumulation of errors.
Later architectures such as ParallelWaveNet [11], NSynth [12],
MelGAN [13] or SING [14] proposed non-autoregressive architectures for audio generation.
Recent autoencoder-based models such as RAVE [15] or SoundStream [16] are able to process highresolution signals in an end-to-end fashion, producing audio of very good perceptual quality.
Model overview
Sound waves are traditionally represented digitally as a collection of amplitude values sampled at regular intervals, which approximates a continuous real function x ( t ) .
Our goal is to obtain a metarecipe for generating audio INRs replicating such functions.
While creating INRs for particular audio samples can be quite easily done with gradient descent, finding a general solution is much harder due to the inherent complexity of audio time series.
Therefore, similar to [5], we model such functions with neural networks T (target networks), parameterized by weights generated by another neural network H (hypernetwork).
Our framework, shown in Fig. 1, can be described as
[Equation]
3.1 Hypernetwork architecture
Typical audio recordings contain several thousands of samples, so the hypernetwork is composed of a convolutional encoder that produces a latent representation of a lower dimensionality, and fully connected layers that transform this representation to weights θ of the target network.
We use an encoder based on SoundStream [16], and the fully connected part of the hypernetwork is composed of six fully-connected layers with biases and ELU [17] activation, where the last layer produces the flattened weights of the target network.
3.2 Approximating sound waves with neural networks
A target network should be as small as possible to avoid overfitting and explosion of weights in the hypernetwork, but must be expressive enough to represent a wide variety of audio recordings.
Our target network has one input and one output, and consists of a positional embedding layer followed by four fully-connected layers of 256 neurons with biases and ReLU activation. Inspired by NeRF [3],
[Figure]
we define embedding vectors γ as
[Equation]
where t is the time coordinate and L denotes the embedding size.
We rescale input coordinates to a range of [0 , 1] and use L = 16 .
3.3 Optimization
We train the hypernetwork in a supervised fashion using backpropagation.
To obtain audio results that are more perceptually pleasant, we use a loss function that penalizes the reconstruction error both in the time and frequency domains.
Given an original recording x and its reconstruction ˆ x generated with a target network, we compute the loss function as
[Equation]
where L SL 1 is a smooth L1 loss [18] with β = 0 .
1 , L STFT is a multi-resolution mel-scale STFT loss introduced in ParallelWaveGAN [19] and λ SL 1 , λ STFT are the weights of these two losses.
We use λ SL 1 = 1 and λ STFT = 1 .
For STFT loss, we use 128 mel bins and FFT sizes of [512 , 1024 , 2048] with matching window sizes and an overlap of 87 .
Experiments
We test the reconstruction quality of our model on the VCTK dataset downsampled to f
= 22
Hz , with the recordings of the last 10 speakers retained as a validation set.
We set the recording length to 32 768 samples, and use data augmentations such as random crop, phase mangle, or dequantization proposed in RAVE [15].
We train the models for 1.25M steps using the AdamW optimizer [20] with a learning rate of 5e − 5 and a batch size of 16 .
In Fig.
2, we show waveforms and spectrograms of the reconstructions obtained with our model on samples selected from the validation set.
Since there is no consensus on a single approach for quantitative evaluation of audio quality, we assess the reconstruction results with multiple metrics such as MSE, Log-Spectral Distance (LSD) [21],
SI-SNR [22], PESQ [23], STOI [24] and CDPAM [25].
We also compare the reconstruction quality of our model with the RAVE baseline.
Moreover, we test the quality of resampling performed by our model.
Finally, we investigate the impact of the target network size and the employed loss function on the reconstruction quality.
The results of our experiments are shown in Tab. 1.
Unless explicitly mentioned, model hyperparameters in experiments are as described in Sec. 3.
Comparision with RAVE.
We compare the reconstruction error of HyperSound with RAVE [15] trained for 3M steps on the same dataset, with an identical sampling rate of 22 050 Hz .
We find that our model produces reconstructions closer to the originals in the spectral domain and obtains better perceptual scores of PESQ and STOI.
However, RAVE reconstructions achieve better MSE, SI-SNR, and perceptual CDPAM scores, with slightly less perceptible noise and robotic artifacts.
Reconstruction quality while resampling.
We also test the reconstruction error of the model trained with a sampling rate of 22 050 Hz when used for downsampling and upsampling 22
Hz recordings to other commonly used frequencies: 8000 Hz , 16
Hz and 44 100 Hz .
We obtain the ground truth by downsampling the original VCTK 48 kHz recordings to the desired sampling frequency using soxr high-quality setting.
As shown by the LSD levels, the hypernetwork approach works best when [Table] close to the sampling rate used for training.
Nevertheless, it does not collapse when queried with time coordinates from outside the training domain.
However, we hypothesize that for proper super-resolution capabilities, our learning regime would require an introduction of an additional loss term directed specifically at the quality of representation in higher frequency bands.
Impact of target network architecture.
We compare our model which uses the baseline target network (4 layers of 256 neurons each, 206K parameters) with target networks that use 4 layers of 64 neurons (14K parameters) and 6 layers of 384 neurons (752K parameters).
We find that the base version presents an optimal trade-off between the reconstruction quality and computational requirements, as the size of the last hypernetwork layer scales linearly with the number of parameters in the target network.
The smaller variant of the target network achieves comparable results to the base using fewer parameters than the number of samples in the original signal.
Impact of the loss function.
We compare HyperSound trained with the loss function as described in Sec. 3.3 with models trained using the STFT loss where we do not apply the mel-scale, but use a wider array of FFT sizes of [128 , 256 , 512 , 1024 , 2048] .
We also try training without Smooth L loss ( λ SL 1 = 0 , λ STFT = 1 ).
Moreover, we find that STFT is vital for stable training and obtaining perceptually plausible reconstructions, as our training runs with λ SL 1 = 1 .
and λ STFT =
01] collapsed.
As evidenced by the results, the L1 part of the loss function leads to slightly better results and faster training, as it enables the model to correctly learn the DC offset.
Conclusion
We demonstrate the possibility of applying hypernetworks to the generation of implicit neural representations for audio signals.
Reconstructions generated with our model are quantitatively comparable to the state-of-the-art model RAVE.
However, we find that the perceptual quality of our reconstructions is still slightly lacking.
We hope that our work can be further improved by optimizing the hypernetwork architecture and designing target networks better suited to the audio domain.
Initial results for signal compression are also promising but require further investigation.
Acknowledgments and Disclosure of Funding
This work was supported by Foundation for Polish Science (grant no POIR.04.04.00-00-14DE/18-00) carried out within the Team-Net program co-financed by the European Union under the Euro- well