# A Review of Deep Learning Algorithms and Their Applications in Healthcare
## 3 Artificial Neural Networks
### Convolutional Neural Networks (CNNs)
#### 3.6.1 The Ultimate Guide to Convolutional Neural Networks (CNN)  
CNN consists of four main steps: the convolution operation and the rectified linear unit step, the pooling step, the flattening step, and the full connection step. **Step 1a: Convolution Operation**  
The convolution operation's main objective is to reduce the size of the input image by extracting its high-level features. In this step, the feature detectors serve as the neural networks' filters. The patterns are detected in the form of layers and the findings are mapped out. These feature maps are referred to as convolutional layers. The network categorizes objects or images based on the set of features that pass through them that they manage to detect. The responsibility of the first convolution layer is to capture low-level features such as color, edges, and orientation. The architecture adapts to the high-level features using the added layers. This gives the network a holistic understanding of the images in the dataset. The other use of the convolution matrix is to adjust an image. The convolution operation has three elements: the input image, the feature detector, and the feature map [57; 58; 59]. 1. An input image is a matrix of pixel values. Each pixel contains eight bits of information. Black and white images are scanned differently from colored images. Black and white images are two-dimensional, colors are represented on a scale of (2\({}^{8}\)) possible values, from 0 to 255. In other cases, such as detecting facial expressions, all of the pixels are valued at 0 except the objects, which are valued at 1 [57; 58]. Figure 14: The architecture of a convolutional neural network [58]. 2. Convolution layer--the feature detector and the feature map: A 5 \(\times\) 5 or a 7 \(\times\) 7 matrix is used as a feature detector (kernel), but the 3 \(\times\) 3 matrix is more conventional. A 5 (Height) \(\times\) 5 (Breadth) \(\times\) 1 (Number of channels, e.g., RGB) input image is convoluted with a 4 \(\times\) 3 \(\times\) 1 kernel filter to get a 3 \(\times\) 3 \(\times\) 1 convolved feature. The kernel/filter, K, is the feature detector. It is the part that is involved in carrying out the convolution operation. K is selected as a 3 \(\times\) 3 \(\times\) 1 matrix [57; 58]. \[\text{Kernel/Filter K}= \begin{array}{ccc}1&0&1\\ 0&1&0\\ 1&0&1\end{array} \]  
The number of cells in which the feature detector matches the input image is counted, and the number of matching cells is then inserted in the top-left cell of the feature map. Since the stride length (movements of the feature detector across pixels) = 1 (one cell at a time), the kernel shifts nine times. Every time it performs a matrix multiplication between k and the portion of the image that is hovered over by the kernel. The larger the strides, the smaller the feature map/activation map. Wide movements across pixels are required when working with proper images. A feature map can contain any digit, not only 1 s and 0 s. The purpose of the kernel/detector is to sift through the information in the input image, filter the parts that are integral to it, and exclude the rest. The network determines what these features are. Here the kernel and the input image have the same depth. The performed matrix multiplication is between K\({}_{\text{n}}\) and in stack. ([K\({}_{\text{1}}\), I\({}_{\text{1}}\)]; [K\({}_{\text{2}}\), I\({}_{\text{2}}\)]; [K\({}_{\text{3}}\), I\({}_{\text{3}}\)]). To obtain a squashed, one depth channel convoluted feature output, the results are summed with the bias. Small neurons (receptive fields) in multiple layers process the input image in portions, and the result is a clear representation of the original input image. One of the most distinguishable characteristics of the CNN is that it consists of 3D volumes of neurons, which are arranged in three dimensions: depth, height, and weight [57; 58]. **Step 1b: Rectified Linear Unit (ReLU) Layer**  
This is a supplementary step to the convolution operation.