Fish spectral classification based on principal component analysis

Li Xu, Alina Menchynska, Olena Ochkolyas, Mykola Nikolaenko
Abstract

Spectral detection technology can be used to identify different types of fish flesh and determine the presence of ingredients in samples, which helps to control the authenticity and conformity of products. The aim of this study was to develop and compare the effectiveness of machine learning methods for the classification of different types of fish based on hyperspectral data. In this paper, hyperspectral technology was used to obtain spectral data of 328 sampling points in the 400-1,000 nm band of four different fish, and the spectral curves were preprocessed to obtain more accurate and efficient spectral curves. The study systematically compared the preprocessing methods of Savitzky-Golay smoothing and multivariate scatter correction (MSC), and combined the principal component analysis (PCA) method to optimise the k-nearest neighbour (KNN) and support vector machine (SVM) classification models, in order to provide a more effective solution for fish classification. The principal component analysis method was used to reduce the dimensionality of the spectral data. The principal components after dimensionality reduction were compared with the full components, and the training set and test set were randomly generated. The SVM algorithm and the KNN algorithm were used in Python to predict and determine the accuracy of the model. It was shown that the average accuracy of spectral data after preprocessing and dimensionality reduction in the classification of SVM models can reach 97.25%, and the average classification accuracy of KNN models can reach 97.48%, which indicates that different types of fish flesh can be classified. Both models showed that overall, the preprocessing method that combines MSC and PCA is better than the single preprocessing method, highlighting the importance of PCA in removing redundant information and preserving key classification characteristics. When comparing the model performance under the same preprocessing conditions, the accuracy of SVM is higher than that of KNN, indicating that the SVM has greater adaptability to spectral data classification. Through the development and application of spectral detection technology, technological progress and innovation in food testing can be promoted, guiding the entire industry to a safer and more reliable future

Keywords

spectrum; Savitzky-Golay method; multiplicative scatter correction; k-nearest neighbours model; support vector machine algorithm

Suggested citation
Xu, L., Menchynska, A., Ochkolyas, O., & Nikolaenko, M. (2025). Fish spectral classification based on principal component analysis. Animal Science and Food Technology, 16(3), 70-85. https://doi.org/10.31548/animal.3.2025.70
References
  1. Chen, Z., Wang, Q., Zhang, H., & Nie, P. (2021). Hyperspectral Imaging (HSI) technology for the non-destructive freshness assessment of pearl gentian grouper under different storage conditions. Sensors, 21(2), article number 583. doi: 10.3390/s21020583
  2. Deng, Z., Wang, T., Zheng, Y., Zhang, W., & Yun, Y.-H. (2024). Deep learning in food authenticity: Recent advances and future trends. Trends in Food Science & Technology, 144, article number 104344. doi: 10.1016/j.tifs.2024.104344.
  3. Do, T.D., & Wong, L.L. (2025). Investigation of seafood mislabeling in Asia: A review of the literature and mitigation strategies. Journal of Agriculture and Food Research, 22, article number 101702. doi: 10.1016/j.jafr.2025.101702.
  4. European Convention for the Protection of Vertebrate Animals used for Experimental or other Scientific Purposes. (1986, March). Retrieved from https://rm.coe.int/168007a67b.
  5. Fan, K.-J., & Su, W.-H. (2022). Applications of fluorescence spectroscopy, RGB- and multispectral imaging for quality determinations of white meat: A review. Biosensors, 12(2), article number 76. doi: 10.3390/bios12020076.
  6. Fan, Y., Dong, R., Luo, Y., Tan, Y., Hong, H., Ji, Z., & Shi, C. (2024). Deep learning models with optimised fluorescence spectroscopy to advance freshness of rainbow trout predicting under nonisothermal storage conditions. Food Chemistry, 454, article number 139774. doi: 10.1016/j.foodchem.2024.139774.
  7. Feng, Y., Wan, S., Pan, S., Luan, P., Kong, L., & Zhu, M. (2023). Quantitative detection of surimi adulteration based on spectral reconstruction of RGB images. Transactions of the Chinese Society of Agricultural Engineering, 39(20), 275-282. doi: 10.11975/j.issn.1002-6819.202307013.
  8. He, L., Ma, J., Li, Q., Wang, L., Fan, S., & Zhang, Y. (2022). Determination of ingredients in livestock and poultry meat based on liquid chromatography-tandem mass spectrometry. Journal of Future Foods, 2(1), 53-60. doi: 10.1016/j.jfutfo.2022.03.017.
  9. Hu, Y., Huang, S.Y., & Lu, X. (2023). A green analytical method for fish species authentication based on Raman spectroscopy. Green Analytical Chemistry, 4, article number 100052. doi: 10.1016/j.greeac.2023.100052.
  10. Kim, N. (2021). Generalised indicator of the quality of qualimetry objects of various nature. Ukrainian Black Sea Region Agrarian Science, 25(1), 94-101. doi: 10.31521/2313-092X/2021-1(109)-12.
  11. Law of Ukraine No. 3447-IV “On the Protection of Animals from Cruelty”. (2006, February). Retrieved from https://zakon.rada.gov.ua/laws/show/3447-15#Text.
  12. Li, B., Lu, Y., Liu Y., & Wan, X. (2024). Detection of adulterated beef mince based on hyperspectral reflectance and transmission fusion technology. Transactions of the Chinese Society of Agricultural Engineering, 40(16), 251-260. doi: 10.11975/j.issn.1002-6819.202402097.
  13. Li, H., Zhang, L., Yu, Y., Ai, T., Zhang, Y., & Su, J. (2022). Rapid detection of Edwardsiella ictaluri in yellow catfish (Pelteobagrus fulvidraco) by real-time RPA and RPA-LFD. Aquaculture, 552, article number 737976. doi: 10.1016/j.aquaculture.2022.737976.
  14. Melnychuk, D.O., Melnychuk, S.D., Voitsitskyi, V.M., Hryshchenko, V.A., Kalachniuk, L.H., Khyzhniak, S.V., & Tsvilikhovskyi, V.I. (2016). Analytical research methods. Spectroscopic analysis methods: Theoretical foundations and techniques. Kyiv: Komprynt.
  15. Omwange, K.A., Saito, Y., Zichen, H., Khaliduzzaman, A., Kuramoto, M., Ogawa, Y., Kondo, N., & Suzuki, T. (2021). Evaluating Japanese dace (Tribolodon hakonensis) fish freshness during storage using multispectral images from visible and UV excited fluorescence. LWT, 151, article number 112207. doi: 10.1016/j.lwt.2021.112207.
  16. Palamarchuk, I., Yuanxia, F., Zhuravel, D., Petrychenko, I., Blishch, R., Holovatyuk, A., Domin, O., & Kostiuk, T. (2024). Spectroscopic assessment and quantitative analysis of the trace element composition of vegetable additives to meat products. Potravinarstvo Slovak Journal of Food Sciences, 18, 480-496. doi: 10.5219/1965.
  17. Qin, J., Vasefi, F., Hellberg, R.S., Akhbardeh, A., Isaacs, R.B., Yilmaz, A.G., Hwang, C., Baek, I., Schmidt, W.F., & Kim, M.S. (2020). Detection of fish fillet substitution and mislabeling using multimode hyperspectral imaging techniques. Food Control, 114, article number 107234. doi: 10.1016/j.foodcont.2020.107234.
  18. Rahman, M., Shibata, M., Nakazawa, N., Rithu, N.A., Nakauchi, S., Hagiwara, T., Osako, K., & Okazaki, E. (2022). Nondestructive approach for the prediction of pH in frozen fish meat using fluorescence fingerprints in tandem with chemometrics. Fishes, 7, article number 364. doi: 10.3390/fishes7060364.
  19. Rahman, M., Shibata, M., Nakazawa, N., Rithu, N.A., Okazaki, E., & Nakauchi, S. (2023). Potential of fluorescence fingerprints for fish meat authentication: Differences in freshness evaluation in white and dark meat at frozen state. Journal of Food Science, 88(12), 5339-5354. doi: 10.1111/1750-3841.16825.
  20. Shi, X., Zhang, J., Shi, C., Tan, Y., Hong, H., & Luo, Y. (2022). Nondestructive prediction of freshness for bighead carp (Hypophthalmichthys nobilis) head by Excitation-Emission Matrix (EEM) analysis based on fish eye fluid: Comparison of BPNNs and RBFNNs. Food Chemistry, 382, article number 132341. doi: 10.1016/j.foodchem.2022.132341.
  21. Tian, P. (2023). Research on salmon quality detection based on VIS-NIR spectroscopy and hyperspectral imaging technology. Beijing: Tongfang Knowledge Network (Beijing) Technology. doi: 10.27147/d.cnki.ghdju.2023.000624.
  22. Tsagkatakis, G., Nikolidakis, S., Petra, E., Kapantagakis, A., Grigorakis, K., Katselis, G., Vlahos, N., & Tsakalides, P. (2020). Fish freshness estimation though analysis of multispectral images with convolutional neural networks. Electronic Imaging, 32(12), 171-175. doi: 10.2352/issn.2470-1173.2020.12.fais-171.
  23. Wang, H., et al. (2019). Recent progress in hyperspectral imaging for nondestructive evaluation of fish quality. Food Science, 40(05), 329-338. doi: 10.7506/spkx1002-6630-20180129-392.
  24. Wang, R. (2022). Study on detection of surimi starch adulteration based on spectral reconstruction. Beijing: Tongfang Knowledge Network (Beijing) Technology. doi: 10.27158/d.cnki.ghznu.2022.001742.
  25. Wu, L., Ma, L., Zhang, Y., Tian, Y., Zhu, Y., & Zhang, Y. (2025). Detection of coated cabbage seeds color based on hyperspectral imaging technology. Journal of Analysis and Testing, 44(3), 454-463. doi: 10.12452/j.fxcsxb.240711212.
  26. Xu, T. (2020). Detection of drug residues in fish based on surface enhanced Raman spectroscopy. Beijing: Tongfang Knowledge Network (Beijing) Technology. doi: 10.27314/d.cnki.gsscu.2020.000414.
  27. Yuan, Y., Ji, Z., Fan, Y., Xu, Q., Shi, C., Lyu, J., & Ertbjerg, P. (2025). Deep learning-assisted fluorescence spectroscopy for food quality and safety analysis. Trends in Food Science & Technology, 156, article number 104821. doi: 10.1016/j.tifs.2024.104821.
  28. Zhou, J., Wu, X., & Chen, Z. (2019). Rapid prediction of freshness of Megalobrama amblycephala using near infrared spectroscopy. Journal of Huazhong Agricultural University, 38(4), 120-126. doi: 10.13300/j.cnki.hnlkxb.2019.04.016.