# Analysis of Airglow Image Classification Based on Feature Map Visualization
## 3 Experiment
### Learning Process  
In constructing the CNN image classifier, we used Keras, a deep learning API written in Python and running on top of the machine learning platform TensorFlow, to build a CNN. In every epoch of training, a model was generated after 22 iterations. The model was modified continuously until 140 epochs of learning were performed. In one iteration, 64 images were drawn at random from the training set for learning and all 1400 images in the training set in 22 iterations. Such random sampling was employed in the stochastic gradient descent (SGD) method in LeNet. The prediction accuracy and prediction loss in both the training set and validation set during the 140 epochs of learning are shown in Figure 4. The prediction accuracy in the validation set rose rapidly in the 1 st to 5 th epoch, gradually stabilized and converged to 0.999 in the 5 th to 31 st epoch, and finally decreased slowly to 0.994 in the 31 st to 40 th epoch. The prediction loss in the training set quickly descended from the beginning and then gradually stabilized and converged to around 0.007 in the 5 th to 40 th epoch. The prediction loss in the validation set quickly decreased in the 1 st to 5 th epoch, gradually stabilized and converged to around 0.003 in the 5 th to 31 st epoch, and finally rose slowly to 0.014 in 31 st to 40 th epoch. The quality of model is capricious after 40 th epoch. All the minor fluctuations in the curves were caused by the random sampling.  
Figure 4: Prediction accuracy and prediction loss in training and validation set in 140 epochs.  
Figure 3: (**a–e**) Examples of cropped 512 \(\times\) 512 images in five categories. (**a**) Clear night; (**b**) overcast sky; (**c**) light band; (**d**) moon; (**e**) twilight.  
The prediction loss in the validation set rose slowly after the 31 st epoch, which might be caused by overfitting. After training, finally the best fitting model result was selected in the 31 st epoch based on the trends of prediction loss and feature maps. The image classifier achieved a prediction accuracy of around 100% in training set; the prediction accuracy was around 99% in the validation set; the prediction loss was around 0.002 in the training set, and around 0.003 in the validation set. Despite minor fluctuations caused by random sampling, the convergence of the prediction accuracy and prediction loss in both training and validation sets is acceptable.  
The visualized feature maps of five categories of this model are shown in Figure 5, which further verifies that this image classifier has successfully focused on the significant features in every category. The feature maps all roughly display rotational symmetry of 90\({}^{\circ}\) rotation about the center of the map since the 90\({}^{\circ}\), 180\({}^{\circ}\), and 270\({}^{\circ}\) anticlockwise rotated versions of images were included in both training and validation sets. Typically, in feature map 5 (a), the scattered bright dots correspond to the stars in the clear sky; in feature map 5 (b), the smooth and plain central region indicates the feature of thick cloud covers; in feature map 5 (c), the tiny intersecting lines form a large vertical intersecting structure in the central region, which reflect the feature of the light band; in feature map 5 (d), the darker region of the center and the larger light circles around it reflect the characteristics of the moonlight in the edge region; and in feature map 5 (e), most areas near the edge covered by bright features correspond to overexposure caused by the sun.