Research Article

Ethereum Ponzi Scheme Detection Based on PD-SECR

Algorithm 2

CNN-RF detection method.
input:
epochs number of training rounds feature, label features and labels of the input data set.
W processed data set by SMOTEENN
output:
The detection result, output the category 0 or 1 of the predicted feature
(1)W is divided into Train set Wtrain and Test set Wtest and save as PKl file;
(2)if is_balance = true then load_balance.pkl;
(3)else load imbalance.pkl;
(4)setup
(5)for epoch in range(epochs) do
(6)for feature, label in Wtraindo
(7)  Training feature extraction model CNN;
(8)  
(9)  setup optimizer;
(10) Evaluate the feature extraction model CNN;
(11) save best feature extraction model as best.pt and return it;
(12) setup scheduler
(13)Training classification detection model RF;
(14)if is_balance = true then load_balance.pkl;
(15)else load imbalance.pkl;
(16)load(best.pt);
(17)
(18)Classification model for classification detection;
(19)
(20)ifthen return 1;
(21)else otherwise return 0;