To accurately identify apple varieties on the assembly line and to improve the development of the apple quality detection, we proposed a possibilistic fuzzy c‐means (PFCM) algorithm based on similar particle swarm optimization (SPSO) for classifying near‐infrared spectroscopy (NIR) spectra. We took the objective function of PFCM as the fitness function of SPSO (SPSO‐PFCM), which reduced the dependence on fuzzy c‐means algorithm (FCM). The similarity between particles maintained the diversity of particles and then avoided premature convergence of particle swarm optimization (PSO). In the experiment, we classified four kinds of apples. SPSO‐PFCM was utilized to develop the classification model for the NIR spectra of apples. The results showed that SPSO‐PFCM had the highest clustering accuracy, which reached 96%. We also used two datasets to verify the algorithm, and the results proved that SPSO‐PFCM had the highest accuracy. Therefore, SPSO‐PFCM combined with NIR was an effective method to identify apple varieties.
Practical Applications
Different kinds of apples have various nutritional components and prices. Based on this, to identify apple varieties faster, correctly and nondestructively, SPSO‐PFCM and NIR reflectance spectroscopy were used to build a powerful classification model. The experimental results showed that compared with the other four algorithms, SPSO‐PFCM has apparent advantages. A novel method for apple classification of apple varieties using SPSO‐PFCM and NIR spectroscopy was introduced in this paper. With this method, the factory can classify apples quickly and accurately.