<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shubham Bhatt on Medium]]></title>
        <description><![CDATA[Stories by Shubham Bhatt on Medium]]></description>
        <link>https://medium.com/@shubhambhatt838?source=rss-efbe65caf3d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Shubham Bhatt on Medium</title>
            <link>https://medium.com/@shubhambhatt838?source=rss-efbe65caf3d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 15 May 2026 19:03:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shubhambhatt838/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Why Anchor boxes?]]></title>
            <link>https://medium.com/@shubhambhatt838/why-anchor-boxes-58913f0449b6?source=rss-efbe65caf3d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/58913f0449b6</guid>
            <dc:creator><![CDATA[Shubham Bhatt]]></dc:creator>
            <pubDate>Sun, 07 Apr 2024 10:49:54 GMT</pubDate>
            <atom:updated>2024-04-07T10:49:54.682Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever wondered why anchor boxes come into the picture? Let us understand that today.</p><p>When we pass hundreds of anchor boxes as input. what happens to those?</p><p>Anchor boxes play a crucial role in the loss calculation during the training of object detection models. They primarily aid in training the model to accurately predict bounding boxes for objects of various sizes and aspect ratios.</p><p>Reducing these anchor boxes becomes manageable. for this we segregate the Once those are passed to the object detection model, these anchor boxes are adjusted to objects in the images. once adjusted, these are filtered out based on below factors:</p><ol><li><strong>Prediction and adjustment</strong> —</li></ol><p>a) Objectness — if any anchor boxes have less probability of having an object, it will discard those.</p><p>b) Predictions on how to adjust the anchor box dimensions (scale, height, and width) and position (centre coordinates) to best fit the actual object in the image.</p><p>2. <strong>NMS</strong> — The next step is to remove the overlapping anchors. It keeps the box with the highest objectness score while removing other boxes that overlap it beyond a certain threshold (based on Intersection over Union, or IoU). NMS is applied per class to ensure that objects of different classes are detected separately, even if their bounding boxes overlap significantly.</p><p>3. <strong>Output</strong> — The final output after applying NMS is a set of bounding boxes, each associated with a class label and a confidence score. These represent the model’s predictions for the locations and identities of objects in the image.</p><p>4. <strong>Loss Calculation</strong>: The model is trained using a loss function that penalizes the difference between the predicted bounding boxes and their corresponding ground truth boxes. Anchor boxes are categorized as positive or negative based on their IoU (Intersection over Union) with ground truth boxes. Positive anchors have a high IoU with a ground truth box and are responsible for detecting objects, while negative anchors have a low IoU and are treated as background or non-object regions. This calculation happens only on positive anchor boxes. The loss calculation is applied only to positive anchors, focusing on refining their localization and classification predictions. This loss function incorporates terms for localization (bounding box regression) and classification.</p><p><strong>Is anchor boxes used while inferencing on a trained model?</strong></p><p>During inference, the trained model uses its learned parameters to make predictions directly on the input image. It doesn’t need anchor boxes anymore because it has learned to localize objects without them. Instead, the model predicts bounding boxes and their corresponding class probabilities directly from the features extracted from the input image.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58913f0449b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications]]></title>
            <link>https://medium.com/@shubhambhatt838/mobilenets-efficient-convolutional-neural-networks-for-mobile-vision-applications-920f2ae12d1d?source=rss-efbe65caf3d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/920f2ae12d1d</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[mobilenet]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[simple-explanations]]></category>
            <dc:creator><![CDATA[Shubham Bhatt]]></dc:creator>
            <pubDate>Mon, 11 Dec 2023 19:24:54 GMT</pubDate>
            <atom:updated>2023-12-11T19:27:06.132Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we will see the minute details in the MobileNets architecture. This is one of the architectures with light weight useful for mobile and embedded vision applications. This architecture describes an efficient network architecture and a set of two hyper-parameters to build very small, low-latency models that can be easily matched to the design requirements for mobile and embedded vision applications.</p><p>MobileNets are built primarily from depth-wise separable convolutions used in Inception models to reduce the computation in the first few layers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*F9NEkwTINxI4UGkPboGVtg.png" /><figcaption>MobileNet Architecture</figcaption></figure><p>The above table shows the architecture of the Mobilnet which utilizes depth-wise convolution and point-wise convolutional, which is explained further. The softmax layer along with flatten layer helps to classify the image.</p><p>The below diagram is a comparison to standard convolution with this architecture block used. It leads to a reduction in computation around 8 to 9 times than standard convolution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*EC8GT6ymtB_5F1xac95aVw.png" /><figcaption>Comparison of standard convolution and Mobilenet Depthwise separable Conv block</figcaption></figure><p>MobileNets use both batch norm and ReLU nonlinearities for both layers(depthwise and convolutional).</p><p>MobileNet architecture is broadly built upon two concepts:</p><p>1) Depthwise Separable Convolution</p><p>2) Two model shrinking hyperparameters:</p><blockquote>A) Width multiplier</blockquote><blockquote>B) Resolution multiplier</blockquote><p><strong>Depthwise Separable Convolution:</strong></p><p>The MobileNet model is based on depthwise separable convolutions which is a form of factorized convolutions which factorize a standard convolution into a depthwise convolution and a 1×1 convolution called a pointwise convolution. A standard convolution both filters and combines inputs into a new set of outputs in one step. The depthwise separable convolution splits this into two layers, a separate layer for filtering and a separate layer for combining. This factorization has the effect of drastically reducing computation and model size. The below figure shows, <strong>standard convolution</strong> factorized into a</p><blockquote><strong>a)</strong> depthwise convolution and</blockquote><blockquote><strong>b)</strong> 1 x 1 pointwise convolution.</blockquote><p>Depthwise separable convolutions are made up of two layers: depthwise convolutions and pointwise convolutions. Depthwise convolutions are applied to a single filter per each input channel (input depth).</p><p>In the above figure, we can see that the convolutional kernel of size Dk x Dk is applied to each input channel(input depth), contributing total computation contribution cost of:</p><blockquote>Dk x Dk x M x Df x Df (Df is the input channel dimension)</blockquote><p>Depthwise convolution is extremely efficient relative to standard convolution however it only filters input channels, it does not combine them to create new features. So additional layer that computes a linear combination of the output depthwise is via 1 x 1 convolutional also known as Pointwise convolution. Combining both called Depthwise separable convolutional. The total cost of Depthwise is:</p><blockquote><strong>Dk x Dk x M x Df x Df + M x N x Df x Df</strong></blockquote><p>By expressing convolution as a two-step process of filtering and combining we get a reduction in computation:</p><blockquote><strong>(Dk x Dk x M x Df x Df + M x N x Df x Df)/Dk x Dk x M x Df x Df + M x N x Df x Df</strong></blockquote><p>which is equivalent to:</p><blockquote><strong>1/N + 1/(Dk)²</strong></blockquote><p>Let’s talk about the other speciality of the MobileNet:</p><p><strong>Width Multiplier:</strong></p><p>Many times there is a requirement to build an even less computationally expensive and simple model. This architecture introduced a very simple parameter α called width multiplier. The role of the width multiplier α is to thin a network uniformly at each layer. For a given layer and width multiplier α, the number of input channels M becomes αM and the number of output channels N becomes αN.</p><p>The computational cost of a depthwise separable convolution with width multiplier α is:</p><blockquote><strong>Dk x Dk x αM x Df x Df + αM x αN x Df x Df</strong></blockquote><p><strong>Resolution Multiplier:</strong></p><p>The second hyper-parameter to reduce the computational cost of a neural network is a resolution multiplier ρ. This is applied to the input image and the internal representation of every layer is subsequently reduced by the same multiplier. computation cost with resolution multiplier is as:</p><blockquote>DK x DK x αM x ρDF x ρDF + αM x αN x ρDF x ρDF</blockquote><p>Below are a few of the interesting facts and results:</p><p>The impact of the depthwise separable layer can be seen in the below table, wherein the parameters &amp; MAC operations are reduced to a large extent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*i53G9alpcp5ZdkcWMKCs6w.png" /><figcaption>Depthwise Separable vs Full Convolution MobileNet</figcaption></figure><p>MobileNet with fewer parameters &amp; MAC operations can match the accuracy of the other model having higher MACs and parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*SrB5UV6b7gS7bsNLfMGbvQ.png" /><figcaption>Accuracy Comparison with few standard models</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=920f2ae12d1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intersection Over Union (IoU) Maths]]></title>
            <link>https://medium.com/@shubhambhatt838/intersection-over-union-iou-maths-84513cee6f48?source=rss-efbe65caf3d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/84513cee6f48</guid>
            <dc:creator><![CDATA[Shubham Bhatt]]></dc:creator>
            <pubDate>Sat, 22 Jul 2023 18:36:47 GMT</pubDate>
            <atom:updated>2023-07-22T18:36:47.509Z</atom:updated>
            <content:encoded><![CDATA[<p>This article demonstrates the maths behind the IoU(Intersection over Union).</p><p>We will start with calculating the <strong>intersection </strong>(shown in yellow region) and <strong>union</strong>(total area under blue and red area) on the first step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*xJmN9NdFCcsSvVNNMdGKiw.png" /><figcaption>Intersection over Union Explained and PyTorch Implementation(www.youtube.com)</figcaption></figure><p>For calculating the formula we will start with calculating the <strong>intersection area </strong>as follow:</p><p>box1(blue) = [x1, y1, x2, y2]</p><p>box2(red) = [x11, y11, x22, y22]</p><p>x1(of intersection) — max(box1[0], box2[0])</p><p>x2(of intersection) — min(box1[2], box2[2])</p><p>y1(of intersection) — max(box1[1], box2[1])</p><p>y2(of intersection) — min(box1[3], box2[3])</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4TQk9zAAkaXbsBsLdVgbMw.png" /><figcaption>Intersection over Union Explained and PyTorch Implementation(www.youtube.com)</figcaption></figure><p>For calculating the <strong>union </strong>we simply have to add an area of box 1 and the area of box 2 and then subtract the common area since we have added them twice i.e.</p><blockquote><strong>area of box1+ area of box2 — intersection</strong></blockquote><p>Code snippet for implementing the same:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*OYrIXNXazBtwhhR1nE8hKQ.png" /></figure><p>Hope this would have simplified the maths behind the operation.<br>Happy Learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84513cee6f48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Version Control using GIT]]></title>
            <link>https://medium.com/@shubhambhatt838/version-control-using-git-5d0e64580e3a?source=rss-efbe65caf3d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d0e64580e3a</guid>
            <category><![CDATA[avoid-code-conflict]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[savings-code]]></category>
            <category><![CDATA[version-control]]></category>
            <dc:creator><![CDATA[Shubham Bhatt]]></dc:creator>
            <pubDate>Sun, 16 Jan 2022 18:44:04 GMT</pubDate>
            <atom:updated>2022-01-16T18:44:04.532Z</atom:updated>
            <content:encoded><![CDATA[<p>A version control system that allows saving the changes made to a file or directory in a project</p><p>The benefit of GIT:</p><ul><li>You cannot overwrite the files, as it notifies you if you overwrite</li><li>GIT can synchronize work done by different people on a different machine</li><li>GIT stores all information in a directory called .git located in the root directory of the project. It is hidden by default to avoid any edit or delete by mistake.</li></ul><blockquote><strong>Create new Git repo:</strong></blockquote><p><strong><em>git init project_name:</em></strong> It will create a repository for a new project. The use <strong>git init</strong> for initializing the git.</p><blockquote><strong>Cloning a repo</strong></blockquote><p>It copies a repo in a new directory(or simply a new machine)</p><p><strong><em>git clone </em></strong><a href="http://www.sample.com/project.git"><strong><em>www.sample.com/project.git</em></strong></a></p><blockquote><strong>How can i find out where a cloned repo originated?</strong></blockquote><p>When you clone a repository, git remember where the original repo was. It does this by storing a remote in new repository configuration.</p><p><strong><em>git remote –v shows the remote urls</em></strong></p><p>When you clone a repository, Git automatically creates a remote called origin that points to the original repository. You can add more remotes using:</p><p><strong><em>git remote add remote-name URL</em></strong></p><p>and remove existing ones using:</p><p><strong><em>git remote rm remote-name</em></strong></p><p>You can connect any two Git repositories this way, but in practice, you will almost always connect repositories that share some common ancestry.</p><p>Now you have an online repo(like github or bitbucket), now you want to pull changes from those repo and push changes to them.</p><blockquote><strong>Pull</strong></blockquote><p>Pulling changes is straightforward, the command <strong><em>git pull remote branch </em></strong>gets everything in branch in the remote repository identified by remote and merges it into the current branch of your local repository.</p><p><strong><em>git pull remote branch</em></strong></p><p>For example, if you are in the “quarterly-report” branch of your local repository, the command,<strong><em> git pull thunk latest-analysis</em></strong> would get changes from “latest-analysis” branch in the repository associated with the remote called “thunk” and merge them into your “quarterly-report” branch.</p><blockquote><strong>How can I push my changes to a remote repository?</strong></blockquote><p>The complement of git pull is git push, which pushes the changes you have made locally into a remote repository. The most common way to use it is<strong><em> git push remote-name branch-name </em></strong>which pushes the contents of your branch “branch-name” into a branch with the same name in the remote repository associated with “remote-name”. It’s possible to use different branch names at your end and the remote’s end, but doing this quickly becomes confusing: it’s almost always better to use the same names for branches across repositories.</p><blockquote><strong>What happens if my push conflicts with someone else’s work?</strong></blockquote><p>Overwriting your own work by accident is bad; overwriting someone else’s is worse.</p><p>To prevent this from happening, Git does not allow you to push changes to a remote repository unless you have merged the contents of the remote repository into your own work.</p><blockquote><strong>Checking state of repository -</strong></blockquote><p><strong><em>git status</em></strong> — It checks the status of the repository, i.e. it displays a list of files that have been modified since the last time changes were made. It will return the file(s) that were modified since the last save.</p><p>Git has a staging area in which it stores the files with changes you want to save that haven’t been saved yet. Committing means putting this staging area to the .git directory where no more changes can be made. Git status shows the files in the staging area and files that have changes that haven’t yet been put there</p><p><strong><em>git diff filename — </em></strong>can also be used to check the difference in the file and if want to check in all files in a folder then <strong><em>git diff</em></strong> can be used.<em> </em><strong>git diff directory</strong><em> </em>will show the changes to all files in a directory.</p><p><strong><em>diff </em></strong>on the other hand show the formatted difference between two files.</p><p>Sample output:</p><p><em>diff — git a/report.txt b/report.txt</em></p><p><em>index e713b17..4c0742a 100644</em></p><p><em>— — a/report.txt</em></p><p><em>+++ b/report.txt</em></p><p><em>@@ -1,4 +1,5 @@</em></p><p><em>-# Seasonal Dental Surgeries 2017–18 <br>+# Seasonal Dental Surgeries (2017) 2017–18 <br>+# TODO: write new summary</em></p><ul><li>The command used to produce the output (in this case, <strong><em>diff — git</em></strong>). In it, a and b are placeholders meaning “the first version” and “the second version”.</li><li>An index line showing keys into Git’s internal database of changes. We will explore these in the next chapter.</li><li>— — a/report.txt and +++ b/report.txt, wherein lines being <em>removed</em> are prefixed with — and lines being added are prefixed with +.</li><li>A line starting with @@ that tells <em>where</em> the changes are being made. The pairs of numbers are start line and number of lines (in that section of the file where changes occurred). This diff output indicates changes starting at line 1, with 5 lines where there were once 4.</li><li>A line-by-line listing of the changes with — showing deletions and + showing additions (we have also configured Git to show deletions in red and additions in green). Lines that <em>haven’t</em> changed are sometimes shown before and after the ones that have in order to give context; when they appear, they <em>don’t</em> have either + or — in front of them.</li><li>Unique identifier ‘hash’ will remain the same if two files are same.</li></ul><blockquote><strong>Adding file</strong></blockquote><p><strong><em>git add filename </em></strong>— it adds the file(s) in the staging area. If you mistakenly stage a file, then you can revert that using <strong><em>git reset HEAD</em></strong></p><blockquote><strong>Comparing files</strong></blockquote><ul><li><strong><em>git diff –r HEAD</em></strong> — It compares the particular version with a file in the staging area. -r flag means “compare to a particular revision”</li><li><strong><em>git diff –r HEAD path/to/file</em></strong> — It can be used for specific version.</li></ul><blockquote><strong>Saving changes to staging</strong></blockquote><p><strong><em>git commit</em></strong><em> — </em>It saves the changes in the staging area. Git allows entering a log message. It helps to track the changes. e.g. git commit -m “Program appears to have become self-aware.”</p><p>In case you miss-type the commit message then use git commit — amend — m “new message”</p><p><strong><em>git log</em></strong><em> helps to view the log of the project&#39;s history.</em></p><p><strong><em>git log path/to/file</em></strong> shows the specific file history instead of the entire project.</p><blockquote><strong>HOW DOES GIT STORE THE DATA:</strong></blockquote><p>It stored in three-level structure</p><p><strong>Commit, </strong>contains the metadata such as author, the commit message and the time the commit happened.</p><p><strong>Tree, </strong>Track the name and location of the repository when that commit happened.</p><p><strong>BLOB, </strong>comprising a snapshot of the contents of the file when the commit happened. Reusing the blob that is not changed saves the memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*RV3EhG07rqKcwzF2DJ2NyQ.png" /><figcaption>Three Level Structure of GIT Storage</figcaption></figure><p><strong><em>git log</em></strong> displays the overall history of a project/files while <strong><em>git annotation</em></strong> <strong><em>file</em></strong> shows who made the changes to each line of a file and when it was changed. If <strong><em>git log –3 filename</em></strong> is passed then only the last three changes will be seen.</p><p><strong><em>git diff </em></strong>views different commit. Those changed.</p><blockquote><strong>Configuring the setting</strong></blockquote><p><strong><em>git config –list</em></strong> : to see the setting and change then. You can add suffix –local, — global, — system. Local setting precedence over the global setting. To check a specific setting we can use <strong><em>git config — global</em></strong> setting value(e.g. git config — global user.email).</p><blockquote><strong>How can I undo changes to unstaged files?</strong></blockquote><p>Suppose you have made changes to a file, then decide you want to undo them. Your text editor may be able to do this, but a more reliable way is to let Git do the work. The command:</p><p><strong><em>git checkout — filename</em></strong></p><p>will discard the changes that have not yet been staged. (The double dash — must be there to separate the <strong><em>git checkout</em></strong> command from the names of the file or files you want to recover.)</p><blockquote><strong>How can I undo changes to staged files?</strong></blockquote><p>If you use just <strong><em>git reset</em></strong> it will reset everything from the staging or <strong><em>git reset HEAD</em></strong> <strong><em>folder</em></strong>, it will reset all the files from that folder.</p><p>By combining <strong><em>git reset </em></strong>with <strong><em>git checkout</em></strong>, you can undo changes to a file that you staged changes to. The syntax is as follows.</p><p><strong><em>git reset HEAD path/to/file</em></strong></p><p><strong><em>git checkout — path/to/file</em></strong></p><blockquote><strong>How do I restore an old version of a file?</strong></blockquote><p>The syntax for restoring an old version takes two arguments: the hash that identifies the version you want to restore, and the name of the file.</p><p>For example, if <strong><em>git log</em></strong> shows this:</p><p><em>commit ab8883e8a6bfa873d44616a0f356125dbaccd9ea <br>Author: Author: Rep Loop <br>Date: Thu Oct 19 09:37:48 2017 -0400 <br> <br> Adding graph to show latest quarterly results.</em></p><p><em>commit 2242bd761bbeafb9fc82e33aa5dad966adfe5409 <br>Author: Author: Rep Loop <br>Date: Thu Oct 16 09:17:37 2017 -0400</em></p><p><em>Modifying the bibliography format.</em></p><p>then <strong><em>git checkout 2242bd report.txt</em></strong> would replace the current version of report.txt with the version that was committed on October 16. Notice that this is the same syntax that you used to undo the unstaged changes, except — has been replaced by a hash.</p><p>Restoring a file doesn’t erase any of the repository’s history. Instead, the act of restoring the file is saved as another commit, because you might later want to undo your undoing.</p><blockquote><strong>What is a branch?</strong></blockquote><p><strong>branches</strong>, which allows you to have multiple versions of your work, and lets you track each version systematically. one branch does not affect other branches (until you <strong>merge</strong> them back together).</p><p>By default, master is the branch repository has. To get list of branches a project has, git branch is the option.</p><p><strong><em>git checkout -b branch-name</em></strong> is to create a new branch</p><p>To compare two versions of the repo, you can <strong><em>git diff revision-1..revision-2</em></strong> and <strong><em>git diff branch-1..branch-2</em></strong> shows the difference between two branches.</p><p>To switch the branch use<strong><em> git checkout branch_name</em></strong></p><blockquote><strong>Merge two branches:</strong></blockquote><p>While Branches work parallelly merging brings them together. <strong><em>git merge source destination</em></strong>. If those changes don’t overlap, the result is a new commit in the destination branch that includes everything from the source branch</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d0e64580e3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSD explained]]></title>
            <link>https://medium.com/@shubhambhatt838/ssd-explained-b4ecfe16ceb3?source=rss-efbe65caf3d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4ecfe16ceb3</guid>
            <category><![CDATA[ssd]]></category>
            <category><![CDATA[single-shot-detection]]></category>
            <dc:creator><![CDATA[Shubham Bhatt]]></dc:creator>
            <pubDate>Mon, 03 Jan 2022 02:27:44 GMT</pubDate>
            <atom:updated>2022-01-03T02:27:44.174Z</atom:updated>
            <content:encoded><![CDATA[<p>Object detection models are broadly classified into two categories, single-stage, and multiple stages. SSD is one of the single-stage object detection models. This makes it much faster compared to other architecture and even faster than Faster R-CNN.</p><p>SSD has the following key features:</p><ul><li>Multi-scale feature maps for detection— After the base network i.e. VGG16, CNN is used to decrease the size progressively which allows the prediction at multiple scales.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*moJxh0OwA7ZXwRDr8PtuVg.png" /></figure><ul><li>*Convolutional predictors for detection* — at the end of the base network, several feature layers were added, which produces fix set of detection predictions using a set of convolutional filters. The feature layer with kernel predicts score for a category or a shape offset relative to the default box coordinates</li><li>Default boxes and aspect ratios — Default boxes are similar to Anchor boxes in Faster RCNN. However, unlike Faster RCNN, they are applied at several feature maps of different resolutions. We predict the offsets relative to the default box shapes in the cell, as well as the per-class scores that indicate the presence of a class instance in each of those boxes. By default SSD used 6 default boxes per location.</li><li>Matching strategy — During training default boxes need to be matched with the actual box. That is done using Jaccard overlap.</li><li>Training objective — The training objective is to a weighted sum of localization loss and confidence loss(using softmax). Localization loss is Smooth L1 loss between the predicted box and ground truth box.</li></ul><p>L(x, c, l, g) = 1/N (L<em>conf</em> (x, c) + αL<em>loc</em>(x, l, g)), where N is matching default boxes.</p><ul><li>Choosing scales and aspect ratios for default boxes — To handle different scale, SSD suggest preprocessing the image at different size and combining the result after. They Designed the tiling of default boxes so that specific feature maps learn to be responsive to particular scales of the objects. Lower layer’s feature map capture more fine details that can improve the semantic segmentation quality because lower layers capture more fine details of input objects. So, SSD used both lower and upper feature maps for detection.</li><li>Hard negative mining — After the matching step, Most default boxes are negative, especially when the number of possible default boxes is large. This introduces a significant imbalance between positive and negative raining training examples. Sorting negative examples with the highest confidence for each default box and picking only the top negative example so that the ratio between negative and positive is at most 3:1. This leads to fast and more stable optimization.</li><li>Data Augmentation for Small Object Accuracy — augmenting the dataset using zoom in and zoom out operation for images especially for the small objects has significantly improved the result to 2%-3% mAP across multiple datasets.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R0kVJFqteTK3UdB7tS2PLw.png" /></figure><p>Accuracy over PASCAL VOC2007 dataset is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BpZE4KcAYVMruCKI7s18EQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4ecfe16ceb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>