Trying to classify a rather messy image dataset

username: farazk86
cooked: <p>Hi,</p>
<p>This post is not specifically about a pytorch related issue but a general computer vision problem and I hope this is the correct place for such a discussion.</p>
<p>I am trying to classify a rather messy dataset of images. The images are taken using mobile phones and scanner scans from various sources so there is some variation in the dataset.</p>
<p>Its a dataset of election party flyers/leaflets, there are about 5 classes and each class/label has about 3000 images associated with it so there is enough variation here. Here are a couple examples of what the images look like:</p>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/0/2/0260e1db69bbf12bf14f964c934fcd1cc096bd8e.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/0260e1db69bbf12bf14f964c934fcd1cc096bd8e" title="leaflet_1041_1"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/0/2/0260e1db69bbf12bf14f964c934fcd1cc096bd8e_2_365x500.jpeg" alt="leaflet_1041_1" data-base62-sha1="l2wv4Hz6fw9mF5xZ2GL7FT2YO2" width="365" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/0/2/0260e1db69bbf12bf14f964c934fcd1cc096bd8e_2_365x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/0/2/0260e1db69bbf12bf14f964c934fcd1cc096bd8e_2_547x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/0/2/0260e1db69bbf12bf14f964c934fcd1cc096bd8e_2_730x1000.jpeg 2x" data-dominant-color="81767E"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">leaflet_1041_1</span><span class="informations">1024×1400 223 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/9/0/9040cd082445228a2514609cb31ebaff8b7c1d1a.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/9040cd082445228a2514609cb31ebaff8b7c1d1a" title="leaflet_100_2"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/9/0/9040cd082445228a2514609cb31ebaff8b7c1d1a_2_690x487.jpeg" alt="leaflet_100_2" data-base62-sha1="kA7ADYq1cMPPKn7tMAR7CNPXHho" width="690" height="487" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/9/0/9040cd082445228a2514609cb31ebaff8b7c1d1a_2_690x487.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/9/0/9040cd082445228a2514609cb31ebaff8b7c1d1a_2_1035x730.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/9/0/9040cd082445228a2514609cb31ebaff8b7c1d1a_2_1380x974.jpeg 2x" data-dominant-color="948F7C"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">leaflet_100_2</span><span class="informations">1449×1024 204 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/0/e/0e8cdcc5128e22716ec357cbf02228ad40b31a5c.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/0e8cdcc5128e22716ec357cbf02228ad40b31a5c" title="leaflet_1139_2"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/0/e/0e8cdcc5128e22716ec357cbf02228ad40b31a5c_2_356x499.jpeg" alt="leaflet_1139_2" data-base62-sha1="24ItOnyciwHhtdj7z0asiM4KsYk" width="356" height="499" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/0/e/0e8cdcc5128e22716ec357cbf02228ad40b31a5c_2_356x499.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/0/e/0e8cdcc5128e22716ec357cbf02228ad40b31a5c_2_534x748.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/0/e/0e8cdcc5128e22716ec357cbf02228ad40b31a5c_2_712x998.jpeg 2x" data-dominant-color="B5C3C8"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">leaflet_1139_2</span><span class="informations">1024×1437 183 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/5/3/53cf5623f829a0652321abd243ef09f8cfb9ad84.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/53cf5623f829a0652321abd243ef09f8cfb9ad84" title="leaflet_1015_1"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/5/3/53cf5623f829a0652321abd243ef09f8cfb9ad84_2_467x500.jpeg" alt="leaflet_1015_1" data-base62-sha1="bXpQtDIKxQ7RqV08GssSiRgGOWw" width="467" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/5/3/53cf5623f829a0652321abd243ef09f8cfb9ad84_2_467x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/5/3/53cf5623f829a0652321abd243ef09f8cfb9ad84_2_700x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/5/3/53cf5623f829a0652321abd243ef09f8cfb9ad84_2_934x1000.jpeg 2x" data-dominant-color="9D9993"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">leaflet_1015_1</span><span class="informations">1024×1096 185 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
As a starting point, I used a <code>ResNet 101</code> network to learn this dataset and for preprocessing all I did was resize the images to <code>200 x 200</code> using interpolation.</p>
<p>But after training for over 24 hours the validation/test accuracy is about 54%, so the network did not lean much and is just random guessing.</p>
<p>Is it possible to classify such a dataset? Any tips on how to pre-process these images to improve result?</p>
<p>Thanks</p>

username: ptrblck
cooked: <aside class="quote no-group" data-username="farazk86" data-post="1" data-topic="92278">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/farazk86/48/7071_2.png" class="avatar"> farazk86:</div>
<blockquote>
<p>But after training for over 24 hours the validation/test accuracy is about 54%, so the network did not lean much and is just random guessing.</p>
</blockquote>
</aside>
<p>That doesn’t seem to be the case for 5 classes, as a random guess would give you an accuracy of 20%, wouldn’t it?</p>
<aside class="quote no-group" data-username="farazk86" data-post="1" data-topic="92278">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/farazk86/48/7071_2.png" class="avatar"> farazk86:</div>
<blockquote>
<p>there are about 5 classes and each class/label has about 3000 images associated with it so there is enough variation here.</p>
</blockquote>
</aside>
<p>I think there might even be “too much variation” given the example images and the comparably small dataset size.<br>
However, I’m quite impressed that the model has learned something at all (if I’m not mistaken in my first point).</p>