Abstract To resolve the conflicting requirements of measurement precision and real-time performance speed, an improved algorithm for pattern classification and recognition was developed. The angular distribution of diffracted light varies with particle size. These patterns could be classified into groups with an innovative classification based upon reference dust samples. After such classification patterns could be recognized easily and rapidly by minimizing the variance between the reference pattern and dust sample eigenvectors. Simulation showed that the maximum recognition speed improves 20 fold. This enables the use of a single-chip, real-time inversion algorithm. An increased number of reference patterns reduced the errors in total and respiring coal dust measurements. Experiments in coal mine testify that the accuracy of sensor achieves 95%. Results indicate the improved algorithm enhances the precision and real-time capability of the coal dust sensor effectively.