HƯỚNG DẪN AI âm thanh

Khử nhiễu giọng nói bằng RNNoise

RNNoise is an open-source noise suppression library, released by Jean-Marc Valin of Xiph.Org and Mozilla in 2017, that removes background noise from speech in real time.

Nghe hướng dẫn nàyAI thuật lại · ~8 min

Trên trang nàyđọc 9 phút
  1. Tổng quan
  2. Những điểm chính rút ra
  3. Lặn sâu
  4. Denoise a recording with the RNNoise demo
  5. Triển khai trong thế giới thực
  6. Tương lai của việc khử nhiễu lời nói với RNNoise
  7. Đưa nó vào thực tế
  8. Nguồn tham khảo và đọc thêm
  9. Tiếp tục khám phá
  10. Câu hỏi thường gặp

Tổng quan

It pairs classic signal processing with a small recurrent neural network of about 88,000 weights, so it runs on an ordinary CPU core and became a common building block in streaming and voice-call software.

Những điểm chính rút ra

  1. RNNoise is a BSD-licensed C library from Xiph.Org and Mozilla, released in 2017, that suppresses background noise in 48 kHz speech in real time.
  2. It predicts 22 band gains with a small gated recurrent network instead of estimating every frequency bin, which keeps computation low.
  3. The 2018 paper reports 87,503 weights and about 1.3 percent of one x86 core, with no GPU required.
  4. A pitch-tuned comb filter removes noise between voice harmonics that the coarse band gains cannot reach.
  5. OBS Studio added RNNoise as a noise suppression method in version 26.0 in September 2020.

Lặn sâu

RNNoise is a speech enhancement library: software that takes audio containing someone talking over background noise, such as a fan, traffic or keyboard clicks, and returns a cleaner version in which the voice is kept and the noise is reduced. It was written by Jean-Marc Valin and published in September 2017 as a Xiph.Org and Mozilla project with a browser demo and a technical paper. The paper, A Hybrid DSP/Deep Learning Approach to Real-Time Full-Band Speech Enhancement, appeared at the 2018 IEEE Workshop on Multimedia Signal Processing. The code is written in C and distributed under a BSD license.

The design goal was practical: run in real time on modest hardware at full-band 48 kHz audio, the sample rate used in high-quality voice calls, without a GPU. Many deep learning denoisers of the time estimated every frequency bin of a spectrogram, or even every audio sample, which takes large networks. RNNoise instead keeps the parts of a traditional noise suppressor that signal processing already does well, such as framing, spectral analysis and pitch tracking, and asks a neural network to do only the hardest part, which is estimating how much each part of the spectrum should be turned down.

The processing happens in short, overlapping frames. Audio is cut into 20 millisecond windows that advance every 10 milliseconds, and each window is converted to the frequency domain with a Fourier transform. Rather than handle hundreds of individual frequency bins, RNNoise groups them into 22 bands spaced on the Bark scale, a scale that roughly matches how human hearing resolves frequency, using the band layout of the Opus codec. For each frame it computes 42 input features: 22 Bark-frequency cepstral coefficients that summarize the spectral shape, the first and second time derivatives of the first six, six coefficients describing how strongly each band follows the voice's pitch, the pitch period itself and a measure of how stationary the spectrum is.

Those features go into a recurrent neural network, a network that keeps an internal state from frame to frame so it can track how sounds evolve over time. The network uses gated recurrent units (GRUs), a type of recurrent layer that learns what to remember and what to forget, combined with fully connected layers. The paper reports four hidden layers with 215 units in total, the largest having 96, and 87,503 weights. The network produces 22 gains between 0 and 1, one per band, plus a voice activity probability. Each gain multiplies the energy in its band: a value near 1 lets the band through, near 0 suppresses it. Because 22 band gains are too coarse to remove noise sitting between the harmonics of a voice, a final pitch filter, a comb filter tuned to the detected pitch, attenuates energy between harmonics. The result is converted back to a waveform by overlap-add.

Training uses synthetic mixtures. Clean speech and noise are rarely recorded together with a clean reference, so they are recorded separately and mixed at random levels with random filtering. The paper reports about 6 hours of speech and 4 hours of noise expanded this way into about 140 hours of noisy training audio. The target for each band is the square root of the ratio between clean speech energy and noisy energy, and the loss compares gains after a further square root, which penalizes mistakes on quiet bands more. Because the system does not normalize levels, the training data must include speech at every realistic volume.

The efficiency numbers explain its adoption. The paper reports that the network needs about 175,000 floating point operations per frame, or 17.5 million per second at 100 frames per second, and about 40 million per second for the whole algorithm including transforms and pitch search. That used about 1.3 percent of one core of an Intel Haswell laptop processor and about 14 percent of a Raspberry Pi 3 core. Weights constrained to plus or minus 0.5 during training can be stored as 8-bit values, giving a model of about 85 kB according to the demo page. In a PESQ evaluation, an objective speech quality score, the paper reports clearly better quality than the conventional suppressor in SpeexDSP, particularly for non-stationary noise such as babble, car and street noise.

Compared with the alternatives, RNNoise sits between old and new. Classical suppressors such as the Speex preprocessor estimate the noise spectrum statistically and subtract it; they are cheap but struggle with noise that changes quickly. Large neural denoisers trained for the Microsoft-run Deep Noise Suppression Challenge at INTERSPEECH 2020 can remove more noise but cost more compute; the challenge organizers ranked entries with crowdsourced listening tests under the ITU-T P.808 standard because objective metrics often disagreed with human judgments. Valin's own follow-up with co-authors, PercepNet, presented at INTERSPEECH 2020, kept the band-and-pitch design but reported higher quality while still using less than 5 percent of a CPU core.

The limitations follow from the design. A band gain cannot separate a voice from noise that occupies the same band at the same moment, so strong noise leaves a muffled or watery voice, a distortion often called musical noise. RNNoise is trained to separate speech from background sounds, not one talker from another, so a competing voice in the background is treated as speech. Its quality is bounded by the training mixtures, and a 2017-era model can misjudge noise types it never heard. The 10 millisecond look-ahead keeps latency low for calls but limits how much future context the network can use.

Using RNNoise in practice requires little. The repository builds with a standard configure and make process, downloads the model files during setup, and includes a demo that reads headerless 16-bit mono audio at 48 kHz. Developers who want a custom model can generate features from their own speech and noise files with the provided tools, train with the included Python script and compile the quantized weights back into the library. The README recommends at least 10,000 training sequences and preferably 200,000 or more.

04Ví dụ hoạt động

Denoise a recording with the RNNoise demo

  1. Record about 30 seconds of speech near a running fan, or mix clean speech with a noise clip.

  2. Convert the file to raw headerless 16-bit mono PCM at 48 kHz, for example with a command-line audio converter.

  3. Build RNNoise from the official repository with autogen.sh, configure and make, which also downloads the model files.

  4. Run examples/rnnoise_demo with the noisy file as input and a new file name as output.

  5. Convert the output back to WAV and listen to the original and denoised versions back to back.

  6. Open both files in a spectrogram viewer and compare the energy between speech harmonics and during pauses.

Những gì nó cho thấy

The learner ends with a denoised file in which steady fan noise is strongly reduced, especially in pauses. The spectrogram should show darker gaps between voice harmonics, while very loud noise overlapping the voice may leave some muffling, illustrating the band-gain limitation.

Triển khai trong thế giới thực

OBS Studio 26.0, released in September 2020, added RNNoise as a method in its Noise Suppression filter, giving streamers a neural option alongside the older Speex-based suppressor.

GamingOnLinux reported that the Linux tools NoiseTorch and Cadmus use the same RNNoise technology to clean up microphone input system-wide for voice chat and calls.

The rnnoise_demo program in the official repository denoises a raw 16-bit, 48 kHz mono recording from the command line, which makes it easy to test on podcast or meeting audio.

Valin's Noise Donation project invited the public to record a minute of their own environment's noise, and the collected recordings were released as a 6.4 GB downloadable archive for training.

RNNoise 0.2, released in April 2024, shipped models retrained only on publicly available datasets and added AVX2 and SSE4.1 optimizations with run-time CPU detection.

Tương lai của việc khử nhiễu lời nói với RNNoise

RNNoise's 2024 release, version 0.2, changed training and engineering rather than the core idea: Phoronix reported in April 2024 that the distributed models were retrained using only publicly available datasets and that the code gained SSE4.1 and AVX2 optimizations with run-time CPU detection. The repository now also offers a sparser little model and a way to load weights from a file at run time, which makes swapping in custom models easier. The broader research direction, visible in PercepNet (INTERSPEECH 2020) and the Deep Noise Suppression Challenge series that began in 2020, is toward higher perceived quality at similar low compute, judged by human listening tests rather than objective scores alone, since the challenge organizers found the two often disagree. Open problems include suppressing competing talkers and reverberation without damaging the target voice, robustness to noise types absent from training data, and evaluation that reflects real calls rather than synthetic mixtures. Whether small hybrid designs like RNNoise or larger fully neural models running on dedicated hardware become the default for voice calls remains an open question.

Đưa nó vào thực tế

Tại sao nó quan trọng

  • Truy cập và tiếp cận. Nó cải thiện khả năng tiếp cận thông qua phiên âm, tường thuật và giao diện giọng nói.
  • Chi phí và ngân sách. Các nhóm truyền thông có thể gửi âm thanh tinh tế nhanh hơn với ngân sách nhỏ hơn.
  • Tốc độ và tỷ lệ. Các hệ thống hướng tới khách hàng có thể xử lý các tương tác bằng giọng nói ở quy mô lớn hơn.

coi chừng

  • Rủi ro lạm dụng giọng nói và mạo danh sẽ tăng lên khi thiếu sự đồng ý.
  • Độ chính xác có thể giảm đối với các giọng, phương ngữ hoặc môi trường ồn ào.
  • Âm thanh tổng hợp có thể bị nhầm lẫn với lời nói đích thực nếu không có nhãn rõ ràng.

Các bước tiếp theo

  1. Nhận được sự đồng ý rõ ràng để thu âm, sao chép và tái sử dụng giọng nói.
  2. Kiểm tra chất lượng trên nhiều loa và điều kiện nền khác nhau.
  3. Xác định khi nào con người phải xem xét hoặc phê duyệt kết quả đầu ra.
  4. Dán nhãn âm thanh tổng hợp và lưu giữ hồ sơ xuất xứ để đảm bảo trách nhiệm giải trình.

Nguồn tham khảo và đọc thêm

  1. arXiv / IEEE MMSP 2018A Hybrid DSP/Deep Learning Approach to Real-Time Full-Band Speech Enhancement
  2. Jean-Marc Valin (Xiph.Org / Mozilla)RNNoise: Learning Noise Suppression
  3. Xiph.Org Foundation (GitHub)xiph/rnnoise: Recurrent neural network for audio noise reduction
  4. PhoronixRNNoise 0.2 Released With AVX2 Optimizations For Neural Network Noise Suppression
  5. GamingOnLinuxOBS Studio adds in better noise suppression thanks to RNNoise in the 26.0 release
  6. arXiv / INTERSPEECH 2020A Perceptually-Motivated Approach for Low-Complexity, Real-Time Enhancement of Fullband Speech
  7. arXiv / INTERSPEECH 2020The INTERSPEECH 2020 Deep Noise Suppression Challenge: Datasets, Subjective Testing Framework, and Challenge Results

Tiếp tục khám phá

Bản tin miễn phí

Nhận bản tóm tắt AI hàng ngày

Ba câu chuyện AI đã được xác minh vào mỗi buổi sáng các ngày trong tuần, được viết bằng tiếng Anh đơn giản. Miễn phí mãi mãi, không có quảng cáo.

Một email mỗi ngày trong tuần. Hủy đăng ký trong một cú nhấp chuột. Chúng tôi không bao giờ bán hoặc chia sẻ địa chỉ của bạn.

Tự kiểm tra

Take the Speech Denoising with RNNoise quiz

Phản hồi tức thì về mọi câu trả lời và chứng chỉ có thể chia sẻ với ID có thể xác minh sau khi bạn vượt qua khóa học.

Bắt đầu bài kiểm tra

Hỗ trợ giáo dục AI miễn phí. AI Understanding là tổ chức phi lợi nhuận 501(c)(3) — không bao giờ có quảng cáo, không có tường phí. Hãy quyên góp

Câu hỏi thường gặp

Khử nhiễu giọng nói với RNNoise là gì?

RNNoise is an open-source noise suppression library, released by Jean-Marc Valin of Xiph.Org and Mozilla in 2017, that removes background noise from speech in real time. It pairs classic signal processing with a small recurrent neural network of about 88,000 weights, so it runs on an ordinary CPU core and became a common building block in streaming and voice-call software.

RNNoise chủ yếu dự đoán điều gì cho mỗi khung âm thanh ngắn?

RNNoise ước tính mức tăng trên mỗi băng tần làm giảm các dải nhiễu chiếm ưu thế trong khi vẫn duy trì các dải chiếm ưu thế bằng giọng nói, thay vì hoạt động trên mọi thùng quang phổ.

Loại mạng lưới thần kinh nào là cốt lõi của RNNoise?

RNNoise sử dụng mạng thần kinh tái phát nhỏ gọn được xây dựng bằng Đơn vị tái phát có cổng, mang lại cho nó bộ nhớ tạm thời trong khi vẫn ở kích thước nhỏ.

Tại sao RNNoise sử dụng dải tần cảm nhận thay vì các thùng quang phổ thô?

Chỉ dự đoán mức tăng băng tần ~22 giúp mạng nhỏ, nhanh và ít bị ảnh hưởng bởi các tạo tác nhiễu âm nhạc gây khó khăn cho các phương pháp mỗi thùng.

Mô hình RNNoise lớn đến mức nào?

RNNoise có trọng lượng khoảng 85.000, đủ nhỏ để chạy nhanh hơn thời gian thực trên một lõi CPU.

Vai trò của bộ lọc cao độ trong RNNoise là gì?

Bộ lọc lược/cao độ khai thác cấu trúc hài hòa của giọng nói hữu thanh để triệt tiêu tiếng ồn nằm giữa các hài âm, bổ sung cho lợi ích của băng tần.