Insect grading and classifying method and system based on multi-task convolutional neural network
The edge and color features of insect images are extracted through multi-task convolutional neural networks and a comprehensive feature vector is generated, which solves the problem that insect classification methods rely on a single feature in the existing technology, and achieves efficient and accurate classification of different insect species and life stages.
Patent Information
- Application Number
- CN202510681199.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-05-26
AI Technical Summary
The existing insect classification methods rely on a single feature, cannot fully express the complex information of insect images, and ignore the characteristics changes of insects at different life stages, resulting in insufficient classification accuracy and refinement.
A multi-task convolutional neural network is used to extract edge features and color features of insect images, generate comprehensive feature vectors, and build an insect feature library to achieve efficient and accurate hierarchical classification of insects.
It improves the recognition accuracy of insects in different species and life stages, enhances the stability and applicability of feature extraction, and ensures the accuracy and efficiency of classification results.
Smart Images

Figure CN120198940A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of insect recognition, and specifically provides an insect hierarchical classification method and system based on a multi-task convolutional neural network. Background Art
[0002] The hierarchical classification of insects is of great significance in the fields of biodiversity research, agricultural pest control, and ecological environment monitoring. Traditional insect hierarchical classification methods usually rely on manual observation and identification, which are not only time-consuming and laborious, but also easily affected by human factors, resulting in low accuracy and consistency of the results. In recent years, with the development of image processing technology and machine learning technology, automatic classification methods based on images have gradually attracted attention. However, in the prior art, insect classification methods often focus on a single feature, such as color features, texture features, or morphological features, and cannot fully express the complex information of insect images. In addition, many classification methods ignore the characteristic changes of insects at different life stages, resulting in insufficient accuracy and refinement of hierarchical classification. Therefore, there is an urgent need to construct an efficient, accurate, and insect classification and grading method applicable to different life stages.
[0003] In the prior art, the publication number CN116343182A discloses an insect species recognition method and its system and electronic device, which uses an infrared thermal imager set in the insect species recognition system to collect the current frame thermal imaging image of the target area according to the first acquisition period, processes and recognizes the current frame infrared thermal imaging image, establishes a target search box and processes and marks dot matrices for the target search box, calculates the total gray value of each marked point in the marked dot matrix, calculates the actual difference between the total gray value of each marked point in the marked dot matrix and the total gray value of each sample point in the dot matrices of various insect samples in the sample database, and outputs a signal related to the insect species judgment result according to the actual difference.
[0004] The main problems of the above solution are: feature extraction only relies on the infrared thermal imaging method to extract the temperature distribution characteristics of insects, and the extraction dimension of features is relatively single, resulting in insufficient recognition accuracy; and the infrared thermal imager is easily affected by factors such as environmental temperature and humidity, and its applicability is poor.
[0005] The above information disclosed in the background art section is only used to enhance the understanding of the background of the present disclosure, and therefore it may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0006] The purpose of the present invention is to provide an insect hierarchical classification method and system based on a multi-task convolutional neural network to solve the problems raised in the above background art.
[0007] To achieve the above purpose, the present invention provides the following technical solutions: An insect grading and classification method based on a multi-task convolutional neural network, the specific steps include: Step 1: Collect insect images to be graded and classified. After scaling the insect images to a size of 224×224, copy them into two identical groups. One group is grayscale processed to generate the first recognition image, and the other group transforms the image from the RGB color space to the HSV color space to generate the second recognition image; Step 2: Extract the edge pixel points of the first recognition image based on canny edge detection to generate the third recognition image. Record the number of edge pixel points, the area and perimeter of the region enclosed by the edge pixel points in the third recognition image. Generate the edge complexity based on the number of edge pixel points and the area of the region enclosed by the edge pixel points, generate the edge circularity based on the perimeter and area of the region enclosed by the edge pixel points, and generate the edge feature index based on the edge complexity and the edge circularity; Step 3: Extract the hue, saturation, and brightness of the pixel points in the second recognition image. Generate the hue index, saturation index, and brightness index of the second recognition image based on the average values of the hue, saturation, and brightness of all pixel points, and generate the image vividness based on the hue index, saturation index, and brightness index; Step 4: Concatenate the edge feature index and the image vividness to generate a comprehensive feature vector, and calculate the comprehensive feature vectors corresponding to different types of insects at different life stages according to the methods in Steps 1 to 3, and construct an insect feature library containing the comprehensive feature vectors of different types of insects at different life stages; Step 5: Build a model based on a multi-task convolutional neural network. Use the comprehensive feature vectors in the insect feature library as inputs and the types and life stages of insects as labels to train the insect grading and classification model; Step 6: Input the comprehensive feature vector of the insect image to be graded and classified into the trained insect grading and classification model, and output the type and life stage of the insect.
[0008] Furthermore, the principle for generating the third recognition image is: For each pixel point in the first recognition image, convolve the pixel point and its surrounding eight neighborhood pixel points with the horizontal direction template and vertical direction template of the Prewitt operator respectively to generate the gray-scale difference of the pixel point in the horizontal direction and vertical direction. The formulas are as follows: ; ; ; ; Among them, represents the horizontal direction template of the Prewitt operator, Represents the vertical direction template of the Prewitt operator, Represents the horizontal direction difference of the pixel point, Represents the vertical direction difference of the pixel point, Represents the coordinates of the pixel point; According to the grayscale differences in the horizontal and vertical directions, generate the gradient magnitude of each pixel point. The formula is: ; Among them, Represents the gradient magnitude of the pixel point with coordinates , Represents the horizontal direction difference of the pixel point, Represents the vertical direction difference of the pixel point; Preset an edge threshold. When the gradient magnitude of the pixel point is higher than that of the edge pixel point, mark the pixel point as an edge pixel point.
[0009] Furthermore, the principle for generating the edge feature index is: The formula for generating the edge complexity is: ; Among them, Represents the edge complexity, Represents the number of edge pixel points, Represents the area of the region enclosed by the edge pixel points; The formula for generating the edge circularity is: ; Among them, Represents the edge circularity, Represents the edge perimeter; The formula for generating the edge feature index is: ; Among them, Represents the edge feature index.
[0010] Furthermore, the principle for generating the image vividness is: The formulas for generating the hue index, saturation index, and brightness index are: ; ; ; Among them, Represents the hue index, Represents the index of the pixel point, and ,[[]]END]] Represents the number of pixel points, Indicates the hue of the th pixel point, represents the saturation index, Indicates the th pixel point's saturation, represents the brightness index of the pixel point, Indicates the th pixel point's brightness; The formula for generating the image vividness is: ; ; Among them, represents the image vividness, represents the correction function of hue to vividness; Furthermore, the formula for generating the comprehensive feature vector is: ; Among them, represents the comprehensive feature vector, represents the edge feature index, represents the image vividness.
[0011] The present invention also provides an insect hierarchical classification system based on a multi-task convolutional neural network. The system is used to implement the above-mentioned insect hierarchical classification method based on a multi-task convolutional neural network, and specifically includes: An image acquisition module, which is used to acquire an insect image to be hierarchically classified, scale the insect image to a size of 224×224 and then copy it into two identical groups. One group is grayscale processed to generate a first recognition image, and the other group converts the image from the RGB color space to the HSV color space to generate a second recognition image; An edge extraction module, which is used to extract the edge pixel points of the first recognition image based on canny edge detection, generate a third recognition image, record the number of edge pixel points, the area and perimeter of the area surrounded by the edge pixel points in the third recognition image, generate an edge complexity based on the number of edge pixel points and the area of the area surrounded by the edge pixel points, generate an edge circularity based on the perimeter and area of the area surrounded by the edge pixel points, and generate an edge feature index based on the edge complexity and the edge circularity; A color extraction module, which is used to extract the hue, saturation and brightness of the pixel points in the second recognition image, generate a hue index, a saturation index and a brightness index of the second recognition image based on the average values of the hue, saturation and brightness of all pixel points, and generate an image vividness based on the hue index, the saturation index and the brightness index; A feature library construction module, which is used to splice the edge feature index and the image vividness to generate a comprehensive feature vector, and calculate the comprehensive feature vectors corresponding to different types of insects at different life stages according to the methods of the above modules, and construct an insect feature library containing the comprehensive feature vectors of different types of insects at different life stages; A model training module, which is used to build a model based on a multi-task convolutional neural network, use the comprehensive feature vectors in the insect feature library as inputs, and the types and life stages of insects as labels to train an insect grading and classification model; A judgment and output module, which is used to input the comprehensive feature vector of the insect image to be graded and classified into the trained insect grading and classification model, and output the insect type and life stage.
[0012] Compared with the prior art, the beneficial effects of the present invention are: By separately extracting the edge features and color features of the image, the present invention constructs a more comprehensive feature vector, thereby improving the recognition accuracy of the classification model for different types of insects and their different life stages, and providing richer insect appearance features; by extracting hue, saturation and brightness, the color features of the image are comprehensively analyzed, and the hue index, saturation index and brightness index are calculated based on the average value of pixel points, effectively alleviating the problem of uneven color distribution caused by factors such as light, shooting angle or other interference factors in the image, and enhancing the stability of feature extraction and the applicability of the solution. Quantifying the vividness of the insect body surface color with the image vividness helps to identify insects with significantly different colors.
[0013] The present invention also splices the edge feature index and the image vividness to generate a comprehensive feature vector, makes full use of the complementarity between different features, covers insects of different types and life stages, comprehensively reflects the diversity of insects, and helps to improve the generalization ability of the training model; trains an insect grading and classification model based on a multi-task convolutional neural network. The model can not only quickly adapt to new data, but also conduct detailed classification for specific insect types and life stages, ensuring the accuracy and efficiency of the entire solution. Description of the Drawings
[0014] Figure 1 It is a schematic flowchart of the method of the embodiment of the present invention; Figure 2 It is a grayscale image of insects at the same growth stage of the embodiment of the present invention; Figure 3 It is an HSV image of insects at the same growth stage of the embodiment of the present invention; Figure 4 It is a grayscale image of insects at different growth stages of the embodiment of the present invention; Figure 5 It is an HSV image of insects at different growth stages of the embodiment of the present invention; Figure 6 Schematic diagram of the system module in the embodiment of the present invention. Specific implementation manners
[0015] To make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to specific embodiments.
[0016] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should have the ordinary meanings understood by those of ordinary skill in the field to which the present invention belongs. The "first", "second" and similar terms used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. The terms such as "including" or "comprising" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. The terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left", "right" are only used to represent relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0017] Embodiment: Please refer to Figures 1 to 5 , the present invention provides a technical solution: An insect grading and classification method based on a multi-task convolutional neural network, the specific steps include: Step 1: Collect insect images to be graded and classified, scale the insect images to a size of 224×224 and copy them into two identical groups. One group is grayscale processed to generate a first recognition image, and the other group converts the image from the RGB color space to the HSV color space to generate a second recognition image; In this embodiment, the formula for generating the first recognition image by grayscale processing is: ; Among them, represents the grayscale value of the pixel point, represents the red channel value of the pixel point, represents the green channel value of the pixel point, represents the blue channel value of the pixel point; The principle for generating the second recognition image is: For any pixel point in the image, its RGB color space is , and its HSV color space is . First, convert the values of R, G, and B to the range of , and R, G, and B respectively correspond to : ; ; ; based on The formula for generating H, S, and V is: ; ; ; Among them, H, S, and V represent hue, saturation, and brightness respectively.
[0018] Step 2: extract edge pixels of the first recognition image based on canny edge detection, generate a third recognition image, record the number of edge pixels, the area and perimeter of the region enclosed by the edge pixels in the third recognition image, generate edge complexity based on the number of edge pixels and the area of the region enclosed by the edge pixels, generate edge circularity based on the perimeter and area of the region enclosed by the edge pixels, and generate an edge feature index based on the edge complexity and edge circularity; In this embodiment, the principle for generating the third identification image is: For each pixel in the first recognition image, the pixel and its eight neighboring pixels are convolved with the horizontal template and vertical template of the Prewitt operator to generate the grayscale difference of the pixel in the horizontal and vertical directions. The formula is: ; ; ; ; in, Represents the horizontal template of the Prewitt operator, Represents the vertical template of the Prewitt operator, Represents the horizontal difference of the pixel. Represents the vertical difference of the pixel. Represents the coordinates of the pixel; The gradient amplitude of each pixel is generated based on the grayscale difference in the horizontal and vertical directions. The formula is: ; in, The coordinates are The gradient amplitude of the pixel point, Represents the horizontal difference of the pixel. Indicates the vertical difference of the pixel; An edge threshold is preset, and when the gradient amplitude of a pixel is higher than that of an edge pixel, the pixel is marked as an edge pixel.
[0019] The gradient amplitude reflects the rate of change of the grayscale value of an image pixel. The higher the gradient amplitude of a pixel, the more dramatic the grayscale value change of the image at the pixel, and the more likely the pixel is an edge pixel. Therefore, the edge threshold is set to compare with the gradient amplitude. When the gradient amplitude is less than the edge threshold, it means that the grayscale value of the pixel does not change significantly and is not considered to be an edge pixel. It may be a smooth area or noise in the image. When the gradient amplitude is greater than the edge threshold, it means that the grayscale value of the pixel changes significantly and may be the edge area of the image. The median of the pixel grayscale value is selected as the initial gradient amplitude, and the extracted edge pixels are determined based on the initial gradient amplitude to determine whether the extracted edge pixels can reflect the contour characteristics of the insect. If the edge pixels are too sparse, the edge threshold is lowered. If the edge pixels are too complex, the edge threshold is increased.
[0020] The principle for generating edge feature index is: The formula used to generate edge complexity is: ; in, represents the edge complexity, Indicates the number of edge pixels, Indicates the area of the region enclosed by edge pixels; Edge complexity reflects the complexity of the edge in the third recognition image. The higher the edge complexity, the more details of the insect's appearance structure. It is used to distinguish between insect species with complex and simple morphologies, as well as the different complexities of morphologies corresponding to insects at different stages. Edge complexity is proportional to the number of edge pixels and inversely proportional to the area enclosed by edge pixels. Insects with higher edge complexity have more complex appearance structures.
[0021] The formula used to generate edge roundness is: ; in, Indicates the edge roundness, Indicates the edge perimeter; The edge circularity reflects whether the contour shape of the area enclosed by the edge pixels is close to a circle. The higher the edge circularity, the closer the area enclosed by the edge pixels is to a circle, and the corresponding insect shape is also closer to a circle, such as a beetle or an insect in the larva or pupa stage.
[0022] The formula for generating the edge feature index is: ; Among them, represents the edge feature index.
[0023] The edge complexity is used to measure the level of detail of the edge. The higher the edge complexity, the more complex the edge morphology. The edge roundness reflects the shape regularity of the area enclosed by the edge. The closer the edge roundness is to 1, the closer the shape is to a circle, and the smaller the value, the more irregular the shape. The edge feature index generated based on the edge complexity and edge roundness reflects the level of detail and contour shape of the edge. The more complex the edge, generally the lower the roundness, and the higher the edge feature index. The simpler the edge, generally the higher the roundness, and the lower the edge feature index. The edge feature index is directly proportional to the edge complexity and inversely proportional to the edge roundness.
[0024] Step 3: Extract the hue, saturation, and brightness of the pixel points in the second recognition image, generate the hue index, saturation index, and brightness index of the second recognition image based on the average values of the hue, saturation, and brightness of all pixel points, and generate the image vividness based on the hue index, saturation index, and brightness index; In this embodiment, the principle for generating the image vividness is as follows: The formulas for generating the hue index, saturation index, and brightness index are as follows: ; ; ; Among them, represents the hue index, represents the index of the pixel point, and , represents the number of pixel points, represents the th pixel point's hue, represents the saturation index, represents the th pixel point's saturation, represents the brightness index of the pixel point, represents the th pixel point's brightness; The formula for generating the image vividness is as follows: ; ; Among them, represents the image vividness, represents the correction function of hue to vividness; Saturation reflects the purity of color, indicating the amount of gray in the color. The higher the saturation, the purer the color and the brighter it appears visually. When the saturation is 0, the color appears gray. When the saturation is 1, the color is in the purest state. Therefore, saturation has the greatest impact on the vividness of the image, and the vividness of the image is proportional to the saturation. Brightness reflects the lightness and darkness of the color. It means that when the brightness is close to the median brightness of 0.5, the vividness is the greatest. When the brightness becomes higher or lower, the vividness gradually decreases. The hue reflects the type of color and does not directly affect the saturation. However, different hues have different visual expressions. Warm colors are more vivid than cool colors. Therefore, different weights are set for different hues to adjust the difference between warm and cool colors.
[0025] Step 4: The edge feature index and image vividness are concatenated to generate a comprehensive feature vector, and the comprehensive feature vectors corresponding to different types of insects at different life stages are calculated according to the methods of steps 1 to 3, and an insect feature library containing comprehensive feature vectors of different types of insects at different life stages is constructed; In this embodiment, the formula for generating the comprehensive feature vector is: ; in, represents the comprehensive feature vector, represents the edge feature index, Indicates image vividness.
[0026] The comprehensive feature vector reflects the morphological and color characteristics of insects. Different insects differ in shape, size, and color. The comprehensive feature vector combines the complexity of the contour edge and the uniqueness of the color distribution to distinguish different insect species. The physical characteristics of insects change significantly in different life stages. The life stages include larvae, pupae, and adults. The edge feature index is used to capture morphological changes, such as the appearance of wings or changes in body shape. Image vividness is used to reflect the brightness of colors. For example, insects have a single color in the larval stage and bright colors in the adult stage. The edge feature index and image vividness are calculated for insects of known species and life stages, respectively, to generate a comprehensive feature vector and construct an insect feature library. The insect feature library contains comprehensive feature vectors of different insects at different life stages.
[0027] Step 5: Build a model based on a multi-task convolutional neural network, use the comprehensive feature vector in the insect feature library as input, and the insect species and life stages as labels to train the insect classification model; In this embodiment, the structure of the model built based on the multi-task convolutional neural network is: Input layer: contains 1 neuron, used to input the comprehensive feature vector; The first hidden layer: contains 64 neurons, activated by the ReLU function; The second hidden layer: contains 32 neurons, activated by the ReLU function; The output layer: contains 2 neurons, used to output the species and life stage of the insect.
[0028] Step 6: Input the comprehensive feature vector of the insect image to be classified and graded into the trained insect classification and grading model, and output the insect species and life stage.
[0029] Please refer to Figure 6 , the present invention also provides an insect classification and grading system based on a multi-task convolutional neural network, which is used to implement the above-mentioned insect classification and grading method based on a multi-task convolutional neural network, specifically including: An image acquisition module, used to acquire insect images to be classified and graded, scale the insect images to a size of 224×224 and copy them into two identical groups. One group is grayscale processed to generate a first recognition image, and the other group converts the image from the RGB color space to the HSV color space to generate a second recognition image; An edge extraction module, used to extract the edge pixel points of the first recognition image based on canny edge detection to generate a third recognition image, record the number of edge pixel points, the area and perimeter of the area enclosed by the edge pixel points in the third recognition image, generate an edge complexity based on the number of edge pixel points and the area of the area enclosed by the edge pixel points, generate an edge circularity based on the perimeter and area of the area enclosed by the edge pixel points, and generate an edge feature index based on the edge complexity and the edge circularity; A color extraction module, used to extract the hue, saturation, and brightness of the pixel points in the second recognition image, generate a hue index, a saturation index, and a brightness index of the second recognition image based on the average values of the hue, saturation, and brightness of all pixel points, and generate an image vividness based on the hue index, the saturation index, and the brightness index; A feature library construction module, used to splice the edge feature index and the image vividness to generate a comprehensive feature vector, and calculate the comprehensive feature vectors corresponding to different species of insects in different life stages according to the methods of the above modules, and construct an insect feature library containing the comprehensive feature vectors of different species of insects in different life stages; A model training module, used to construct a model based on a multi-task convolutional neural network, use the comprehensive feature vectors in the insect feature library as input, and the species and life stage of the insect as labels to train the insect classification and grading model; A judgment output module, used to input the comprehensive feature vector of the insect image to be classified and graded into the trained insect classification and grading model, and output the insect species and life stage.
[0030] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data and performing software simulation to get a formula closest to the actual situation. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0031] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those skilled in the art will realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software methods depends on the specific application and design constraints of the technical solution.
[0032] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, and may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0033] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all of them should be covered by the protection scope of the present application.
Claims
1. An insect hierarchical classification method based on a multi-task convolutional neural network, characterized in that, The specific steps include: Step 1: Collect insect images to be classified and graded. After scaling the insect images to a size of 224×224, copy them into two identical groups. One group is grayscale processed to generate the first recognition image, and the other group converts the image from the RGB color space to the HSV color space to generate the second recognition image; Step 2: Extract the edge pixel points of the first recognition image based on canny edge detection to generate the third recognition image. Record the number of edge pixel points, the area and perimeter of the area enclosed by the edge pixel points in the third recognition image. Generate the edge complexity based on the number of edge pixel points and the area of the area enclosed by the edge pixel points, generate the edge circularity based on the perimeter and area of the area enclosed by the edge pixel points, and generate the edge feature index based on the edge complexity and the edge circularity; Step 3: Extract the hue, saturation, and brightness of the pixel points in the second recognition image. Generate the hue index, saturation index, and brightness index of the second recognition image based on the average values of the hue, saturation, and brightness of all pixel points, and generate the image vividness based on the hue index, saturation index, and brightness index; Step 4: Concatenate the edge feature index and the image vividness to generate a comprehensive feature vector, and calculate the comprehensive feature vectors corresponding to different types of insects at different life stages according to the methods in Steps 1-3 to construct an insect feature library containing the comprehensive feature vectors of different types of insects at different life stages; Step 5: Build a model based on a multi-task convolutional neural network. Use the comprehensive feature vectors in the insect feature library as inputs and the types and life stages of insects as labels to train the insect classification and grading model; Step 6: Input the comprehensive feature vector of the insect image to be classified and graded into the trained insect classification and grading model, and output the type and life stage of the insect.
2. The insect hierarchical classification method based on a multi-task convolutional neural network according to claim 1, characterized in that: In Step 2, the principle for generating the third recognition image is: For each pixel point in the first recognition image, convolve the pixel point and its eight surrounding neighborhood pixel points with the horizontal direction template and the vertical direction template of the Prewitt operator respectively to generate the gray-scale difference of the pixel point in the horizontal direction and the vertical direction. The formula is: ; ; ; ; Among them, represents the horizontal direction template of the Prewitt operator, represents the vertical direction template of the Prewitt operator, represents the horizontal direction difference of the pixel point, represents the vertical direction difference of the pixel point, represents the coordinates of the pixel point; According to the gray-scale differences in the horizontal direction and the vertical direction, generate the gradient amplitude of each pixel point. The formula is: ; Among them, represents the gradient magnitude of the pixel point with coordinates , represents the horizontal direction difference of the pixel point, represents the vertical direction difference of the pixel point; Preset an edge threshold. When the gradient amplitude of a pixel point is higher than that of an edge pixel point, mark the pixel point as an edge pixel point.
3. A method for insect hierarchical classification based on a multi-task convolutional neural network according to claim 1, characterized in that: In Step 2, the principle for generating the edge feature index is: The formula for generating the edge complexity is: ; Among them, represents the edge complexity, represents the number of edge pixel points, represents the area of the region enclosed by the edge pixel points; The formula for generating the edge circularity is: ; Among them, represents the edge circularity, represents the edge perimeter; The formula for generating the edge feature index is: ; Among them, represents the edge feature index.
4. The insect hierarchical classification method based on a multi-task convolutional neural network according to claim 1, characterized in that: In Step 3, the principle for generating the image vividness is: The formulas for generating the hue index, saturation index, and brightness index are: ; ; ; Among them, represents the hue index, represents the index of the pixel, and , represents the number of pixels, represents the th hue of the pixel, represents the saturation index, represents the saturation of the th pixel, represents the brightness index of the pixel, represents the th brightness of the pixel; The formula for generating the image vividness is: ; ; Among them, represents the image vividness, represents the correction function for the hue to vividness.
5. A method for insect hierarchical classification based on a multi-task convolutional neural network according to claim 1, characterized in that: The formula for generating the comprehensive feature vector in Step 4 is: ; Among them, represents the comprehensive feature vector, represents the edge feature index, represents the image vividness.
6. An insect hierarchical classification system based on a multi-task convolutional neural network, characterized in that: The system is used to execute the insect classification and grading method based on a multi-task convolutional neural network according to any one of claims 1-5, specifically including: An image acquisition module, which is used to acquire insect images to be classified and graded, scale the insect images to a size of 224×224 and copy them into two identical groups. One group is grayscaled to generate a first recognition image, and the other group converts the image from the RGB color space to the HSV color space to generate a second recognition image; An edge extraction module, which is used to extract the edge pixel points of the first recognition image based on canny edge detection to generate a third recognition image, record the number of edge pixel points, the area and perimeter of the area enclosed by the edge pixel points in the third recognition image, generate edge complexity based on the number of edge pixel points and the area of the area enclosed by the edge pixel points, generate edge circularity based on the perimeter and area of the area enclosed by the edge pixel points, and generate an edge feature index based on the edge complexity and the edge circularity; A color extraction module, which is used to extract the hue, saturation and brightness of the pixel points in the second recognition image, generate a hue index, a saturation index and a brightness index of the second recognition image based on the average values of the hue, saturation and brightness of all pixel points, and generate image vividness based on the hue index, the saturation index and the brightness index; A feature library construction module, which is used to splice the edge feature index and the image vividness to generate a comprehensive feature vector, and calculate the comprehensive feature vectors corresponding to different types of insects at different life stages according to the methods of the above modules, and construct an insect feature library containing the comprehensive feature vectors of different types of insects at different life stages; A model training module, which is used to construct a model based on a multi-task convolutional neural network, use the comprehensive feature vectors in the insect feature library as inputs, and the types and life stages of insects as labels to train an insect classification and grading model; A judgment and output module, which is used to input the comprehensive feature vector of the insect image to be classified and graded into the trained insect classification and grading model, and output the type and life stage of the insect.
Citation Information
Patent Citations
Insect type identification method and system, and electronic equipment
CN116343182A
Method for identifying and counting farmland pests based on colors and models
CN102930249A
Insect grading and classifying method and device based on multi-task convolutional neural network
CN118840604A
Multi-scale underwater fish school detection system and detection method based on attention module
CN119414398A
Parasite egg detection method and system
CN119438046A