# Neural Network-Based Identification of Cloud Types from Ground-Based Images of Cloud Layers
## 3 Method  
### Image Processing  
The classification of ground-based cloud images is primarily based on the textural characteristics of the clouds. However, some cloud genera have less distinctive textural characteristics than others, and the differences between them are mainly based on their height and composition. For example, Altocumulus (Ac) and Cirrocumulus (Cc) share a similar appearance of a patch, sheet, or layer of cloud. However, the distinguishing factor \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Height** & **Cloud Genera** & **Texture** & **Quantity** \\ \hline \multirow{3}{*}{High-level} & Cirrus (Ci) & Stratiformis & 103 \\  & Cirrocumulus (Cc) & Undulatus & 103 \\  & Cirrostratus (Cs) & Stratiformis & 110 \\ \hline \multirow{3}{*}{Middle-level} & Altocuratus (As) & Stratiformis & 100 \\  & Altocumulus (Ac) & Undulatus & 106 \\ \hline \multirow{3}{*}{Low-level} & Nimbostratus (Ns) & Stratiform & 133 \\  & Stratus (St) & Undulatus & 102 \\ \cline{1-1}  & Stratocumulus (Sc) & Undulatus & 101 \\ \cline{1-1}  & Cumulus (Cu) & Cumulus & 107 \\ \cline{1-1}  & Cumulonimbus (Cb) & Cumulus & 127 \\ \hline \hline Total & & 1092 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Classification and quantity of cloud genera. Figure 2: Display of the samples of each category in the SSC dataset. (**a**) Ci; (**b**) Cc; (**c**) Cs; (**d**) As; (**e**) Ac; (**f**) Ns; (**g**) St; (**h**) Sc; (**i**) Cu; (**j**) Cb. is that Cc has a white cloud base with a ripple-like texture, while Ac has a greyish cloud base with smaller and well-defined cloud patches. It may be challenging to accurately differentiate between cloud genera with similar textural characteristics based solely on the original images. To emphasize these textural characteristics for subsequent feature extraction, we will pre-process all data samples. There are two methods: edge detection and contrast enhancement. Edge detection is typically carried out using the Sobel operator [26], which suppresses discrete differences by computing a grey-scale approximation of the image. This algorithm employs two \(3\times 3\) convolution kernels to convolve in the x and y directions, respectively, and the convolution kernels are  
\[G_{x}= \begin{bmatrix}-1&0&1\\ -1&0&1\\ -1&0&1\end{bmatrix} ,G_{y}= \begin{bmatrix}-1&-1&-1\\ 0&0&0\\ 1&1&1\end{bmatrix}  \tag{1}\]  
The image is convolved and the approximate gradient value of each pixel in the image is calculated \(g\):  
\[|G|=|G_{x}|+\big{|}G_{y}\big{|}, \tag{2}\]  
\[g=\left\{ \begin{aligned} &|G|,|G|\geq\rho\\ & 0,|G|<\rho\end{aligned} \right. \tag{3}\]  
Typically, algorithms aiming for efficiency in the future will not directly use \(G_{x}\) and \(G_{y}\), but will calculate them using the approximate values of their square roots. Then, where \(\rho\) is the hyperparameter, and when the grey gradient value \(g\) is bigger than \(\rho\), it will be considered as graphical edge retention; otherwise, it will be suppressed. The Sobel operator detects edges by assigning weights to the differences based on the grey values of neighboring pixels surrounding pixel point 8. This phenomenon reaches an extreme value at the edge. The operator also has a smoothing effect on noise and provides relatively quick and accurate information on the direction of edges. However, it is not very precise in locating the edges. Edge detection will also be performed using the Canny operator [27], which firstly smooths the image through a Gaussian filter with a Gaussian kernel \(G\):  
\[G(x,y)=\frac{1}{\sqrt{2\pi\sigma}}e^{-\frac{x^{2}+y^{2}}{2\sigma^{2}}}, \tag{4}\]  
where \(\sigma\) is the hyperparameter that determines the width of the Gaussian function. The magnitude and direction of the gradient are then calculated. The Canny operand uses two convolution kernels in the x and y directions to calculate the edge pixels in the \(x\), and \(y\) directions, using the convolution kernel in the Sobel operator, as shown in Equation (1).