Require:
1: Set of controllers
2: Time step t, Learning rate , Batch size B, Regularization parameter
3: Dataset from east–west traffic telemetry
4: Initial local malicious detection models:
5: CNN-based model , SVM-based model , General local model
6: Controller private keys and public keys
Ensure:
7: Updated and signed local models with digital signatures
8: Prepared model updates for secure transmission to the blockchain layer
9: for each controller node do
10: Step 1: Data Collection
11: Load local traffic data from east–west interface flows
12: Extract feature vectors
13: Step 2: Local Model Initialization
14: Retrieve previous local models
15: Step 3: Gradient Computation for General Model
16: Compute gradient of loss:
17: Step 4: General Model Update
18: Update local model weights:
19:
20: Step 5: CNN Model Training
21: For each batch do
22: Extract batch samples
23: Compute CNN gradient:
24:
25: end for
26: Update CNN model:
27:
28: Step 6: SVM Model Training with Hinge Loss
29: For each sample do
30: Compute indicator function:
31:
32: Calculate SVM gradient component:
33:
34: end for
35: Aggregate gradient over dataset and update:
36:
37: Step 7: Digital Signature Creation
38: Sign updated model using private key:
39:
40: Step 8: Secure Transmission
41: Transmit to blockchain layer
42: Step 9: Signature Verification
43: Verify signature with public key:
44:
45: if validation accepted then
46: Accept model update for global aggregation
47: else
48: Reject update, log security alert
49: end if
50: end for