<?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 Karan Uppal on Medium]]></title>
        <description><![CDATA[Stories by Karan Uppal on Medium]]></description>
        <link>https://medium.com/@karan3-zoh?source=rss-6d6306dfd70d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JBCFvQCXNdR8Of-fZfEBGA.jpeg</url>
            <title>Stories by Karan Uppal on Medium</title>
            <link>https://medium.com/@karan3-zoh?source=rss-6d6306dfd70d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:03:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@karan3-zoh/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[Paper Summary: Very Deep Convolutional Networks for Large-Scale Image Recognition]]></title>
            <link>https://karan3-zoh.medium.com/paper-summary-very-deep-convolutional-networks-for-large-scale-image-recognition-e7437959d856?source=rss-6d6306dfd70d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7437959d856</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Karan Uppal]]></dc:creator>
            <pubDate>Sun, 16 Jun 2024 09:41:22 GMT</pubDate>
            <atom:updated>2024-06-16T09:41:22.367Z</atom:updated>
            <content:encoded><![CDATA[<p>Simonyan, Karen, and Andrew Zisserman. arXiv preprint arXiv:1409.1556 (2014).</p><p><a href="https://arxiv.org/abs/1409.1556">Link to original paper</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*phHh1DAH3ABYCEvpKYh57A.png" /></figure><p>The paper introduces the famous VGG architecture whose deep features trained on ImageNet serve as a transfer learning baseline for many applications. The important concept here is the introduction of stacking of multiple 3x3 convolutions which are shown to be better than windows of larger sizes.</p><h3>1. Introduction</h3><p>The manuscript aims to explore the effect of network depth by fixing other parameters of the architecture and steadily increasing the depth of the network by adding 3x3 convolution filters in all layers. They explore the tasks of image classification as well as localization (beating Overfeat).</p><h3>2. ConvNet Configurations</h3><p>The input to the model consists of 224x224 RGB images which undergo mean subtraction. Rather than using relatively large receptive fields in the convolutional layers, the authors use very small 3x3 receptive fields which stride 1 and padding 1, alongside 2x2 max pooling with stride 2. These stack of convolutional layers are followed by 3 fully connected layers to give the final classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vpgmPgOxCCsE37l3dniJ2Q.png" /></figure><p>All the configurations used are outlined above. Local Response Normalisation from <a href="https://medium.com/@karan3-zoh/paper-summary-imagenet-classification-with-deep-convolutional-neural-networks-41ce6c65960">AlexNet</a> is also used in one configuration to gauge the claim whether they help boost accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*sF1K1NGfKDPWIA0hrJBNAA.png" /></figure><p>The authors also note that despite the large depth, the number of parameters in their network is not greater than the number of parameters in a more shallow net with larger convolutional width and receptive fields, for example Overfeat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aouHvRT9zu9srQRw6Q8f4g.png" /></figure><p>The authors state that a stack of two 3x3 conv layers has an effective receptive field of 5x5; three such layers have a 7x7 effective receptive field. The stacking provides more non-linearity to the network instead of a single one in a larger receptive field. This is accompanied by fewer parameters as well as fewer operations. In a way, it can be seen as imposing a regularisation on the 7x7 convolutional filters, forcing them to have a decomposition through the 3x3 filters with multiple non-linearity injected in between.</p><p>The incorporation of 1x1 convolutional layers is a way to increase non-linearity without affecting the receptive fields of the convolutional layers and have also been used previously in “Network in Network” and “GoogLeNet”.</p><h3>3. Classification Framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdXeoZ64_275BfKHO8eRAg.png" /></figure><p>The training procedure follows that of <a href="https://medium.com/@karan3-zoh/paper-summary-imagenet-classification-with-deep-convolutional-neural-networks-41ce6c65960">AlexNet</a>, with an interesting observation shown above.</p><p>The initialisation of the network A was done randomly and the subsequent configurations were intialised with the optimized weights of configuration A. The authors also note that after paper submission they found that this pre training was unnecessary since they could just use <a href="https://medium.com/@karan3-zoh/paper-summary-understanding-the-difficulty-of-training-deep-feedforward-neural-networks-6f184ba5e6d6">Xavier initialisation</a>.</p><p>To obtain the fixed-size 224x224 input, the images were rescaled to size S (training scale) and randomly cropped with the fixed size, after which it underwent more data augmentation. The authors consider two approaches for setting the training scale S.</p><ol><li>Fix S which corresponds to single-scale training. The authors used S = 256 and S = 384 (it was initialised with the weights pretrained with S = 256 to speed up training)</li><li>Perform multi-scale training where each training image is rescaled by randomly sampling S from a certain range of (S_min, S_max), where S_min = 256 and S_max = 512. Again, to speed up training, the model was initialised with weights used in fixed S = 384.</li></ol><p>At test time, the image is first rescaled to size Q (test scale) and then the network is applied densely over the rescaled test image, that is, the fully-connected layers are converted to convolutional, which leads to a map with the number of channels equal to the number of classes. The class score map is then spatially averaged. Since the network is applied over the whole image, there is no need to sample multiple crops at test time which requires a network pass for each crop. However, the authors note that mulit-crop evaluation is complementary to dense evaluation due to different convolution boundary conditions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GjcLqzJ9xZ5yal01DidFBg.png" /></figure><h3>4. Classification Experiments</h3><p>The authors present the image classification results achieved by their different configurations on the ImageNet dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oAtm0svsRCRrD7vvZSTW_w.png" /></figure><p>The authors begin by evaluating the performance of individual ConvNet models at a single scale. The first observation is that the local response normalisation does not improve on the model A with any normalisation layers, and thus, the authors do not use any normalisation in the deeper architectures.</p><p>The second observation is that the classification error decreases with the increased ConvNet depth. An interesting thing to note is that inspite of the same depth, model C (which contains 1x1 conv layers) performs worse than model D. This indicates that which the additional non-linearity does help (C performans better than B), it is important to capture spatial context (D is better than C). The error rates saturate at 19 layers, however, even deeper models might be beneficial for larger datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0oQscdQ2cT5Sw8q49mL3g.png" /></figure><p>Another interesting insight is shown above. We also note that scale jittering at training time leads to significantly better results than training on images with fixed scale, even though a single scale is used at test time. This confirms that training set augmentation by scale jittering is indeed helpful for capturing multi-scale image statistics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qv6AC_cTjfUy4O6-hY1p1A.png" /></figure><p>Now the authors experiment with scale jittering at test time. Their results indicate that scale jittering at training and evaluation of test image at multiple scales leads to the best performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDQ072q41bGG7Wq97It7bg.png" /></figure><p>Next, the authors compare dense ConvNet evaluation with multi-crop evaluation. They also assess their combination by averaging their softmax outputs. They note that multiple crops performs slightly better than dense evaluation and the two approaches are complementary, since their combination outperforms each of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*59TsKHpWWNJLRgICqGvEsQ.png" /></figure><p>The authors now combine the outputs of several models by averaging their softmax class posteriors, which boosts their accuracy further. They form an ensemble of only two best performing models which leads to their best accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rIzf5KaNhKaNPjFEft5djg.png" /></figure><p>They also outperform previous models who achieved best results in ILSVRC-2012 and 2013, as well as, achieve comparable performance with GoogLeNet.</p><h3>5. Localisation</h3><p>This can be seen as a special case of object detection, where a single object bounding box should be predicted for each of the top-5 classes. The architecture used is configuration D which is kept similar to before with the last fully connected layer now predicting a bounding box location instead of class scores. This can be done in two ways:</p><ol><li>Single Class Regression, where the bounding box prediction is shared across all classes and the model outputs 4 numbers.</li><li>Per-class Regression, where the bounding box prediction is class-specific and the model outputs 4 x number of classes.</li></ol><p>The model is trained similarly to the classification model and is tested both on single scale as well dense application of the network. In this case, we obtain a set of bounding box predictions after which they use a post-processing merging technique used by Overfeat (merge spatially close predictions by averaging coordinates and then rate them based on class scores from a classification network).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*BI9nlNp061eV5HKdt-Pghw.png" /></figure><p>The authors also run some initial experiments and determine that per-class regression works better and hence, conduct all subsequent experiments with that scheme. They experiment on the ILSVRC localisation dataset and win the 2014 challenge, using above configuration with densely computed bounding box predictions.</p><h3>6. Generalisation of Very Deep Features</h3><p>Now the authors evaluate their ConvNets, pretrained on ImageNet, as feature extractors on other, smaller datasets, using Net-D and Net-E. For transfer learning, the penultimate features are used which are aggregated across multiple locations and scales, and then combined with a linear SVM classifier, trained on the target dataset. As seen earlier, evaluation over multiple scales is beneficial, so the features are extracted over several scales Q. The resulting features can either be stacked (Allows a subsequent classifier to learn how to optimally combine image statistics over a range of scales) or pooled across scales (more computationally cheap).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5PC50CSeBwLoc1q_CBNs3A.png" /></figure><p>The first experiment is on the image classification task of PASCAL VOC 2007 and 2012 benchmarks. The authors state that they found aggregating image descriptors computed at multiple scales by averaging performs similarly to the aggregation by stacking. The authors hypothesize that this is due to the fact that in the VOC dataset the objects appear over a variety of scales so there is no particular scale-specific semantics which a classifier could exploit. Their methods set the new state of the art on PASCAL VOC datasets.</p><p>Next, they experiment with Caltech-101 and Caltech-256 image classification benchmarks. Unlike VOC, they found that stacking of descriptors computed over multiple scales performs better than averaging or max pooling. This can be explained by the fact that in Caltech images typically occupy the whole image, so multi-scale image features are semantically different, and stacking allows a classifier to exploit such scale-specific representations. Again, the model outperforms the state of the art.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VIMCg62pXcTrNDfQhJT77A.png" /></figure><p>In their last experiment, the authors evaluate their best-performing image-representation (stacking of Net-D and Net-E features) on the PASCAL VOC-2012 action classification task which consists of predicting an action class from a single image, given a bounding box of the person performing an action. The authors consider two training settings:</p><ol><li>Computing the ConvNet features on the whole image and ignoring the provided bounding box</li><li>Computing the features on the whole image and on the provided bounding box and stacking them to obtain the final representation</li></ol><p>Their representation achieves state of the art on this dataset, even without using the provided bounding boxes and the results are further improved by the combination.</p><h3>7. Conclusion</h3><p>In this work, the authors evaluate deep convolutional networks along with deep convolutional features to a variety of tasks and datasets, illustrating the importance of depth in achieving good representations. They achieve state of the art in multiple datasets as well as introduce the concept of stacking of multiple small convolutions.</p><h3>8. Final Words</h3><p>The paper is very well written and introduces one of the most well-known as well as simple architectures.</p><h3>9. References</h3><p>Simonyan, Karen, and Andrew Zisserman. “Very deep convolutional networks for large-scale image recognition.” <em>arXiv preprint arXiv:1409.1556</em> (2014).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7437959d856" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Summary: Visualizing and Understanding Convolutional Networks]]></title>
            <link>https://karan3-zoh.medium.com/paper-summary-visualizing-and-understanding-convolutional-networks-aaa4a87a35f9?source=rss-6d6306dfd70d------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaa4a87a35f9</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Karan Uppal]]></dc:creator>
            <pubDate>Wed, 05 Jun 2024 12:04:22 GMT</pubDate>
            <atom:updated>2024-06-05T12:04:22.202Z</atom:updated>
            <content:encoded><![CDATA[<p>Zeiler, Matthew D., and Rob Fergus. Computer Vision–ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6–12, 2014, Proceedings, Part I 13. Springer International Publishing, 2014.</p><p><a href="https://arxiv.org/abs/1311.2901">Link to original paper</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ej3xGjgwGH19xZNGS5Unsg.png" /></figure><p>This manuscript delves into the visualization of activation maps which allows the authors to develop model architectures (now commonly known as ZFNet) that outperform the current state-of-the-art. Published concurrently with the DeCAF paper, they also perform an ablation study demonstrating one of the first use cases of transfer learning.</p><h3>1. Introduction</h3><p>Visualizing a convolutional neural network is difficult after its first layer as the feature maps cannot be remapped back to the pixel space. Previous visualization techniques don’t capture every part of an input image to show which part directly affects which feature map. The authors aim to introduce a visualization technique that reveals the input stimuli that excite individual feature maps at any given layer in the model, using a “Deconvolutional Network”. This technique, when used as a diagnostic tool, helps them to develop better architectures. Lastly, they explore the generalization ability of convolutional features to other datasets (Caltech-101, Caltech-256 and PASCAL 2012).</p><h3>2. Approach</h3><p>Understanding the operation of a convolutional networks requires interpreting the feature activity in the intermediate layers. The authors present a method to map these activities back to the input pixel space, showing what input pattern originally caused a given activation in the feature maps. This is done using Deconvolutional Networks which can be though of as a convolutional network but in reverse. It has three components:</p><ol><li><strong>Unpooling: </strong>The normal max pooling operation involves finding the maximum value in the kernel and then storing that as the output. This operation is non-invertible. However, we can store where we found the maximum value in the kernel and place the reconstructions from the layer above into the appropriate locations. This technique is often called “bed of nails” since all the other values are set to zero. An example of the same is shown below:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G26Nsm8OKFH-sWarO_ZDoA.png" /></figure><p>2. <strong>Rectification:</strong> To obtain valid feature reconstructions at each layer, they are passed through a ReLU function.</p><p>3. <strong>Filtering: </strong>The convolutional network uses learned filters to convolve the feature maps from the previous layers. To invert this, the deconvolutional network uses transposed versions of the same filters, applied to the rectified maps, to obtain the reconstruction.</p><p>To start, an image is passed to the convolutional network and the features are computed through the layers. To examine a given activation, all the other activations in the layer are set to zero and the feature maps are passed as input to the attached deconvolutional network. The above operations are then used to reconstruct the activity in the layer beneath that gave rise to the chosen activation. This is repeated till the pixel space is reached.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*iPBzygK-YoQ5YjXHa2MT2Q.png" /></figure><p>Since the unpooling operation is different for each image, the reconstruction obtained resembles a small piece of the original image, with structures weighted according to their contribution to the feature activation.</p><h3>3. Training Details</h3><p>The model architecture is based on AlexNet with modifications made using the above visualisation technique as a diagnostic tool. It trained on ImageNet 2012 with several data augmentation techniques using stochastic gradient descent. The exact details can be found in the paper.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4KUy3vVblkACLonmjUY5fw.png" /></figure><p>The authors state that visualization of the first layer filters during training revealed that a few of them dominate, as shown below. This leads to training instability and hinders a balanced feature learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*iYUirR8sXBOtQvVgLlU2Fw.png" /></figure><p>To combat this, they renormalize each filter in the convolutional layers whose RMS value exceeds a fixed radius, sort of like a regularization effect.</p><h3>4. Convnet Visualization</h3><p>Using the model described in the previous section, we now perform feature visualization using the deconvolutional network. They visualize the top 9 activations for each layer and project each separately down to the pixel space, alongside the corresponding image patches.</p><p>Here the maps seem to be mostly activated by texture (Row 4, Column 3), color (Row 3, Column 2) or edges (Row 4, Column 4).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1TxetGcbyXyMucO7fFfhtA.png" /></figure><p>Some structure is now being identified by the model, for example the text patterns in Row 2, Column 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jou2SfhNyeR6ZarN1LRcOA.png" /></figure><p>Discriminate parts of the object can now be seen in many cases (for example, Layer 4, Row 1, Column 1). It usefulness as a diagnostic tool is apparent in the case of Layer 5, Row 1, Column 2, where the patches don’t seem to have anything in common but the activation maps reveal that they are getting activated by the grass in the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LH8HFa2HGOvRQdACdf8WxA.png" /></figure><p>The figure below visualizes the progression of the strongest activation within a given feature map, during 70 epochs of training. The lower layers of the model can be seen to converge within a few epochs. However, the upper layers only develop after a considerable number of epochs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oiC7SKAs_KnbkhtNMk2YTw.png" /></figure><p>The figure below shows 5 sample images being translated, rotated and scaled by varying degrees while looking at the changes in the feature vectors from the top and bottom layers of the model, relative to the untransformed feature. The authors note the small transformations have a dramatic effect in the first layer of the model, but a lesser impact at the top feature layer. The figure also shows that the network output is stable to translation and scaling but is not invariant to rotation (except for objects with rotational symmetry).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QO3_rtD1wFCuW_X0-DZWpw.png" /></figure><p>Using the visualization tool, the authors now improve the AlexNet model. They state that the first layer activations display a mix of extremely high and low frequency information with little coverage of the mid frequencies and also some “dead” activations. Additionally, the 2nd layer visualization shows aliasing artifacts caused by the large stride of the previous layer. To remedy this, they reduce the 1st layer filter size (from 11x11 to 7x7) and reduce the stride of the convolution (from 4 to 2). They later empirically demonstrate the improved performance of the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ha2Al4u2Htnedfkt-6KQFA.png" /></figure><p>With image classification approaches, it is often the case wherein the model uses surrounding context to predict the output (for e.g., husky vs wolf). The figure below attempts to approach this by systematically occluding different portions of the input image with a grey square and monitoring the output of the classifier. The examples clearly demonstrate that the model is localizing the objects as the probability of the correct class drops when the object is occluded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KhKpH_JG0eanHTwz7LS43A.png" /></figure><p>Classical recognition approaches establish correspondences between specific objects parts in the image (for e.g., faces have a particular spatial configuration of the eyes and nose) to recognize objects. With neural networks as a black box, it is quite difficult to understand whether such a correspondence is computed implicitly or not. The authors aim to explore this by taking 5 random dog images with frontal pose and then systematically masking out the same part of the face in each image. Using the feature vectors of the original image and the occluded image, their similarity is computed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aH0AMiGp6wEtNCfWqmE9iA.png" /></figure><p>The authors state that the lower score for the eyes and nose compared to random occluding for layer 5 features show the model does establish some degree of correspondence. However, these values are still comparable for layer 7. A possible explanation is provided below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RFf7s0dHo5iU_HblZWfpYw.png" /></figure><h3>5. Experiments</h3><p>The authors experiment with the original AlexNet architecture and their modified one on the ImageNet dataset. Their architecture, when combined with multiple models, achieved the best published performance on ImageNet and became the SOTA of that time.</p><p>The authors then experiment by removing layer from their model. Removing the fully connected layers gave a slight increase in slight which is surprising since they contain the majority of the model parameters. They also state that removing two of the middle convolutional layers also makes a relatively small difference to the error rate. However, removing both of these leads to a model with only 4 layers which performs a lot worse. The authors then conclude that the overall depth of the model is important for obtaining good performance. However, it can be the case that more parameters would be required for their 4 layer model. What if the model was more wider than deep? What if more filters were used?</p><p>The authors then showcase the ability of their model to act as a feature extractor. They keep the model parameters frozen and train a softmax classifier on top using a different dataset (Caltech-101 and Caltech-256). This approach is compared to methods which utilize hand-crafted features. Their approach performs exceedingly well on both these datasets. They even experiment with the “one-shot” learning paradigm using just 6 Caltech-256 images per class to achieve comparable performance with methods that use 10 times as many images. These experiments showcase the power of the ImageNet trained feature extractor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzncAcva4qU769W3sDJMpg.png" /></figure><p>They perform the same experiment with PASCAL 2012. However, they achieve a performance lower than the leading method with the reason being stated that PASCAL images can contain multiple objects and their model just provides a single prediction which may hamper the feature extraction.</p><p>In another insightful experiment, the authors vary the number of layer retrained from the model and place a linear SVM classifier on top. For both Caltech-101 and Caltech-256, they achieve a steady improvement in performance as they ascend the layers indicating that as the feature hierarchies become deeper, the model learns increasingly powerful features.</p><h3>6. Discussion</h3><p>The authors present a novel way to visualize activations within the model and how these visualizations can be used to debug problems with the model to obtain better results. They perform several ablations studies which reveal insights regarding feature correspondence and invariance. The authors also show how the ImageNet trained model generalizes well to other datasets and successfully demonstrated one of the first examples of transfer learning.</p><h3>7. Final Words</h3><p>The paper is quite well-written and easy to follow. The several visualizations, although quite overwhelming, well supplement the reading.</p><h3>8. References</h3><p>Zeiler, Matthew D., and Rob Fergus. Computer Vision–ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6–12, 2014, Proceedings, Part I 13. Springer International Publishing, 2014.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaa4a87a35f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Summary: NPMs: Neural Parametric Models for 3D Deformable Shapes]]></title>
            <link>https://karan3-zoh.medium.com/paper-summary-npms-neural-parametric-models-for-3d-deformable-shapes-843a06504c9f?source=rss-6d6306dfd70d------2</link>
            <guid isPermaLink="false">https://medium.com/p/843a06504c9f</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Karan Uppal]]></dc:creator>
            <pubDate>Thu, 14 Sep 2023 09:23:49 GMT</pubDate>
            <atom:updated>2023-09-14T09:24:51.393Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Palafox, Pablo, et al. “Npms: Neural parametric models for 3d deformable shapes.” Proceedings of the IEEE/CVF International Conference on Computer Vision. 2021.</em></p><p><a href="https://arxiv.org/abs/2104.00702">Link to original paper</a></p><p><strong><em>Abstract:</em></strong><em> Parametric 3D models have enabled a wide variety of tasks in computer graphics and vision, such as modeling human bodies, faces, and hands. However, the construction of these parametric models is often tedious, as it requires heavy manual tweaking, and they struggle to represent additional complexity and details such as wrinkles or clothing. To this end, we propose Neural Parametric Models (NPMs), a novel, learned alternative to traditional, parametric 3D models, which does not require hand-crafted, object-specific constraints. In particular, we learn to disentangle 4D dynamics into latent-space representations of shape and pose, leveraging the flexibility of recent developments in learned implicit functions. Crucially, once learned, our neural parametric models of shape and pose enable optimization over the learned spaces to fit to new observations, similar to the fitting of a traditional parametric model, e.g., SMPL. This enables NPMs to achieve a significantly more accurate and detailed representation of observed deformable sequences. We show that NPMs improve notably over both parametric and non-parametric state of the art in reconstruction and tracking of monocular depth sequences of clothed humans and hands. Latent-space interpolation as well as shape/pose transfer experiments further demonstrate the usefulness of NPMs. Code is publicly available at </em><a href="https://pablopalafox.github.io/npms"><em>this https URL</em></a><em>.</em></p><h3>1. Introduction</h3><p>The title alone carries a lot of questions: What are deformable shapes? What are parametric models? How are neural networks used for this modeling? Let’s start with each of them one by one.</p><p><strong>What are deformable shapes?</strong><br>Deformable models are curves or surfaces defined within an image domain that can move under the influence of forces.</p><p><strong>What are parametric models?</strong><br>This is a way of 3D shape representation which maps a parameter domain to the 3D surface. A simple 2D example would be x = cos(t) and y = sin(t) are parametric representations of a circle.</p><p>Constructing such a model for deformable shapes or even rigid shapes is quite complex and many times requires manual intervention and domain knowledge. This paper proposes Neural Parametric Models (NPMs), wherein they learn both the shape and pose representation that can be used like a traditional parametric model to fit to new observations. The authors demonstrate its performance on the task of reconstruction and tracking of monocular depth sequences, as well as their capability in shape and pose transfer and interpolation. Their main contributions can be stated as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3sIZtsPqt3c9uOmh8t34qA.png" /></figure><h3>2. Related Work</h3><p>“DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation” (<a href="https://openaccess.thecvf.com/content_CVPR_2019/papers/Park_DeepSDF_Learning_Continuous_Signed_Distance_Functions_for_Shape_Representation_CVPR_2019_paper.pdf">link</a>) proposes a feed-forward network to predict an SDF value given a query location conditional on a latent code that represents the shape, trained in an auto-decoder fashion. To know in-depth about how it works, read <a href="https://medium.com/p/147af4740485">this blog</a>.</p><p>However, DeepSDF produces static surfaces that are not controllable. This paper proposes to use the representation power of DeepSDF to learn representations for both shape and pose, to enable controllable 3D models.</p><h3>3. Method</h3><p>Neural Parametric Models (NPMs) are a learned approach to construct parametric 3D models from a dataset of different posed identities. A brief overview is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7n2y_m7Uk3JhenrFX7j5Kw.png" /></figure><p>The dataset consists of a meshes featuring a set of shape identities from the same class category in different poses. However, it must follow 2 constraints:</p><ol><li>Each shape identity is poses canonically (e.g. T-pose)</li><li>Each shape identity has several posed or deformed instances for which surface correspondences to the canonical shape are available</li></ol><h3>3.1 Learned Shape Space</h3><p>The shape space is learned in a similar manner to the DeepSDF paper. It is learned by an MLP in an auto-decoder fashion which predicts the implicit SDF for shape identities in their canonical pose.</p><p>All the shapes are first normalized to reside within a unit bounding box and then made watertight. For each shape in the training set, points are sampled alongside their SDF value in two ways:</p><ol><li>Near surface points by adding random noise to surface points</li><li>Uniformly sampled points in the unit bounding box</li></ol><p>Using this sampled data, the Shape MLP is trained.</p><h3>3.2 Learned Pose Space</h3><p>The pose space is learned by an MLP which predicts the deformation field, that is, it maps points from the canonical pose to the corresponding point location in the space of the deformed pose. This prediction is conditional on both the learned shape space and learned pose space.</p><p>This MLP is trained on a set of deformation fields from the shapes’ canonical pose to the arbitrary poses. However, how do we get the dataset for training such a model?</p><p>They sample surface points on the previously normalized canonical shapes for each shape in the dataset, alongside storing the barycentric weights for each sampled point. Each point is then randomly displaced a small distance <em>d</em> along the normal direction of the corresponding triangle in the mesh. Then, for each posed shape available for the canonical shape, they compute the corresponding point using the barycentric weights and <em>d</em> to sample to posed mesh. This in turn gives the deformation field defined near the surface.</p><p>The training is carried out as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-UxUX0LIsCNnbaRi5Kzg4g.png" /></figure><h3>3.3 Inference-time Optimization</h3><p>Once our latent representations of shape and pose have been constructed, one can leverage these spaces at test time by traversing them to solve for the latent codes that best explain an input sequence of L depth maps. The authors thus fit NPMs to the input data by solving for the unique latent shape code and the L per-frame latent pose codes that best explain the whole sequence of observations.</p><p>The first step is obtain initial estimates of the shape code and pose codes. This is done via two 3D convolutional encoders, one for shape and pose codes respectively. Both encoders take as input the back-projected depth observation in the form of a partial voxel grid. It is passed through 3D convolutional and fully connected layer to output a latent code estimate. It is trained using the latent shape and pose codes learned from the training set.</p><p>Once one has the initial shape code, one can extract the canonical shape surface. The authors state that from the canonical shape surface, they sample surface points and add random displacements to them. These are our input points.</p><p>Then, they minimize the following loss over the shape code and its respective pose codes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NksT5eCCCum6WOgFdP5z6w.png" /></figure><p>The exact details about the loss can be found in the paper.</p><h3>4. Experiments</h3><p>The authors evaluate NPMs on the task of reconstruction from monocular depth sequence observations. They also demonstrate shape and pose transfer and lastly, show interpolation between learned shape and pose spaces.</p><p>The authors present a comprehensive comparison with state-of-the-art methods on clothed human datasets and show the general applicability by learning NPM for hands.</p><p>For evaluation, the authors report the following metrics: Intersection over Union (IoU), Chamfer-l2 (C-l2) and End-Point Error (EPE).</p><h3>4.1 Model Fitting to Monocular Depth Sequences</h3><h4><strong>Real human data</strong></h4><p>The authors present a comparison to the state-of-the-art on monocular depth data rendered from the CAPE dataset. NPMs clearly outperform previous approaches on all 3 metrics. The authors state that their approach to learn shape and pose spaces provides both effective shape and pose regularization over the manifolds, while capturing local details. This results in more accurate reconstruction and tracking performance. A qualitative comparison can be seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eHcTGc_DLCwVzcKvAShUiw.png" /></figure><h4>Effect of the encoder initialization</h4><p>In order to gauge the effectiveness of the encoder initialization for the shape and pose codes, they ran experiments with no shape encoder, no pose encoder and no shape &amp; pose encoders. In place of the encoder predicted initialization, they use the average shape and pose latent codes from the training set. The authors note that shape and pose code estimates provided by the encoders resulted in a closer initialization and led to an improvement in reconstruction and tracking performance.</p><h4>Synthetic human data</h4><p>The authors also evaluate on synthetic sequences from the DeformingThings4D dataset, wherein NPMs again outperform the previous approaches on all three metrics. Qualitative comparison can be seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rAQ2ApQcBR9EOMVGF1Y4Mg.png" /></figure><h4>4D point cloud completion</h4><p>The authors also compare this approach with a previous model called OFlow on their 4D point cloud completion task. For NPMs, only monocular depth sequence of depth maps are passed as input as compared to dense point cloud trajectories sampled for OFlow. However, even with more partial data, NPMs achieve significantly improved performance.</p><h4>Hand registration</h4><p>We have seen that NPMs can be constructed on various datasets with posed identities and now the authors demonstrate its applicability to hand data generated with the MANO model. The authors state that NPMs accurately capture both global structure as well as smaller-scale details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nQ5dEasuyK15HrlJkkgYjw.png" /></figure><h3>4.2 Shape and Pose Transfer</h3><p>Due to the different spaces of shape and pose representation, NPMs enable shape and pose transfer, that is, we can transfer a given shape to a specified pose (shape transfer) or a given shape to different poses (pose transfer).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*YX0ihRfMm9Rf-urUt9l_6A.png" /></figure><h3>4.3 Latent-Space Interpolation</h3><p>Similar to the DeepSDF paper, the latent spaces of shape and pose can be traversed to obtain novel shapes and poses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o6eOWHfu2yDhO-L6UwElKw.png" /></figure><h3>4.4 Limitations</h3><p>While NPMs demonstrate great potential for constructing and fitting learned parametric models, several limitations remain. The authors note that their implicit representation of shape and pose deformation can struggle with very flat surfaces as they comprise little volume and must have precisely defined inside and outside. They also state that while NPMs can capture fine-scale details, high frequency details (sharp edges) still remain challenging.</p><h3>5. Conclusion</h3><p>Neural Parametric Models enable the construction of learned parametric models with disentangled shape and pose representations which can accurately represent 4D sequences of dynamic objects. The authors demonstrate its performance on both real-world and synthetic data, proving how it can learn implicit functions to expressively capture local details in shape and pose.</p><h3>6. Final Words</h3><p>The paper is quite comprehensive and well-written. The approach builds upon DeepSDF for deformable shapes to outperform existing benchmarks. However, one thing to note is that training (~8 days) and inference-time optimization (100 frames takes ~4 hours) take a significant amount of time on a GeForce RTX 3090.</p><h3>7. References</h3><ul><li>Palafox, Pablo, et al. “Npms: Neural parametric models for 3d deformable shapes.” <em>Proceedings of the IEEE/CVF International Conference on Computer Vision</em>. 2021.</li><li>Park, Jeong Joon, et al. “Deepsdf: Learning continuous signed distance functions for shape representation.” Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2019.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=843a06504c9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Summary: DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation]]></title>
            <link>https://karan3-zoh.medium.com/paper-summary-deepsdf-learning-continuous-signed-distance-functions-for-shape-representation-147af4740485?source=rss-6d6306dfd70d------2</link>
            <guid isPermaLink="false">https://medium.com/p/147af4740485</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[representation]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[3d-modeling]]></category>
            <dc:creator><![CDATA[Karan Uppal]]></dc:creator>
            <pubDate>Thu, 27 Jul 2023 16:04:02 GMT</pubDate>
            <atom:updated>2023-07-27T16:04:02.191Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Park, Jeong Joon, et al. Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2019.</em></p><p><a href="https://openaccess.thecvf.com/content_CVPR_2019/papers/Park_DeepSDF_Learning_Continuous_Signed_Distance_Functions_for_Shape_Representation_CVPR_2019_paper.pdf">Link to original paper</a></p><p><strong><em>Abstract:</em></strong><em> Computer graphics, 3D computer vision and robotics communities have produced multiple approaches to representing 3D geometry for rendering and reconstruction. These provide trade-offs across fidelity, efficiency and compression capabilities. In this work, we introduce DeepSDF, a learned continuous Signed Distance Function (SDF) representation of a class of shapes that enables high quality shape representation, interpolation and completion from partial and noisy 3D input data. DeepSDF, like its classical counterpart, represents a shape’s surface by a continuous volumetric field: the magnitude of a point in the field represents the distance to the surface boundary and the sign indicates whether the region is inside (-) or outside (+) of the shape, hence our representation implicitly encodes a shape’s boundary as the zero-level-set of the learned function while explicitly representing the classification of space as being part of the shapes’ interior or not. While classical SDF’s both in analytical or discretized voxel form typically represent the surface of a single shape, DeepSDF can represent an entire class of shapes. Furthermore, we show state-of-the-art performance for learned 3D shape representation and completion while reducing the model size by an order of magnitude compared with previous work.</em></p><h3>1. Introduction</h3><p>Prior research in computer graphics and 3D computer vision has proposed numerous approaches for representing 3D shapes. Such methods are useful for storing memory-efficient representations of known shapes, generating new shapes, and fixing/reconstructing shapes based on limited or noisy data.</p><p><strong>But wait a minute! What is 3D shape representation?</strong></p><p>Geometry processing is mostly about applying algorithms to geometric models. For these algorithms, we can identify a characteristic set of operations to perform the operations. However, we may notice that a few of the operations dominate the computation and hence we have to choose an appropriate representation that supports the efficient implementation of these operations. These include spline surfaces, triangle meshes, point clouds, regular grids, etc.</p><p>Directly storing a 3D shape using a point cloud, mesh, or voxels requires a lot of memory. Instead, we will usually want to store an indirect representation of the shape that’s more efficient. A simple 2D example of it is using the parametric form (x = r cos θ, y = r sin θ) to represent a circle.</p><p>The approach we will look at is called the signed distance function (SDF). Given a spatial [x, y, z] point as input, SDFs will output the distance from that point to the nearest surface of the underlying object being represented. The sign of the SDF’s output indicates whether that spatial point is inside (negative) or outside (positive) of the object’s surface. Using this, the surface can be identified by finding the locations at which the SDF is equal to zero.</p><p>Deep learning can be used to represent 3D shapes. To do this, we can train a neural network to output a representation of a 3D shape, allowing representations for a variety of shapes to be indirectly stored within the weights of the neural network. Using this, we can query the neural network to produce new shapes. This, in a better way and more specifically is called a generative model.</p><p>In this paper, the authors present a novel representation approach for generative 3D modelling that is efficient, expressive, and fully continuous, using the concept of an SDF. Their contributions are as follows:</p><ul><li>the formulation of generative shape-conditioned 3D modelling with a continuous implicit surface</li><li>a learning method for 3D shapes based on a probabilistic auto-decoder</li><li>the demonstration and application of this formulation to shape modelling and completion</li></ul><h3>2. Related Work</h3><p>In order to learn compact data representations, we can have an auto-encoder which is an encoder-decoder architecture to basically learn representations of your input and then using those representations, reconstruct it back. However, the authors propose using a decode-only network, wherein the latent vector assigned to each data point as well as the decoder weights are both optimized through backpropagation. For inference, an optimal latent vector is searched to match the new observation with fixed decoder parameters. The authors refer to this class of networks as auto-decoders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8j19Yw_wmAtzNmSd" /></figure><p>I found a reference for the same from a paper from 1998 titled: “Input-Training Neural Network Approach for Gross Error Detection”, wherein the auto-decoders are dubbed as Input-Training Networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sPBssCBLLuGmGbdK" /></figure><h3>3. Modeling SDFs with Neural Networks</h3><p>The authors describe modeling shapes as the zero iso-surface decision boundaries of feed-forward networks trained to represent SDFs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/0*_UXPG130jJ9LA5UD" /></figure><p>The key idea is to directly regress the continuous SDF from point samples using deep neural networks so that the resulting trained network is able to predict the SDF value of a given query point. The most direct application of this approach is to train a single deep network for a given target shape.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/0*-gVE25pZrpD40vOA" /></figure><p>Given a target shape, the authors prepare a set of pairs X which comprises of 3D point samples and their SDF values. Using this, a multi-layer fully connected neural network is trained to minimise the following loss function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*807Qi0No6Vqa5kzw" /></figure><p>One nice property of this approach is that accurate normals can be computed by calculating the derivative with respect to the query point.</p><h3>4. Learning the Latent Space of Shapes</h3><p>Training a specific neural network for each space is neither feasible nor very useful. Ideally, we would want to model a variety of shapes with a single neural network. To achieve this, the authors introduce a latent vector z as a second input to the neural network, which can be thought of as encoding the desired shape. Now the neural network is the function of a latent code and a query point which outputs the shape’s approximate SDF at that point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*XEYuyB_RlRclCopA" /></figure><p><strong>How can we achieve the latent vector for a shape?</strong></p><p>The authors use auto-decoder networks for learning a shape embedding without an encoder. Given a dataset of N shapes, the authors prepare a set of K sample point and their signed distance values. The latent vectors are initialized randomly from N(0, 0.01²). Now using the same loss function as before, the authors maximise the joint log posterior over all training shapes with respect to the individual latent vectors and network parameters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pBL1lQqYgRRuxwyu" /></figure><p>At inference time, the network parameters are fixed, and the shape code for each shape can be estimated via a maximum-a-posterior estimation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cCIFuiPK82N3omnb" /></figure><p>Crucially, this formulation is valid for SDF samples of arbitrary size and distribution. This implies that DeepSDF can handle any form of partial observations such as depth maps.</p><h3>5. Data Preparation</h3><p>The authors make use of the ShapeNet dataset which provides complete 3D shape meshes. To prepare data, they start by normalizing each mesh to a unit sphere and sampling 5,00,000 spatial points, with more aggressive sampling near the surface.</p><h3>6. Results</h3><p>To show the ability of DeepSDF in terms of generalization capability and to describe geometric details. They propose 4 experiments to test its ability to:</p><ol><li><strong>Represent training data</strong></li></ol><p>First, they evaluate the capacity of the model to represent known shapes (already in the training set) from only a restricted-size latent code. The metric used for comparison is Chamfer Distance (CD) which is the sum of the squared distance between nearest neighbour correspondences of two point clouds. The authors find that their proposed model significantly beats the existing state-of-the-art models by a large margin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Gu6oRZECv1Zsp63h" /></figure><p><strong>2. Use learned feature representations</strong></p><p>For encoding unknown shapes, it again significantly outperforms other models on a wide variety of shape classes (chair, plane, table, lamp, sofa). They note that other models fail to represent the fine details of the shapes but DeepSDF leads to more detailed reconstructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*47z7OPAMud_QMnEQ" /></figure><p><strong>3. Apply shape priors to complete partial shapes</strong></p><p>Shape completion amounts to solving for the latent code that best explains a partial shape observation. Given the latent vector, a complete shape can be rendered easily using the model. The authors test the completion scheme using single view depth observations and sample points from that image. The authors note that their model produces more visually pleasing and accurate shape reconstructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mqsUMQ81FeaM51In" /></figure><p><strong>4. Learn smooth and complete shape embeddings</strong></p><p>To show the learned shape embedding is complete and continuous, the authors render the results of the decoder when a pair of shapes are interpolated in the latent vector space. The note that the results suggest that the embedded continuous SDF’s are of meaningful shapes and that their representation extracts common interpretable shape features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k-H58ADEsLQ36H8j" /></figure><h3>7. Conclusion</h3><p>DeepSDF significantly outperforms the benchmarked methods across shape representation and completion tasks, with significantly less memory than previous models. They note that while point-wise forward sampling of a shape’s SDF is efficient, shape complete tasks take considerably more time due to the need for optimization over the latent vector. They hope to increase performance by replacing Adam with more efficient methods like Gauss-Newton. On another note, DeepSDF currently assumes models are in a canonical pose and as such completion in-the-wild requires more optimization.</p><h3>8. Final Words</h3><p>The paper is very well written, even me being a beginner to 3D deep learning was able to easily follow along. The approach is also quite novel and simplistic, generating significant results.</p><h3>9. References</h3><ul><li>Park, Jeong Joon, et al. “Deepsdf: Learning continuous signed distance functions for shape representation.” Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2019.</li><li>Reddy, V. N., and M. L. Mavrovouniotis. “An input-training neural network approach for gross error detection and sensor replacement.” <em>Chemical Engineering Research and Design</em> 76.4 (1998): 478–489.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=147af4740485" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Summary: DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition]]></title>
            <link>https://karan3-zoh.medium.com/decaf-a-deep-convolutional-activation-feature-for-generic-visual-recognition-b7f0e85e152c?source=rss-6d6306dfd70d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7f0e85e152c</guid>
            <category><![CDATA[artifical-intellegence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Karan Uppal]]></dc:creator>
            <pubDate>Mon, 26 Jun 2023 18:53:11 GMT</pubDate>
            <atom:updated>2024-06-05T17:22:57.022Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Donahue, Jeff, et al. International conference on machine learning. PMLR, 2014.</em></p><p><a href="https://arxiv.org/abs/1310.1531">Link to original paper</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nNKBO5ysBdPUmMVT" /></figure><p>DeCAF is probably one of the first papers to demonstrate the concept of transfer learning and how CNNs can be used effectively for a variety of visual recognition tasks. This paper investigates the usefulness of features extracted from a pretrained CNN to novel generic tasks and achieves state-of-the-art performance in most of them.</p><h3>1. Introduction</h3><p>The paper starts off by stating deep or layered compositional architectures should be able to capture salient aspects of a given domain through the discovery of salient features. Such models have been able to perform better than traditional hand-engineered representations in many domains, outperforming methods like HOG. It then talks about AlexNet and how such models perform extremely well in domains with large amounts of training data. But with limited training data, such architectures will generally dramatically overfit the training data. Thus, the authors plan to investigate the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L5oiQ7PIS6Z7rLP4" /></figure><p>Their goal is to verify whether visual features based on convolutional network weights trained on ImageNet outperforms a host of conventional visual representations on standard benchmark tasks, like object recognition, domain adaptation, subcategory recognition and scene recognition. They also plan to compare these to conventional feature representations.</p><h3>2. Deep Convolutional Activation Features</h3><p>The authors train AlexNet (in a similar fashion as the original paper) and then extract various features from this network, and evaluate the efficacy of these features on generic vision tasks. Their main goal is to answer the following two questions:</p><ul><li>Do features extracted from the CNN generalize to other datasets?</li><li>How do these features perform versus depth?</li></ul><p>They then visually compare the features obtained from DeCAF with current state-of-the-art methods. They run the t-SNE algorithm to find a 2-dimensional embedding of the high-dimensional feature space and plot them as points coloured depending on their semantic category in a particular hierarchy.</p><p>They first visualize the semantic segregation of the model by plotting the embedding of labels for higher levels of the WordNet hierarchy, for example, indoor and outdoor instances, for the validation set of ImageNet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1nOfz5vtQ_KYNfD9" /></figure><p>They note that the features extracted on the validation set using the first pooling layer, and the second to last fully connected layer, show a clear semantic clustering in the latter but not in the former, which is common deep learning knowledge that the first layers learn low-level features, whereas the latter layers learn higher-level features.</p><p>But this experiment was on a dataset on which the model was already trained on. The authors wanted to analyze what would have in the case of a different dataset. Hence, they utilise SUN-397 dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KRHhFpYCd89FihDh" /></figure><p>Even in this case, they note that the features show very good clustering of semantic classes and state that these features are an excellent starting point for generalizing to unseen classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8Qtf-7sJ_QOXFrSE" /></figure><p>The authors then state that a detailed analysis of the computation time over the multiple layers involved is still missing in the literature and hence to fill that gap, they perform a time analysis of the AlexNet model. They observe that the convolution and fully connected layers take most of the time to run, but the last few fully-connected layers require the most computation time as they involve large transform matrices.</p><h3>3. Experiments</h3><p>In each of the experiments, they take the activations of the nth hidden layer of the CNN as a feature DeCAFn. For e.g., DeCAF7 denotes features taken from the final hidden layer, DeCAF6 is the activations of the layer before DeCAF7 and so on. They took only DeCAF5, DeCAF6 and DeCAF7 as the earlier layers are unlikely to contain a richer semantic representation than the later features. They present results on multiple datasets to evaluate the strength of DeCAF for basic object recognition, domain adaptation, fine-grained recognition, and scene recognition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fVS5qSWaCunuSKoZ" /></figure><p>Making use of the Caltech -101 dataset, a logistic regression or support vector machine is trained on a random set of samples per class, and tested on the rest of the data, with parameters cross-validated for each split. The top-performing method trains a linear SVM on DeCAF6 with dropout, while the DeCAF5 features perform substantially worse than both the DeCAF6 and DeCAF7 feature. One important thing to note is that DeCAF7 features generally have an accuracy of about 1–2% lower than the DeCAF6 features on this task. This might be because these features can encode more meaningful and discriminative representations of the input data. On the other hand, the last layer might focus on fine-grained details that are more specific to the original task of the network. By using the second-to-last layer, one may leverage more generalizable features that can be helpful for other tasks or datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/0*IcjmndqbRCKVuSOT" /></figure><p>They also show how the performance of the two DeCAF6 with dropout methods above vary with the number of training cases per category. They state that their one-shot learning results suggest that with sufficiently strong representations like DeCAF, useful models of visual categories can often be learned from just a single positive example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jVNnvBR5WuWtqL3Q" /></figure><p>Next, they evaluate DeCAF for use on the task of domain adaptation, using the Office dataset. This dataset contains three domains: Amazon, which consists of product images taken from amazon.com; and Webcam and Dslr, which consists of images taken in an office environment using a webcam and DSLR camera, respectively. To analyze the ability of the model to accommodate to different domains, they visually compare DeCAF6 and SURF features, using t-SNE. They find that DeCAF not only provides better within-category clustering but also clusters same-category instances across domains. This indicates qualitatively that DeCAF removed some of the domain bias between the Webcam and DSLR domains. In the figure above, all images from the scissor class are well clustered and overlapping in both domains with DeCAF, while SURF only clusters a subset and places the others in disjoint parts of the space, closest to distinctly different categories such as chairs and mugs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DvAx3tIAy9ovFLEo" /></figure><p>To quantitatively validate this, they perform another experiment for the domain shifts Amazon-&gt;Webcam and DSLR-&gt; Webcam. They compare SURF with the DeCAF6, and DeCAF7 using an SVM and Logistic Regression trained in 3 ways: with only source data (S), only target data (T), and source and target data (ST). They conclude that DeCAF dramatically outperforms the baseline SURF feature available with the Office dataset.</p><p>Next, the authors tested the performance of DeCAF on the task of subcategory recognition on the Caltech-UCSD birds dataset. The results report that DeCAF together with a simple logistic regression obtains a significant performance increase over existing approaches, indicating that such features, although not specifically designed to model subcategory level differences, capture such information well.</p><p>Finally, they evaluate DeCAF on the SUN-397 large-scale scene recognition database. The authors believe that because they are applying DeCAF to a task for which it was not designed, it might be very challenging for the model unless the features are highly generic representations of the visual world. They train a model using the above strategies with DeCAF6 and DeCAF7, and see a performance improvement over the current state-of-the-art method.</p><h3>4. Discussion</h3><p>The paper analyzes the use of deep features applied in a semi-supervised multi-task framework. The authors quantitatively demonstrate that by using a large labelled object database to train a deep convolutional architecture, we can learn features that have sufficient generalization ability to perform a wide variety of tasks, including domain adaptation, fine-grained part-based recognition, and large-scale scene recognition.</p><h3>5. Final Words</h3><p>The paper is quite well-written and has exhaustive experiments. It is quite fundamental in regard to deep learning knowledge as it is one of the first use cases of transfer learning in CNNs with such experimentation.</p><h3>6. References</h3><p>Donahue, Jeff, et al. International conference on machine learning. PMLR, 2014</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7f0e85e152c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Summary: Dropout: A Simple Way to Prevent Neural Networks from Overfitting]]></title>
            <link>https://karan3-zoh.medium.com/dropout-a-simple-way-to-prevent-neural-networks-from-overfitting-d50186502d1d?source=rss-6d6306dfd70d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d50186502d1d</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Karan Uppal]]></dc:creator>
            <pubDate>Tue, 30 May 2023 10:52:42 GMT</pubDate>
            <atom:updated>2023-05-30T10:57:40.097Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Srivastava, Nitish, et al. The Journal of Machine Learning Research (2014)</em></p><p><a href="https://jmlr.org/papers/v15/srivastava14a.html">Link to original paper.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LFpKTHLwYR6neR-XcExzZg.png" /></figure><p>My first introduction to dropout was in Andrew Ng’s Deep Learning Specialisation on Coursera which gave a pretty neat intuition of how and why dropout works using a simple cat classifier example which has stuck with me ever since. Although this technique was already used in the AlexNet paper, this manuscript provides an in-depth understanding and analysis of dropout, with thorough experimentation.</p><h3>1. Introduction</h3><p>The paper starts off by stating that model combination nearly always improves performance. However, to combine neural network models, they should either be trained on different subsets of the data or have different architectures. Both of these scenarios pose challenges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fkPiV_TE3AHSSiactI_L5Q.png" /></figure><p>Using the Bayesian gold standard, the best way to average the predictions of several different models, weighing them by their posterior probability given the training data. Dropout proposes an approximation of this wherein they take an equally weighted geometric mean of the predictions of an exponential number of learned models that share parameters. Applying this technique is equivalent to sampling a subset of the actual architecture of the neural network where the parameters are being shared.</p><h3>2. Motivation</h3><p>The authors claim that the motivation for this technique comes from one of the drivers of mankind, sex.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6MHTbga0LkGPhF_YtzC7IA.png" /></figure><h3>3. Model Description</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_484ugOuWtnXr_Ca9YUZlg.png" /></figure><p>With dropout, the feed-forward operation becomes as shown below, where the vector r is a vector of independent Bernoulli random variables each of which has probability p of being 1. This amounts to sampling a sub-network from a larger network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*MMDh13qUrubvUnNTX4lfSg.png" /></figure><p>The change in the architecture is as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gjnD2HQwYE8TAt_30h9C-g.png" /></figure><p>At test time, the weights W are scaled as pW and the resulting neural network is used without dropout.</p><h3>4. Learning Dropout Nets</h3><p>Dropout neural networks can be trained using stochastic gradient descent in a manner similar to standard neural nets. But forward and backpropagation are done only on this thinned network. The authors state that a particular regularisation technique was found to be especially useful for dropout: max-norm regularisation. It can be described as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hzz4W0-xn_JchaEabDedOA.png" /></figure><p>They further state that dropout along with max-norm regularisation, large decaying learning rates and high momentum provide a significant boost over simply using dropout. They justify this by the following intuition: <em>Constraining weight vectors to lie inside a ball of fixed radius makes it possible to use a huge learning rate without the possibility of weights blowing up. The noise provided by dropout then allows the optimization process to explore different regions of the weight space that would have otherwise been difficult to reach. As the learning rate decays, the optimization takes shorter steps, thereby doing less exploration and eventually settling into a minimum.</em></p><p>The authors also note that dropout can be applied to finetune nets that have been pretrained by scaling the weights up by a factor of 1/p.</p><h3>5. Experimental Results</h3><p>The authors trained dropout neural networks for classification problems on a variety of datasets, demonstrating that dropout is a general technique for improving neural networks and is not specific to any particular application domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SyK2z-TcKvNFwckxNA00iA.png" /></figure><p>They achieve state-of-the-art performance on almost all of these datasets and even win the ILSVRC-2012 competition using dropout neural networks. One thing they note is that the improvement on the text dataset was much smaller as compared to that for the vision and speech datasets.</p><p>They further compare the technique with Bayesian Neural Networks. BNNs offer a proper way of performing model averaging over the space of neural network architecture and parameters. Here, each mode is weighed taking into account the prior and posterior probability. On the other hand, dropout performs an equally weighted average of exponentially many models with shared parameters. The authors conduct experiments that compare BNNs with dropout neural networks on the dataset where BNNs are known to obtain state-of-the-art results. They found that BNNs perform better than dropout but dropout improves significantly upon the performance of standard neural networks and outperforms all other methods.</p><h3>6. Salient Features</h3><p>The authors now explore the effect dropout has on the quality of features produced and sparsity of hidden unit activations; the effect of varying dropout rate and size of the training set; and compare dropout with Monte-Carlo Model averaging.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S2vHoxnOYX5daHF_SS7HaA.png" /></figure><p>In a standard neural network, each parameter receives a gradient which tells it how the parameter should change so that the loss is reduced, given what all the other units are doing. This may lead to co-adaptations between the units causing a loss of generalisation. For each hidden unit, dropout prevents co-adaptation by making the presence of other hidden units unreliable. A hidden unit must perform well in a variety of different contexts provided by the other hidden units. The figure above gives a visualisation of the features produced with and without dropout. The hidden units using dropout seem to detect edges and spots in different parts of the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LMoEEOw13Eghiq_Ld1jyjQ.png" /></figure><p>The authors also note that a side-effect of using dropout is sparse representations, even when no sparsity-inducing regularizers are present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R4YcuMUl2fF2n_gHTMNA6w.png" /></figure><p>Next, the authors experiment with different values of p, keeping the number of hidden units n constant. In this case, having a small p means very few units will turn on during training, leading to underfitting. As p increases the error goes down and then increases as p becomes closer to 1.</p><p>In another variation of the same, the authors keep pn constant, while varying the value of p. This means that networks that have a small value of p will have a large number of hidden units, and vice-versa. However, the test networks will of different sizes. In this case, values of p that are close to 0.6 seem to perform best for their choice of pn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TF5k919_KAMFf8hwjnMnWw.png" /></figure><p>Next, the authors experiment to gauge the effect of changing dataset size when dropout is used. They observe that for very small datasets (100, 500), dropout does not give any improvements. The model has enough parameters that it can overfit the training data. As the size of the dataset is increased, the gain from performing dropout increases and then declines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jCRrRQUzk0-rpoAUxXGv-Q.png" /></figure><p>During test time using dropout, we approximate model combinations by scaling down the weights of the trained neural networks. A more correct way of averaging is to sample k neural nets for each test case using dropout and average their predictions. As k tends to infinity, the model average gets close to the true model average. From the above figure, it can be seen that when k=50, the Monte-Carlo method becomes as good as the approximate method, suggesting that the weight scaling method is a fairly good approximation of the true model average.</p><h3>7. Multiplicative Gaussian Noise</h3><p>This section is an interesting insight by the authors wherein they generalise dropout as multiplying the activations with random variables drawn from probability distributions. They state that multiplying by a random variable drawn from N(1,1) works just as well or perhaps better than using Bernoulli noise. It is somewhat math-heavy and it is better if one reads this section directly from the paper.</p><h3>8. Conclusion</h3><p>The authors state that dropout is a general technique for improving neural networks by reducing overfitting. It breaks up co-adaptations by making the presence of any particular hidden unit reliable and thereby, reduces overfitting. One of the drawbacks of dropout is that it increases training time. A dropout network typically takes 2–3 times longer to train than a standard neural network of the same architecture. A major cause of this increase is that the parameter updates are very noisy. However, it is likely that this stochasticity prevents overfitting.</p><h3>9. Final Words</h3><p>The paper is extremely well written and is quite easy to understand, alongside providing an in-depth analysis of one of the most important training techniques.</p><h3>10. References</h3><p>Srivastava, Nitish, et al. The Journal of Machine Learning Research (2014)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d50186502d1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Summary: Maxout Networks]]></title>
            <link>https://karan3-zoh.medium.com/paper-summary-maxout-networks-c9a08ef6d078?source=rss-6d6306dfd70d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9a08ef6d078</guid>
            <category><![CDATA[academic-writing]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Karan Uppal]]></dc:creator>
            <pubDate>Thu, 12 Jan 2023 13:17:50 GMT</pubDate>
            <atom:updated>2023-01-12T13:17:50.274Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Goodfellow, Ian, et al. “Maxout networks.” International conference on machine learning. PMLR, 2013.</em></p><p><a href="https://arxiv.org/abs/1302.4389">Link to original paper</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/0*SUV9KNKAMZQ_DVda" /></figure><p>Starting off the year with a paper by the father of GANs, we take a look at a unique activation function called Maxout. It is a piecewise linear function that returns the maximum of the inputs, designed to be used in conjunction with dropout, hence the name. The paper thoroughly analyses the performance of Maxout and achieves state-of-the-art performance on five different benchmark tasks.</p><h3>1. Introduction</h3><p>The paper starts off by explaining Dropout. Dropout provides an inexpensive and simple means of both training a large ensemble of models that share parameters and approximately averaging together these models’ predictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mvjSaWfHcUo_OFpd" /></figure><p>The authors state that training using dropout differs a lot from ordinary SGD. Under the dropout regime, each update can be seen as making a significant update to a different model on a different subset of the training set. Another thing they state is that dropout model averaging is only an approximation when applied to deep models. Thus, explicitly designing models to minimize these weaknesses can lead to better optimization.</p><h3>2. Review of Dropout</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_myHb4pHOGrKHsVx" /></figure><p>The authors give a brief description of dropout and similarities of the technique with bagging. It differs from bagging in that each model is trained for only one step and all of the models share parameters. One problem arises that it is not obvious how to average all the sub-models’ predictions. It turns out that for a single-layer neural network with a softmax activation (logistic regression), the average prediction of exponentially many sub-models can be computed by running the full model with all weights divided by 2. This also holds true for a neural network with all linear layers. For more general networks, this weight scaling is only an approximation but performs well in practice.</p><h3>3. Description of Maxout</h3><p>Maxout model uses a new type of activation function, which the authors call the maxout unit. A hidden layer of the model implements the following operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/0*9y1s5lbyH6OcuONd" /></figure><p>When training with dropout, we perform the elementwise multiplication with the dropout mask immediately prior to the multiplication by the weights in all cases, ensuring that no input is dropped to the max operator.</p><p>A single maxout unit can be interpreted as making a piecewise linear approximation to an arbitrary convex function. They are, in a sense, learning the activation function of each hidden unit. The example below showcases how it can approximate convex functions in 2D.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xdhtjkfwaxy2Dg4o" /></figure><p>In a convolutional network, a maxout feature map can be constructed by taking the maximum across k affine feature maps (i.e., pool across channels), the example for which is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*f1oCZqWCfhrAKHY1" /></figure><h3>4. Maxout is a universal approximator</h3><p>A standard MLP with enough hidden units is a universal approximator. The authors argue that a maxout model with just two hidden units (provided each individual maxout unit may have arbitrarily many affine components) can approximate, arbitrarily well, any continuous function. An outline of the proof is illustrated below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NAfNno3WagD5ObhW" /></figure><p>We will now go over the formal proof in a not-so-formal way:</p><p><strong>Proposition 4.1:</strong> <em>Any continuous piece-wise linear function can be expressed as a difference of two convex piece-wise linear functions.</em></p><p><strong>Proposition 4.2:</strong> <em>Let C be a compact domain belonging to real n-dimensions, f : C -&gt; R be a continuous function and ε &gt; 0 be any positive real number. Then there exists a continuous piece-wise linear function g, (depending upon ε), such that for all v belonging to C, | f(v) — g(v) | &lt; ε</em></p><p>The proof is then laid out as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Nvdr_CWTcMvG_IwJ" /></figure><h3>5. Benchmark Results</h3><p>To evaluate the performance of maxout networks, the authors experiment on four benchmarks datasets (MNIST, CIFAR-10, CIFAR-100 and SVHN) and set the state-of-the-art on all of them. For exact model desgin, refer to the paper.</p><h3>6. Comparison to rectifiers</h3><p>The authors compare the performance of maxout with ReLU, to verify whether the performance gain is due to improved preprocessing/larger models, rather than by the use of maxout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AvahZmJsCNW0IaqI" /></figure><p>The authors run a large cross-validation experiment as shown above, which clearly indicate that maxout offers a clear improvement over rectifiers. They also found that their preprocessing and size of models improves ReLU and dropout beyond the previous state-of-the-art results.</p><h3>7. Model Averaging</h3><p>When using dropout, we know that for averaging sub-models we divide the weights by 2, which gives us the exact model averaging for a single-layer model. This same concept can be extended to multiple linear layers (although they have the same representational power as a single layer). The authors then argue the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mTMcsvqkv3eYVQ8z" /></figure><p>They further state that dropout training encourages maxout units to have large linear regions around inputs. This indicates that dropout will do exact model averaging for any activation provided that it is locally linear among the space of inputs to each layer that are visited by applying different dropout masks. Thus, maxout units make the network act like a linear one, making the approximate model averaging more exact (in contrast to a network with nonlinear units).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LjD-DOJSf-cA2TNU" /></figure><p>To test this theory, they compared maxout with a tanh network. It was found that the KL divergence between the approximate model average and the sampled model average was smaller for maxout, indicating that maxout was doing more effective model averaging.</p><h3>8. Optimization</h3><p>The authors state that maxout is effective as compared to rectifier units becasue it is easier to train with dropout than a max-pooled ReLU network, particularly with many layers. They empirically verify this by the following experiment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wuaytetHSZCEqnnm" /></figure><p>They trained very deep and narrow models on the MNIST dataset, noting the train and test errors for varying depths. Maxout optimization degrades gracefully with depth but pooled rectifier units worsen noticeably at 6 layers and dramatically at 7.</p><p>Next, the authors argue that by using ReLU, we include 0 in the activation function which blocks the gradient flow from flowing through the unit, leading to saturation. Maxout doesn’t suffer from this problems because gradient always flows through every maxout unit, even in the case of 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8KiJls2moSHSvMSK" /></figure><p>Active ReLU units become inactive at a greater rate than inactive units become active when training with dropout. But maxout units, which are always active, transition between positive and negative activations at about equal rates in each direction. This is illustrated in the above figure. They hypothesize that the high proportion of zeros and the difficulty of escaping them impairs the optimization performance of ReLU relative to maxout.</p><h3>9. Conclusion</h3><p>The authors propose a new activation function called maxout which is particularly well suited for training with dropout. They empirically showcase the model averaging behaviour of maxout networks as well as its ability to train deeper networks. The state-of-the-art performance of their approach on several reputed benchmark tasks further illustrates the novelty and usefulness of maxout networks.</p><h3>10. Final Words</h3><p>The paper is quite well written and easy to understand if one gives some time. However, certain analysis (for example, variance of gradient experiment) is not explained well and are not easily grasped.</p><h3>11. References</h3><p>Goodfellow, Ian, et al. “Maxout networks.” International conference on machine learning. PMLR, 2013.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9a08ef6d078" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Summary: Adam: A Method for Stochastic Optimization]]></title>
            <link>https://karan3-zoh.medium.com/paper-summary-adam-a-method-for-stochastic-optimization-4b0a030a019f?source=rss-6d6306dfd70d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b0a030a019f</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[academic-writing]]></category>
            <category><![CDATA[artifical-intellegence]]></category>
            <dc:creator><![CDATA[Karan Uppal]]></dc:creator>
            <pubDate>Thu, 04 Aug 2022 08:44:16 GMT</pubDate>
            <atom:updated>2022-08-04T08:44:16.534Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Kingma, Diederik P., and Jimmy Ba. arXiv preprint arXiv:1412.6980 (2014)</em></p><p><a href="https://arxiv.org/abs/1412.6980v8?hl=pl">Link to original paper</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UWMdgB7AowcLbug0" /></figure><p>You pick up a paper and you come across this at the end of the first page, you know it is going to be an interesting read.</p><p><strong>Abstract:</strong><em> We introduce Adam, an algorithm for first-order gradient-based optimization of stochastic objective functions, based on adaptive estimates of lower-order moments. The method is straightforward to implement, is computationally efficient, has little memory requirements, is invariant to diagonal rescaling of the gradients, and is well suited for problems that are large in terms of data and/or parameters. The method is also appropriate for non-stationary objectives and problems with very noisy and/or sparse gradients. The hyper-parameters have intuitive interpretations and typically require little tuning. Some connections to related algorithms, on which Adam was inspired, are discussed. We also analyze the theoretical convergence properties of the algorithm and provide a regret bound on the convergence rate that is comparable to the best known results under the online convex optimization framework. Empirical results demonstrate that Adam works well in practice and compares favorably to other stochastic optimization methods. Finally, we discuss AdaMax, a variant of Adam based on the infinity norm.</em></p><p>Stochastic gradient-based optimization is of core practical importance in many fields of science and engineering. The authors propose Adam, a method for efficient stochastic optimization that only requires first-order gradients with little memory requirement. They also discuss the theoretical convergence properties and show that the convergence rate is comparable to the current best-known results. Finally, they introduce a variant to the Adam method based on the infinity norm.</p><h3>1. Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5xug07WRlB_1NpdI" /></figure><p>They explain their novel optimizer, Adam, derived from adaptive moment estimation. This is designed to combine the advantages of AdaGrad and RMSProp, having it work well in the case of spare gradients as well as online/non-stationary settings. They highlight other advantages including, invariant to gradient rescaling, bounding of stepsize by the learning rate, and step size annealing.</p><h3>2. Algorithm</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Wx34uoX8QUbSMi4x" /></figure><p>The pseudo-code for Adam is given above. The algorithm updates exponential moving averages of the gradient (mt) and the squared gradient (vt) where the hyper-parameters β1, β2 ∈ [0, 1) control the exponential decay rates of these moving averages. The moving averages themselves are estimates of the 1st moment (the mean) and the 2nd raw moment (the uncentered variance) of the gradient. However, these values are initialised with 0, leading to moment estimates that are biased towards zero during the initial steps. This is corrected by applying bias correction to both mt and vt.</p><p>Next, the authors discuss the bound of the stepsize, illustrating that in a general case, the upper bound is the learning rate. They also define a term called the signal-to-noise ratio (SNR) which is defined as mt/√vt. If the value of SNR is low, the stepsize will be close to zero. This is desired as a smaller SNR means that there is greater uncertainty about whether the direction of mt corresponds to the direction of the true gradient. The SNR also tends to zero near the optimum, leading to smaller stepsize in the space (a sort of annealing).</p><h3>3. Initialisation Bias Correction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DZ07CFfUqgs4H6s8" /></figure><p>In this section, the authors derive the bias correction for the 2nd-moment estimates. The terms are described above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GtctBNHJAZnY1ajs" /></figure><p>What is left in the expectation calculation is used for the bias correction. We can take ζ = 0 if the second moment is stationary, otherwise, it can be kept small as β assigns small weights to gradients far in the past.</p><h3>4. Convergence Analysis</h3><p>In this section, the authors cover the theoretical guarantee of the convergence of the Adam optimizer. The proofs are given in the appendix of the paper if you want to know more about them.</p><p>One interesting thing that they highlight is that decaying β1,t towards zero is important in their theoretical analysis and also matches previous empirical findings as it can improve convergence.</p><h3>5. Related Work</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*Nkvh1D1AsiP1J9gz" /></figure><p>The authors start with the relationship between RMSProp with momentum and Adam. RMSProp with momentum generates its parameter updates using momentum on the rescaled gradient, whereas Adam updates are directly estimated using a running average of the first and second moment of the gradient. It also lacks a bias-correction term.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/0*KftB03PJ-6tqN9yw" /></figure><p>AdaGrad is an algorithm that works well for sparse gradients. It can be thought of as the version of Adam with β1 = 0, infinitesimal (1 − β2), without bias correction.</p><h3>6. Experiments</h3><p>To empirically evaluate the proposed method, the authors conduct a series of experiments on machine learning tasks. They also investigate the use of bias correction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NGoD3_IJ_FsLCvQ3" /></figure><p>The first experiment was on a logistic regression model using the MNIST dataset. They compare Adam to accelerated SGD with Nesterov momentum and Adagrad. As seen above, Adam yields similar convergence as SGD with momentum and both converge faster than Adagrad.</p><p>The advantage of using AdaGrad is that it can work with spare features as well. In order to gauge performance of Adam in such a task, they again train a logistic regression model using the IMDB reviews dataset. They observe that AdaGrad outperforms SGD with Nesterov momentum by a large margin both with and without dropout noise, while Adam converges as fast as Adagrad.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p4-tCe2JJGYXma-M" /></figure><p>The next experiment dealt with the training of a multilayer neural network on the MNIST dataset. They compared the effectiveness of Adam to other stochastic first-order methods on multi-layer neural networks trained with dropout noise, showcasing that Adam achieves better convergence. They also compare Adam with a newly proposed quasi-Newton method called sum-of-functions (SFO). They find that Adam makes faster progress in terms of both the number of iterations and wall-clock time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-QOseqI1eWOyG7TL" /></figure><p>The third experiment dealt with training a deep CNN on the CIFAR-10 dataset. Although both Adam and Adagrad make rapid progress in lowering the cost in the initial stage of the training, as shown above, Adam and SGD eventually converge considerably faster than Adagrad for CNNs. They also notice that the second-moment estimate vt vanishes to zeros after a few epochs and is dominated by the ε. Hence the second-moment estimate is a poor approximation to the geometry of the cost function in CNNs as compared to a fully connected network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n3ojUlecf-PZ7Rfl" /></figure><p>The final experiment evaluates the effect of the bias correction terms. They take up the task of training an autoencoder with varying values of β1 and β2, as shown above. Values β2 close to 1 lead to instabilities in training when no bias correction term was present, especially at the first few epochs of the training. The best results were achieved with small values of (1−β2) and bias correction; this was more apparent towards the end of optimization when gradients tend to become sparser as hidden units specialize to specific patterns.</p><h3>7. Extensions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M4Zcki-ZXzk6UQyX" /></figure><p>The authors propose a variant of the Adam optimizer based on the infinity norm wherein the L2 norm is replaced by the Infinity norm. The derivation can be understood from the paper quite easily. The pseudo-code for the same is given above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t_-fhKLmsU0HSI8h" /></figure><p>They also propose temporal averaging over the model parameters. Since the iterations are noisy due to stochastic approximations, averaging will lead to better generalization performance.</p><h3>8. Conclusion</h3><p>The authors have proposed a simple and computationally efficient algorithm for gradient-based optimization of the stochastic objective function, combining the advantages of both RMSProp and AdaGrad. The experimental results confirm Adam to be a versatile optimizer for both convex and non-convex optimisation tasks in the field of machine learning.</p><h3>9. Final Words</h3><p>The paper introduces Adam in a coherent manner which is easy to follow. The math in section 4 (Convergence Analysis) is a bit hard to follow as I am not too familiar with such analysis. Other than that, the rest of the paper is quite intuitive and backed by lots of experimental results.</p><h3>10. References</h3><p>Kingma, Diederik P., and Jimmy Ba. “Adam: A method for stochastic optimization.” arXiv preprint arXiv:1412.6980 (2014).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b0a030a019f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Summary: On the importance of initialization and momentum in deep learning]]></title>
            <link>https://karan3-zoh.medium.com/paper-summary-on-the-importance-of-initialization-and-momentum-in-deep-learning-8b8121d21aa9?source=rss-6d6306dfd70d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b8121d21aa9</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[academia]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Karan Uppal]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 20:02:04 GMT</pubDate>
            <atom:updated>2022-07-28T20:04:49.164Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Sutskever, Ilya, et al. International conference on machine learning. PMLR, 2013</em></p><p><a href="https://proceedings.mlr.press/v28/sutskever13.html">Link to original paper</a></p><p>This paper showcases how momentum alongside well-designed random initialisation of neural networks can improve the training process.</p><p><strong>Abstract:</strong> <em>Deep and recurrent neural networks (DNNs and RNNs respectively) are powerful models that were considered to be almost impossible to train using stochastic gradient descent with momentum. In this paper, we show that when stochastic gradient descent with momentum uses a well-designed random initialization and a particular type of slowly increasing schedule for the momentum parameter, it can train both DNNs and RNNs (on datasets with long-term dependencies) to levels of performance that were previously achievable only with Hessian-Free optimization. We find that both the initialization and the momentum are crucial since poorly initialized networks cannot be trained with momentum and well-initialized networks perform markedly worse when the momentum is absent or poorly tuned. Our success training these models suggests that previous attempts to train deep and recurrent neural networks from random initializations have likely failed due to poor initialization schemes. Furthermore, carefully tuned momentum methods suffice for dealing with the curvature issues in deep and recurrent network training objectives without the need for sophisticated second-order methods.</em></p><p>The effectiveness of stochastic gradient descent can be increased by having better well-designed random initialisation and by the use of momentum methods. The paper explores the usage of momentum for training DNNs and showcases how a first-order method can effectively train a neural network without the need for complex second-order methods.</p><h3>1. Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BmF4BUpHhYe7rwGo" /></figure><p>The authors highlight a state-of-the-art optimization method, called Hessian-free Optimization (HF) which will later be used to compare to their own proposed methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WAR-f_8ZxzOdfkvQ" /></figure><p>The authors further highlight that momentum performs better than even HF at some tasks and have done an analysis of the momentum methods with different types of initialisations. They will study the method with 2 tasks: training an autoencoder and training an RNN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lgq922jYBbkQmCmV" /></figure><p>There was previous work done regarding the use of momentum to train neural network models but it never realised its importance. An explanation for the same is provided above by them.</p><h3>2. Momentum and Nesterov’s Accelerated Gradient</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VPhPsU9Vf1vHiNN8" /></figure><p>The authors first highlight the classical momentum (CM). The update equations are given above. The basic idea behind CM is that it accumulates a velocity vector in directions of persistent reduction in the objective across iterations. Directions of low-curvature which are suffering from a slow local change in their reduction, these will tend to persist across iterations and hence be amplified by the use of CM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/0*6KfJxd15YfM0O74Q" /></figure><p>Nesterov’s Accelerated Gradient (NAG) is now described by the authors (update equations given above).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JfJYRFXZh_UEiYPt" /></figure><p>While CM computes the gradient update from the current position θt, NAG first performs a partial update to θt, computing θt + μvt, which is similar to θt+1, but missing the as yet unknown correction. This benign-looking difference seems to allow NAG to change v in a quicker and more responsive way, letting it behave more stably than CM in many situations, especially for higher values of μ.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GBMXKx7l2gQ8LU2g" /></figure><p>The reason behind the effectiveness of NAG over CM is explained via an example above. While each iteration of NAG may only be slightly more effective than CM at correcting a large and inappropriate velocity, this difference in effectiveness may compound as the algorithms iterate.</p><p>Next, some mathematics is given which is elucidated in the appendix. I’d suggest a reading to help understand it better at the end of the summary. It is at Distill and has some cool visualisation which helps understand this better. The conclusion from the above is as follows:</p><ul><li>CM and NAG become equivalent when ε is small (when ελ &lt;&lt; 1 for every eigenvalue λ of A), so NAG and CM are distinct only when ε is reasonably large.</li><li>When ε is relatively large, NAG uses smaller effective momentum for the high-curvature eigen-directions, which prevents oscillations (or divergence) and thus allows the use of a larger µ than is possible with CM for a given ε</li></ul><h3>3. Deep Autoencoders</h3><p>Next, the authors propose to test their assumptions through an experiment of training an autoencoder. Their aim is to investigate the performance of momentum from well-designed random initialisations, to explore the scheduling of µ and to compare NAG and CM. The networks used the standard sigmoid nonlinearity and were initialized using the “sparse initialization” technique (SI).</p><p>In this scheme, each random unit is connected to 15 randomly chosen units in the previous layer, whose weights are drawn from a unit Gaussian, and the biases are set to zero. This is further scaled by a scaling factor depending on the type of activation function used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YvdndWCf-zz4o-G2" /></figure><p>The momentum coefficient is scheduled and follows the above scheme. Previous works by Nesterov suggested decaying the momentum coefficient as training progressed to help in the fine-tuning. The reasoning behind this is explained ahead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hV2lYJkYrOSM2pi0" /></figure><p>The results show that NAG achieves the lowest published results on this set of problems, including HF. It also shows that larger values of µmax tend to achieve better performance and that NAG usually outperforms CM, especially when µmax is 0.995 and 0.999.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E9rC7LjP_bazlcUD" /></figure><p>They further highlight that reducing the momentum coefficient during the ‘transient stage’ of training leads to finer convergence to take place which wouldn’t be possible with high values of momentum coefficient as it leads to aggressive nature of CM / NAG. While a large value of µ allows the momentum methods to make useful progress along slowly-changing directions of low-curvature, this may not immediately result in a significant reduction in error, due to the failure of these methods to converge in the more turbulent high-curvature directions (which is especially hard when µ is large). Nevertheless, this progress in low-curvature directions takes the optimizers to new regions of the parameter space that are characterized by closer proximity to the optimum.</p><h3>4. Recurrent Neural Networks</h3><p>The author states that they found that momentum-accelerated SGD can successfully train such RNNs on various artificial datasets exhibiting considerable long-range temporal dependencies. This is unexpected because RNNs were believed to be almost impossible to successfully train on such datasets with first-order methods, due to various difficulties such as vanishing/exploding gradients. They also discuss on the type of initialisation scheme to use for RNNs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uNqVb0jedGx75kDI" /></figure><p>Their results show that despite the considerable long-range dependencies present in training data for these problems, RNNs can be successfully and robustly trained to solve them, through the use of the initialization discussed, momentum of the NAG type, a large µ, and a particularly small learning rate.</p><h3>5. Momentum and HF</h3><p>In this section, the author compares the HF method and derives an analogy for the same to the momentum method through its special initialisations. The authors use this to develop a more momentum-like version of HF which combines some of the advantages of both methods (see Table 1).</p><h3>6. Discussion</h3><ul><li>A large part of the remaining performance gap that is not addressed by using a well-designed random initialization is in fact addressed by careful use of momentum-based acceleration. Although careful attention must be paid to the momentum constant µ</li><li>Momentum-accelerated SGD, despite being a first-order approach, is capable of accelerating directions of low-curvature</li></ul><h3>7. Final Words</h3><p>The paper turns a bit mathematical at the end of section 2 which can be difficult to follow. I found <a href="https://distill.pub/2017/momentum/">this blog</a> on Distill which explains that part with amazing visualisations. Do read if you want a more in-depth analysis of momentum.</p><h3>8. References</h3><ul><li>Sutskever, Ilya, et al. “On the importance of initialization and momentum in deep learning.” International conference on machine learning. PMLR, 2013.</li><li>Goh, “Why Momentum Really Works”, Distill, 2017. <a href="http://doi.org/10.23915/distill.00006">http://doi.org/10.23915/distill.00006</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b8121d21aa9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Summary: Understanding the difficulty of training deep feedforward neural networks]]></title>
            <link>https://karan3-zoh.medium.com/paper-summary-understanding-the-difficulty-of-training-deep-feedforward-neural-networks-6f184ba5e6d6?source=rss-6d6306dfd70d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f184ba5e6d6</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[publishing]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[academia]]></category>
            <dc:creator><![CDATA[Karan Uppal]]></dc:creator>
            <pubDate>Tue, 19 Jul 2022 12:32:37 GMT</pubDate>
            <atom:updated>2022-07-19T15:04:39.546Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Glorot, Xavier, and Yoshua Bengio. JMLR Workshop and Conference Proceedings, 2010</em></p><p><a href="https://proceedings.mlr.press/v9/glorot10a.html">Link to original paper</a></p><p>This paper is one of the foundational papers of the deep learning domain, introducing mainly the Xavier initialisation and various visualisations to analyze the training process.</p><p><strong><em>Abstract:</em></strong><em> Whereas before 2006 it appears that deep multi-layer neural networks were not successfully trained, since then several algorithms have been shown to successfully train them, with experimental results showing the superiority of deeper vs less deep architectures. All these experimental results were obtained with new initialization or training mechanisms. Our objective here is to understand better why standard gradient descent from random initialization is doing so poorly with deep neural networks, to better understand these recent relative successes and help design better algorithms in the future. We first observe the influence of the non-linear activations functions. We find that the logistic sigmoid activation is unsuited for deep networks with random initialization because of its mean value, which can drive especially the top hidden layer into saturation. Surprisingly, we find that saturated units can move out of saturation by themselves, albeit slowly, and explaining the plateaus sometimes seen when training neural networks. We find that a new non-linearity that saturates less can often be beneficial. Finally, we study how activations and gradients vary across layers and during training, with the idea that training may be more difficult when the singular values of the Jacobian associated with each layer are far from 1. Based on these considerations, we propose a new initialization scheme that brings substantially faster convergence.</em></p><p>The effectiveness of deep learning models relies heavily on the choice of activation function and initialisation. This paper aims to analyze the effect of various activation functions on the overall training process as well as suggests a better initialisation than the then used unsupervised pretraining.</p><h3><strong>1. Deep Neural Networks</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UW9KErV44dw8hGsa" /></figure><p>The authors state that the classical methods of initialisation and training a neural network are falling behind recent methods in this domain. They wish to pursue this further and also provide a plausible explanation for the effectiveness of unsupervised pretraining.</p><p>They further state that the objective of the paper is to analyze the activations (watching for saturation of hidden units) and gradients, across layers and across training iterations. They will also evaluate the effect of these on the choice of activation function and initialisation.</p><h3>2. Experimental Setup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UCeXNK-n1qFXM3uN" /></figure><p>They utilise 4 datasets for their experiments: MNIST digits, CIFAR-10, Small ImageNet and their self-created dataset, Shapeset (described above).</p><p>They use feedforward neural networks with one to five layers, each having 1000 hidden units and a softmax logistic regression for the output layer. The learning rate for each model is optimized based on the validation set error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*NnyMpOSV097Cl790" /></figure><p>They ran all experiments with 3 different activation functions: Sigmoid, Hyperbolic Tangent and SoftSign. To compare them properly, they searched for the best hyperparameters (learning rate and depth) separately for each model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/0*BgWz7Wt8qWt7wxMp" /></figure><p>Finally, every model was initialised with biases set to 0 and the weight matrix initialised as above, where U stands for uniform distribution.</p><h3><strong>3. Effect of Activation Functions and Saturation During Training</strong></h3><p>The thing that caught my eye was the visualisations used here which was probably the first time someone was using them to analyze the training of a deep neural network. So please don’t mind if I spend the majority of the blog discussing them :P</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bNx0TxD4CINs6Jtl" /></figure><p>They first experimented with the Sigmoid activation function and found that the activation values of the last layer are quickly pushed to 0, while the other layers have a mean activation of more than 0.5 which decreases as we go from the input layer to the output layer. They found that the last layer may move out of the low saturation zone, although it may take several iterations of training (the graph above is of a depth 4 model, the 5 depth model never recovered).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mfVFKNxj19kDwCLf" /></figure><p>With the tanh activation function, they did not observe the kind of saturation behaviour of the top hidden layer observed with sigmoid networks, because of its symmetry around 0. One strange thing was that they was a sequentially occurring saturation phenomenon starting with layer 1 and propagating up in the network which can be seen in the top graph in Figure 3. The reason for this is unknown to the authors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UKU3NMlzuP1kKHTw" /></figure><p>The behaviour of the softsign activation function is explained above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W_f_h_IgcIFa7KcR" /></figure><p>Another interesting visualisation is shown above. Shown above are the activation values normalized histogram at the end of learning, averaged across units of the same layer. The top graph utilised the tanh activation function while the bottom used the softsign function.</p><p>The tanh graph has modes of the distribution of the activation mostly at the extremes (asymptotes -1 and 1) or around 0, while the softsign network has modes of activation around its knees (between the linear regime around 0 and the flat regime around -1 and 1). These are the areas where there is substantial non-linearity but where the gradients would flow well.</p><h3>4. <strong>Studying Gradients and their Propagation</strong></h3><p>They did a comparative study between negative log-likelihood loss and something called quadratic loss (Scaled Euclidean Loss used for Classification). Unsurprisingly, they found that the negative log-likelihood loss worked better.</p><p>Next, they studied how the information flow should occur from both a forward prop and backward prop point of view and derived a new initialisation scheme. This is a bit mathematical and a rough derivation of this can be found <a href="https://drive.google.com/file/d/1M3fGAA0-oHAlh3_CyqejzEU6xOC0F65o/view?usp=sharing">here</a> (please do feel free to correct me if I made any errors here). The conclusion from this was that they came up with a normalized initialisation. One important thing highlighted here was that the variance of the back-propagated gradients gets smaller as it is propagated downwards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/0*i4SZt0DN1gfGjLGm" /><figcaption>Normalised Initialisation</figcaption></figure><p>Finally, to validate the above theoretical ideas, they ran several experiments and observed the activations and gradients. Again, pretty great visualisations are shown which gives the reader an intuitive understanding of all this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EQpOcCJIqbh19O4Y" /></figure><p>Firstly, the activation values are found to have a more spread-out curve than the one without any normalized initialisation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KxoOBMXotMeURroSzM5zwg.png" /></figure><p>As stated above, the back-propagated gradients become slower as we go towards the output layer, but the variance of the weight gradient is roughly the same across all the layers (normal initialisation). This is explained by their theoretical analysis above and is tackled by their normalized initialisation.</p><h3><strong>5. Conclusion</strong></h3><ul><li>Monitoring activations and gradients across layers and training iterations is a powerful investigative tool for understanding training difficulties in deep nets.</li><li>Sigmoid activations (not symmetric around 0) should be avoided when initializing from small random weights, because they yield poor learning dynamics, with initial saturation of the top hidden layer.</li><li>The proposed normalized initialization can be quite helpful, presumably because the layer-to-layer transformations maintain magnitudes of activations (flowing upward) and gradients (flowing backward), and allows to eliminate a good part of the discrepancy between purely supervised deep networks and ones pre-trained with unsupervised learning.</li></ul><h3>6. Final Words</h3><p>The paper is extremely well written and is quite easy to understand. The visualisations are pretty great and provide a more in-depth view of the training process.</p><h3>7. Reference</h3><p>Glorot, Xavier, and Yoshua Bengio. “Understanding the difficulty of training deep feedforward neural networks.” Proceedings of the thirteenth international conference on artificial intelligence and statistics. JMLR Workshop and Conference Proceedings, 2010.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f184ba5e6d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>