As the integral part of the new generation of information technology, the Internet of things significantly accelerates the intelligent sensing and data fusion in different industrial processes including mining, assisting people to make appropriate decision. These days, an increasing number of coal mine disasters pose a serious threat to people’s lives and property especially in several developing countries. In order to assess the risks arisen from gas explosion or gas poisoning, wireless sensor data should be processed and classified efficiently. Due to the fact that the “negative samples” of coal mine safety data are scarce, least squares support vector machine is introduced to deal with this problem. In addition, several swarm intelligence techniques such as particle swarm optimization, artificial bee colony algorithm, and genetic algorithm are applied to optimize the hyper parameters of least squares support vector machine. Using the popular deep neural networks, convolutional neural network and long short-term memory model, as comparisons, a number of experiments are carried out on several UCI machine learning datasets with different features. Experimental results show that least squares support vector machine optimized by swarm intelligence techniques can effectively handle classification task on different datasets especially on those datasets with limited samples and mixed attributes. The application of least squares support vector machine optimized by swarm intelligence techniques on real coal mine data demonstrates that this algorithm can process the data accurately and timely, therefore can warn of the accidents early in mining workplace.