Skip to main content
. 2024 Jul 24;24(15):4804. doi: 10.3390/s24154804
Algorithm 2. Signal modulation classification algorithm based on improved stacking.
Define:
(1) The dataset consists of a training set T and a validation set V with sample sizes t and v respectively;
(2) The features proposed in Section 2.1 are defined as base-features F with the dimension f, and the class labels of the signal samples are taken as the expected outputs;
(3) The number of folds for cross-validation is denoted as K, and the corresponding initialization index k is set to 1. The number of base-learner types is denoted as N, and the corresponding initialization index n is set to 1.
Input: Base-features
Output: Modulation type of signal
Training Phase
Training of base-learners:
1 Divide the training set T into K parts equally; the k-th part serves as the validation set Tak for the base-learner, containing tK samples; the remaining k−1 parts serve as the training set Tbk for the base-learner, containing (K − 1)tK samples
2 while (k < K) do
3   while (n < N) do
4     Initialize base-learner Bn
5     
  • B(n, k)=train(Bn, Tbk) // Train base-learner Bn on training set Tbk to obtain the corresponding pre-trained base-learner B(n, k)

6     
  • Q(n, k)=B(n, k)(Fk) // Input base-features Fk to pre-trained base-learner B(n, k) to obtain the corresponding output Q(n, k)

7 end while
8
  • Qk=[Q(1, k),Q(2, k),Q(3, k),⋯,Q(N, k)] // Concatenate [Q(1, k),Q(2, k),Q(3, k),⋯,Q(N, k)] along the feature axis to obtain the k-th fold feature Qk

9
  • Meta-feature enhancement: Pk=[Qk,Fk] // Concatenate Qk and Fk along the feature axis to obtain the enhanced meta-feature Pk

10 end while
11 P=[P1,P2,P3,⋯,PK] // Concatenate [P1,P2,P3,⋯,PK] along the sample axis to obtain the meta-feature set P, which is based on training set T
12 Save all pre-trained base-learners B(n, k)
Training of meta-learner:
13 Initialize the meta-learner M
14 M=train(M, P, OT) // Take the meta-feature set P as the input of meta-learner, take the labels of training set T, i.e., ground truth, as the target output OT for meta-learner, and then obtain pre-trained meta-learner by training
15 Save the pre-trained meta-learner
Validation Phase
1 Load all pre-trained base-learner B(n, k) and pre-trained meta-learner M
2 while (n < N) do
3   while (k < K) do
4   
  • Q(n,k)=B(n,k)(FV) // Input the base-feature FV of validation set V into all pre-trained base-learners B(n,k), and then obtain output Q(n,k)

5   end while
6   
  • Qn=Votingk(Q(n,1), Q(n,2), Q(n,3), ⋯, Q(n,K)) // Apply the voting method to Q(n,k) to obtain Qn

7 end while
8 Meta-feature enhancement: PV=[Q1,Q2,Q3,⋯,Qn,FV] // Concatenate [Q1,Q2,Q3,⋯,Qn] and FV along the feature axis to obtain enhanced meta-feature PV
9 R=M(PV) // Input PV into pre-trained meta-learner M to obtain prediction R
10 E=eval(R,OV) // Evaluate the prediction performance of R by comparing with the target output OV of the validation set V using relevant metrics
11 Return the prediction R and evaluation results E