In the processing and transmitting of data via wireless networks, wireless sensor networks (WSNs) are being commonly used. Similar to its minimal cost and fast connectivity, this form of network is currently used in several systems for surveillance operations in various domains. In these networks, the nodes use a finite source of energy which, as it is sustainable, concludes the life of the network after its degradation. They are vulnerable to various threats referring to the vulnerabilities in the sensor network. Denial of Service (DoS) is another important attack threatening WSN. DoS attacks show the lack of energy in these sensors by stopping the nodes from entering into idle mode and conserving energy. The Abnormal Sensor Identification Accuracy technique is used in this paper to prevent DoS attacks to minimize the amount of energy consumed. A new and unique lift-set algorithm is based on the Imperialist Competitive Algorithm (ICA) is proposed in this article. The proposed algorithm that uses the ICA specifies the nodes of the sensor that must be chosen in various live sets. The live sets are developed to detect all applied goals as the algorithm efficiently wants to continue. Several evaluations have been performed to test the efficiency of the proposed algorithm and the results achieved show that the proposed methodology performs better than alternative algorithms to expand the lifespan of the network.