## 3 System Implementation and Verification
### Temperature Prediction Using the CNN and LSTM Models  
To validate the indoor temperature prediction functionality, the LSTM [13] and CNN-LSTM [14] models were used to predict the ideal room temperature after training. For temperature prediction using the LSTM model, temperature data were uploaded to the model as an input vector. The first five-sixths of the data were used for training, while the last one-sixth was used for testing. The LSTM model comprises a 64-layer output dimension, a rectified linear unit (ReLU) activation function, and an Adam optimizer [18]. Figure 15: Mobile app homepage. The training was conducted over 25 epochs. The trained LSTM model was then tested to predict room temperature, which serves as the output vector. Figure 16 presents the results of indoor temperature prediction using the LSTM model. Additionally, the remaining data, such as indoor humidity and carbon dioxide levels, can also be utilized as input and output vectors. Next, a CNN-LSTM model was used to complete the training. The CNN model comprised a convolution layer, a pooling layer, and a flattening layer. The LSTM model comprised a recurrent layer and a fully connected layer. The CNN model was placed upstream of the LSTM model to reduce training time. Figure 17 illustrates the system architecture of the CNN-LSTM model. The setting parameters of the CNN-LSTM model were similar to those of the LSTM model. Figure 18 presents the results of the indoor temperature prediction using the CNN-LSTM model. A comparison of the results presented in Figures 16 and 18 reveals that the indoor temperature prediction performance of the CNN-LSTM model was comparable to that of the LSTM model. However, the training time of the CNN-LSTM model was much shorter than that of the LSTM model. The accuracy of the two models was evaluated based on their MAPE and root-mean-squared error (RMSE) [14]. RMSE was calculated using the following formula:  
\[RMSE=\sqrt{\frac{1}{n}{\sum\limits_{i=1}^{n}{\left({y_{i}-y_{i}^{p}}\right)^{2}}}} \tag{8}\]  
where \(n\) represents the total number of times, \(y_{i}\) represents the real data, and \(y_{i}^{P}\) represents the predicted data. The RMSE values of the LSTM and CNN-LSTM models were 0.042 \({}^{\circ}\)C and 0.117 \({}^{\circ}\)C, respectively. Table 2 presents a comparison of indoor temperature prediction performance across multiple studies, including the present study. Figure 16: Results of indoor temperature prediction using the LSTM model. The proposed LSTM and CNN-LSTM models are superior to the models used in other studies [14; 18; 19; 20; 21] based on the MAPE and RMSE values. Moreover, the LSTM model is more suitable for indoor temperature prediction. The proposed CNN-LSTM model takes approximately 3 min to complete 25 epochs of training [22]. This training time is 50% \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**References**} & \multicolumn{2}{c}{**MAPE (\%)**} & \multicolumn{2}{c}{**RMSE (\({}^{\circ}\)C)**} \\ \cline{2-5}  & **LSTM** & **CNN\(-\)LSTM** & **LSTM** & **CNN\(-\)LSTM** \\ \hline
[14] & 2.004 & 2.000 & 0.579 & 0.521 \\
[18] & 0.024 & \(-\) & 0.528 & \(-\) \\
[19] & 0.906 & \(-\) & 1.237 & \(-\) \\
[20] & 8.700 & 10.511 & 0.052 & 0.071 \\
[21] & 0.349 & 0.098 & 0.611 & 0.125 \\ This study & 0.180 & 1.370 & 0.042 & 0.117 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of indoor temperature prediction performance obtained in the present study with that reported in previous studies. Figure 17: System architecture of the CNN–LSTM model. Figure 18: Results of the indoor temperature prediction using the CNN–LSTM model. faster than that of the LSTM model alone. The model's key advantage lies in the strong generalization capabilities of CNNs. By utilizing convolutional layers, CNNs efficiently handle large-scale image data, avoiding the excessive computation caused by numerous parameters in traditional neural networks. As a result, the training time for the CNN-LSTM model was significantly reduced compared to the LSTM model.