High-efficiency image classification system and method based on Hu moment characteristics
The image classification system that optimizes Hu moment features through image preprocessing and feature fusion solves the problems of low computing efficiency and insufficient accuracy in the prior art, and realizes efficient and accurate image classification, which is suitable for complex image scenarios.
Patent Information
- Application Number
- CN202510353790.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-18
AI Technical Summary
The existing Humo-based image classification method has low computational efficiency, limited classification accuracy, and limited application scenarios, especially in complex image scenarios.
Grayscale, normalization and denoising are performed through the image preprocessing module, feature fusion is combined with Hu moment features and texture features and color features, and an adaptive support vector machine classifier is used to optimize the classifier parameters to improve classification accuracy and efficiency.
It significantly improves the calculation speed and accuracy of image classification, especially when high-resolution image processing, meets real-time requirements, and the classification accuracy is close to that of deep learning methods, and is suitable for complex image scenarios.
Smart Images

Figure CN120339686A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of image processing and pattern recognition, and specifically provides an efficient image classification system and method based on Hu moment features. Background Art
[0002] Image classification is an important research direction in the field of computer vision and is widely applied in fields such as medical image diagnosis, security monitoring, autonomous driving, and industrial inspection. Currently, image classification technologies are mainly divided into two categories: deep learning-based methods and traditional feature extraction-based methods.
[0003] In the prior art, Hu moments have the following important characteristics: translational invariance: under translational transformation of an image, Hu moments remain unchanged; rotational invariance: under rotational transformation of an image, Hu moments remain unchanged; scaling invariance: under scaling transformation of an image, Hu moments are only related to the scaling ratio and the influence can be eliminated through normalization processing. These characteristics make Hu moments have unique advantages in image recognition and classification, especially suitable for scenarios that require geometric transformation invariance processing of images.
[0004] Although Hu moments have significant advantages in image feature extraction, the existing Hu moment-based image classification methods still have the following deficiencies:
[0005] 1. Low computational efficiency: The traditional Hu moment calculation method has low efficiency when processing high-resolution images and is difficult to meet real-time requirements.
[0006] 2. Limited classification accuracy: When using only Hu moment features for classification, other information of the image (such as texture, color, etc.) may not be fully utilized, resulting in insufficient classification accuracy.
[0007] 3. Limited application scenarios: Existing Hu moment-based image classification methods are mostly targeted at specific types of images (such as simple geometric figures) and have less application in complex image scenarios (such as natural scene images, medical images, etc.). Summary of the Invention
[0008] The purpose of the present invention is to provide an efficient image classification system and method based on Hu moment features to solve the problems raised in the above background art.
[0009] To achieve the above purpose, the present invention provides the following technical solution: An efficient image classification system based on Hu moment features, comprising:
[0010] An image input module: responsible for receiving the image to be classified and supporting multiple image formats;
[0011] An image preprocessing module: preprocesses the input image, including grayscale conversion, normalization, and denoising operations to improve the robustness of feature extraction;
[0012] Feature extraction module: Calculate the Hu moment features of the image and perform feature fusion by combining other features;
[0013] Classifier module: Classify the image according to the extracted features, supporting multiple classifiers;
[0014] Output module: Output the classification result to the user interface or subsequent system, supporting visual display and data export.
[0015] Preferably, the image preprocessing module specifically includes:
[0016] Grayscale conversion: Convert the color image to a grayscale image based on OpenCV to reduce the amount of data and simplify the calculation;
[0017] Normalization: Use the OpenCV and NumPy libraries to normalize the pixel values of the grayscale image to the range [0, 1] to eliminate the influence of image brightness differences;
[0018] Denoising: Use median filtering to denoise the image and improve the image quality.
[0019] Preferably, the feature extraction module specifically includes:
[0020] On the preprocessed image, calculate its Hu moment features, and the specific steps are as follows:
[0021] Calculate the geometric moments of the image: Calculate its zero-order moment, first-order moment, and second-order moment according to the gray-scale distribution of the image;
[0022] Calculate the Hu moments: Calculate seven Hu moment invariants according to the geometric moments, and these invariants are invariant to the translation, rotation, and scaling of the image;
[0023] Feature fusion: Use the gray-level co-occurrence matrix to extract the texture features of the image, calculate the contrast and correlation, convert the image to the HSV color space, calculate its histogram, extract the color distribution features, normalize the Hu moment features, texture features, and color features, and then fuse them by weighted average to form a comprehensive feature vector, and the weights are adjusted according to the application scenario and experimental results.
[0024] Preferably, the classifier module specifically includes:
[0025] Classifier selection: Support vector machine;
[0026] Use the radial basis function as the kernel function and optimize the kernel function parameters by the grid search method;
[0027] According to the characteristics of Hu moment features, design an adaptive parameter adjustment strategy to dynamically adjust the values of C and γ according to the image category and feature distribution, improving the adaptability and robustness of the classifier;
[0028] Classifier training: Use the labeled training data set to train the classifier, optimize the classifier parameters, and improve the classification accuracy;
[0029] Classifier optimization: According to the characteristics of Hu moment features, design an adaptive classifier optimization strategy to dynamically adjust the classification parameters according to the image category, further improving the classification performance.
[0030] Preferably, the output module specifically includes: Feed back the classification result to the user or subsequent system through the output module, supporting the following functions:
[0031] Visualization display: Display the classification result graphically on the user interface for the user to view intuitively;
[0032] Data export: Export the classification result in CSV format for subsequent analysis and processing.
[0033] A classification method for an efficient image classification system based on Hu moment features, including the following steps:
[0034] Image preprocessing, receive the image to be classified, supporting multiple image formats; preprocess the input image, including grayscale conversion, normalization, and denoising operations, to improve the robustness of feature extraction;
[0035] Feature extraction, calculate the Hu moment features of the image, and perform feature fusion in combination with other features;
[0036] Classifier design, classify the image according to the extracted features, supporting multiple classifiers;
[0037] Classification result output, output the classification result to the user interface or subsequent system, supporting visualization display and data export.
[0038] The image preprocessing specifically includes:
[0039] Grayscale conversion: Based on OpenCV, convert the color image to a grayscale image to reduce the data volume and simplify the calculation;
[0040] Normalization: Use the OpenCV and NumPy libraries to normalize the pixel values of the grayscale image to the range [0, 1] to eliminate the influence of image brightness differences;
[0041] Denoising: Use median filtering to denoise the image and improve the image quality.
[0042] Preferably, the feature extraction specifically includes:
[0043] On the preprocessed image, calculate its Hu moment features. The specific steps are as follows:
[0044] Calculate the geometric moments of the image: According to the gray scale distribution of the image, calculate its zero-order moment, first-order moment, and second-order moment;
[0045] Calculate the Hu moments: Calculate seven Hu moment invariants based on the geometric moments. These invariants are invariant to the translation, rotation, and scaling of the image;
[0046] Feature fusion: Use the gray level co-occurrence matrix to extract the texture features of the image, calculate the contrast and correlation. Convert the image to the HSV color space, calculate its histogram, and extract the color distribution features. After normalizing the Hu moment features, texture features, and color features, fuse them by weighted averaging to form a comprehensive feature vector. The weights are adjusted according to the application scenario and experimental results.
[0047] Preferably, the classifier design specifically includes:
[0048] Classifier selection: Support Vector Machine;
[0049] Use the radial basis function as the kernel function and optimize the kernel function parameters through the grid search method;
[0050] Aiming at the characteristics of the Hu moment features, design an adaptive parameter adjustment strategy to dynamically adjust the values of C and γ according to the image category and feature distribution, improving the adaptability and robustness of the classifier;
[0051] Classifier training: Use the labeled training data set to train the classifier, optimize the classifier parameters, and improve the classification accuracy;
[0052] Classifier optimization: Aiming at the characteristics of the Hu moment features, design an adaptive classifier optimization strategy to dynamically adjust the classification parameters according to the image category, further improving the classification performance.
[0053] Preferably, feedback the classification result to the user or the subsequent system through the output module, supporting the following functions:
[0054] Visualization display: Display the classification result graphically on the user interface for the user to intuitively view;
[0055] Data export: Export the classification result in CSV format for subsequent analysis and processing.
[0056] Compared with the prior art, the beneficial effects of the present invention are:
[0057] The efficient image classification system and method based on Hu moment features proposed by the present invention significantly reduces redundant calculations by optimizing the calculation process of Hu moments and using image symmetry and block calculation techniques. Compared with the traditional Hu moment calculation method, the calculation speed is increased by more than about 30%, especially when processing high-resolution images, it can meet the real-time requirements and is applicable to fast image classification scenarios.
[0058] By combining Hu moment features, texture features, and color features for fusion, various information of the image is fully utilized, and the classification accuracy is significantly improved. Experimental results show that on medical images, natural scene images, and multi-class image datasets, the classification accuracy, recall rate, and F1 value of the method of the present invention are better than traditional feature extraction methods and are close to the performance of deep learning methods. Description of the Drawings
[0059] Figure 1 It is a flowchart of the method of the present invention. Detailed Embodiments
[0060] In order to clearly and completely describe the objectives, technical solutions of the present invention, and make the advantages more clearly understood, the following further details the embodiments of the present invention with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are some embodiments of the present invention, rather than all embodiments, and are only used to explain the embodiments of the present invention and are not used to limit the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
[0061] Embodiment 1, the present invention provides a technical solution: an efficient image classification system based on Hu moment features, including:
[0062] Image input module: responsible for receiving the image to be classified and supporting multiple image formats;
[0063] Image preprocessing module: preprocesses the input image, including grayscale conversion, normalization, and denoising operations to improve the robustness of feature extraction; specifically including:
[0064] Grayscale conversion: converts the color image into a grayscale image based on OpenCV to reduce the data volume and simplify the calculation;
[0065] Normalization: normalizes the pixel values of the grayscale image to the range [0, 1] using the OpenCV and NumPy libraries to eliminate the influence of image brightness differences;
[0066] Denoising: uses median filtering to denoise the image and improve the image quality.
[0067] Feature extraction module: calculates the Hu moment features of the image and performs feature fusion in combination with other features; specifically including:
[0068] On the pre - processed image, calculate its Hu - moment features. The specific steps are as follows:
[0069] Calculate the geometric moments of the image: According to the gray - level distribution of the image, calculate its zero - order moment, first - order moment, and second - order moment;
[0070] Calculate the Hu - moments: Calculate seven Hu - moment invariants based on the geometric moments. These invariants are invariant to translation, rotation, and scaling of the image;
[0071] Feature fusion: Use the gray - level co - occurrence matrix to extract the texture features of the image, calculate the contrast and correlation. Convert the image to the HSV color space, calculate its histogram, and extract the color - distribution features. After normalizing the Hu - moment features, texture features, and color features, fuse them by weighted average to form a comprehensive feature vector. The weights are adjusted according to the application scenario and experimental results.
[0072] Classifier module: Classify the image according to the extracted features, supporting multiple classifiers; specifically including:
[0073] Classifier selection: Support vector machine;
[0074] Use the radial basis function as the kernel function and optimize the kernel - function parameters by the grid - search method;
[0075] According to the characteristics of the Hu - moment features, design an adaptive parameter - adjustment strategy to dynamically adjust the values of C and γ according to the image category and feature distribution, improving the adaptability and robustness of the classifier;
[0076] Classifier training: Use the labeled training data set to train the classifier, optimize the classifier parameters, and improve the classification accuracy;
[0077] Classifier optimization: According to the characteristics of the Hu - moment features, design an adaptive classifier - optimization strategy to dynamically adjust the classification parameters according to the image category, further improving the classification performance.
[0078] Output module: Output the classification result to the user interface or subsequent system, supporting visual display and data export; specifically including: Feedback the classification result to the user or subsequent system through the output module, supporting the following functions:
[0079] Visual display: Display the classification result graphically on the user interface for the user to view intuitively;
[0080] Data export: Export the classification result in CSV format for subsequent analysis and processing.
[0081] Example 2. On the basis of Example 1, a classification method for an efficient image classification system based on Hu moment features is proposed, including the following steps:
[0082] Image preprocessing. Receive the image to be classified, supporting multiple image formats; perform preprocessing on the input image, including grayscale conversion, normalization, and denoising operations to improve the robustness of feature extraction; specifically including:
[0083] Grayscale conversion: Convert the color image to a grayscale image based on OpenCV to reduce the amount of data and simplify the calculation;
[0084] Normalization: Use the OpenCV and NumPy libraries to normalize the pixel values of the grayscale image to the range [0, 1] to eliminate the influence of image brightness differences;
[0085] Denoising: Use median filtering to denoise the image and improve the image quality.
[0086] Feature extraction. Calculate the Hu moment features of the image and perform feature fusion in combination with other features; specifically including:
[0087] On the preprocessed image, calculate its Hu moment features. The specific steps are as follows:
[0088] Calculate the geometric moments of the image: Calculate its zero-order moment, first-order moment, and second-order moment according to the grayscale distribution of the image;
[0089] Calculate the Hu moments: Calculate seven Hu moment invariants according to the geometric moments. These invariants are invariant to image translation, rotation, and scaling;
[0090] Feature fusion: Use the gray-level co-occurrence matrix to extract the texture features of the image, calculate the contrast and correlation, convert the image to the HSV color space, calculate its histogram, and extract the color distribution features. After normalizing the Hu moment features, texture features, and color features, fuse them by weighted average to form a comprehensive feature vector, and the weights are adjusted according to the application scenario and experimental results.
[0091] Classifier design. Classify the image according to the extracted features, supporting multiple classifiers; specifically including:
[0092] Classifier selection: Support vector machine;
[0093] Use the radial basis function as the kernel function and optimize the kernel function parameters by the grid search method;
[0094] Aiming at the characteristics of the Hu moment features, design an adaptive parameter adjustment strategy, dynamically adjust the values of C and γ according to the image category and feature distribution, and improve the adaptability and robustness of the classifier;
[0095] Classifier training: Use the labeled training dataset to train the classifier, optimize the classifier parameters, and improve the classification accuracy;
[0096] Classifier optimization: Design an adaptive classifier optimization strategy according to the characteristics of Hu moment features, dynamically adjust the classification parameters according to the image category, and further improve the classification performance.
[0097] Output of classification results: Output the classification results to the user interface or subsequent systems, supporting visual display and data export; Specifically, include: Feedback the classification results to the user or subsequent systems through the output module, supporting the following functions:
[0098] Visual display: Display the classification results graphically on the user interface for the user to view intuitively;
[0099] Data export: Export the classification results in CSV format for subsequent analysis and processing.
[0100] Experimental results show that the image classification system and method of the present invention have achieved good classification effects on multiple datasets. The following are some comparisons of experimental results:
[0101]
[0102]
[0103] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An efficient image classification system based on Hu moment features, characterized in that: It includes: Image input module: Responsible for receiving the images to be classified and supporting multiple image formats; Image preprocessing module: Preprocesses the input images, including grayscale conversion, normalization, and denoising operations to improve the robustness of feature extraction; Feature extraction module: Calculates the Hu moment features of the images and performs feature fusion by combining other features; Classifier module: Classifies the images according to the extracted features and supports multiple classifiers; Output module: Outputs the classification results to the user interface or subsequent systems, supporting visual display and data export.
2. The efficient image classification system based on Hu moment features according to claim 1, characterized in that: The image preprocessing module specifically includes: Grayscale conversion: Converts the color images to grayscale images based on OpenCV to reduce the data volume and simplify the calculation; Normalization: Normalizes the pixel values of the grayscale images to the range [0, 1] using the OpenCV and NumPy libraries to eliminate the influence of image brightness differences; Denoising: Performs denoising on the images using median filtering to improve the image quality.
3. An efficient image classification system based on Hu moment features according to claim 2, characterized in that: The feature extraction module specifically includes: On the preprocessed images, calculate their Hu moment features. The specific steps are as follows: Calculate the geometric moments of the images: Calculate their zero-order moments, first-order moments, and second-order moments according to the gray distribution of the images; Calculate the Hu moments: Calculate seven Hu moment invariants based on the geometric moments. These invariants are invariant to the translation, rotation, and scaling of the images; Feature fusion: Extracts the texture features of the images using the gray-level co-occurrence matrix, calculates the contrast and correlation, converts the images to the HSV color space, calculates their histograms, extracts the color distribution features, normalizes the Hu moment features, texture features, and color features, and then fuses them by weighted average to form a comprehensive feature vector. The weights are adjusted according to the application scenarios and experimental results.
4. An efficient image classification system based on Hu moment features according to claim 4, characterized in that: The classifier module specifically includes: Classifier selection: Support vector machine; Uses the radial basis function as the kernel function and optimizes the kernel function parameters through the grid search method; Aiming at the characteristics of the Hu moment features, designs an adaptive parameter adjustment strategy to dynamically adjust the values of C and γ according to the image categories and feature distributions, improving the adaptability and robustness of the classifier; Classifier training: Trains the classifier using the labeled training data set to optimize the classifier parameters and improve the classification accuracy; Classifier optimization: Aiming at the characteristics of the Hu moment features, designs an adaptive classifier optimization strategy to dynamically adjust the classification parameters according to the image categories, further improving the classification performance.
5. An efficient image classification system based on Hu moment features according to claim 5, characterized in that: The output module specifically includes: Feeds back the classification results to the user or subsequent systems through the output module, supporting the following functions: Visual display: Displays the classification results graphically on the user interface for the user to view intuitively; Data export: Exports the classification results in CSV format for subsequent analysis and processing.
6. A classification method for an efficient image classification system based on Hu moment features according to claim 5, characterized in that: It includes the following steps: Image preprocessing, receiving the images to be classified and supporting multiple image formats; Preprocesses the input images, including grayscale conversion, normalization, and denoising operations to improve the robustness of feature extraction; Feature extraction, calculating the Hu moment features of the images and performing feature fusion by combining other features; Classifier design, classifying the images according to the extracted features and supporting multiple classifiers; Classification result output, output the classification result to the user interface or subsequent systems, supporting visual display and data export.
7. A classification method according to claim 6, characterized in that: Image preprocessing specifically includes: Grayscale conversion: Based on OpenCV, convert the color image into a grayscale image to reduce the data volume and simplify the calculation; Normalization: Use the OpenCV and NumPy libraries to normalize the pixel values of the grayscale image to the range [0, 1] to eliminate the influence of image brightness differences; Denoising: Use median filtering to denoise the image and improve the image quality.
8. A classification method according to claim 7, characterized in that: Feature extraction specifically includes: On the preprocessed image, calculate its Hu moment features. The specific steps are as follows: Calculate the geometric moments of the image: According to the grayscale distribution of the image, calculate its zero-order moment, first-order moment, and second-order moment; Calculate the Hu moments: Calculate seven Hu moment invariants based on the geometric moments. These invariants are invariant to the translation, rotation, and scaling of the image; Feature fusion: Use the gray-level co-occurrence matrix to extract the texture features of the image, calculate the contrast and correlation, convert the image to the HSV color space, calculate its histogram, and extract the color distribution features. After normalizing the Hu moment features, texture features, and color features, fuse them by weighted average to form a comprehensive feature vector. The weights are adjusted according to the application scenario and experimental results.
9. A classification method according to claim 8, characterized in that: Classifier design specifically includes: Classifier selection: Support Vector Machine; Use the radial basis function as the kernel function and optimize the kernel function parameters by the grid search method; Aiming at the characteristics of the Hu moment features, design an adaptive parameter adjustment strategy to dynamically adjust the values of C and γ according to the image category and feature distribution, improving the adaptability and robustness of the classifier; Classifier training: Use the labeled training data set to train the classifier, optimize the classifier parameters, and improve the classification accuracy; Classifier optimization: Aiming at the characteristics of the Hu moment features, design an adaptive classifier optimization strategy to dynamically adjust the classification parameters according to the image category, further improving the classification performance.
10. A classification method according to claim 9, characterized in that: Classification result output specifically includes: Feed back the classification result to the user or subsequent systems through the output module, supporting the following functions: Visual display: Display the classification result graphically on the user interface for the user to view intuitively; Data export: Export the classification result in CSV format for subsequent analysis and processing.