Multi-feature fusion animal image classification method and device and storage medium
Through the animal image classification method of multi-feature fusion and the dynamic adjustment of weights using animal image feature models, the problem of insufficient classification accuracy under complex background and lighting conditions is solved, and higher classification accuracy is achieved.
Patent Information
- Application Number
- CN202510301565.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-09-26
AI Technical Summary
Existing animal image classification methods lack accuracy under complex background and lighting conditions, and multi-feature fusion methods fail to dynamically adjust weights, resulting in unsatisfactory fusion effects.
The image is independently predicted through the animal image feature model, color feature model, shape feature model and texture feature model to generate a probability distribution vector set, dynamically calculate the weight set, and determine the final classification result based on the maximum probability value set and the weight set.
It improves the accuracy of animal image classification, can effectively cope with classification tasks under complex backgrounds and lighting conditions, and dynamically adjusts weights to integrate the advantages of multiple feature models.
Smart Images

Figure CN120707912A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of animal image classification, and in particular to a multi-feature fusion animal image classification method, device and storage medium. Background Art
[0002] Animal image classification is a key research area in computer vision, widely used in animal behavior research, biodiversity monitoring, and ecological conservation. Early research primarily relied on handcrafted features and traditional machine learning classifiers, such as SIFT (Scale-Invariant Feature Transform) and HOG (Histogram of Oriented Gradients) feature extraction methods. While these methods can address animal image classification to a certain extent, they are often sensitive to image rotation, scaling, and illumination variations, and their performance is limited when processing large datasets. In recent years, deep learning models (particularly convolutional neural networks and Transformer models) have been introduced to image classification tasks, significantly improving classification accuracy. However, these models tend to overlook local feature details in fine-grained classification tasks and lack adaptability to complex backgrounds and lighting conditions. Furthermore, existing multi-feature fusion methods typically employ fixed weighting or concatenation strategies, failing to dynamically adjust the weights of each feature based on the specific task or data distribution, resulting in suboptimal fusion results. Therefore, it is urgent to develop animal image classification methods that can comprehensively utilize multiple features and dynamically adjust weights to improve classification accuracy. Summary of the Invention
[0003] This application provides an animal image classification method based on multi-feature fusion, which can improve the accuracy of animal image classification under complex background and lighting conditions.
[0004] In a first aspect, the present application provides a multi-feature fusion animal image classification method, comprising:
[0005] Obtain animal image test data to be classified;
[0006] Independently predict the animal image test data using an animal image feature model, a color feature model, a shape feature model, and a texture feature model to obtain corresponding probability distribution vectors, and form all probability distribution vectors into a probability distribution vector set;
[0007] A weight set is obtained according to the probability distribution vector set and a preset weight calculation method, and a classification result of the animal image test data is determined according to the probability distribution vector set and the weight set.
[0008] The embodiment of the present application predicts animal images from multiple dimensions and obtains a probability distribution vector set, which can fully capture the details of the image. Then, the present application extracts the maximum value of the component of each vector in the probability distribution vector set and forms a maximum probability value set, which can highlight the most significant contribution of each feature model to the classification result. Then, the present application adopts a weight calculation method to obtain a weight set based on the maximum probability value set. By dynamically allocating weights, the contribution of each feature model to the final prediction result can be adjusted according to its performance on the current test data. Finally, the present application obtains the final prediction probability based on the probability distribution vector set and the weight set. By synthesizing the weighted probability distribution vector, the advantages of multiple feature models can be effectively integrated. Compared with the existing technology that easily ignores local features, the present application can improve the accuracy of animal image classification by comprehensively utilizing color, texture, and shape features and dynamically adjusting weights, effectively coping with classification tasks under complex backgrounds and lighting conditions.
[0009] As a preferred example of the first aspect, the weight set is obtained according to the probability distribution vector set and a preset weight calculation method, specifically:
[0010] Extracting the maximum value of each component of each probability distribution vector in the probability distribution vector set, and forming a maximum probability value set from all the extracted maximum values of the components;
[0011] Adding each element in the maximum probability value set to obtain a total probability value;
[0012] The proportion of each element in the maximum predicted probability value set to the total probability value is used as the feature weight corresponding to the element, and all feature weights are combined into a weight set.
[0013] In this preferred example, the weight allocation is dynamic by adding up each element in the maximum probability value set to obtain the total probability value and dynamically allocating feature weights according to the proportion of each element in the total.
[0014] As a preferred example of the first aspect, determining the classification result of the animal image test data according to the probability distribution vector set and the weight set is specifically:
[0015] Multiplying each vector in the probability distribution vector set by the corresponding weight in the weight set to obtain a weighted probability distribution vector set;
[0016] Adding the components at the same position of each vector in the weighted probability distribution vector set to obtain a predicted probability distribution vector;
[0017] The maximum value of the component in the predicted probability distribution vector is extracted to obtain the classification result of the animal image test data.
[0018] In this preferred example, a weighted probability distribution vector set is obtained by multiplying each vector in the probability distribution vector set by the corresponding weight, and the components of these vectors at the same position are added together, and finally the maximum value of the component is extracted as the predicted probability, thereby realizing the fusion of the prediction results of multiple feature models.
[0019] As a preferred example of the first aspect, the method for constructing the animal image feature model, the color feature model, the shape feature model, and the texture feature model includes:
[0020] Constructing an animal image dataset, removing the background of each image in the animal image dataset to obtain a first target area image dataset;
[0021] generating a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset;
[0022] The animal image dataset, the color feature image dataset, the shape feature dataset and the texture feature dataset are trained independently to obtain an animal image feature model, a color feature model, a shape feature model and a texture feature model.
[0023] In this preferred example, by constructing an animal image dataset and removing the background to extract the target area, color, shape and texture feature image datasets are generated, and these datasets are independently trained to obtain multiple feature models, thereby achieving multi-dimensional modeling of animal images.
[0024] As a preferred example of the first aspect, generating a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset is specifically:
[0025] Convert each image in the first target area image dataset into HSV space to obtain a second target area image dataset, and decompose pixels of each image in the second target area image dataset into a first hue component, a first saturation component, and a first brightness component;
[0026] multiplying the first saturation component of each picture in the second target area image dataset by a preset enhancement factor to obtain a second saturation component;
[0027] The first saturation component of each picture in the second target area image dataset is replaced with the second saturation component to obtain a third target area image dataset.
[0028] In this preferred example, by converting the image into the HSV space and enhancing the saturation component, the present invention can highlight the color features of the image, thereby improving the distinguishing ability and classification accuracy of the color feature model.
[0029] As a preferred example of the first aspect, generating a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset is specifically:
[0030] Performing Gaussian blur processing on each image in the first target area image dataset to obtain a blurred image dataset;
[0031] The Canny edge detection algorithm is used to perform edge detection on each image in the blurred image dataset to obtain a shape feature image dataset.
[0032] In this preferred example, by reducing image noise through Gaussian blur processing and detecting edges using the Canny algorithm, the shape features of the image can be effectively extracted, thereby enhancing the recognition and classification capabilities of the shape feature model for animal images.
[0033] As a preferred example of the first aspect, generating a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset is specifically:
[0034] Performing grayscale processing on each image in the first target area image dataset to obtain a grayscale image dataset;
[0035] A local binary pattern algorithm is used to extract texture features from each image in the grayscale image dataset to obtain a texture feature image dataset.
[0036] In this preferred example, the texture features are extracted by grayscale processing and local binary pattern algorithm, which can effectively enhance the expressive ability of texture features, thereby improving the classification accuracy and discrimination of animal images by the texture feature model.
[0037] In a second aspect, the present application provides a multi-feature fusion animal image classification device, comprising: a test data acquisition module, an independent prediction module, a maximum probability value calculation module, a weight calculation module, and a prediction probability generation module:
[0038] The test data acquisition module is used to acquire the test data to be classified;
[0039] The feature model prediction module is used to independently predict the test data using an animal image feature model, a color feature model, a shape feature model, and a texture feature model, respectively obtaining corresponding probability distribution vectors, and forming all probability distribution vectors into a probability distribution vector set;
[0040] The maximum probability value calculation module is used to extract the maximum value of each component of the probability distribution vector in the probability distribution vector set, and form a maximum probability value set from all the extracted component maximum values;
[0041] The weight calculation module is used to obtain a weight set using a weight calculation method according to the maximum probability value set;
[0042] The predicted probability generation module is used to obtain the predicted probability based on the probability distribution vector set and the weight set.
[0043] As a preferred example of the second aspect, the weight calculation device includes a probability sum calculation unit and a feature weight calculation unit;
[0044] The probability sum calculation unit is used to add each element in the maximum probability value set to obtain a probability value sum;
[0045] The feature weight calculation unit is used to take the proportion of each element in the maximum predicted probability value set to the total probability value as the feature weight corresponding to the element, and form all feature weights into a weight set.
[0046] As a preferred example of the first aspect, the prediction probability generating device includes a vector generating unit, a component adding unit, and a probability acquiring unit;
[0047] The vector generating unit is configured to multiply each vector in the probability distribution vector set by a corresponding weight in the weight set to obtain a weighted probability distribution vector set;
[0048] The component adding unit is used to add the components at the same position of each vector in the weighted probability distribution vector set to obtain a predicted probability distribution vector;
[0049] The probability acquisition unit is used to extract the maximum value of the component in the predicted probability distribution vector to obtain the predicted probability of the test data.
[0050] As a preferred example of the first aspect, the independent prediction module includes a background removal unit, a feature image generation unit, and a feature model training unit;
[0051] The background removal unit is used to construct an animal image dataset, remove the background of each picture in the animal image dataset, and obtain a first target area image dataset;
[0052] The feature image generating unit is configured to generate a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset;
[0053] The feature model training unit is used to independently train the animal image dataset, the color feature image dataset, the shape feature dataset and the texture feature dataset to obtain an animal image feature model, a color feature model, a shape feature model and a texture feature model.
[0054] As a preferred example of the first aspect, the feature image generation unit includes a component decomposition subunit, a saturation enhancement subunit and an image reconstruction subunit;
[0055] The component decomposition subunit is used to convert each image in the first target area image dataset into an HSV space to obtain a second target area image dataset, and decompose pixels of each image in the second target area image dataset into a first hue component, a first saturation component, and a first brightness component;
[0056] The saturation enhancement subunit is configured to multiply the first saturation component of each picture in the second target area image data set by a preset enhancement factor to obtain a second saturation component;
[0057] The image recombining subunit is configured to replace the first saturation component of each picture in the second target area image dataset with the second saturation component to obtain a third target area image dataset.
[0058] As a preferred example of the first aspect, the feature image generation unit further includes a Gaussian blur processing subunit and an edge detection subunit;
[0059] The Gaussian blur processing subunit is used to perform Gaussian blur processing on each image in the first target area image dataset to obtain a blurred image dataset;
[0060] The edge detection subunit is used to perform edge detection on each image in the blurred image dataset using a Canny edge detection algorithm to obtain a shape feature image dataset.
[0061] As a preferred example of the first aspect, the feature image generation unit further includes a grayscale processing subunit and a texture feature extraction subunit;
[0062] The grayscale processing subunit is used to perform grayscale processing on each image in the first target area image dataset to obtain a grayscale image dataset;
[0063] The texture feature extraction subunit is used to extract texture features from each image in the grayscale image dataset using a local binary pattern algorithm to obtain a texture feature image dataset.
[0064] On the third aspect, the present application also provides a computer storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the multi-feature fusion animal image classification method described in the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 A schematic flow chart of a multi-feature fusion animal image classification method provided in some embodiments of the present application;
[0066] Figure 2 A flowchart of object extraction from animal images provided for some embodiments of the present application;
[0067] Figure 3 A multi-feature fusion prediction flow chart provided for some embodiments of the present application;
[0068] Figure 4 A schematic diagram of the dynamic weight allocation principle provided in some embodiments of the present application;
[0069] Figure 5 This is a schematic structural diagram of a multi-feature fusion animal image classification device provided in some embodiments of the present invention. DETAILED DESCRIPTION
[0070] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0071] Example 1
[0072] Please refer to Figure 1 , an animal image classification method based on multi-feature fusion provided by an embodiment of the present invention, including S11 to S13, specifically:
[0073] S11: Obtain animal image test data to be classified;
[0074] S12: independently predicting the animal image test data using an animal image feature model, a color feature model, a shape feature model, and a texture feature model, respectively obtaining corresponding probability distribution vectors, and forming all probability distribution vectors into a probability distribution vector set;
[0075] Furthermore, in some embodiments of the present application, the method for constructing the animal image feature model, the color feature model, the shape feature model, and the texture feature model includes steps S121 to S123, each of which is specifically as follows:
[0076] S121: constructing an animal image dataset, removing the background of each picture in the animal image dataset, and obtaining a first target area image dataset;
[0077] S122: generating a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset;
[0078] S123: Independently train the animal image dataset, the color feature image dataset, the shape feature dataset, and the texture feature dataset to obtain an animal image feature model, a color feature model, a shape feature model, and a texture feature model.
[0079] Specifically, in order to fully explain step S121, the following scheme is used as an example for description:
[0080] An animal image dataset containing 4,000 animal images was collected through the Internet. The dataset covers 10 animal categories: bears, cats, cows, dogs, donkeys, elephants, horses, lions, sheep and tigers, with 400 images in each category. These images are manually annotated to ensure that each image accurately corresponds to its category. Then, a deep learning method combining a target detection model with text prompts and a segmentation model (SAM) is used to accurately remove the background of each image in the animal image dataset to obtain the first target area image dataset. The target area extraction flow chart is shown below. Figure 2 As shown, the specific process is as follows:
[0081] (1) Use Python Image Processing Library (PIL) to load the animal image dataset and convert it into a standard RGB format image;
[0082] (2) Load the Grounding DI NO zero-shot detection model provided by Huggin Face on a standard RGB format image to identify and locate the target in the image through natural language text description. After entering the text description, the model may generate multiple possible target boxes in the image. Each target box has a confidence score, which indicates the model's confidence in whether the location is the target. Zero-shot detection means that the model does not need to be specially trained for specific objects, but directly understands the target object in the image through natural language description;
[0083] (3) Select the target box with the highest confidence as the best bounding box. Based on the best bounding box, use the segmentation model to perform accurate background segmentation processing to obtain the first target area image dataset.
[0084] Furthermore, in some embodiments of the present application, a color feature image dataset, a shape feature image dataset, and a texture feature image dataset are generated based on the first target area image dataset, specifically as follows: each picture in the first target area image dataset is converted into HSV space to obtain a second target area image dataset, and the pixels of each picture in the second target area image dataset are decomposed into a first hue component, a first saturation component, and a first brightness component; the first saturation component of each picture in the second target area image dataset is multiplied by a preset enhancement multiple to obtain a second saturation component; the first saturation component of each picture in the second target area image dataset is replaced by the second saturation component to obtain a third target area image dataset; and each picture in the third target area image dataset is converted to RGB space to obtain a color feature image dataset.
[0085] Compared with the prior art, the above embodiment has the following beneficial effects: by converting the image into the HSV space and enhancing the saturation component, the present invention can highlight the color features of the image, thereby improving the distinguishing ability and classification accuracy of the color feature model.
[0086] Furthermore, in some embodiments of the present application, the first target area image dataset generates a color feature image dataset, a shape feature image dataset and a texture feature image dataset, specifically: Gaussian blur processing is performed on each image in the first target area image dataset to obtain a blurred image dataset; and the Canny edge detection algorithm is used to perform edge detection on each image in the blurred image dataset to obtain a shape feature image dataset.
[0087] Compared with the existing technology, the above embodiment has the following beneficial effects: by reducing image noise through Gaussian blur processing and detecting edges using the Canny algorithm, the shape features of the image can be effectively extracted, thereby enhancing the recognition and classification capabilities of the shape feature model for animal images.
[0088] Furthermore, in some embodiments of the present application, a color feature image dataset, a shape feature image dataset, and a texture feature image dataset are generated based on the first target area image dataset, specifically: each image in the first target area image dataset is grayscaled to obtain a grayscale image dataset; and texture features are extracted from each image in the grayscale image dataset using a local binary pattern algorithm to obtain a texture feature image dataset.
[0089] Compared with the existing technology, the above embodiment has the following beneficial effects: by extracting texture features through grayscale processing and local binary pattern algorithm, the expressive ability of texture features can be effectively enhanced, thereby improving the classification accuracy and discrimination of animal images by the texture feature model.
[0090] S13: Obtaining a weight set according to the probability distribution vector set and a preset weight calculation method, and determining a classification result of the animal image test data according to the probability distribution vector set and the weight set.
[0091] Furthermore, in some embodiments of the present application, obtaining a weight set according to the probability distribution vector set and a preset weight calculation method specifically includes the following steps:
[0092] (1) extracting the maximum value of each component of the probability distribution vector in the probability distribution vector set, and forming a maximum probability value set from all the extracted maximum values of the components;
[0093] (2) adding up each element in the maximum probability value set to obtain a total probability value;
[0094] (3) The proportion of each element in the maximum predicted probability value set to the total probability value is used as the feature weight corresponding to the element, and all feature weights are combined into a weight set.
[0095] Specifically, in order to fully explain the weight calculation method described in steps (1) to (3), the following scheme is used as an example for explanation:
[0096] For the animal image test data to be classified, such as Figure 3 As shown, texture, color and shape features are first extracted, and the animal image test data to be classified is independently predicted by four feature models (corresponding to texture, color, shape and original image respectively) that have been trained in the training set. Figure 4As shown, each feature model will output a probability distribution vector O i =(O1,O2...,O C ), where C is the number of animal categories, O i The predicted probability of each animal category for the i-th feature model is then obtained from the output O of each feature model. i Extract the maximum probability value P i =max O i , that is, the maximum confidence of each feature model for the category prediction. In order to ensure that the contribution of each feature model can be reasonably reflected in the final classification result, we calculate the weight w of each feature i , and its calculation formula is;
[0097]
[0098] Among them, w i Indicates the contribution of each feature to the final classification result. i All participate in the calculation, so the weight w i It is a quantitative representation of the contribution of each feature in the final decision. The sum of all weights is 1, that is:
[0099]
[0100] Through this normalization process, the model automatically adjusts the weights to ensure that features with higher predicted probabilities have a greater impact on the final classification results, while features with lower predicted probabilities have less impact on the results.
[0101] Compared with the prior art, the above embodiment has the following beneficial effects: by adding each element in the maximum probability value set to obtain the total probability value, and dynamically allocating feature weights according to the proportion of each element in the total, dynamic weight allocation is achieved.
[0102] Furthermore, in some embodiments of the present application, determining the classification result of the animal image test data according to the probability distribution vector set and the weight set specifically includes the following steps:
[0103] (1) multiplying each vector in the probability distribution vector set by the corresponding weight in the weight set to obtain a weighted probability distribution vector set;
[0104] (2) adding the components of the same position of each vector in the weighted probability distribution vector set to obtain a predicted probability distribution vector;
[0105] (3) Extracting the maximum value of the component in the predicted probability distribution vector to obtain the classification result of the animal image test data.
[0106] Specifically, in order to fully explain the above steps, the following scheme is used as an example for illustration:
[0107] The output of each feature model (i.e., the probability distribution vector O i ) multiplied by the corresponding weight w i , thus obtaining the weighted probability distribution vector y of each feature model i , the formula is:
[0108] y i =w i *O i
[0109] Thus, the output of each feature model O i The weights are adjusted according to their corresponding values, reflecting the degree of influence of the feature on the final classification result. The weighted outputs of all feature models will be summed to obtain the predicted probability distribution vector y, which is a C-dimensional vector, where C is the number of animal categories, and each element represents the predicted probability of the sample belonging to the corresponding category. The formula is:
[0110]
[0111] The final category prediction result Y is determined by the category corresponding to the maximum probability value in the predicted probability distribution vector y, and its formula is:
[0112] Y=max(y)
[0113] Compared with the existing technology, the above embodiment has the following beneficial effects: by multiplying each vector in the probability distribution vector set by the corresponding weight, a weighted probability distribution vector set is obtained, and the components at the same position of these vectors are added together, and finally the maximum value of the component is extracted as the predicted probability, thereby realizing the fusion of the prediction results of multiple feature models.
[0114] In summary, it can be seen that the multi-feature fusion animal image classification method provided by this embodiment has the following beneficial effects: by predicting animal images from multiple dimensions and obtaining a probability distribution vector set, the details of the image can be fully captured. Next, the present application extracts the maximum value of the components of each vector in the probability distribution vector set and forms a maximum probability value set, which can highlight the most significant contribution of each feature model to the classification result. Then, the present application adopts a weight calculation method to obtain a weight set based on the maximum probability value set. By dynamically assigning weights, the contribution of each feature model to the final prediction result can be adjusted according to its performance on the current test data. Finally, the present application obtains the final prediction probability based on the probability distribution vector set and the weight set. By synthesizing the weighted probability distribution vectors, the advantages of multiple feature models can be effectively integrated. Compared with the existing technology that easily ignores local features, the present application can improve the accuracy of animal image classification by comprehensively utilizing color, texture, and shape features and dynamically adjusting weights, effectively coping with classification tasks under complex backgrounds and lighting conditions.
[0115] Example 2
[0116] Please refer to Figure 5 , which is a multi-feature fusion animal image classification device provided in an embodiment of the present application, includes: a test data acquisition module 11, an independent prediction module 12 and a result generation module 13.
[0117] Furthermore, in some embodiments of the present application, the test data acquisition module 11 is used to acquire animal image test data to be classified; the independent prediction module 12 is used to independently predict the animal image test data through an animal image feature model, a color feature model, a shape feature model, and a texture feature model, and obtain corresponding probability distribution vectors respectively, and form all probability distribution vectors into a probability distribution vector set; the result generation module 13 is used to obtain a weight set according to the probability distribution vector set and a preset weight calculation method, and determine the classification result of the animal image test data according to the probability distribution vector set and the weight set.
[0118] Furthermore, in some embodiments of the present application, the result generation module 13 includes a probability value generation unit, a probability sum calculation unit and a feature weight calculation unit; the probability value generation unit is used to extract the maximum value of the component of each probability distribution vector in the probability distribution vector set, and all the extracted component maximum values are combined into a maximum probability value set; the probability sum calculation unit is used to add each element in the maximum probability value set to obtain the total probability value; the feature weight calculation unit is used to take the proportion of each element in the maximum predicted probability value set to the total probability value as the feature weight corresponding to the element, and to form all feature weights into a weight set.
[0119] Furthermore, in some embodiments of the present application, the result generation unit includes a vector generation unit, a component addition unit, and a maximum value acquisition unit; the vector generation unit is used to multiply each vector in the probability distribution vector set by the corresponding weight in the weight set to obtain a weighted probability distribution vector set; the component addition unit is used to add the components at the same position of each vector in the weighted probability distribution vector set to obtain a predicted probability distribution vector; the maximum value acquisition unit is used to extract the maximum value of the component in the predicted probability distribution vector to obtain the classification result of the animal image test data.
[0120] Furthermore, in some embodiments of the present application, the independent prediction module 12 includes a background removal unit, a feature image generation unit and a feature model training unit; the background removal unit is used to construct an animal image dataset, remove the background of each picture in the animal image dataset, and obtain a first target area image dataset; the feature image generation unit is used to generate a color feature image dataset, a shape feature image dataset and a texture feature image dataset based on the first target area image dataset; the feature model training unit is used to independently train the animal image dataset, the color feature image dataset, the shape feature dataset and the texture feature dataset, respectively, to obtain an animal image feature model, a color feature model, a shape feature model and a texture feature model. Furthermore, in some embodiments of the present application, the feature image generation unit includes a component decomposition subunit, a saturation enhancement subunit and an image reconstruction subunit; the component decomposition subunit is used to convert each picture in the first target area image data set into the HSV space to obtain a second target area image data set, and decompose the pixels of each picture in the second target area image data set into a first hue component, a first saturation component and a first brightness component; the saturation enhancement subunit is used to multiply the first saturation component of each picture in the second target area image data set by a preset enhancement multiple to obtain a second saturation component; the image reconstruction subunit is used to replace the first saturation component of each picture in the second target area image data set with the second saturation component to obtain a third target area image data set.
[0121] Furthermore, in some embodiments of the present application, the feature image generation unit also includes a Gaussian blur processing subunit and an edge detection subunit; the Gaussian blur processing subunit is used to perform Gaussian blur processing on each image in the first target area image data set to obtain a blurred image data set; the edge detection subunit is used to use the Canny edge detection algorithm to perform edge detection on each image in the blurred image data set to obtain a shape feature image data set.
[0122] Furthermore, in some embodiments of the present application, the feature image generation unit also includes a grayscale processing subunit and a texture feature extraction subunit; the grayscale processing subunit is used to perform grayscale processing on each picture in the first target area image data set to obtain a grayscale image data set; the texture feature extraction subunit is used to use a local binary pattern algorithm to extract texture features from each picture in the grayscale image data set to obtain a texture feature image data set.
[0123] For more detailed steps and working principles of this embodiment, please refer to, but not limited to, the relevant records of Embodiment 1.
[0124] Example 3
[0125] Based on the above-mentioned embodiment of the multi-feature fusion animal image classification method, another embodiment of the present application provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the multi-feature fusion animal image classification method of any embodiment of the present application.
[0126] In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0127] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application by those skilled in the art should be included within the scope of protection of this application.
Claims
1. A multi-feature fusion animal image classification method, characterized in that: include: Obtain animal image test data to be classified; Independently predict the animal image test data using an animal image feature model, a color feature model, a shape feature model, and a texture feature model to obtain corresponding probability distribution vectors, and form all probability distribution vectors into a probability distribution vector set; A weight set is obtained according to the probability distribution vector set and a preset weight calculation method, and a classification result of the animal image test data is determined according to the probability distribution vector set and the weight set.
2. The animal image classification method based on multi-feature fusion according to claim 1, characterized in that: The weight set is obtained according to the probability distribution vector set and the preset weight calculation method, specifically: Extracting the maximum value of each component of each probability distribution vector in the probability distribution vector set, and forming a maximum probability value set from all the extracted maximum values of the components; Adding each element in the maximum probability value set to obtain a total probability value; The proportion of each element in the maximum predicted probability value set to the total probability value is used as the feature weight corresponding to the element, and all feature weights are combined into a weight set.
3. The animal image classification method based on multi-feature fusion according to claim 1, characterized in that: The determining of the classification result of the animal image test data according to the probability distribution vector set and the weight set is specifically: Multiplying each vector in the probability distribution vector set by the corresponding weight in the weight set to obtain a weighted probability distribution vector set; Adding the components at the same position of each vector in the weighted probability distribution vector set to obtain a predicted probability distribution vector; The maximum value of the component in the predicted probability distribution vector is extracted to obtain the classification result of the animal image test data.
4. The animal image classification method based on multi-feature fusion according to claim 1, characterized in that: The method for constructing the animal image feature model, the color feature model, the shape feature model, and the texture feature model includes: Constructing an animal image dataset, removing the background of each image in the animal image dataset to obtain a first target area image dataset; generating a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset; The animal image dataset, the color feature image dataset, the shape feature dataset and the texture feature dataset are trained independently to obtain an animal image feature model, a color feature model, a shape feature model and a texture feature model.
5. The animal image classification method based on multi-feature fusion according to claim 4, characterized in that: The step of generating a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset is specifically as follows: Convert each image in the first target area image dataset into HSV space to obtain a second target area image dataset, and decompose pixels of each image in the second target area image dataset into a first hue component, a first saturation component, and a first brightness component; multiplying the first saturation component of each picture in the second target area image dataset by a preset enhancement factor to obtain a second saturation component; replacing the first saturation component of each picture in the second target area image dataset with the second saturation component to obtain a third target area image dataset; Each image in the third target area image dataset is converted into RGB space to obtain a color feature image dataset.
6. The animal image classification method based on multi-feature fusion according to claim 4, characterized in that: The step of generating a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset is specifically as follows: Performing Gaussian blur processing on each image in the first target area image dataset to obtain a blurred image dataset; The Canny edge detection algorithm is used to perform edge detection on each image in the blurred image dataset to obtain a shape feature image dataset.
7. The animal image classification method based on multi-feature fusion according to claim 4, characterized in that: The step of generating a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset is specifically as follows: Performing grayscale processing on each image in the first target area image dataset to obtain a grayscale image dataset; A local binary pattern algorithm is used to extract texture features from each image in the grayscale image dataset to obtain a texture feature image dataset.
8. A multi-feature fusion animal image classification device, characterized in that: include: Test data acquisition module, independent prediction module and result generation module: The test data acquisition module is used to acquire animal image test data to be classified; The independent prediction module is used to independently predict the animal image test data using an animal image feature model, a color feature model, a shape feature model, and a texture feature model, respectively obtaining corresponding probability distribution vectors, and forming all probability distribution vectors into a probability distribution vector set; The result generation module is used to obtain a weight set based on the probability distribution vector set and a preset weight calculation method, and determine the classification result of the animal image test data based on the probability distribution vector set and the weight set.
9. The multi-feature fusion animal image classification device according to claim 8, characterized in that: The result generation module includes a probability value generation unit, a probability sum calculation unit and a feature weight calculation unit; The probability value generating unit is used to extract the maximum value of each component of the probability distribution vector in the probability distribution vector set, and form a maximum probability value set from all the extracted maximum values of the components; The probability sum calculation unit is used to add each element in the maximum probability value set to obtain a probability value sum; The feature weight calculation unit is used to take the proportion of each element in the maximum predicted probability value set to the total probability value as the feature weight corresponding to the element, and form all feature weights into a weight set.
10. The multi-feature fusion animal image classification device according to claim 8, characterized in that: The result generating unit includes a vector generating unit, a component adding unit, and a maximum value obtaining unit; The vector generating unit is configured to multiply each vector in the probability distribution vector set by a corresponding weight in the weight set to obtain a weighted probability distribution vector set; The component adding unit is used to add the components at the same position of each vector in the weighted probability distribution vector set to obtain a predicted probability distribution vector; The maximum value acquisition unit is used to extract the maximum value of the component in the predicted probability distribution vector to obtain the classification result of the animal image test data.
11. The multi-feature fusion animal image classification device according to claim 8, characterized in that: The independent prediction module includes a background removal unit, a feature image generation unit and a feature model training unit; The background removal unit is used to construct an animal image dataset, remove the background of each picture in the animal image dataset, and obtain a first target area image dataset; The feature image generating unit is configured to generate a color feature image dataset, a shape feature image dataset, and a texture feature image dataset based on the first target area image dataset; The feature model training unit is used to independently train the animal image dataset, the color feature image dataset, the shape feature dataset and the texture feature dataset to obtain an animal image feature model, a color feature model, a shape feature model and a texture feature model.
12. The multi-feature fusion animal image classification device according to claim 11, characterized in that: The feature image generation unit includes a component decomposition subunit, a saturation enhancement subunit and an image reconstruction subunit; The component decomposition subunit is used to convert each image in the first target area image dataset into an HSV space to obtain a second target area image dataset, and decompose pixels of each image in the second target area image dataset into a first hue component, a first saturation component, and a first brightness component; The saturation enhancement subunit is configured to multiply the first saturation component of each picture in the second target area image data set by a preset enhancement factor to obtain a second saturation component; The image recombining subunit is configured to replace the first saturation component of each picture in the second target area image dataset with the second saturation component to obtain a third target area image dataset.
13. The multi-feature fusion animal image classification device according to claim 11, characterized in that: The feature image generation unit further includes a Gaussian blur processing subunit and an edge detection subunit; The Gaussian blur processing subunit is used to perform Gaussian blur processing on each image in the first target area image dataset to obtain a blurred image dataset; The edge detection subunit is used to perform edge detection on each image in the blurred image dataset using a Canny edge detection algorithm to obtain a shape feature image dataset.
14. The multi-feature fusion animal image classification device according to claim 11, characterized in that: The feature image generation unit also includes a grayscale processing subunit and a texture feature extraction subunit; The grayscale processing subunit is used to perform grayscale processing on each image in the first target area image dataset to obtain a grayscale image dataset; The texture feature extraction subunit is used to extract texture features from each image in the grayscale image dataset using a local binary pattern algorithm to obtain a texture feature image dataset.
15. A computer storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the animal image classification method of any one of claims 1 to 7 using multi-feature fusion.