# Neural Network-Based Identification of Cloud Types from Ground-Based Images of Cloud Layers
## 3 Method
### Image Processing
In this case, \(G_{x}\) performs edge detection in the x-direction, and when the convolution kernel calculates the boundary pixels perpendicular to the x-direction  
the width of the edge is kept to a minimum of one pixel. If a pixel is an edge of the graph, it will have the maximum gradient value in the gradient direction; otherwise, the grey value is set to zero, which helps to refine the graph edge. The Canny algorithm performs non-maximum suppression in four directions:  
1. \(\theta=0^{\lx@math@degree}\), contrast the left and right neighboring points of the pixel. 2. \(\theta=45^{\lx@math@degree}\), contrast the lower-left with the upper-right neighborhoods of the pixel. 3. \(\theta=90^{\lx@math@degree}\), contrast the top and bottom neighborhoods of the pixel. 4. \(\theta=135^{\lx@math@degree}\), contrast the upper-left with the lower-right neighborhoods of the pixel. Finally, using the hysteresis thresholding method, the hysteresis threshold requires two thresholds (high and low threshold). As shown in Figure 3, an edge pixel with a gradient value higher than the high threshold is labeled as a strong edge pixel; an edge pixel with a gradient value less than the high threshold and greater than the low threshold is labeled as a weak edge pixel; and an edge pixel is suppressed if its gradient value is less than the low threshold. The Canny operator is not susceptible to noise interference and is able to detect the true weak edges. Moreover, the Canny operator excels at locating edge pixels and accurately identifying edge points on pixels that have the highest grayscale variation, but the Canny operator's computational complexity is significantly higher, which reduces its efficiency. Contrast enhancement uses the Clahe algorithm [28], which is further improved by the Histogram Enhancement algorithm (HE). This method enhances the contrast of an image by locally performing histogram equalization, which preserves more details of the image and facilitates the extraction of features. The Clahe algorithm first adjusts the luminance distribution of pixels by equalizing the histogram, while it avoids the issue of certain colors overpowering others by limiting the number of pixels per color. By comparing the histogram of the original image in part a of Figure 4 with the histogram processed by the Clahe algorithm in part b, it is evident that the Clahe operator alters the grey values of pixels that exceed a certain threshold to a lower value. By reducing the brightness of the bright areas and increasing the brightness of the dark areas, the Clahe algorithm enhances the contrast of the image. The image enhancement method still utilizes Gamma Correction [29], a non-linear operation that adjusts the brightness of the image. The corresponding pixel value is determined using a transformation formula, which is represented as  
\[s=cr^{\gamma} \tag{7}\]  
Figure 3: Displaying the hysteresis threshold, when pixel values greater than maxVal are flagged as strong edges; pixel values less than maxVal and greater than minVal are flagged as weak edges; pixel values less than minVal are suppressed. where \(r\) is the input pixel grey value, \(c\) is a constant, usually taken as 1, and \(\gamma\) is the Gamma Correction value, which determines whether the output pixel grey value s is transformed to a larger or smaller value. As shown in Figure 5, when \(\gamma>1\) this transformation is called decoding gamma, and the final image will be darker overall; when \(\gamma<1\), this transformation is called coding gamma, and the final image will be brighter overall. We utilize the above four methods to enhance the original data, aiming to strengthen the texture information present in the image. The results obtained after pre-processing the images are presented in Figure 6. We will utilize the four datasets obtained after processing the original dataset to train the models and compare their performance. Figure 4: (**a**) The original image and its grayscale histogram. (**b**) The image is processed by [PERSON] and its grayscale histogram.