tungsomot
    • 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
    • Engagement control
    • 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 Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- tags: papers --- # ATOM: Robustifying Out-of-Distribution Detection Using Outlier Mining. ECML PKDD 2021. ## Abstract Detecting out-of-distribution (OOD) inputs is critical for safely deploying deep learning models in an open-world setting. However, existing OOD detection solutions can be brittle in the open world, facing various types of adversarial OOD inputs. In this paper, we provide a theoretically motivated method, Adversarial Training with informative Outlier Mining (ATOM), which improves the robustness of OOD detection. We show that, by mining informative auxiliary OOD data, one can significantly improve OOD detection performance, and somewhat surprisingly, generalize to unseen adversarial attacks. ## Introduction Out-of-distribution (OOD) detection has become an indispensable part of building reliable open-world machine learning models. An OOD detector determines whether an input is from the same distribution as the training data, or different distribution. An OOD image (e.g., mailbox) can be perturbed to be misclassified by the OOD detector as in-distribution (traffic sign data). Failing to detect such an adversarial OOD example 1 can be consequential in safety-critical applications. The authors propose a novel training framework, **A**dversarial **T**raining with informative **O**utlier **M**ining (**ATOM**). The key idea is to selectively utilize auxiliary outlier data for estimating a tight decision boundary between ID and OOD data, which leads to robust OOD detection performance. While recent methods have leveraged auxiliary OOD data, they show that randomly selecting outlier samples for training yields a large portion of uninformative samples, which do not meaningfully improve the decision boundary between ID and OOD data. **ATOM** demonstrates that by mining low OOD score data for training, one can significantly improve the robustness of an OOD detector, and generalize to unseen adversarial attacks. The authors extensively evaluate ATOM on common OOD detection benchmarks, as well as a suite of adversarial OOD tasks, as illustrated in Figure 1. Lastly, the authors provide theoretical analysis for ATOM, characterizing how outlier mining can better shape the decision boundary of the OOD detector. ![](https://i.imgur.com/ivezYKA.png) Fig.1. Robust out-of-distribution detection. When deploying an image classification system (OOD detector $G(\mathbf{x})$ + image classifier $f(\mathbf{x})$) in an open world, there can be multiple types of OOD examples. We consider a broad family of OOD inputs, including (a) Natural OOD, (b) $\ell_{\infty}$ OOD, (c) corruption OOD, and (d) Compositional OOD. In (b-d), a perturbed OOD input (e.g., a perturbed mailbox image) can mislead the OOD detec- tor to classify it as an in-distribution sample. This can trigger the downstream image classifier $f(\mathbf{x})$ to predict it as one of the in-distribution classes (e.g., speed limit 70). Through adversarial training with informative outlier mining (ATOM), our method can robustify the decision boundary of OOD detector $G(\mathbf{x})$, which leads to improved performance across all types of OOD inputs. Solid lines are actual computation flow. ## Preliminaries Considering a training dataset $\mathcal{D}$ train in drawn i.i.d. from a data distribution $P_{\mathbf{X},Y}$ , where $\mathbf{X}$ is the sample space and $Y = \{1,2,\ldots,K\}$ is the set of labels. In addition, having an auxiliary outlier data $\mathcal{D}^{\text{auxiliary}}_{\text{out}}$ from distribution $U_{\mathbf{X}}$. The goal is to learn a detector $G: \mathbf{x} \rightarrow \{-1, 1\}$, which outputs $1$ for an indistribution example $\mathbf{x}$ and output $-1$ for a clean or perturbed OOD example $\mathbf{x}$. Let $\Omega(\mathbf{x})$ be a set of small perturbations on an OOD example $\mathbf{x}$. The detector is evaluated on $\mathbf{x}$ from $P_{\mathbf{X}}$ and on the worst-case input inside $\Omega(\mathbf{x})$ for an OOD example $\mathbf{x}$ from $Q_{\mathbf{X}}$. The false negative rate (FNR) and false positive rate (FPR) are defined as $$ \mathrm{FNR}(G)=\mathbb{E}_{\mathbf{X} \sim P_{\mathbf{X}}}\mathbb{I}[G(\mathbf{x})=-1] \\ \mathrm{FPR}(G;Q\mathbf{x},\Omega)=\mathbb{E}_{\mathbf{X}\sim Q_{\mathbf{X}}}\max_{\delta \in \Omega(\mathbf{X})}\mathbb{I}[G(\mathbf{x} + \delta)=1] $$ ## Methodology ### Method Overview The authors use the terminology outlier mining to denote the process of selecting informative outlier training samples from the pool of auxiliary outlier data. Outlier training data is sampled from a uniform distribution from outside the support of in-distribution. ### ATOM: Adversarial Training with Informative Outlier Mining #### Training Objective. ![](https://i.imgur.com/JWTnFyB.png) Fig.2. A toy example in 2D space for illustration of informative outlier mining. With informative outlier mining, we can tighten the decision boundary and build a robust OOD detector. The classification involves using a mixture of ID data and outlier samples. consider a $(K + 1)$-way classifier network $f$, where the $(K + 1)$-th class label indicates out-of-distribution class. Denote by $F_{\theta}(\mathbf{x})$ the softmax output of f on x. The robust training objective is given by $$ \min_{\theta} \mathbb{E}_{(\mathbf{x},y)\sim\mathcal{D}^{\text{train}}_{\text{in}}}[\mathcal{L}(\mathbf{x},y,F_{\theta})] + \lambda \cdot \mathbb{E}_{\mathbf{x}\sim\mathcal{D}^{\text{train}}_{\text{out}}} \max_{\mathbf{x}'\in\Omega_{\infty,\epsilon}(\mathbf{x})}[\mathcal{L}(\mathbf{x}', K+1; F_{\theta})] $$ where $\mathcal{L}$ is the cross entropy loss, and $\mathcal{D}^{\text{train}}_{\text{out}}$ is the OOD training dataset. The authors use Projected Gradient Descent (PGD) to solve the inner max of the objective, and apply it to half of a minibatch while keeping the other half clean to ensure performance on both clean and perturbed data Once trained, the OOD detector $G(\mathbf{x})$ can be constructed $$ G(\mathbf{x})=\left\{\begin{array}{l} -1 \: &\mathrm{if}\ F(\mathbf{x})_{K+1} \geq \gamma,\\ 1 \: &\mathrm{if}\ F(\mathbf{x})_{K+1} < \gamma, \end{array}\right. $$ where $\gamma$ is the threshold, and in practice can be chosen on the in-distribution data so that a high fraction of the test examples are correctly classified by $G$. And $F(x)_{K+1}$ is the OOD score of $\mathbf{x}$. For an input labeled as in-distribution by $G$, one can obtain its semantic label using $F(\mathbf{x})$ $$ \hat{F}(\mathbf{x}) = \max_{y \in \{1,2,\ldots,K\}} F(\mathbf{x})_{y} $$ #### Informative Outlier Mining. During each training epoch, we randomly sample $N$ data points from the auxiliary OOD dataset $\mathcal{D}^{\text{auxiliary}}_{\text{out}}$, and use the current model to infer the OOD score. Next, the authors sort the data points according to the OOD scores and select a subset of $n < N$ data points, starting with the $qN$-th data in the sorted list. We then use the selected samples as OOD training data D$\mathcal{D}^{\text{train}}_{\text{out}}$ for the next epoch of training. Intuitively, $q$ determines the informativeness of the sampled points w.r.t the OOD detector. The larger $q$ is, the less informative those sampled examples become. ![](https://i.imgur.com/FlpZPzf.png)

    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