## 3 System Design
### Model Training Parameters  
During model training, it is essential to preprocess the input images using experimental data for augmentation and to prevent overfitting while enhancing robustness. The main data augmentation methods are as follows:  
1. Images are cropped and resized to a unified size to facilitate training. 2. Horizontal flipping and random cropping are applied to some images. 3. Random rotation and scaling are applied to some images. 4. Image data are converted into tensors for easy model input. Furthermore, to achieve the global optimum model as quickly as possible while preventing overfitting, we utilize EarlyStopping and ReduceLROnPlateau from the Keras callback library. The EarlyStopping mechanism saves the best model parameters throughout the learning process to prevent overfitting. To track changes in accuracy, we set the  
Figure 3: ShuffleNet V1 scene recognition model architecture. monitor parameter to val_acc. If val_acc does not increase within 10 epochs, training is halted, and the weights at that point are used as model parameters. If the initial learning rate is no longer applicable to the model after a certain number of epochs, the learning rate is decreased to improve training efficiency. We use the ReduceLROnPlateau callback function from Keras to adaptively adjust the learning rate. The monitor parameter is also set to val_acc to track changes in accuracy, and the learning rate is reduced if the accuracy does not increase within five epochs. These optimization methods effectively avoid model overfitting and improve training efficiency. The formula for decreasing the learning rate is as follows: \(lr\) and \(new\_lr\) represent the initial learning rate and the reduced learning rate, respectively. \[new\_lr=lr*0.1 \tag{1}\]  
Using the callback function, we can achieve a better val_acc than not using it. Furthermore, the number of training epochs increases without triggering EarlyStopping too early, resulting in better optimization results. Cross-entropy is used to evaluate the difference between the current probability distribution obtained from training and the true distribution and is highly suitable for the multiclass scene recognition tasks addressed in this study. Therefore, we use the categorical cross-entropy loss for multiclass scene recognition tasks, which may belong to one of many categories. The principal formula for the loss function is as follows:  
\[\text{Loss }=-\sum_{i=1}^{\text{output}}y_{i}\cdot\log\hat{y}_{i} \tag{2}\]  
As shown in Equation (2), \(y_{i}\) can be either zero or one. When \(y_{i}=0\), the result will be zero; only when \(y_{i}=1\) will a corresponding classification result exist. Therefore, the categorical cross-entropy loss is only used for a predetermined result, which is typically used in combination with the SoftMax classifier for single-label classifications. In this study, a general scene recognition model based on the ShuffleNet network is trained, and its parameters are saved as H5 files for subsequent use. Simultaneously, the classification categories are saved as corresponding label files to explain and evaluate the predicted model results. The ShuffleNet network has fewer parameters and a faster running speed, and accuracy is used as the primary evaluation indicator. Accuracy represents the ratio of the number of times the model correctly classifies results over all judgments. The number of times the model is classified correctly is denoted by the sum of true positives (TPs) plus true negatives (TNs), and the total number of decisions is denoted as false positives (FPs) plus false negatives (FNs) plus (TP + TN). TPs represents the number of times a positive sample is correctly classified as a positive sample; TNs represents the number of times a negative sample is correctly classified as a negative sample; FPs represents the number of times a negative sample is incorrectly classified into a positive sample; TNs represents the number of times a positive sample is incorrectly classified as a negative sample.