# R24 Q5b

Subject: Deep Learning

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/#tee/read/14/tee-c14-s11

Canonical: https://deep-learning-study-room.vercel.app/read/dl/tee/section/tee-c14-s11/

## Question

**Question (10 marks).** (i) Justify DL for chest-cancer diagnosis from X-ray images(5). (ii) List RNN advantages and disadvantages(5).

## Answer — step by step

A convolutional neural network processes local spatial neighborhoods using learnable filters. A filter slides across the image; the same weights are reused at different locations. Each filter produces one output channel. Early features often respond to edges, subsequent layers combine local patterns into textures or parts, and deeper features support object-level classification.

![One filter is reused at successive spatial positions](https://deep-learning-study-room.vercel.app/assets/figures/convolution.svg)

Diagram: One filter is reused at successive spatial positions. Labels: Step 1: start (1,1) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | K = [1, 0] | [0, −1] | 1×1 + 2×0 + 4×0 | + 5×(−1) = −4 | Step 2: start (1,2) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | K = [1, 0] | [0, −1] | 2×1 + 3×0 + 5×0 | + 6×(−1) = −4 | Step 3: start (2,1) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | K = [1, 0] | [0, −1] | 4×1 + 5×0 + 7×0 | + 8×(−1) = −4 | Step 4: start (2,2) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | K = [1, 0] | [0, −1] | 5×1 + 6×0 + 8×0 | + 9×(−1) = −4 | Output: [−4, −4; −4, −4]. Kernel is not flipped.

One filter is reused at successive spatial positions Tap the diagram to enlarge.

Convolution extracts local patterns, a nonlinear activation lets the network combine them nonlinearly, and pooling reduces spatial resolution and sensitivity to small local shifts. Flattening or global pooling converts feature maps into a classification representation; a dense output layer produces class scores or probabilities.

Compared with a fully connected image network, CNNs exploit locality and weight sharing, often requiring far fewer parameters for early image processing. An RGB filter extends through all input channels. Pooling does not change the number of channels and normally has no trainable parameters. A CNN is not automatically invariant to every transformation.

For medical-image analysis, a CNN can classify a chest X-ray or identify suspicious regions from labeled scans, learning useful spatial patterns. For autonomous vehicles, CNN-based perception can detect road signs, pedestrians or lanes from camera images. Benefits include learned hierarchical visual features and reuse across image positions; both applications require held-out evaluation under relevant acquisition conditions.

**RNN advantages:**  ordered context, shared weights over time, variable sequence lengths and flexible input/output mappings. **Limitations:**  sequential computation reduces time-step parallelism; vanilla cells have vanishing/exploding gradient issues and limited learned long context; many training choices still require validation. Use CNNs for spatial image patterns and recurrent models when temporal/ordered structure is relevant.
