|
Algorithm 1 CNN-based IoT attack detection |
|
Require:
Dataset , learning rate , batch size B, epochs E, folds K
|
|
Ensure:
Trained model , results
|
| 1: Normalize features:
|
| 2: Initialize model weights
|
| 3: Initialize result set
|
| 4: Stratified K-fold split on
|
| 5: for all
do
|
| 6:
|
| 7: for to E do
|
| 8: Shuffle
|
| 9: for all do
|
| 10:
|
| 11:
|
| 12:
|
| 13:
|
| 14:
|
| 15:
|
| 16: end for
|
| 17:
|
| 18:
|
| 19: if EarlyStopping() then
|
| 20: Break |
| 21: end if
|
| 22: end for
|
| 23: Append to
|
| 24: end for
|
| 25: return
|