# CAA-RF: An Anomaly Detection Algorithm for Computing Power Blockchain Networks
## 4 Experimental Results and Analysis
### Performance Evaluation and Comparative Analysis
As shown in Figures 7b and 9b, compared with the CAA model, the CAA-RF model exhibits a significantly smaller decrease in metrics during the middle and later stages of training. From these two metrics, the CAA-RF model structure, compared to the CAA model, shows that at 250 s, the CAA model experiences a noticeable decline on the test set and develops overfitting as training progresses. However, the decline in the CAA-RF model is much less pronounced, indicating that it can effectively alleviate overfitting during training. To further verify the effectiveness of integrating random forest structures with other deep learning models, we conducted additional experiments. We selected one high-performing model and one lower-performing model, specifically, the Variational Autoencoder (VAE) and the Long Short-Term Memory (LSTM) Network, to enhance representativeness. The experimental results are shown in the figures. Figures 8a and 9a display the F1 score and accuracy over the first 60 training epochs, respectively. Figures 8a and 9a illustrate the trends of F1 score and accuracy during the first 60 training epochs. By comparison, it can be observed that the VAE-RF and LSTM-RF models, which combine random forest with VAE and LSTM, respectively, exhibit significant improvements in both metrics compared to using VAE and LSTM alone. This demonstrates that integrating random forest with deep learning models can effectively enhance classification performance. To enhance the accuracy and robustness of anomaly detection in blockchain networks, we have introduced multiple innovations in our model design. Our model utilizes convolutional neural networks to extract high-level features and captures complex spatial characteristics within blockchain networks through multiple layers of sophisticated convolutional structures. By incorporating a self-attention mechanism, the model can dynamically focus on key features while suppressing irrelevant ones. This mechanism is particularly important for anomaly detection, as it effectively addresses the issue of imbalanced data distribution in blockchain networks. The ever-changing environment of blockchain leads to feature distribution drift; therefore, we adopt an adaptive mechanism that dynamically adjusts the learning rate, enabling the model to reduce the learning rate, alleviate overfitting, and enhance robustness to changes. Random forest demonstrates excellent performance in classification tasks, especially in scenarios with small sample sizes and imbalanced data, due to its inherent robustness. By combining high-level featuresextracted through deep learning with random forest, classification performance is further improved, and the risk of overfitting that may occur with a single deep learning model is reduced. In terms of computational cost balance, although the training time of CAA-RF is slightly higher than that of a standalone random forest model, it maintains moderate CPU usage, memory consumption, and floating-point operations per second (FLOPS), thus achieving a good balance between performance and resource consumption. Considering the actual blockchain network environment, data may vary, and the performance of the model may decline. However, our model is designed with this issue in mind and can mitigate the degradation caused by such differences. To address real-world scenarios, we have adopted a combination of CNNs and self-attention mechanisms, feature transfer ensemble learning, and adaptive training mechanisms. Real network traffic may include a wider variety of attack types, noise, abnormal patterns, and diverse normal business activities, as well as network fluctuations, latency, and data loss, resulting in more complex data distributions and higher requirements for model scalability. Blockchain nodes, protocols, and network topology may change over time, leading to feature distribution drift. In real-world scenarios, attacks are only a minority, which also causes data imbalance.