<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Deep-Learning on Arshad Siddiqui</title><link>https://arshadhs.github.io/categories/deep-learning/</link><description>Recent content in Deep-Learning on Arshad Siddiqui</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 22 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://arshadhs.github.io/categories/deep-learning/index.xml" rel="self" type="application/rss+xml"/><item><title>Convolutional Neural Networks</title><link>https://arshadhs.github.io/docs/ai/deep-learning/060-cnn-fundamentals/</link><pubDate>Sun, 19 Apr 2026 00:00:00 +0000</pubDate><guid>https://arshadhs.github.io/docs/ai/deep-learning/060-cnn-fundamentals/</guid><description>&lt;h1 id="convolutional-neural-networks-cnn">
 Convolutional Neural Networks (CNN)
 
 &lt;a class="anchor" href="#convolutional-neural-networks-cnn">#&lt;/a>
 
&lt;/h1>
&lt;p>Convolutional Neural Networks (CNNs) are specialised neural networks designed for data with spatial structure, especially images. They became the standard model for computer vision because they preserve spatial locality, reuse the same pattern detector across the image, and build representations hierarchically. In practical terms, a CNN starts by learning simple features such as edges and corners, then combines them into textures, shapes, object parts, and finally full semantic categories.&lt;/p></description></item><item><title>Deep CNN Architectures</title><link>https://arshadhs.github.io/docs/ai/deep-learning/065-deep-cnn-architectures/</link><pubDate>Sun, 19 Apr 2026 00:00:00 +0000</pubDate><guid>https://arshadhs.github.io/docs/ai/deep-learning/065-deep-cnn-architectures/</guid><description>&lt;h1 id="deep-cnn-architectures">
 Deep CNN Architectures
 
 &lt;a class="anchor" href="#deep-cnn-architectures">#&lt;/a>
 
&lt;/h1>
&lt;p>Once the basic ideas of convolution, pooling, channels, and classifier heads are understood, the next step is to study how successful CNN architectures are designed in practice. The history of deep CNNs is not just a list of famous models. It is a progression of design ideas: smaller filters, more depth, better optimisation, bottlenecks, multi-scale processing, residual connections, and transfer learning.&lt;/p>
&lt;blockquote class="book-hint info">
&lt;p>&lt;strong>Key takeaway:&lt;/strong>&lt;br>
Deep CNN architectures evolved by solving specific problems one by one: &lt;strong>LeNet&lt;/strong> established the template, &lt;strong>AlexNet&lt;/strong> proved deep learning could dominate large-scale vision, &lt;strong>VGG&lt;/strong> simplified the design, &lt;strong>NiN&lt;/strong> introduced powerful &lt;code>1 × 1&lt;/code> ideas, &lt;strong>GoogLeNet&lt;/strong> made multi-scale processing efficient, and &lt;strong>ResNet&lt;/strong> solved the optimisation problem of very deep networks.&lt;/p></description></item><item><title>CNN Pipeline</title><link>https://arshadhs.github.io/docs/ai/deep-learning/067-cnn-model/</link><pubDate>Wed, 22 Apr 2026 00:00:00 +0000</pubDate><guid>https://arshadhs.github.io/docs/ai/deep-learning/067-cnn-model/</guid><description>&lt;h1 id="cnn-pipeline-preprocessing--models">
 CNN Pipeline: Preprocessing &amp;amp; Models
 
 &lt;a class="anchor" href="#cnn-pipeline-preprocessing--models">#&lt;/a>
 
&lt;/h1>
&lt;ul>
&lt;li>Understand CNN concepts deeply&lt;/li>
&lt;li>Build CNN models step-by-step&lt;/li>
&lt;li>Apply CNNs in assignments using Keras&lt;/li>
&lt;/ul>
&lt;blockquote class="book-hint info">
&lt;p>Think of CNN as a pipeline:
Image → Features → Patterns → Prediction&lt;/p>
&lt;/blockquote>
&lt;hr>
&lt;h1 id="1-image-representation">
 1. Image Representation
 
 &lt;a class="anchor" href="#1-image-representation">#&lt;/a>
 
&lt;/h1>
&lt;span style="color: green;">
 &lt;link rel="stylesheet" href="https://arshadhs.github.io/katex/katex.min.css" />
&lt;script defer src="https://arshadhs.github.io/katex/katex.min.js">&lt;/script>
 &lt;script defer src="https://arshadhs.github.io/katex/auto-render.min.js" onload="renderMathInElement(document.body, {
 &amp;#34;delimiters&amp;#34;: [
 {&amp;#34;left&amp;#34;: &amp;#34;$$&amp;#34;, &amp;#34;right&amp;#34;: &amp;#34;$$&amp;#34;, &amp;#34;display&amp;#34;: true},
 {&amp;#34;left&amp;#34;: &amp;#34;$&amp;#34;, &amp;#34;right&amp;#34;: &amp;#34;$&amp;#34;, &amp;#34;display&amp;#34;: false},
 {&amp;#34;left&amp;#34;: &amp;#34;\\(&amp;#34;, &amp;#34;right&amp;#34;: &amp;#34;\\)&amp;#34;, &amp;#34;display&amp;#34;: false},
 {&amp;#34;left&amp;#34;: &amp;#34;\\[&amp;#34;, &amp;#34;right&amp;#34;: &amp;#34;\\]&amp;#34;, &amp;#34;display&amp;#34;: true}
 ]
});">&lt;/script>
&lt;span>
 \[ 
X \in \mathbb{R}^{H \times W \times C}
 \]
 &lt;/span>
&lt;/span>
&lt;ul>
&lt;li>H = Height&lt;/li>
&lt;li>W = Width&lt;/li>
&lt;li>C = Channels&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h1 id="2-convolution-operation">
 2. Convolution Operation
 
 &lt;a class="anchor" href="#2-convolution-operation">#&lt;/a>
 
&lt;/h1>
&lt;span style="color: green;">
 &lt;span>
 \[ 
Z(i,j) = \sum_{m,n} X(i+m, j+n) \cdot K(m,n)
 \]
 &lt;/span>
&lt;/span>
&lt;ul>
&lt;li>Sliding filter extracts features&lt;/li>
&lt;li>Produces feature maps&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h1 id="3-stride--padding">
 3. Stride &amp;amp; Padding
 
 &lt;a class="anchor" href="#3-stride--padding">#&lt;/a>
 
&lt;/h1>
&lt;span style="color: green;">
 &lt;span>
 \[ 
Output = \frac{N - F + 2P}{S} + 1
 \]
 &lt;/span>
&lt;/span>
&lt;hr>
&lt;h1 id="4-activation-relu">
 4. Activation (ReLU)
 
 &lt;a class="anchor" href="#4-activation-relu">#&lt;/a>
 
&lt;/h1>
&lt;span style="color: green;">
 &lt;span>
 \[ 
ReLU(x) = max(0, x)
 \]
 &lt;/span>
&lt;/span>
&lt;hr>
&lt;h1 id="5-pooling">
 5. Pooling
 
 &lt;a class="anchor" href="#5-pooling">#&lt;/a>
 
&lt;/h1>
&lt;ul>
&lt;li>Max Pooling → strongest feature&lt;/li>
&lt;li>Average Pooling → smooth&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h1 id="6-global-average-pooling">
 6. Global Average Pooling
 
 &lt;a class="anchor" href="#6-global-average-pooling">#&lt;/a>
 
&lt;/h1>
&lt;span style="color: green;">
 &lt;span>
 \[ 
y_k = \frac{1}{HW} \sum_{i,j} x_{i,j,k}
 \]
 &lt;/span>
&lt;/span>
&lt;hr>
&lt;h1 id="7-loss-function">
 7. Loss Function
 
 &lt;a class="anchor" href="#7-loss-function">#&lt;/a>
 
&lt;/h1>
&lt;span style="color: green;">
 &lt;span>
 \[ 
L = - \sum y \log(\hat{y})
 \]
 &lt;/span>
&lt;/span>
&lt;hr>
&lt;h1 id="8-cnn-architecture">
 8. CNN Architecture
 
 &lt;a class="anchor" href="#8-cnn-architecture">#&lt;/a>
 
&lt;/h1>


&lt;script src="https://arshadhs.github.io/mermaid.min.js">&lt;/script>

 &lt;script>mermaid.initialize({
 "flowchart": {
 "useMaxWidth":true
 },
 "theme": "default"
}
)&lt;/script>




&lt;pre class="mermaid">graph LR
A[Input Image] --&amp;gt; B[Conv]
B --&amp;gt; C[ReLU]
C --&amp;gt; D[Pooling]
D --&amp;gt; E[Conv Layers]
E --&amp;gt; F[Flatten / GAP]
F --&amp;gt; G[Dense]
G --&amp;gt; H[Output]&lt;/pre>
&lt;hr>
&lt;h1 id="9-training">
 9. Training
 
 &lt;a class="anchor" href="#9-training">#&lt;/a>
 
&lt;/h1>
&lt;ul>
&lt;li>Forward pass&lt;/li>
&lt;li>Loss computation&lt;/li>
&lt;li>Backpropagation&lt;/li>
&lt;li>Weight update&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h1 id="10-keras-implementation">
 10. Keras Implementation
 
 &lt;a class="anchor" href="#10-keras-implementation">#&lt;/a>
 
&lt;/h1>
&lt;h2 id="model">
 Model
 
 &lt;a class="anchor" href="#model">#&lt;/a>
 
&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> tensorflow.keras.models &lt;span style="color:#f92672">import&lt;/span> Sequential
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> tensorflow.keras.layers &lt;span style="color:#f92672">import&lt;/span> Conv2D, MaxPooling2D, Dense, Flatten
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>model &lt;span style="color:#f92672">=&lt;/span> Sequential()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>model&lt;span style="color:#f92672">.&lt;/span>add(Conv2D(&lt;span style="color:#ae81ff">32&lt;/span>, (&lt;span style="color:#ae81ff">3&lt;/span>,&lt;span style="color:#ae81ff">3&lt;/span>), activation&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#39;relu&amp;#39;&lt;/span>, input_shape&lt;span style="color:#f92672">=&lt;/span>(&lt;span style="color:#ae81ff">64&lt;/span>,&lt;span style="color:#ae81ff">64&lt;/span>,&lt;span style="color:#ae81ff">3&lt;/span>)))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>model&lt;span style="color:#f92672">.&lt;/span>add(MaxPooling2D((&lt;span style="color:#ae81ff">2&lt;/span>,&lt;span style="color:#ae81ff">2&lt;/span>)))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>model&lt;span style="color:#f92672">.&lt;/span>add(Conv2D(&lt;span style="color:#ae81ff">64&lt;/span>, (&lt;span style="color:#ae81ff">3&lt;/span>,&lt;span style="color:#ae81ff">3&lt;/span>), activation&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#39;relu&amp;#39;&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>model&lt;span style="color:#f92672">.&lt;/span>add(MaxPooling2D((&lt;span style="color:#ae81ff">2&lt;/span>,&lt;span style="color:#ae81ff">2&lt;/span>)))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>model&lt;span style="color:#f92672">.&lt;/span>add(Flatten())
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>model&lt;span style="color:#f92672">.&lt;/span>add(Dense(&lt;span style="color:#ae81ff">128&lt;/span>, activation&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#39;relu&amp;#39;&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>model&lt;span style="color:#f92672">.&lt;/span>add(Dense(&lt;span style="color:#ae81ff">1&lt;/span>, activation&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#39;sigmoid&amp;#39;&lt;/span>))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h2 id="compile">
 Compile
 
 &lt;a class="anchor" href="#compile">#&lt;/a>
 
&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>model&lt;span style="color:#f92672">.&lt;/span>compile(optimizer&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#39;adam&amp;#39;&lt;/span>, loss&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#39;binary_crossentropy&amp;#39;&lt;/span>, metrics&lt;span style="color:#f92672">=&lt;/span>[&lt;span style="color:#e6db74">&amp;#39;accuracy&amp;#39;&lt;/span>])
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h2 id="train">
 Train
 
 &lt;a class="anchor" href="#train">#&lt;/a>
 
&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>model&lt;span style="color:#f92672">.&lt;/span>fit(X_train, y_train, epochs&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">10&lt;/span>, batch_size&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">32&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h2 id="predict">
 Predict
 
 &lt;a class="anchor" href="#predict">#&lt;/a>
 
&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>pred &lt;span style="color:#f92672">=&lt;/span> model&lt;span style="color:#f92672">.&lt;/span>predict(X_test)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h1 id="11-tips">
 11. Tips
 
 &lt;a class="anchor" href="#11-tips">#&lt;/a>
 
&lt;/h1>
&lt;ul>
&lt;li>Normalize images&lt;/li>
&lt;li>Use small filters&lt;/li>
&lt;li>Avoid too many dense layers&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h1 id="12-summary">
 12. Summary
 
 &lt;a class="anchor" href="#12-summary">#&lt;/a>
 
&lt;/h1>
&lt;blockquote class="book-hint info">
&lt;p>CNN = Automatic feature extractor + classifier&lt;/p></description></item><item><title>Recurrent Neural Networks</title><link>https://arshadhs.github.io/docs/ai/deep-learning/070-recurrent-nn/</link><pubDate>Sun, 19 Apr 2026 00:00:00 +0000</pubDate><guid>https://arshadhs.github.io/docs/ai/deep-learning/070-recurrent-nn/</guid><description>&lt;h1 id="recurrent-neural-networks">
 Recurrent Neural Networks
 
 &lt;a class="anchor" href="#recurrent-neural-networks">#&lt;/a>
 
&lt;/h1>
&lt;p>Recurrent Neural Networks (RNNs) are neural networks designed for &lt;strong>sequential data&lt;/strong>, where the order of inputs matters and the model must use information from earlier time steps to interpret later ones. Unlike a feedforward network, an RNN does not process each input in isolation. It carries a &lt;strong>hidden state&lt;/strong> from one time step to the next, so the network can build a running summary of what it has seen so far.&lt;/p></description></item><item><title>Deep Recurrent Neural Networks</title><link>https://arshadhs.github.io/docs/ai/deep-learning/075-recurrent-nn-deep/</link><pubDate>Sun, 19 Apr 2026 00:00:00 +0000</pubDate><guid>https://arshadhs.github.io/docs/ai/deep-learning/075-recurrent-nn-deep/</guid><description>&lt;h1 id="deep-recurrent-neural-networks">
 Deep Recurrent Neural Networks
 
 &lt;a class="anchor" href="#deep-recurrent-neural-networks">#&lt;/a>
 
&lt;/h1>
&lt;p>Vanilla RNNs introduce the hidden-state idea, but they struggle on longer and more complex sequences because gradients can vanish across time. Deep recurrent models extend the RNN idea in two important ways:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>make the recurrent architecture richer&lt;/strong>, for example by stacking multiple recurrent layers or using information from both directions,&lt;/li>
&lt;li>&lt;strong>use gates and memory cells&lt;/strong> to control what should be remembered, forgotten, updated, and exposed.&lt;/li>
&lt;/ol>
&lt;p>This is why practical recurrent modelling usually moves from a simple RNN to &lt;strong>stacked RNNs, bidirectional RNNs, GRUs, or LSTMs&lt;/strong>.&lt;/p></description></item></channel></rss>