# CAA-RF: An Anomaly Detection Algorithm for Computing Power Blockchain Networks
## 3 Network Anomaly Detection Strategy for Computing Power Blockchain Networks
By combining the structural advantages of machine learning models with the feature extraction capabilities of deep learning models, the overall generalization performance and prediction accuracy of the model are improved. In 2022, [PERSON] et al. proposed an unsupervised anomaly detection method that identifies abnormal behaviors in WAX blockchain NFT transactions through clustering and statistical analysis [18]. This method mainly relies on unsupervised clustering algorithms for anomaly detection and belongs to the category of single-machine learning models. In 2023, [PERSON] et al. proposed a system that combines blockchain and traditional network intrusion detection technologies, leveraging distributed and immutable characteristics to enhance detection security [19]. This method is mainly based on traditional machine learning and rule-based approaches and does not involve serial or parallel integration with deep learning. In 2019, [PERSON] et al. proposed a serial deep learning model based on autoencoders and AlexNet for network intrusion detection [20]. This method automatically extracts features and performs classification through a multi-layer serial structure of deep neural networks, representing a typical deep learning serial model. In 2021, [PERSON] et al. proposed a network intrusion detection system combined with a parallel stacking ensemble method, which obtained the highest accuracy of 80.10% on the NSL-KDD dataset, effectively improving the detection performance [21]. In 2024, [PERSON] et al. conducted a parallel comparison of machine learning algorithms such as SVM, random forest, and isolation forest, evaluating their performance in blockchain anomaly detection [22]. This study focuses on the parallel comparison and integration of different machine learning models. In 2023, [PERSON] et al. proposed a supervised anomaly detection method based on conditional Generative Adversarial Networks and ensemble active learning, which improves detection performance through a parallel architecture of multiple discriminators and an active sampling strategy [23]. This method belongs to the category of parallel deep learning models, emphasizing multi-model collaboration and active learning. The core model of the CPBN anomaly detection system is the CAA-RF model, and its overall structure is mainly divided into the following three parts. Since the collected data often exhibit class imbalance in the labels, we first performed data normalization during preprocessing to eliminate the influence of different feature scales and bring all features to a comparable level, thereby improving the effectiveness of model training. Subsequently, to further tackle this issue, we employed the Adaptive Synthetic Sampling (ADASYN) method in our experiments to handle data imbalance. ADASYN generates synthetic samples for the minority class and dynamically adjusts the number of generated samples to balance the data distribution, thus enhancing the model's ability to learn from the minority class and effectively mitigating the negative impact of data imbalance on model performance. To accelerate convergence and improve training efficiency, we chose the Adam optimizer, a widely used adaptive learning rate optimization algorithm. For the loss function, we use the cross-entropy loss (CrossEntropyLoss) as the objective function because it is suitable for multi-class classification problems and can directly handle both the classification labels and the network's unnormalized probability distributions.