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

      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
    # Notes on "[ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation](https://arxiv.org/abs/1606.02147)" ###### tags: `notes` `segmentation` `supervised` #### Author [Akshay Kulkarni](https://akshayk07.weebly.com/) ## Brief Outline This paper presents a network architecture which is faster and more compact, for low real-time inference times. ## Introduction * This paper introduces a novel neural network architecture for fast inference and high accuracy. * Don't use any post-processing steps. Thus, completely end-to-end CNN architecture. ## Network Architecture ![Initial Block](https://i.imgur.com/qymfQnS.png) * The above module is called `InitialBlock`. * The $3\times3$ convolutional block has 13 convolutional filters. The MaxPooling has non-overlapping $2\times2$ filters. So, total 16 filters in the output for input RGB images. ![Bottleneck Block](https://i.imgur.com/Z4UrxMI.png) * The above module is called Bottleneck. It is of 3 types: * RegularBottleneck does not downsample, the input and output channels stay the same, only the intermediate feature map channels reduce according to an internal ratio. The main branch is an identity connection. * DownsampleBottleneck downsamples the input, while the intermediate feature map channels reduce according to an internal ratio. The main branch is a MaxPooling layer followed by padding. The feature maps are zero-padded to match the number of channels while adding. * UpsampleBottleneck upsamples the input, while the intermediate feature map channels reduce according to an internal ratio. The main branch is a convolutional layer followed by batch normalization and PReLU activation. * The `conv` layer maybe either a regular, dilated, or full convolution (deconvolution) with $3\times3$ filters, or a $5\times5$ convolution decomposed into two asymmetric ones. * For the regularizer, Spatial Dropout is used with $p = 0.01$ before `bottleneck2.0` and $p = 0.1$ afterwards. * Check implementation of both [here](https://github.com/akshaykvnit/pl-sem-seg/blob/master/models/enet/parts.py). ![ENet Architecture](https://i.imgur.com/CHyAGXU.png) * Check implementation [here](https://github.com/akshaykvnit/pl-sem-seg/blob/master/models/enet/model.py). * No bias terms are used in any operations. This reduces computation and memory usage. ### Design Choices #### Feature Map Resolution * Downsampling (reducing feature map size) has 2 main drawbacks: * It causes loss of spatial information like exact edge shape. * Generally, same output shape as input is expected. So, strong downsampling will require strong upsampling. This increases model size and computational cost. * The first issue is addressed in FCN ([Long et. al. 2015](https://arxiv.org/abs/1411.4038)) by utilizing feature maps produced at different stages of the encoder, and in SegNet ([Badrinarayanan et. al. 2015](https://arxiv.org/abs/1505.07293)) by saving indices from max pooling layers and using them in the decoder for unpooling. * The SegNet approach is used in this paper because of lesser memory requirements. * Despite this, strong downsampling hurts the accuracy. However, downsampling has one advantage: * Filters operating on downsampled images have a bigger receptive field, so they gather more context. This is especially important when differentiating between classes like rider and pedestrian in a road scene (for example). It is not enough to learn how a person looks, the context in which they appear is equally important. * However, the use of dilated convolutions ([Yu and Koltun, 2015](https://arxiv.org/abs/1511.07122)) is better for this purpose. #### Early Downsampling * The early layers in most architectures process very large input frames, which is very expensive computationally. * The first two ENet blocks heavily reduce the input size, and use only a small set of feature maps. The idea behind it, is that visual information is highly spatially redundant, and thus can be compressed into a more efficient representation. * Also, the initial layers should not directly contribute to classification. Instead, they should be good feature extractors (i.e. preprocess inputs for further layers). #### Decoder Size * Generally, encoder-decoder architectures have decoder symmetric to encoder. Instead, ENet has a large encoder and a small decoder. * The encoder should work like classical classification networks i.e. operate on lower resolution data and provide for information processing and filtering. * The decoder should upsample the encoder output, only finetuning the details. #### Nonlinear Operations * PReLUs ([He et. al. 2015](https://arxiv.org/abs/1502.01852)) have an additional parameter $a$ which determines the slope when input is negative. $$ \text{PReLU}(x) = \begin{cases} x; & x > 0 \\ ax; & x < 0 \end{cases} $$ * All the ReLUs when replaced by PReLUs would give * $a$ = 0, if ReLU is useful at that layer * $a$ = 1, if identity (i.e. no non-linearity) is useful at that layer * They found that early layers had $a$ near to zero i.e. ReLU like. Thus, early layers filter out information. The identity concept didn't work because this is a very shallow network compared to ResNets, so the network has to filter out information quickly. * Further, the upsample layers at the end had positive $a$ implying that the decoder only finetunes the encoder output (doesn't filter). #### Information Preserving Dimensionality Changes * Aggressive dimensionality reduction can hinder information flow. * According to [Szegedy et. al. 2015](https://arxiv.org/abs/1512.00567) (very interesting paper btw), convolution and pooling should be performed in parallel, and feature maps can be concatenated. This is better than * having a convolutional layer followed by a pooling layer because it is computationally expensive. * whereas having a pooling layer followed by a convolution layer because, while relatively cheap, it introduces a representational bottleneck (or forces use of more number of filters, which is again increases computation). * A problem in the original ResNet is that the first $1 \times 1$ projection of the convolutional branch has stride $2$, which means most of the input is not considered by the filter. * Increasing the filter size to $2 \times 2$ takes the full input into consideration, improving the information flow. However, it increases the computation (very few are used in ENet, so not a problem). #### Factorizing Filters * Convolutional weights have some redundancy, and each $n \times n$ convolution can be decomposed into sequential $n \times 1$ and $1 \times n$ filters (proposed in [Szegedy et. al. 2015](https://arxiv.org/abs/1512.00567)). * This allows to increase the variety of functions learned by the network and increase the receptive field (since n = 5 will be equivalent to a single $3 \times 3$ convolution). * It allows to make the functions richer, since non-linear operations can be inserted between the $n \times 1$ and $1 \times n$ layers. #### Dilated Convolutions * As mentioned, it is important to have a large receptive field, so classification is performed taking a wider context into account. * Best accuracy was obtained by interleaving dilated convolution bottleneck blocks with other bottleneck blocks (both regular and asymmetric) instead of in a sequence ([Yu and Koltun, 2015](https://arxiv.org/abs/1511.07122)). #### Regularization * L2 weight decay didn't work well. * According to [Huang et. al. 2016](https://arxiv.org/abs/1603.09382), stochastic depth increased accuracy. However, dropping entire branches (setting o/p to zero) is a special case of Spatial Dropout ([Tompson et. al. 2014](https://arxiv.org/abs/1411.4280)). * Instead, using Spatial Dropout at the end of convolutional branches (before addition) worked better. ### Training Procedure * Adam optimization is used in 2 stages: * First train only the encoder to categorize downsampled regions of the input image. * Then, append the decoder and train the network to perform upsampling and pixel-wise classification. ## Conclusion * This paper presents an efficient architecture and training procedure for real-time inference. * It combines several methods to reduce computation and memory requirements.

    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