When it comes to selecting an optimal defense strategy for an intrusion detection system of a wireless sensor network, such challenges as those brought about by the diversification of the attack methods and the expanded database of the attack patterns have to be dealt with. To overcome those challenges, this paper combines realistic bounded rationality with the incomplete information of the attack-defense players by employing evolutionary game theory as a tool. Firstly, an attack-defense evolutionary game model considering three types of population, in which attackers are subdivided by the source of the threat into external attackers and selfish nodes, is proposed. The sets of player types and the game strategies in our model can be extended from 2× 2 to n× m × l. The sensitivity of the evolutionary population to similar strategies, which reflects the efficiency change in the multi-agent learning process, is depicted by a replicator dynamic equation especially optimized for this purpose by the introduction of an enhanced cooperation mechanism. In essence, an optimal defense strategy selection algorithm is provided by calculating the evolutionary stable equilibrium and a description of the evolutionary trajectory of the players over time is obtained. Moderate security and proactive defense in the form of support decisions have been provided by our method for wireless sensor networks. Experimental results have verified the validity of our method. Moreover, the optimized algorithm has solved the problem that an excessively large database of attack patterns affects the speed of switching to the optimal defense decision strategy and the learning efficiency of the evolutionary game replicator dynamic mechanism is not fast enough.