Image recognition based on combination of RGB–HSV color and shape features using PCA and K-nearest neighbor
DOI:
https://doi.org/10.52465/joscex.v7i2.111Keywords:
Flower image recognition, PCA, HSV, RGB, Shape features, K-nearest neighborAbstract
This study aims to accurately separate flower objects from complex backgrounds in artificial intelligence (AI)-based plant management systems. Previous studies have shown limitations in preprocessing techniques and often did not explicitly report classification accuracy. To address these issues, the proposed framework consists of eight stages. The process begins with image size standardization to 150 × 150 pixels, followed by low-pass filtering and image sharpening to enhance object boundaries. Segmentation is then performed sequentially using RGB and HSV color models to achieve more precise object separation. Subsequently, Sobel edge detection and thinning are applied to extract geometric features, such as distances between petal tips and flower perimeter measurements. The extracted features are optimized using Principal Component Analysis (PCA), which reduces the original ten attributes to four principal components, thereby eliminating data redundancy before classification using the Euclidean distance-based K-Nearest Neighbor (KNN) algorithm. Experimental results show that PCA preserves 86.7% of the original data variance, while the proposed system achieves an overall average classification accuracy of 88% at k = 5. Specifically, the recognition accuracies obtained for the four flower categories were 93.33% for Flower A, 86.67% for Flower B, 90.00% for Flower C, and 80.00% for Flower D. The main contribution of this research is the integration of intensive preprocessing techniques, the combination of RGB-HSV color features with geometric shape features, and PCA-based feature optimization, which collectively improve the stability and computational efficiency of KNN classification.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Journal of Soft Computing Exploration

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
