In areas such as smart grids, intelligent healthcare, circular economies in smart cities, and underwater surveillance, a Cluster-Based Wireless Sensor Network (CBWSN) is a system designed to remotely control and observe specific events or phenomena. The wide range of applications of technology in almost every field of human activityexposes it to various security threats from cybercriminals. One of the pressing concerns that requires immediate attention is the risk of security breaches such as traffic intrusions in wireless sensor networks. Inadequate detection of denial-of-service (DoS) attacks, including flooding, blackhole, grayhole, and scheduling attacks, can cause sensor nodes to run out of energy. This may result in the failure of some sensor nodes, which would reduce the network's lifetime or coverage. Significant computational complexity has resulted from the detection of such attacks in related works.The creation of Cluster-Based Wireless Sensor Network and Variable Selection Ensemble Machine Learning Algorithms (CBWSN_VSEMLA) as a security threats detection system framework for DoS attack detection was suggested in this PAPER