To effectively mitigate Sinkhole attacks in wireless sensor networks (WSN) , this paper proposes a novel Sinkhole attack detection and defense strategy (IF-GBO) that integrates isolation forest (IF) and gradient-based optimizer (GBO) . First, a detection threshold is established to trigger the IF-GBO intrusion detection mechanism, thereby reducing network overhead and improving detection efficiency. Second, considering the characteristics of Sinkhole attacks and the dynamic real-time nature of WSN data, a multidimensional feature dataset is designed, incorporating node hop count, energy consumption, packet reception/forwarding rate, and time delay. The model is trained using a sliding window sampling approach, which not only enhances the algorithm's operational efficiency but also improves the accuracy of malicious node identification. Finally, a multi-objective path selection function is developed,leveraging the GBO algorithm to assist nodes in rapidly identifying alternative transmission paths to counter Sinkhole attacks. This approach effectively ensures reliable data transmission,extends network lifetime,and resolves the issue of delayed delivery of anomaly detection results to the legitimate sink node. Experimental results demonstrate that compared to conventional anomaly detection models such as support vector machine(SVM),k-nearest neighbors(KNN)and local outlier factor(LOF),IF-GBO achieves higher accuracy in identifying malicious nodes with lower false positive rates and superior generalization capability. Furthermore,when compared to dedicated Sinkhole attack detection algorithms like hop count-based detection scheme for Sinkhole attack(HCODESSA)and a Sinkhole detection algorithm based on the random routes selected by minimum hop(RMHSD),the GBO-based defense strategy significantly mitigates the disruptive effects of Sinkhole attacks on the network,ensuring routing security and reliability.
| 科 Family | 属数 Number of genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) | 属 Genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) |
|---|---|---|---|---|---|---|
| 鹅膏菌科Amanitaceae | 2 | 11 | 5.26 | 鹅膏菌属 Amanita | 10 | 4.78 |
| 小菇科 Mycenaceae | 2 | 12 | 5.74 | 丝盖伞属 Inocybe | 5 | 2.39 |
| 多孔菌科 Polyporaceae | 8 | 14 | 6.70 | 蜡蘑属 Laccaria | 5 | 2.39 |
| 红菇科 Russulaceae | 3 | 23 | 11.00 | 小皮伞属 Marasmius | 6 | 2.87 |
| 小菇属 Mycena | 11 | 5.26 | ||||
| 光柄菇属 Pluteus | 5 | 2.39 | ||||
| 红菇属 Russula | 17 | 8.13 | ||||
| 栓菌属 Trametes | 5 | 2.39 |