tonyvu1289
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Thesis | Work session 3 # Một số model state-of-art trong lĩnh vực Speed Enhancment ## MetricGAN ### tổng quan Đây là phiên bản cải tiến dựa trên SEGAN. Khác biệt nằm ở mạng Discriminator(D). Vấn đề của mạng $D$ của SEGAN là nó chỉ phân biệt chuổi âm thanh là âm thanh tạo bởi mô hình $G$ hay âm thanh ground-truth, điều này không phù hợp với tác vụ SE lắm (dù cho ra kết quả khá tốt). Những chỉ số dùng để đánh giá tác vụ SE là PESQ, STOI. Vì vậy, metricGAN sẽ dùng các chỉ số này để tối ưu mạng $D$. ### tối ưu mạng D Gọi hàm $Q(I)$ để biểu diễn chỉ số dùng để ước lượng độ hiệu quả của tác vụ SE (ví dụ : PESQ, STOI). Với STOI và PESQ thì $I$ là 2 chuỗi âm thanh : chuổi âm thanh tạo bởi G (chuỗi chúng ta muốn evaluate) $x$ và chuỗi âm thanh ground-truth $y$ . Để mạng $D$ behave giống như hàm $Q$, ta sẽ thay đổi hàm mất mát của $D$ : ![](https://i.imgur.com/SUQLPb6.png) ![](https://i.imgur.com/wMKXYE6.png) ## CMGAN: Conformer-based Metric GAN for Speech Enhancement Mô hình CMGAN bao gồm: Generator và Metric Discriminator. ### 1. Generator Đầu vào noisy speech waveform y $\in R^{L*1}$ sẽ được biến đổi thành spectrogram phức tạp (spectrogram đa chiều) $Y_{o}\in R^{T*F*2}$ thông qua phép short-time Fourier transform (STFT), với T là chiều thời gian và F là chiều tần số. Sau đó, nén spectrogram $Y_{o}$ thành spectrogram $Y$ bằng định luật nén lũy thừa (power-law compression): $$Y=|Y_{o}|^{c}e^{jY_{p}}=Y_{m}e^{jY_{p}}=Y_{r}+jY_{i}$$ * $Y_{m}$: các giá trị độ lớn (magnitude) *chưa rõ* * $Y_{p}$: phase * $Y_{r}$: thành phần thực trong spectrogram * $Y_{i}$: thành phần ảo trong spectrgram * c : hệ số lũy thừa nén (c= 0.3) > **Việc nén như vậy có tác dụng gì?** Khi áp dụng lower-law compression độ lớn của âm thanh sẽ được cân bằng hơn nghĩa là tầm quan trọng của âm thanh nhỏ và âm thanh lớn sẽ không còn chênh lệch nhiều, từ đó âm thanh trở nên dễ nghe hơn so với cảm nhận của tai con người. ![](https://i.imgur.com/tmL9xAu.jpg) Với B là Batch size Phần thực (real) và phần ảo (imaginary) sẽ được nối với magnitude $Y_{m}$ để làm input của generator. #### 1.1 Encoder ![](https://i.imgur.com/h7YiKYW.jpg) Encoder bao gồm 2 khối convolution trước và sau, ở giữa là một dilated DenseNet. Mỗi khối convolution bao gồm 1 lớp convolution, 1 instance normalization, và hàm kích hoạt PReLU. Khối convolution nằm ở đầu có nhiệm vụ mở rộng 3 feature đầu vào ($Y_{m},Y_{r},Y_{i}$) thành một feature map trung gian với C kênh. Bên trong mạng Dense mở rộng (dilated DenseNet) chứa 4 khối convolution với Dense connection, hệ số mở rộng của mỗi khối lần lượt là 1,2,4,8. Khối convolution cuối có nhiệm vụ làm giảm một nửa chiều tần số ($F\rightarrow F^{'}$) để làm giảm độ phức tạp của mô hình. > **Giải thích về hệ số dilated trong dilated DenseNet** ![](https://i.imgur.com/1pEeOHw.jpg) -Hệ số dilated 1: khoảng cách áp dụng bộ lọc lên các pixel là 2, nghĩa là bộ lọc sẽ áp dụng lên toàn bộ các pixel -Hệ số dilated 2: khoảng cách áp dụng bộ lọc lên các pixel là 2, nghĩa là áp dụng bộ lọc lên các pixel lẻ như là pixel 1,3,5 ở hàng dọc và hàng ngang -Hệ số dilated 3: khoảng cách áp dụng bộ lọc lên các pixel là 3, nghĩa là áp dụng bộ lọc lên các pixel cách nhau 3 pixel (1,5,9) -Việc dùng dilated convolution (dilated DenseNet) giúp tăng cường việc tiếp thu một cách hiệu quả, cho phép một mô hình học các trừu tượng bậc cao hơn mà không cần giảm kích thước (bảo toàn kernel và số layer). #### 1.2 Two-stage conformer block Bao gồm 2 bước chính. Hai khối conformer lần lượt capture sự thời gian phụ thuộc ở bước đầu và capture tần số phụ thuộc ở bước thứ hai. ![](https://i.imgur.com/FtQZOXF.jpg) Đầu vào là một feature map $D \in R^{B*T*F'*C}$ được reshape thành $D^{T} \in R^{BF'*T*C}$ để capture time dependency trong khối conformer đầu tiên. Sau khi đi qua khối conformer đầu tiên, ta thu được $D^{T}_{o}$. Lấy $D^{T}_{o}$ thu được thêm vào $D^{T}$ bằng phép element-wise (thêm vào các kết nối còn lại) và reshape thành một feature map mới $D^{F} \in R^{BT*F'*C}$. Ở khối conformer thứ hai sẽ capture frequency dependency. Sau đó thu được $D_{o}$ và reshape trở về kích thước ban đầu $D_{o} \in R^{B*T*F'*C}$. **Cấu trúc mỗi khối conformer**: Mỗi khối sẽ bao gồm 4 thành phần chính. Gồm 2 feed-forward neural networks (FFNNs). Ở giữa hai FFNNs sẽ là một multi-head self-attention (MHSA) với 4 head và sau đó là một convolution module. Convolution module bắt đầu bằng một lớp chuẩn hóa (normalization), tiếp theo là một lớp point-wise convolution và đi qua hàm kích hoạt gated linear unit (GLU) để tránh vanishing gradient. Output từ GLU sẽ tiếp tục đi qua một lớp Depthwise convolution (1D-depthwise conv) và hàm kích hoạt Swish. Sau đó đi qua thêm một lớp point-wise convolution. Cuối cùng đi qua một lớp drop-out để regularization. Đồng thời, ở mỗi lớp sẽ có bổ sung thêm một kết nối giữa input và output. #### 1.3 Decoder Decoder (bao gồm mask decoder và complex decoder) sẽ extract output từ N khối TS-conformer (two-stage conformer). Mask decoder có nhiệm vụ dự đoán một mask được nhân bởi magnitude input (element-wise). Complex decoder dự đoán 2 thành phần còn lại (real và imaginary). Cả mask decoder và complex decoder bao gồm dilated DenseNet (tương tự như encoder) và đi qua lớp subpixel convolution với mục đích tăng mẫu cho chiều tần số (đổi từ $F' \rightarrow F$). Đối với mask decoder, khối convolution được sử dụng để ép số kênh (channel) thành 1 và tiếp theo là một lớp convolution với hàm kích hoạt PReLu để dự đoán final mask. Đối với complex decoder, kiến trúc tương tự mask decoder nhưng không có hàm kích hoạt PReLu. Masked magnitude $\hat{X}$ được kết hợp với noisy phase $Y_{p}$ tạo ra magnitude-enhanced complex spectrogram, và sau đó tính tổng (element-wise) output của complex decoder và thu được final complex spectrogram: $$\hat{X}_{r}=\hat{X}_{m}cos(Y_{p})+\hat{X'}_{r}$$ $$\hat{X}_{i}=\hat{X}sin(Y_{p})+\hat{X'}_{i}$$ Với final complex spectrogram thu được, ta đảo nghịch quá trình power-law compression và áp dụng short-time Fourier transform nghịch đảo (ISTFT) để đưa về dạng tín hiệu âm thanh về miền thời gian. > Khác biệt giữa ReLu và PReLu ![](https://i.imgur.com/zIwtW3G.jpg) ### 2. Metric Descriminator Discriminator bao gồm 4 khối convolution. Mỗi khối sẽ bắt đầu với một lớp convolution, sau đó là Instance Norm với hàm kích hoạt PReLu. Sau 4 khối convolution, sẽ là global average pooling và 2 lớp feed-forward cùng với hàm kích hoạt sigmoi. Discriminator được huấn luyện để ước lượng normalized PESQ score lớn nhất. Ngoài ra discriminator còn được huấn luyện để ước lượng điểm enhanced PESQ bằng cách cho clean spectrum và enhanced spectrum làm một đầu vào tương ứng với mỗi nhãn PESQ. ### 3. Loss function Hàm loss TF là sự kết hợp giữa magnitude loss và complex loss ![](https://i.imgur.com/xHEQRNO.png) Hệ số $\alpha=0.7$ cho hiệu suất tốt nhất Hàm generatore loss và discriminator loss: ![](https://i.imgur.com/lBqNBsy.png) Với D là discriminator, $Q_{PESQ}$ là điểm normalized PESQ $\in [0,1]$. Hàm penalization giúp cải thiện việc lưu giữ chất lượng âm thanh: ![](https://i.imgur.com/tLYq4eM.png) Với $\hat{x}$ là enhanced waveform, x là clean waveform (target). Hàm loss final: ![](https://i.imgur.com/IkZFBUc.png) ## Phương pháp đánh giá mô hình ### Real-time factor (RTF) #### RTF là gì? Real-time factor là một thang đo tốc độ giải mã âm thanh theo thời gian thực. $$RTF = \frac{time(decode(a))}{length(a)}$$ Đối với một hệ thống xem là real-time khi RTF <= 1. RTF phụ thuộc vào số lượng luồng stream đồng thời đang chạy trong hệ thống ``` def real_time_factor(processingTime, audioLenght, decimals=2): ''' Real-Time Factor (RTF) is defined as processing-time / length-of-audio. ''' rtf = (processingTime / audioLenght) return round(rtf, decimals) ``` * Tìm hiểu thêm một số thứ: 1. Complex spectrogram 2. instance normalization: chuẩn hóa theo cặp mẫu và kênh tương ứng (1 mẫu và 1 kênh), tính mean, std, variance rồi dựa vào đó rescale lại output 3. Dense connection: là fully-connected 4. Gated linear unit (vanishing gradient) ![](https://i.imgur.com/jo3ED6r.png) ## Reference 1. [CMGAN: Conformer-based Metric GAN for Speech Enhancement](https://arxiv.org/pdf/2203.15149v2.pdf) 2. [Dilated DenseNets for Relational Reasoning](https://arxiv.org/pdf/1811.00410.pdf)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully