A multi-class method is proposed based on Error Correcting Output Codes algorithm in order to get better performance of attack recognition in Wireless Sensor Networks. Aiming to enhance the accuracy of attack detection, the multi-class method is constructed with Hadamard matrix and two-class Support Vector Machines. In order to minimize the complexity of the algorithm, sparse coding method is applied in this paper. The comprehensive experimental results show that this modified multi-class method has better attack detection rate compared with other three coding algorithms, and its time efficiency is higher than Hadamard coding algorithm.
 H. Ehsan and F. A. Khan, “Malicious AODV: Implementation and Analysis of Routing Attacks in MANETs,” IEEE Trust, Security and Privacy in Computing and Communications Conference TRUSTCOM, Liverpool, 25-27 June 2012, pp. 1181-1187.
 N. Shahid, I. H. Naqvi and S. B. Qaisar, “Quarter-Sphere SVM: Attribute and Spatio-Temporal Correlations Based Outlier & Event Detection in Wireless Sensor Networks,” IEEE Wireless Communications and Networking Conference WCNC, Shanghai, 1-4 April 2012, pp. 2048-2053.
 S. Xu, C. Hu, L. Wang and G. Zhang, “Support Vector Machines Based on K Nearest Neighbor Algorithm for Outlier Detection in WSNs,” Proceedings of the 8th Wireless Communications, Networking and Mobile Com- puting International Conference WICOM, Shanghai, 21-23 September 2012, pp. 1-4.
 D. Bi, X. Wang and S. Wang, “Particle Swarm Optimization Clustering for Target Classification in Wireless Sensor Networks,” Proceedings of the 4th Natural Computation International Conference, Jinan, 18-20 October 2008, pp. 111-115.
 A. B. Raj, M. V. Ramesh, R. V. Kulkarni and T. Hemalatha, “Security Enhancement in Wireless Sensor Networks Using Machine Learning,” High Performance Computing and Communication & 2012 IEEE 9th International Conference on Embedded Software and Systems HPCC-ICESS, Liverpool, 25-27 June 2012, pp. 1264- 1269.
 X. Liu, X. Zhang and J. Duan, “Speech Recognition Based on Support Vector Machine and Error Correcting Output Codes,” Pervasive Computing Signal Processing and Applications International Conference PCSPA, Harbin, 17-19 September 2010, pp. 336-339.
 F. Masulli and G. Valentini, “An Experimental Analysis of the Dependence among Codeword Bit Errors in ECOC Learning Machines,” Neurocomputing, Vol. 57, 2004, pp. 189-214. http://dx.doi.org/10.1016/j.neucom.2003.09.011
 J. Wales, “Hadamard matrix From Wikipedia,” 2013. http://en.wikipedia.org/wiki/Hadamard_matrix.
 M. M. Khedkar and S. A. Ladhake, “Robust Human Iris Pattern Recognition System Using Neural Network Approach,” Information Communication and Embedded Systems International Conference ICICES, Chennai, 21-22 February 2013, pp. 78-83.
 C. E. Loo, M. Y. Ng, C. Leckie and M. Palaniswami, “Intrusion Detection for Routing Attacks in Sensor Networks,” International Journal of Distributed Sensor Networks, Vol. 2, No. 4, 2006, pp. 313-332. http://dx.doi.org/10.1080/15501320600692044