Akshay Kulkarni
    • 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    # Notes on "[Domain Adaptive Semantic Segmentation Using Weak Labels](https://arxiv.org/abs/2007.15176)" ###### tags: `notes` `domain-adaptation` `segmentation` `weakly-supervised` `unsupervised` ECCV '20 paper; [Project Page](http://www.nec-labs.com/~mas/WeakSegDA/); Code not released as of 20/09/20. Author: [Akshay Kulkarni](https://akshayk07.weebly.com/) ## Brief Outline This paper proposes a framework for domain adaptation (DA) in semantic segmentation with image-level weak labels in the target domain. They use weak labels to enable the interplay between feature alignment and pseudo-labeling, improving both in DA. ## Introduction * Existing UDA methods for semantic segmentation are developed mainly using 2 mechanisms * Psuedo label self-training * In this, pixel-wise pseudo labels are generated via strategies such as confidence scores ([BMVC '18](http://www.bmva.org/bmvc/2018/contents/papers/0200.pdf), [CVPR '19](https://openaccess.thecvf.com/content_CVPR_2019/papers/Li_Bidirectional_Learning_for_Domain_Adaptation_of_Semantic_Segmentation_CVPR_2019_paper.pdf)) or self-paced learning ([ECCV '18](https://openaccess.thecvf.com/content_ECCV_2018/html/Yang_Zou_Unsupervised_Domain_Adaptation_ECCV_2018_paper.html)). * But, such pseudo labels are specific to the target domain and do not consider alignment between domains. * Distribution alignment between source and target domains * Numerous spaces could be considered for the alignment procedure, such as pixel ([ICML '18](http://proceedings.mlr.press/v80/hoffman18a.html), [CVPR '18](https://openaccess.thecvf.com/content_cvpr_2018/papers/Murez_Image_to_Image_CVPR_2018_paper.pdf)), feature ([Hoffman et. al. 2016](https://arxiv.org/abs/1612.02649), [ICCV '17](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhang_Curriculum_Domain_Adaptation_ICCV_2017_paper.pdf)), output ([CVPR '18](https://arxiv.org/abs/1802.10349), [CVPR '18](https://arxiv.org/abs/1711.11556)) and patch ([ICCV '19 Oral](https://arxiv.org/abs/1901.05427)) spaces. * However, alignment by these methods is category-agnostic, which may be problematic as the domain gap may vary across categories. * To alleviate the issue of lacking annotations in the target domain, they propose utilizing weak labels in the form of image- or point-level annotations in the target domain. * The weak labels could be estimated from the model prediction in the UDA setting or provided by the human oracle in the weakly-supervised DA (WDA) paradigm. Note that this is the first paper to introduce a WDA setting for semantic segmentation. * Specifically, they use weak labels to perform * image-level classification to identify the presence/absence of categories in an image as a regularization. * category-wise domain alignment using such categorical labels. * For the image-level classification task, weak labels help obtain a better pixel-wise attention map per category. These category-wise attention maps act as guidance to further pool category-wise features for proposed domain alignment procedure. * The main contributions of this work are * They propose the concept of using weak labels to help DA for semantic segmentation. * They utilize weak labels to improve category-wise alignment for better feature space adaptation. * They demonstrate the applicability of their method to both UDA and WDA settings. ## Methodology ### Problem Definition * In the source domain, they have images and pixel-wise labels denoted as $\mathcal{I}_s=\{ X_s^i, Y_s^i \}_{i=1}^{N_s}$. Whereas, the target dataset contains images and only image-level labels as $\mathcal{I}_t=\{ X_t^i, y_t^i \}_{i=1}^{N_t}$. * Here, $X_s, X_t \in \mathbb{R}^{H \times W \times 3}$, $Y_s \in \mathbb{B}^{H \times W \times C}$ with pixel-wise one-hot vectors, $y_t \in \mathbb{B}^{C}$ is a multi-hot vector representing the categories present in the image and $C$ is the number of categories (same for both source and target datasets). * The image-level labels $y_t$, termed weak labels, can be estimated (in which case, they are called pseudo-weak labels i.e. UDA) or acquired from a human oracle (in which case, they are called oracle-weak labels i.e. WDA). * Given such data, the problem is to adapt a segmentation model $\mathbf{G}$ learned on the source dataset $\mathcal{I}_s$ to the target dataset $\mathcal{I}_t$. ### Algorithm Overview ![Overall Procedure](https://i.imgur.com/AApo7Wf.png) * They first pass both the source and target images through the segmentation network $\mathbf{G}$ and obtain their features $F_s, F_t \in \mathbb{R}^{H' \times W' \times 2048}$, segmentation predictions $A_s, A_t \in \mathbb{R}^{H' \times W' \times C}$ and the upsampled pixel-wise predictions $O_s, O_t \in \mathbb{R}^{H \times W \times C}$. * As a baseline, they use source pixel-wise annotations to learn $\mathbf{G}$, while aligning the output space distribution $O_s$ and $O_t$, following this [CVPR '18](https://arxiv.org/abs/1802.10349) paper. * First, they introduce a module which learns to predict the categories that are present in a target image. Second, they formulate a mechanism to align the features of each individual category between source and target domains. * To this end, they use category-specific domain discriminators $D^c$ guided by the weak labels to determine which categories should be aligned. ### Weak Labels for Category Classification * To predict whether a category is absent/present in a particular image, they define an image classification task using the weak labels, such that $\mathbf{G}$ can discover those categories. * They feed the target images $X_t$ through $\mathbf{G}$ to obtain the predictions $A_t$ and then apply a global pooling layer to obtain a single vector of predictions for each category: $$ p_t^c = \sigma_s[\frac{1}{k} \log \frac{1}{H' W'} \sum_{h', w'} \exp kA_t^{(h', w', c)}] \tag{1} $$ * Here, $\sigma_s$ is the sigmoid function such that $p_t$ represents the probability that a particular category appears in an image. Note that (1) is a smooth approximation of the $\max$ function, and higher the value of $k$, better it approximates to $\max$. They use $k=1$. * Using $p_t$ and the weak labels $y_t$, they compute the category-wise binary CE loss: $$ \mathcal{L}_c(X_t; \mathbf{G}) = \sum_{c=1}^C -y_t^c \log(p_t^c) - (1-y_t^c)\log(1 - p_t^c) \tag{2} $$ * This loss $\mathcal{L}_c$ helps to identify the categories which are absent/present in a particular image and enforces $\mathbf{G}$ to pay attention to those objects/stuff that are partially identified when the source model is used directly on the target images. ### Weak Labels for Feature Alignment * Methods in literature either align feature space or output space across domains. However, these are agnostic to category, so it may align features of categories not present in certain images. * Also, features belonging to different categories may have different domain gaps. Thus, category-wise alignment could be beneficial but has not been widely studied in UDA for semantic segmentation. #### Category-wise Feature Pooling * Given the last layer features $F$ and the segmentation prediction $A$, they obtain the category-wise features by using the prediction as an attention over the features. Specifically, they obtain the category-wise feature $\mathcal{F}^c$ as a 2048-dimensional vector for the $c^{th}$ category as follows: $$ \mathcal{F}^c = \sum_{h', w'} \sigma(A)^{(h', w', c)} F^{(h', w')} \tag{3} $$ * Here, $\sigma(A)$ is a tensor of dimension $H' \times W' \times C$ with each channel along the category dimension representing the category-wise attention obtained by the softmax operation $\sigma$ over the spatial dimensions. * $\sigma(A)^{(h', w', c)}$ is a scalar and $F^{(h', w')}$ is a 2048-dimensional vector. So, $\mathcal{F}^c$ is the summed feature of $F^{(h', w')}$ weighted by $\sigma(A)^{(h', w', c)}$ over the spatial map $H' \times W'$. Note that the subscripts $s$ and $t$ are dropped as they employ the same operation to obtain the category-wise features for both domains. * Note that $\mathcal{F}^c$ denotes the pooled features for the $c^th$ category and $\mathcal{F}^C$ denotes the set of pooled features for all categories. #### Category-wise Feature Alignment * To learn $\mathbf{G}$ such that source and target category-wise features are aligned, they use an adversarial loss while using category-specific discriminators $D^C=\{ D^c \}_{c=1}^C$. * The reason for using category-specific discriminators is to ensure that the feature distribution for each category could be aligned independently, which avoids the noisy distribution modeling from a mixture of categories. * They train $C$ distinct category-specific discriminators $D^C$ as follows: $$ \mathcal{L}_d^C(\mathcal{F}_s^C, \mathcal{F}_t^C; D^C) = \sum_{c=1}^C -y_s^c \log D^c(\mathcal{F}_s^c) - y_t^c \log (1 - D^c(\mathcal{F}_t^c)) \tag{4} $$ * While training the discriminators, they only compute the loss for those categories which are present in the particular images via the weak labels $y_s, y_t \in \mathbb{B}^C$ that indicate whether a category occurs in an image or not. * The adversarial loss for the target images to train $\mathbf{G}$ is: $$ \mathcal{L}_{adv}^C(\mathcal{F}_t^C; \mathbf{G}, D^C)=\sum_{c=1}^C -y_t^c \log D^c(\mathcal{F}_t^c) \tag{5} $$ * Similarly, they use the target weak labels $y_t$ to align only those categories present in the target image. * Note: These 2 loss functions are effectively those used in the original GAN paper and also in the output space adaptation paper ([CVPR '18](https://arxiv.org/abs/1802.10349)). ### Network Optimization #### Discriminator Training * Both source and target images are used to train a set of $C$ distinct discriminators for each category $c$, which learn to distinguish between the category-wise features drawn from either the source or the target domain. * The optimization problem to train the discriminator can be expressed as $\min_{D^C}\mathcal{L}_d^C(\mathcal{F}_s^C, \mathcal{F}_t^C)$. #### Segmentation Network Training * They train $\mathbf{G}$ with the pixel-wise CE loss $\mathcal{L}_s$ on the source images, image classification loss $\mathcal{L}_c$ and adversarial loss $\mathcal{L}_{adv}^C$ on the target images. * The combined loss function to train $\mathbf{G}$ is: $$ \min_{\mathbf{G}} \mathcal{L}_s(X_s) + \lambda_c \mathcal{L}_c(X_t) + \lambda_d \mathcal{L}_{adv}^C(\mathcal{F}_t^C) \tag{6} $$ * They follow standard GAN training procedure ([NeurIPS '14](https://papers.nips.cc/paper/5423-generative-adversarial-nets)) to alternatively update $\mathbf{G}$ and $D^C$. ### Acquiring Weak Labels #### Pseudo-Weak Labels (UDA) * One way is to directly estimate the weak labels using the data available i.e. source images/labels and target images, which is the UDA setting. In this work, they utilize the baseline model ([CVPR '18](https://arxiv.org/abs/1802.10349)) to adapt a model learned from the source to the target domain, and obtain the weak labels of target images as follows: $$ y_t^c = \begin{cases} 1, & p_t^c > T,\\ 0, & \text{otherwise}. \end{cases} \tag{7} $$ * Here, $p_t^c$ is the probability for category $c$ as computed in (1) and $T$ is a threshold, which they set to 0.2 in the experiments. * They forward a target image through the model, obtain the weak labels using (7) in an online manner. Since these do not require human supervision, this is in a UDA setting. #### Oracle-Weak Labels (WDA) * In this, they obtain weak labels by querying a human oracle to provide a list of categories that occur in the target image. * They further show that their method can use different forms of oracle-weak labels by using point supervision ([ECCV '16](https://arxiv.org/abs/1506.02106)) (which is only slightly more effort compared to image-level supervision). * In point supervision, they randomly obtain one pixel coordinate of each category that belongs in the image, i.e. the set of tuples $\{ (h^c, w^c, c) | \forall y_t^c = 1 \}$. For an image, they compute the loss as follows: $\mathcal{L}_{point}=-\sum_{\forall y_t^c=1}y_t^c \log (O_t^{(h^c, w^c, c)})$, where $O_t \in \mathbb{R}^{H \times W \times C}$ is the output prediction of target after pixel-wise softmax. ## Conclusion * In this work, they use weak labels to improve domain adaptation for semantic segmentation in both UDA and WDA settings, with the latter being a novel setting. * They design an image-level classification module using weak labels, enforcing the network to pay attention to categories present in the image. With this guidance from weak labels, they further utilize a category-wise alignment method to improve adversarial alignment in the feature space. * Their formulation generalizes to both pseudo-weak and oracle-weak labels.

    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
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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