Summary
The development of the wireless sensor networks (WSN) being deployed among numerous application for its sensing capabilities is increasing at a very fast tread. Its distributed nature and ability to extend communication even to the inaccessible areas beyond communication range that lacks human intervention has made it even more attractive in a wide space of applications. Confined with numerous sensing nodes distributed over a wide area, the WSN incurs certain limitations as it is battery powered. Many developed routing enhancements with power and energy efficiency lacked in achieving the significant improvement in the performance. So, the paper proposes a machine learning system (capsule network) and technique (data pruning) for WSN involved in the real world observations to have knowledge‐based learning from the experience for an intelligent way of handling the dynamic and real environment without the intervention of the humans. The WSN cluster‐based routing aided with capsule network and data pruning proffered in paper enables the WSN to have a prolonged network lifetime, energy efficiency, minimized delay, and enhanced throughput by reducing the energy usage and extending communication within the limited battery availability. The proposed system is validated in the network simulator and compared with the WSN without ML to check for the performance enhancements of the WSN with ML inclusions in terms of quality of service enhancements, network lifetime, packet delivery ratio, and energy to evince the efficacy of the WSN with capsule network‐based data pruning.