<?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 Marn Yee Toh on Medium]]></title>
        <description><![CDATA[Stories by Marn Yee Toh on Medium]]></description>
        <link>https://medium.com/@marnyeetoh?source=rss-2433aaa996ed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*S8ppB3YLh8L-DyTi.jpg</url>
            <title>Stories by Marn Yee Toh on Medium</title>
            <link>https://medium.com/@marnyeetoh?source=rss-2433aaa996ed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 13:03:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marnyeetoh/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[Detecting Moods in Paintings]]></title>
            <link>https://medium.com/@marnyeetoh/detecting-moods-in-paintings-3a19bd06fb4d?source=rss-2433aaa996ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a19bd06fb4d</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Marn Yee Toh]]></dc:creator>
            <pubDate>Mon, 29 Apr 2019 08:44:10 GMT</pubDate>
            <atom:updated>2019-04-29T19:23:38.329Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>Convolutional Neural Nets, or more commonly known as CNNs, have been the main tool for classifying and identifying images. In this project, we tried to use CNNs to detect and interpret moods in paintings. As a further analysis, we also attempted ResNet34, a neural net which adds skip connections to a CNN architecture to prevent the issue of vanishing gradients in extremely deep networks.</p><h3>Exploring ResNets</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*kBlZtheCjJiA3F1e0IurCw.png" /><figcaption>Illustration of ResNet34 from the original paper</figcaption></figure><p>The idea of ResNets, or Residual Neural Networks centers around using skip connections to allow for propagation to follow the skip connections and ‘skip’ layers during training.</p><p>The most important benefit of Residual Neural Networks is to avoid vanishing gradients, which is a major problem in deep Convolutional Neural Nets. When a network has many layers, the earlier layers tend to receive vanishing gradients, reducing the CNN to a shallower net, in which most layers do not impact the final computation.</p><p>ResNets circumvent this by allowing gradients to ‘skip’ layers within the network.</p><h3>Exploring the Dataset</h3><p>We used data from the Behance Artistic Media Dataset which contains 389,000 crowd-labeled images. These images are mostly paintings, with styles ranging from pencil sketches to oil paintings and of various contents. Of the 389 000 images, only 80,000 of them are labelled with an emotion, and of those, we trained on 8,000 of them, due to size constraints.</p><h3>Our Final Model</h3><p>Our final model is a pre-trained ResNet34 augmented by freezing all layers of the model except for the last layer which is followed by Dropout (p=0.4), a Linear Unit, and a Softmax function.</p><h3>Results &amp; Analysis</h3><p>After training on an augmented pre-trained ResNet34, we found some really interesting results that verify the data hypotheses we had. Specifically, we hypothesized that the features identifying moods are:</p><ul><li>Low level features : Colors ( warm vs cool tones ), Image Brightness and Harmony and Tones.</li><li>High level features: Shapes &amp; Lines and Specific object features (i.e. skulls, sad faces)</li></ul><h4>Warm and Cool Colors</h4><p>The model performed really well when identifying colors associated with moods. The model clearly and consistently differentiated between warm and cool colors associated with the relevant moods. However, the model’s strength in identifying colors also introduced mistakes when the background was not a neutral color. Below are two examples of a correct identification based on color and the confusion with non-neutral background. The model mistakes a warm colored background for a happy picture, while missing contextual cues that should indicate scary. On the other hand, the model performed well when the background color suits the depiction of the relevant mood. The mistakes made clearly shows that color is a major feature for the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*ux2Zp0DmhywdidNpS5l3AA.png" /><figcaption>Model predicted scary correctly.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*e0wVsx5aGHYjAF93ZKSgZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*oene3rXyMc2_oFUQj7_48A.png" /><figcaption>Both images are mislabeled as happy by the model due to the orange background.</figcaption></figure><h4>Tints, Shades and Tones</h4><p>We first hypothesized that shades and tones are crucial to identifying mood in pictures. However, when changing the data representation to better identify hues and tones, test accuracy did not really increase. Still, it is worth investigating if hues and tones are as significant to identifying mood as higher order features.</p><p>While hues and tones are generally important to the picture, the model’s primary mistakes were in distinguishing higher order features between labels that feature very similar hues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*BEOjyooszwC1pYUk" /></figure><h4>Color Harmonies/ Lighting</h4><p>There is clear evidence that more contrast between colors and tones conveyed more `active’ moods (scary, happy) and smaller differences conveyed calmer moods (gloomy, peaceful).</p><p>For instance, in the case where we increased the brightness of the image, the model falsely predicts peaceful rather than happy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*T_LG7QmiQW_yzfHAjHfa2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*d51jLT9AHmFtfyqRb9xRGA.png" /><figcaption>When the image was brightened, the model falsely predicts a happy rather than a peaceful image.</figcaption></figure><h4>Shapes and lines</h4><p>The Resnet model was a lot better at identifying subtle differences in color and tone that changed the mood between happy-peaceful, peaceful-gloomy and gloomy-scary. Notable examples are as below. The CNN consistently mistakens gloomy and scary, but Resnet34 is remarkably better at picking up subtlety. Since this difference cannot be attributed to any of the lower level features such as tone or colors, we posit that the ResNet is also picking up on scary object features on top of accounting for tones and colors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*0mteL8tKoqjdLEfyOMsA7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*Opy2oeRV-ehaOhMi08Rc_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*XIwC6FwVNGHs0r1aRlAvUg.png" /><figcaption>Despite similar hues, the ResNet is able to pick up on object features much better than the CNN is able to.</figcaption></figure><h3>Conclusion</h3><p>A few important points as takeaway:<br>1. Higher order features (shapes, lines and objects) are vital toward separating subtle differences in mood. ResNets, by virtue of having a deeper network, are naturally more capable of differentiating higher order features compared to CNNs.</p><p>2. There are several features that are very easy to spot in order to differentiate between moods: colors and contrast. Separately, tone and hue are less likely to significantly impact tone.</p><p>3. Identifying the mood of a painting is a highly subjective exercise, as indicated by the variability and noise in the initial dataset. In some cases, the model predicted a more appropriate label (in our opinion) as compared to that of the dataset’s true label. This indicates that there is likely to be a high level of disagreement and thus noise within the data.</p><p>4. Surprisingly, changing data representation from the traditional RGB to HSV did very little to improve the model’s prediction ability.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a19bd06fb4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>