A method for image classification based on feature enhancement
By adopting feature enhancement technology in the image classification model, the problem of low accuracy of complex image classification is solved, and higher image classification accuracy and overall performance are achieved.
Patent Information
- Application Number
- CN202110414447.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-16
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2041-04-16
AI Technical Summary
The existing image classification model has different classification accuracy for images to be classified of different complexity, resulting in a low classification accuracy.
The image classification method based on feature enhancement is adopted, by acquiring the features of pre-classified images, using the residual feature enhancement algorithm to enhance features, generate enhanced features, and classifying images through feature classification and gradient division.
It improves the accuracy of the image classification model, can process complex images more effectively, and improves the overall performance of image classification.
Smart Images

Figure CN114627327B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image classification method based on feature enhancement. Background Art
[0002] At present, with the continuous development of science and technology, image processing technology is widely used to solve various problems, such as image classification, pedestrian detection, and medical diagnosis through deep learning models.
[0003] In the related art, a sample set (training set) is trained using the same image classification model to obtain a single image classification model; and all images to be classified (test set) are classified and identified based on the single image classification model to obtain a classification result.
[0004] However, the image classification model obtained by this method has different classification accuracy for images to be classified of different complexity. For example, the classification accuracy for simple samples (images to be classified) is high, but the classification accuracy for complex samples is poor, resulting in a low accuracy of the obtained image classification model. Summary of the invention
[0005] The present invention provides an image classification method based on feature enhancement, which is used to solve the problem that the accuracy of an image classification model is low.
[0006] An image classification method based on feature enhancement, comprising:
[0007] Obtain pre-classified images and extract image features;
[0008] Using a residual feature enhancement algorithm to enhance the image features to generate enhanced features;
[0009] Classifying the enhanced features and calculating reference feature parameters of each type of enhanced features;
[0010] Determining a comprehensive feature mean of each pre-classified image according to the reference feature parameters;
[0011] Performing gradient division on the comprehensive feature mean to determine the gradient corresponding to each comprehensive feature mean;
[0012] The pre-classified image is classified according to the gradient.
[0013] As an embodiment of the present invention: the obtaining of the pre-classified image and extracting the image features includes:
[0014] The pre-classified image is processed based on the RGB color space to obtain the first image feature; wherein,
[0015] The first image features include: texture features, shape features, spatial relationship features and color features;
[0016] The pre-classified image is processed based on the HSV color space to obtain the second image feature; wherein,
[0017] The second image features include: hue features, saturation features and brightness features.
[0018] As an embodiment of the present invention: the acquiring of the first image feature further includes:
[0019] Pre-setting the RGB color space, extracting the first feature rule of the pre-classified image; wherein,
[0020] The first feature extraction rules include: color extraction rules, texture extraction rules, shape extraction rules and spatial relationship extraction rules;
[0021] According to the color extraction rule, the color of each pixel of the pre-classified image is divided to determine the color feature;
[0022] According to the texture extraction rule, the texture features of the pre-classified image are extracted in a preset manner to determine the texture features; wherein,
[0023] The preset methods include: gray-level co-occurrence matrix, Tamura texture feature, autoregressive texture model, and wavelet transform;
[0024] According to the shape extraction rule, extract the shape composed of each color of the pre-classified image to determine the shape feature;
[0025] According to the spatial relationship extraction rule, a three-dimensional coordinate system is constructed according to the spatial position of each pixel point of the pre-classified image to determine the spatial relationship feature.
[0026] As an embodiment of the present invention: the acquiring of the second image feature further includes:
[0027] Pre-setting the HSV color space, the second feature extraction rule for the pre-classified image; wherein,
[0028] The second feature extraction rule includes: a hue extraction rule, a saturation extraction rule and a brightness extraction rule;
[0029] According to the hue extraction rule, the chromaticity value of each pixel of the pre-classified image is set to determine the chromaticity feature;
[0030] According to the saturation extraction rule, each pixel of the classified image is compared with a preset color spectrum to determine a saturation feature;
[0031] According to the brightness extraction rule, the brightness of each pixel of the classified image is extracted to determine the brightness feature.
[0032] As an embodiment of the present invention, the method of enhancing the image features by using a residual feature enhancement algorithm to generate enhanced features includes:
[0033] Pre-built deep convolutional neural network models;
[0034] Processing the pre-classified image through the deep convolutional neural network model to determine a cross entropy loss function;
[0035] Substituting the cross entropy loss function into the residual enhancement algorithm for calculation to determine the enhanced objective function;
[0036] Substituting the pre-classified image into the objective function for processing to generate an enhanced image;
[0037] The feature value of the enhanced image is calculated to determine the enhanced feature.
[0038] As an embodiment of the present invention, the step of classifying the enhanced features and calculating reference feature parameters of each type of enhanced features includes:
[0039] According to the enhanced features, element recognition is performed on the pre-classified images to determine the element attributes of each pre-classified image respectively; wherein,
[0040] The image attributes include: element outline attributes, element position attributes and element area attributes;
[0041] According to the element attributes, the pre-classified image is attribute-classified;
[0042] According to the enhanced features, reference feature parameters of each pre-classified image are determined by calculating elements of the pre-classified images after attribute classification.
[0043] As an embodiment of the present invention: determining the reference feature parameters of each pre-classified image includes:
[0044] Step 1: Obtain the element contour attributes of the pre-classified image and determine the contour reference parameters by the following formula:
[0045]
[0046] Among them, w i represents the attribute characteristics of the i-th pixel; C represents the length of the current element; K represents the width of the current element; Z(i) represents the edge coefficient of the i-th pixel; α and β represent balance factors; S represents the contour curve;
[0047] Step 2: Obtain the element position attribute of the pre-classified image and determine the position reference parameter by the following formula:
[0048]
[0049] Among them, k represents the position feature of the i-th pixel;
[0050] Step 3: Obtain the element area attribute of the pre-classified image and determine the area reference parameter by the following formula:
[0051]
[0052] Among them, m i Represents the area feature of the i-th pixel;
[0053] Step 4: According to the contour reference parameter, the position reference parameter and the area reference parameter, the reference feature parameter is determined by the following formula:
[0054]
[0055] Wherein, Q represents the reference characteristic parameter.
[0056] As an embodiment of the present invention, determining the comprehensive feature mean of each pre-classified image according to the reference feature parameter includes:
[0057] Respectively obtaining reference feature parameters of each element in the pre-classified image;
[0058] A normal distribution function for each element in the pre-classified image;
[0059] The comprehensive feature mean of each pre-classified image is determined according to the normal distribution function and the reference feature parameters.
[0060] As an embodiment of the present invention: the step of performing gradient division on the comprehensive feature mean and determining the gradient corresponding to each comprehensive feature mean includes:
[0061] Determining the comprehensive feature mean of each image in each of the pre-classified images respectively;
[0062] The comprehensive feature means are subjected to correlation calculation according to the same value;
[0063] Obtaining a correlation value of the correlation calculation;
[0064] Gradient division is performed according to the magnitude of the correlation value to determine the gradient corresponding to each comprehensive feature mean.
[0065] As an embodiment of the present invention: classifying the pre-classified image according to the gradient includes:
[0066] According to the gradient and gradient quantity corresponding to each comprehensive feature mean, the corresponding pre-classified image is determined;
[0067] and dividing the pre-classified image into the same sequence with the same number of gradients according to the gradient;
[0068] The pre-classified images are classified according to the same sequence.
[0069] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0070] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0072] Figure 1 The present invention is a flowchart of an image classification method based on feature enhancement in an embodiment of the present invention. DETAILED DESCRIPTION
[0073] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0074] As attached Figure 1 As shown, an image classification method based on feature enhancement includes:
[0075] A pre-classified image is obtained and image features are extracted; when extracting image features, the present invention extracts features based on two color spaces (HSV color space and RGB color space), and performs feature enhancement after feature extraction.
[0076] The image features are enhanced by using a residual feature enhancement algorithm to generate enhanced features; the purpose of residual feature enhancement is mainly to enhance the reliability of features based on residuals.
[0077] The enhancement features are classified, and reference feature parameters of each type of enhancement features are calculated; the purpose of feature classification is that in image processing, after feature classification, different images are classified and fragmented, making it easier to process the details.
[0078] Determining a comprehensive feature mean of each pre-classified image according to the reference feature parameters;
[0079] The reference feature parameters are the iconic parameters of each feature, including color parameters, brightness parameters, etc. The purpose is to mark and distinguish each feature and to better analyze the details of the image.
[0080] The comprehensive feature mean is gradient divided to determine the gradient corresponding to each comprehensive feature mean; the gradient division is because each type of picture may have a certain correlation in the comprehensive features, and this correlation is within an interval in the comprehensive value, and the gradient is the comprehensive feature value interval of different types of pictures, so the present invention can be classified according to the gradient, for example: grassland pictures, whose comprehensive feature values are between 1 and 15, then as long as the comprehensive feature values of the pictures are between these values, they are all pictures of the same type.
[0081] The pre-classified image is classified according to the gradient.
[0082] The principle and beneficial effect of the above technical solution are: the present invention uses the feature enhancement technology of the image to classify the features and calculate the parameters of each enhanced feature after the feature enhancement of the image. Because an image may have multiple types of features, the present invention calculates the comprehensive feature value of each image when calculating the parameters of each image, and then classifies the pre-classified images through the gradient division method of the comprehensive feature value. The present invention can quickly classify images, and after feature enhancement, efficient classification of images can be achieved.
[0083] As an embodiment of the present invention: the obtaining of the pre-classified image and extracting the image features includes:
[0084] The pre-classified image is processed based on the RGB color space to obtain the first image feature; wherein,
[0085] The first image features include: texture features, shape features, spatial relationship features and color features;
[0086] The pre-classified image is processed based on the HSV color space to obtain the second image feature; wherein,
[0087] The second image features include: hue features, saturation features and brightness features.
[0088] The principle and beneficial effect of the above technical solution are: the present invention introduces RGB color space and HSV color space to obtain the texture features, shape features, spatial relationship features, color features, hue features, saturation features and brightness features of the image respectively, and obtains features from the high granularity of the features. The purpose is to determine all the feature parameters of the picture.
[0089] As an embodiment of the present invention: the acquiring of the first image feature further includes:
[0090] The RGB color space is pre-set to extract the first feature of the pre-classified image; wherein the RGB color space can reflect the color, problem, shape and spatial relationship, so the present invention sets relevant rules to extract features.
[0091] The first feature extraction rules include: color extraction rules, texture extraction rules, shape extraction rules and spatial relationship extraction rules;
[0092] According to the color extraction rule, the color of each pixel of the pre-classified image is divided to determine the color feature;
[0093] According to the texture extraction rule, the texture features of the pre-classified image are extracted in a preset manner to determine the texture features; wherein,
[0094] The preset methods include: gray-level co-occurrence matrix, Tamura texture features, autoregressive texture model, and wavelet transform; each method can realize the function of determining texture features, and any one of them can be selected.
[0095] According to the shape extraction rule, extract the shape composed of each color of the pre-classified image to determine the shape feature;
[0096] According to the spatial relationship extraction rule, a three-dimensional coordinate system is constructed according to the spatial position of each pixel point of the pre-classified image to determine the spatial relationship features. The purpose is to determine the relevant parameters according to the rule.
[0097] The principle and beneficial effect of the above technical solution are: the present invention performs feature extraction in RGB color space according to feature extraction rules corresponding to features. Color features include the color of each pixel, and texture features are calculated and obtained by multiple preset methods. Shape features are extracted based on color recognition, and spatial relationship features are extracted in a three-dimensional coordinate system.
[0098] As an embodiment of the present invention: the acquiring of the second image feature further includes:
[0099] Pre-setting the HSV color space, the second feature extraction rule for the pre-classified image; wherein,
[0100] The second feature extraction rule includes: a hue extraction rule, a saturation extraction rule and a brightness extraction rule;
[0101] According to the hue extraction rule, the chromaticity value of each pixel of the pre-classified image is set to determine the chromaticity feature;
[0102] According to the saturation extraction rule, each pixel of the classified image is compared with a preset color spectrum to determine a saturation feature;
[0103] According to the brightness extraction rule, the brightness of each pixel of the classified image is extracted to determine the brightness feature.
[0104] The principle and beneficial effect of the above technical solution are that the present invention performs feature extraction in the HSV color space and also uses feature extraction rules corresponding to the features for extraction. The chromaticity value is determined by comparing with a preset image, the saturation is determined by comparing the color spectrum, and the lightness is determined by the specific brightness of the image.
[0105] As an embodiment of the present invention, the method of enhancing the image features by using a residual feature enhancement algorithm to generate enhanced features includes:
[0106] A deep convolutional neural network model is pre-built; the deep convolutional neural network model is a universal network model. The present invention processes images through this network model and can calculate the cross entropy loss function of the image, which is mainly to reflect the difference between images, and this difference is the difference between different images and the difference with the established labeled images.
[0107] Processing the pre-classified image through the deep convolutional neural network model to determine a cross entropy loss function;
[0108] Substituting the cross entropy loss function into the residual enhancement algorithm for calculation to determine the enhanced objective function;
[0109] Substituting the pre-classified image into the objective function for processing to generate an enhanced image;
[0110] The feature value of the enhanced image is calculated to determine the enhanced feature.
[0111] The principle and beneficial effect of the above technical solution are as follows: in the process of feature enhancement, the present invention pre-builds a convolutional neural network model, and then calculates the cross entropy loss function, that is, the loss function in the classification process, through this network model, and then determines the target function based on the feature enhancement algorithm. Then, the image is enhanced by the target function to obtain an enhanced image.
[0112] As an embodiment of the present invention, the step of classifying the enhanced features and calculating reference feature parameters of each type of enhanced features includes:
[0113] According to the enhanced features, element recognition is performed on the pre-classified images to determine the element attributes of each pre-classified image respectively; wherein,
[0114] The image attributes include: element outline attributes (i.e., outline shape), element position attributes (positions of different elements on the image + addresses of different images), and element area attributes (size of each element in the image);
[0115] According to the element attributes, the pre-classified image is attribute-classified;
[0116] According to the enhanced features, reference feature parameters of each pre-classified image are determined by calculating elements of the pre-classified images after attribute classification.
[0117] The principle and beneficial effect of the above technical solution are: when performing enhanced feature calculation, the present invention extracts element attributes of the image to be classified according to the element attributes, and then classifies and calculates the reference feature parameters of each classified image based on the element attributes.
[0118] As an embodiment of the present invention: determining the reference feature parameters of each pre-classified image includes:
[0119] Step 1: Obtain the element contour attributes of the pre-classified image and determine the contour reference parameters by the following formula:
[0120]
[0121] Among them, w i represents the attribute characteristics of the i-th pixel; C represents the length of the current element; K represents the width of the current element; Z(i) represents the edge coefficient of the i-th pixel; α and β represent balance factors; S represents the contour curve;
[0122] Step 2: Obtain the element position attribute of the pre-classified image and determine the position reference parameter by the following formula:
[0123]
[0124] Among them, k represents the position feature of the i-th pixel;
[0125] Step 3: Obtain the element area attribute of the pre-classified image and determine the area reference parameter by the following formula:
[0126]
[0127] Among them, mi Represents the area feature of the i-th pixel;
[0128] Step 4: According to the contour reference parameter, the position reference parameter and the area reference parameter, the reference feature parameter is determined by the following formula:
[0129]
[0130] Wherein, Q represents the reference characteristic parameter.
[0131] The principle and beneficial effect of the above technical solution are: the present invention calculates the attributes of the element from three aspects, including the contour attribute of the element, the location and type of the element, and the area attribute of the element, and calculates the reference parameters of the element from three aspects, and then determines the specific reference feature parameters of each pixel point by calculating the correlation.
[0132] As an embodiment of the present invention, determining the comprehensive feature mean of each pre-classified image according to the reference feature parameter includes:
[0133] The reference feature parameters of each element in the pre-classified image are obtained respectively; the reference feature parameters are attribute characteristic parameters of the elements set in advance, such as area parameters, size parameters, etc. of the elements.
[0134] A normal distribution function for each element in the pre-classified image;
[0135] The comprehensive feature mean of each pre-classified image is determined according to the normal distribution function and the reference feature parameters.
[0136] The principle and beneficial effect of the above technical solution are: the present invention uses the elements of the image to be classified as reference feature parameters, determines the difficulty of the reference feature parameters based on the normal distribution function, and then determines the comprehensive feature mean of each image through the normal distribution function and the reference feature parameters, which is easy to calculate and can display the comprehensive feature mean of each image through the image. The role of the normal distribution reflects the probability of each element appearing in the picture.
[0137] As an embodiment of the present invention: the step of performing gradient division on the comprehensive feature mean and determining the gradient corresponding to each comprehensive feature mean includes:
[0138] Determining the comprehensive feature mean of each image in each of the pre-classified images respectively;
[0139] The comprehensive feature means are subjected to correlation calculation according to the same value;
[0140] Obtaining a correlation value of the correlation calculation;
[0141] Gradient division is performed according to the magnitude of the correlation value to determine the gradient corresponding to each comprehensive feature mean.
[0142] The principle and beneficial effect of the above technical solution are: when performing gradient division, the present invention judges the pictures corresponding to the same comprehensive feature value through the comprehensive feature mean, and then determines the gradient corresponding to each comprehensive feature value based on the correlation between the pictures.
[0143] As an embodiment of the present invention: classifying the pre-classified image according to the gradient includes:
[0144] According to the gradient and gradient quantity corresponding to each comprehensive feature mean, the corresponding pre-classified image is determined;
[0145] and dividing the pre-classified image into the same sequence with the same number of gradients according to the gradient;
[0146] The pre-classified images are classified according to the same sequence.
[0147] The principle and beneficial effect of the above technical solution are as follows: the present invention evenly divides the pre-classified image by comprehensively considering the number of gradients corresponding to the feature mean, and then realizes accurate division of the pre-classified image based on the same sequence.
[0148] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for image classification based on feature enhancement, characterized in that: include: Obtain pre-classified images and extract image features; Using a residual feature enhancement algorithm to enhance the image features to generate enhanced features; Classifying the enhanced features and calculating reference feature parameters of each type of enhanced features; The step of classifying the enhanced features and calculating reference feature parameters of each type of enhanced features includes: According to the enhanced features, element recognition is performed on the pre-classified images to determine the element attributes of each pre-classified image respectively; wherein, The image attributes include: element outline attributes, element position attributes and element area attributes; According to the element attributes, the pre-classified image is attribute-classified; Determining reference feature parameters of each pre-classified image by calculating elements of the pre-classified image after attribute classification according to the enhanced features; Determining a comprehensive feature mean of each pre-classified image according to the reference feature parameters; Performing gradient division on the comprehensive feature mean to determine the gradient corresponding to each comprehensive feature mean; Wherein, determining the comprehensive feature mean of each pre-classified image according to the reference feature parameter includes: Respectively obtaining reference feature parameters of each element in the pre-classified image; A normal distribution function for each element in the pre-classified image; Determining a comprehensive feature mean of each pre-classified image according to the normal distribution function and the reference feature parameters; The pre-classified image is classified according to the gradient.
2. The image classification method based on feature enhancement as claimed in claim 1, characterized in that: The obtaining of the pre-classified image and extracting image features includes: The pre-classified image is processed based on the RGB color space to obtain a first image feature; wherein, The first image features include: texture features, shape features, spatial relationship features and color features; The pre-classified image is processed based on the HSV color space to obtain a second image feature; wherein, The second image features include: hue features, saturation features and brightness features.
3. The image classification method based on feature enhancement as claimed in claim 2, characterized in that: The acquiring the first image feature further comprises: Pre-setting the RGB color space, extracting the first feature rule of the pre-classified image; wherein, The first feature extraction rules include: color extraction rules, texture extraction rules, shape extraction rules and spatial relationship extraction rules; According to the color extraction rule, the color of each pixel of the pre-classified image is divided to determine the color feature; According to the texture extraction rule, the texture features of the pre-classified image are extracted in a preset manner to determine the texture features; wherein, The preset methods include: gray-level co-occurrence matrix, Tamura texture feature, autoregressive texture model, and wavelet transform; According to the shape extraction rule, extract the shape composed of each color of the pre-classified image to determine the shape feature; According to the spatial relationship extraction rule, a three-dimensional coordinate system is constructed according to the spatial position of each pixel point of the pre-classified image to determine the spatial relationship feature.
4. The image classification method based on feature enhancement as claimed in claim 2, characterized in that: The acquiring the second image feature further comprises: Pre-setting the HSV color space, the second feature extraction rule for the pre-classified image; wherein, The second feature extraction rule includes: a hue extraction rule, a saturation extraction rule and a brightness extraction rule; According to the hue extraction rule, the chromaticity value of each pixel of the pre-classified image is set to determine the chromaticity feature; According to the saturation extraction rule, each pixel of the classified image is compared with a preset color spectrum to determine a saturation feature; According to the brightness extraction rule, the brightness of each pixel of the classified image is extracted to determine the brightness feature.
5. The image classification method based on feature enhancement as claimed in claim 1, characterized in that: The step of using a residual feature enhancement algorithm to enhance the image features to generate enhanced features includes: Pre-built deep convolutional neural network models; Processing the pre-classified image through the deep convolutional neural network model to determine a cross entropy loss function; Substituting the cross entropy loss function into the residual enhancement algorithm for calculation to determine the enhanced objective function; Substituting the pre-classified image into the objective function for processing to generate an enhanced image; The feature value of the enhanced image is calculated to determine the enhanced feature.
6. The image classification method based on feature enhancement as claimed in claim 1, characterized in that: The step of determining the reference feature parameters of each pre-classified image comprises: Step 1: Obtain the element contour attributes of the pre-classified image and determine the contour reference parameters by the following formula: ; in, Indicates The attribute characteristics of each pixel; Indicates the length of the current element; Indicates the width of the current element; Indicates Pixel edge coefficient; and represents the balance factor; Represents the contour curve; Step 2: Obtain the element position attribute of the pre-classified image and determine the position reference parameter by the following formula: ; in, Indicates The position characteristics of pixels; Step 3: Obtain the element area attribute of the pre-classified image and determine the area reference parameter by the following formula: ; in, Indicates The area characteristics of pixels; Step 4: According to the contour reference parameter, the position reference parameter and the area reference parameter, the reference feature parameter is determined by the following formula: ; in, Represents a reference feature parameter.
7. The image classification method based on feature enhancement as claimed in claim 1, characterized in that: The step of performing gradient division on the comprehensive feature mean and determining the gradient corresponding to each comprehensive feature mean includes: Determining the comprehensive feature mean of each image in each of the pre-classified images respectively; The comprehensive feature means are subjected to correlation calculation according to the same value; Obtaining a correlation value of the correlation calculation; Gradient division is performed according to the magnitude of the correlation value to determine the gradient corresponding to each comprehensive feature mean.
8. The image classification method based on feature enhancement as claimed in claim 1, characterized in that: Classifying the pre-classified image according to the gradient includes: According to the gradient and gradient quantity corresponding to each comprehensive feature mean, the corresponding pre-classified image is determined; and dividing the pre-classified image into the same sequence with the same number of gradients according to the gradient; The pre-classified images are classified according to the same sequence.
Citation Information
Patent Citations
Characteristic enhancing method and device of data samples and classifier training method and device
CN106294490A
A neural network smoke image classification method fusing dark channels
CN109740673A