<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MNIST | Saikiran Juttu | Robotics Portfolio</title><link>https://juttu-s.github.io/saikiran_juttu.github.io/tags/mnist/</link><atom:link href="https://juttu-s.github.io/saikiran_juttu.github.io/tags/mnist/index.xml" rel="self" type="application/rss+xml"/><description>MNIST</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Mon, 01 Apr 2024 00:00:00 +0000</lastBuildDate><image><url>https://juttu-s.github.io/saikiran_juttu.github.io/media/icon_hu7729264130191091259.png</url><title>MNIST</title><link>https://juttu-s.github.io/saikiran_juttu.github.io/tags/mnist/</link></image><item><title>Digit Recognition &amp; Transfer Learning with CNNs</title><link>https://juttu-s.github.io/saikiran_juttu.github.io/project/digit-recognition/</link><pubDate>Mon, 01 Apr 2024 00:00:00 +0000</pubDate><guid>https://juttu-s.github.io/saikiran_juttu.github.io/project/digit-recognition/</guid><description>&lt;p>This project focused on &lt;strong>designing, training, and analyzing convolutional neural networks (CNNs)&lt;/strong> for digit recognition and then &lt;strong>applying transfer learning&lt;/strong> to recognize Greek characters using PyTorch.&lt;/p>
&lt;hr>
&lt;h2 id="cnn-for-digit-recognition-mnist">CNN for Digit Recognition (MNIST)&lt;/h2>
&lt;p>We first built and trained a simple CNN model using the MNIST dataset:&lt;/p>
&lt;ul>
&lt;li>Two convolutional layers (5x5 filters)&lt;/li>
&lt;li>Max pooling (2x2) and dropout (0.5)&lt;/li>
&lt;li>Fully connected layer (50 nodes) + final FC with log-softmax (10 classes)&lt;/li>
&lt;li>Achieved &lt;strong>~98% test accuracy&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Sample MNIST Digits" srcset="
/saikiran_juttu.github.io/project/digit-recognition/firstsix_hu15902310905350978628.webp 400w,
/saikiran_juttu.github.io/project/digit-recognition/firstsix_hu10625707504812272563.webp 760w,
/saikiran_juttu.github.io/project/digit-recognition/firstsix_hu9923025005567100836.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/digit-recognition/firstsix_hu15902310905350978628.webp"
width="708"
height="400"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;em>Figure: Example of first 6 MNIST test samples.&lt;/em>&lt;/p>
&lt;hr>
&lt;h2 id="network-architecture">Network Architecture&lt;/h2>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="CNN Diagram" srcset="
/saikiran_juttu.github.io/project/digit-recognition/NN_hu7544495459113416032.webp 400w,
/saikiran_juttu.github.io/project/digit-recognition/NN_hu11458655653262536510.webp 760w,
/saikiran_juttu.github.io/project/digit-recognition/NN_hu5398614519963812698.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/digit-recognition/NN_hu7544495459113416032.webp"
width="760"
height="509"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;em>Figure: End-to-end architecture used for digit recognition.&lt;/em>&lt;/p>
&lt;hr>
&lt;h2 id="training-performance">Training Performance&lt;/h2>
&lt;ul>
&lt;li>Loss decreased steadily over batches/epochs.&lt;/li>
&lt;li>Test loss visualized periodically across training examples.&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Loss Curve" srcset="
/saikiran_juttu.github.io/project/digit-recognition/loss_hu2647141672864762400.webp 400w,
/saikiran_juttu.github.io/project/digit-recognition/loss_hu14298867483472384218.webp 760w,
/saikiran_juttu.github.io/project/digit-recognition/loss_hu3418306977125921203.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/digit-recognition/loss_hu2647141672864762400.webp"
width="760"
height="559"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;em>Figure: Negative log-likelihood training and test loss.&lt;/em>&lt;/p>
&lt;hr>
&lt;h2 id="filter-visualization">Filter Visualization&lt;/h2>
&lt;ul>
&lt;li>First conv layer has 10 learned filters.&lt;/li>
&lt;li>Visualized using matplotlib to show edge/orientation detection.&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Filter Maps" srcset="
/saikiran_juttu.github.io/project/digit-recognition/filter_maps1_hu6510234662074493762.webp 400w,
/saikiran_juttu.github.io/project/digit-recognition/filter_maps1_hu11416344688562476833.webp 760w,
/saikiran_juttu.github.io/project/digit-recognition/filter_maps1_hu16678790348298768722.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/digit-recognition/filter_maps1_hu6510234662074493762.webp"
width="638"
height="469"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;em>Figure: Learned 5x5 filters from first conv layer.&lt;/em>&lt;/p>
&lt;hr>
&lt;h2 id="transfer-learning-to-greek-letters">Transfer Learning to Greek Letters&lt;/h2>
&lt;ul>
&lt;li>Fine-tuned MNIST CNN to classify Greek characters: α, β, γ.&lt;/li>
&lt;li>Froze earlier layers, retrained final classifier head.&lt;/li>
&lt;li>Achieved &lt;strong>96–98% accuracy&lt;/strong> on unseen test samples.&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Greek Classification Output" srcset="
/saikiran_juttu.github.io/project/digit-recognition/greek_hu4305634218149458193.webp 400w,
/saikiran_juttu.github.io/project/digit-recognition/greek_hu16620829909298196167.webp 760w,
/saikiran_juttu.github.io/project/digit-recognition/greek_hu10198682355568399909.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/digit-recognition/greek_hu4305634218149458193.webp"
width="652"
height="391"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;em>Figure: Correct classification of Greek letters using transfer learning.&lt;/em>&lt;/p>
&lt;hr>
&lt;h2 id="transfer-learning-training-error">Transfer Learning Training Error&lt;/h2>
&lt;ul>
&lt;li>Convergence observed over 100+ epochs.&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Greek Training Error Curve" srcset="
/saikiran_juttu.github.io/project/digit-recognition/greek_training_hu10070426372364170428.webp 400w,
/saikiran_juttu.github.io/project/digit-recognition/greek_training_hu13936645240799545862.webp 760w,
/saikiran_juttu.github.io/project/digit-recognition/greek_training_hu10173284984926363065.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/digit-recognition/greek_training_hu10070426372364170428.webp"
width="640"
height="508"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;em>Figure: Error vs epoch for Greek classification.&lt;/em>&lt;/p>
&lt;hr>
&lt;h2 id="live-webcam-digit-recognition">Live Webcam Digit Recognition&lt;/h2>
&lt;ul>
&lt;li>Built a webcam-based interface using OpenCV&lt;/li>
&lt;li>Live input frames classified in real time using the trained CNN&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="live webcam" srcset="
/saikiran_juttu.github.io/project/digit-recognition/live_hu16096523079256018570.webp 400w,
/saikiran_juttu.github.io/project/digit-recognition/live_hu4232723163901620511.webp 760w,
/saikiran_juttu.github.io/project/digit-recognition/live_hu8695550706911073452.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/digit-recognition/live_hu16096523079256018570.webp"
width="580"
height="760"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;em>Figure: Live Webcam Digit Recognition&lt;/em>&lt;/p>
&lt;blockquote>
&lt;p>&lt;em>Sometimes predictions were inaccurate due to motion blur or poor lighting, but most digits were correctly classified in real-time.&lt;/em>&lt;/p>
&lt;/blockquote>
&lt;hr>
&lt;h2 id="key-takeaways">Key Takeaways&lt;/h2>
&lt;ul>
&lt;li>5x5 and 7x7 filters outperform 3x3 in MNIST CNNs&lt;/li>
&lt;li>Dropout around &lt;strong>0.1–0.3&lt;/strong> provided best generalization&lt;/li>
&lt;li>Smaller batch sizes (32) resulted in better accuracy&lt;/li>
&lt;li>Greek letters transfer learning worked well with small data (~27 samples)&lt;/li>
&lt;li>Real-time system demonstrates CNNs are efficient and deployable&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="tools">Tools&lt;/h2>
&lt;ul>
&lt;li>Python, PyTorch, OpenCV&lt;/li>
&lt;li>Jupyter Notebooks&lt;/li>
&lt;li>Matplotlib for visualization&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="resources">Resources&lt;/h2>
&lt;ul>
&lt;li>📄 &lt;a href="Project.pdf">Project Report PDF&lt;/a>&lt;/li>
&lt;li>🔗 &lt;a href="https://github.com/juttu-s/Pattern-Recognition-and-Computer-Vision/tree/main/Recognition%20using%20Deep%20Networks" target="_blank" rel="noopener">GitHub Repository&lt;/a>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;p>This project deepened our understanding of CNN design, filter learning, transfer learning, and real-time deployment — showing the full lifecycle from dataset to deployment.&lt;/p></description></item></channel></rss>