An Automated Identification System and Method for Agarwood Seedlings Based on Image Recognition
By acquiring images of the branches and leaves of agarwood seedlings and using classification and grading models, the problem of accuracy in grading the quality of agarwood seedlings was solved, and accurate identification and grading of agarwood plant species were achieved.
Patent Information
- Application Number
- CN202410337407.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-23
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2044-03-23
AI Technical Summary
Existing technologies make it difficult to accurately classify the quality grade of agarwood seedlings based on the species of agarwood plant, and there is a lack of identification methods for different plants.
By acquiring images of the branches and leaves of the agarwood seedlings to be identified, a target image set is selected, and a pre-built classification and grading model is used to identify the category and grade of the agarwood seedlings, including Qinan seedlings and whitewood seedlings.
This technology enables precise classification of agarwood seedling quality grades based on agarwood plant species, improving the accuracy and consistency of identification.
Smart Images

Figure CN118038429B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and more specifically, to an automated identification system and method for agarwood seedlings based on image recognition. Background Technology
[0002] Agarwood is a precious spice and traditional Chinese medicine, derived from the resin of Aquilaria sinensis in the Thymelaeaceae family. As the top of the four traditional Chinese spices, agarwood has the effects of promoting qi circulation and relieving pain, warming the stomach and stopping vomiting, and calming the mind and relieving asthma. Its natural aroma is unique and varies in quality, resulting in differences in fragrance. Nitrogen is one of the key nutrients for the growth and development of agarwood and an important factor affecting its quality grade. The nitrogen content of agarwood plant leaves is clearly reflected in the color of the canopy. Although current technology has enabled the identification of trees through machine vision, research on the identification of agarwood seedlings is still limited.
[0003] For example, the Chinese patent with authorization announcement number CN112633212B discloses a method for identifying and classifying the grade of tea buds based on computer vision. This patent first obtains images of tea leaves on tea trees, and then uses machine vision to identify the images and complete the final classification.
[0004] Although the aforementioned patent has completed the grading of tea buds, different identification methods and grading conditions are required for different plants. At the same time, since agarwood plants have different species, corresponding grading rules need to be adopted according to different species. For example, agarwood plant species include Qinan agarwood and white agarwood. The nitrogen content of Qinan agarwood is much higher than that of white agarwood. In the existing technology, there are few ways to accurately grade agarwood plants based on the species of agarwood plants.
[0005] In view of this, the present invention proposes an automated identification system and method for agarwood seedlings based on image recognition to solve the above problems. Summary of the Invention
[0006] To overcome the aforementioned deficiencies of the prior art, the present invention provides an automated identification system and method for agarwood seedlings based on image recognition.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] An automated identification method for agarwood seedlings based on image recognition includes:
[0009] S10: Obtain N first images and S second images of the agarwood seedling to be identified, select a first target image set from the N first images, and select a second target image set from the S second images. The first images are images of the branches of the agarwood seedling to be identified, and the second images are images of the leaves of the agarwood seedling to be identified. N and S are both integers greater than 1.
[0010] S20: Obtain the real-time format information of the first target image set and the second target image set, as well as the standard format information of the corresponding standard image; generate a comparison result based on the real-time format information and the standard format information; determine whether to preprocess the first target image set or the second target image set based on the comparison result; the preprocessing refers to converting the real-time format information into standard format information.
[0011] S30: Input the first target image set into the pre-built agarwood seedling classification model to obtain the agarwood seedling category;
[0012] S40: Input the agarwood seedling category and the second target image set into the pre-built grading model to obtain the agarwood seedling grade output by the grading model.
[0013] Furthermore, the method for acquiring N first images and S second images of the agarwood seedling to be identified includes:
[0014] The agarwood seedling to be identified is segmented and the corresponding area image of each segment is obtained. The number of branches in each area image is identified. The number of collection points in each area image is determined based on the number of branches. Based on the number of collection points in each area image, N first images and S second images of the agarwood seedling to be identified are obtained.
[0015] Furthermore, the method for obtaining N first images and S second images of the agarwood seedling to be identified based on the number of corresponding collection points in each region image includes:
[0016] The number of collection points in each region image is rounded up and summed to obtain H collection points. N first image points are calculated based on the preset first ratio and the H collection points. S second image points are calculated based on the preset second ratio and the H collection points. N first images are obtained by taking pictures of the agarwood seedling to be identified based on the N first image points. S second images are obtained by taking pictures of the agarwood seedling to be identified based on the S first image points.
[0017] Furthermore, methods for determining the number of sampling points in each region image based on the number of branches include:
[0018] The number of collection points in each region image is obtained based on the number of branches and the preset corresponding rules.
[0019] Furthermore, the method for selecting the first target image set from the N first images includes:
[0020] All N first images are converted into grayscale images and their corresponding first grayscale values are obtained. The average and median values of the N first grayscale values are taken. The N first grayscale values and the average value are used to determine the first target grayscale value. The first target grayscale value is the grayscale value that is closest to the average value among the N first grayscale values. The first image corresponding to the median value and the first image corresponding to the average value are used to form a first target image set.
[0021] Furthermore, the method for selecting the second target image set from the S second images includes:
[0022] Convert all S second images into grayscale images and obtain the corresponding second grayscale values. Take the average and median of the S second grayscale values. Take the S second grayscale values and the average to determine the second target grayscale value. The second target grayscale value is the grayscale value that is closest to the average among the S second grayscale values. Form a second target image set by combining the second image corresponding to the median value and the second image corresponding to the average value.
[0023] Furthermore, the comparison results include whether the real-time format information is the same as the standard format information and whether the real-time format information is different from the standard format information. The method for determining whether to preprocess the first target image set or the second target image set based on the comparison results includes:
[0024] When the real-time format information is the same as the standard format information, no preprocessing is performed on the first target image set or the second target image set.
[0025] When the real-time format information differs from the standard format information, preprocessing is performed on either the first target image set or the second target image set.
[0026] Furthermore, the standard images include a first standard image and a second standard image. The first standard image is an image of the branches of an agarwood seedling, and the second standard image is an image of the leaves of an agarwood seedling. The categories of agarwood seedlings include Qinan seedlings and whitewood seedlings.
[0027] The methods for constructing a classification model for agarwood seedlings include:
[0028] Obtain i sets of data, where i is a positive integer greater than 1. The data includes historical first standard images and historical agarwood seedling categories. Use the historical first standard images and historical agarwood seedling categories as the sample set, and divide the sample set into a training set and a test set. Construct a classifier, using the historical first standard images in the training set as input data and the historical agarwood seedling categories in the training set as output data to train the classifier and obtain an initial classifier. Use the test set to test the initial classifier and output a classifier that meets the preset accuracy as the agarwood seedling classification model.
[0029] An automated identification system for agarwood seedlings based on image recognition, used to implement the aforementioned automated identification method for agarwood seedlings based on image recognition, includes:
[0030] Image filtering module: used to acquire N first images and S second images of the agarwood seedling to be identified, filter out a first target image set from the N first images, and filter out a second target image set from the S second images. The first image is a branch image of the agarwood seedling to be identified, and the second image is a leaf image of the agarwood seedling to be identified. N and S are both integers greater than 1.
[0031] Format conversion module: used to obtain real-time format information of the first target image set and the second target image set, as well as the standard format information of the corresponding standard image, generate comparison results based on the real-time format information and the standard format information, and determine whether to preprocess the first target image set or the second target image set according to the comparison results. The preprocessing refers to converting the real-time format information into standard format information.
[0032] Classification module: Input the first set of target images into the pre-built agarwood seedling classification model to obtain the agarwood seedling category;
[0033] Grading module: Input the agarwood seedling category and the second target image set into the pre-built grading model to obtain the agarwood seedling grade output by the grading model.
[0034] A computer-readable storage medium storing a computer program, which, when executed, implements the above-described automated identification method for agarwood seedlings based on image recognition.
[0035] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0036] In this invention, N first images and S second images of the agarwood seedlings to be identified are acquired to filter out a first target image set and a second target image set. The first target image set is input into a pre-constructed agarwood seedling classification model to obtain the agarwood seedling category. The agarwood seedling category and the second target image set are input into a pre-constructed grading model to obtain the agarwood seedling grade output by the grading model. By performing image recognition on the agarwood seedlings, the quality grade of agarwood can be accurately classified according to the type of agarwood plant. Furthermore, the N first images and S second images obtained in this invention are more consistent with the proportion of the agarwood seedlings to be identified, making the subsequent identification of the agarwood seedlings more accurate. Attached Figure Description
[0037] Figure 1 This is a flowchart of the automated identification method for agarwood seedlings based on image recognition in this invention;
[0038] Figure 2 This is a schematic diagram of the surface of the Qinan seedling and the surface of an ordinary seedling in this invention;
[0039] Figure 3 This is a schematic diagram of a computer-readable storage medium in this invention. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] Example 1
[0042] Please see Figure 1 As shown, this embodiment discloses an automated identification method for agarwood seedlings based on image recognition, including:
[0043] S10: Obtain N first images and S second images of the agarwood seedling to be identified, select a first target image set from the N first images, and select a second target image set from the S second images. The first images are images of the branches of the agarwood seedling to be identified, and the second images are images of the leaves of the agarwood seedling to be identified. N and S are both integers greater than 1.
[0044] In an embodiment of the present invention, the method for acquiring N first images and S second images of the agarwood seedling to be identified includes:
[0045] The agarwood seedling to be identified is segmented and the corresponding area image of each segment is obtained. The number of branches in each area image is identified. The number of collection points in each area image is determined based on the number of branches. Based on the number of collection points in each area image, N first images and S second images of the agarwood seedling to be identified are obtained.
[0046] The method for obtaining N first images and S second images of the agarwood seedling to be identified based on the number of corresponding collection points in each region image includes:
[0047] The number of collection points in each region image is rounded up and summed to obtain H collection points. N first image points are calculated based on the preset first ratio and the H collection points. S second image points are calculated based on the preset second ratio and the H collection points. The agarwood seedling to be identified is photographed based on the N first image points to obtain N first images. The agarwood seedling to be identified is photographed based on the S first image points to obtain S second images.
[0048] It should be noted that the method for segmenting the agarwood seedlings to be identified can be to divide the agarwood seedlings into equal segments according to their length, or to divide them into segments according to a pre-set ratio. After the segmentation is completed, the corresponding area image of each segment is obtained. The area image should contain branches. The number of branches in each area image can be identified by segmenting the branches in the area image using machine vision to form the minimum bounding rectangle corresponding to each branch. Alternatively, it can be achieved by training a model to identify the number of branches in the seedlings. This embodiment will not elaborate further on this.
[0049] Methods for determining the number of sampling points in each region of the image based on the number of branches include:
[0050] The number of corresponding collection points in each region image is obtained based on the number of branches and the preset corresponding rules.
[0051] It is understood that the preset corresponding rules in this embodiment can be implemented by establishing a table. For example, if the number of branches identified in one area image is 6, then the number of branches is divided by 2 to obtain the number of collection points. At this time, the number of collection points is 3, and 3 is entered into the table. If the number of branches identified in another area image is 5, then 2.5 is entered into the table accordingly. The above content is only an illustrative example. Those skilled in the art can also establish corresponding rules in other ways.
[0052] Following the above, since the number of collection points may not be an integer, in this embodiment, the number of collection points is rounded up and summed to obtain a total of H collection points. Based on the first and second ratios, N first photography points and S second photography points are obtained. The first photography point refers to the location where the branches of the agarwood seedling to be identified are photographed, and the second photography point refers to the location where the leaves of the agarwood seedling to be identified are photographed. It should be noted that if a region of the image does not contain branches, the image of the main trunk can be used as the first image, or the tree segment corresponding to that region can be omitted from the photograph. In this embodiment… The first ratio and the second ratio can be equal or unequal. It is worth noting that this embodiment only limits the number of photo points, but does not limit the specific location of the photo points. It is understood that the branch distribution ratio of each agarwood seedling to be identified is different. Therefore, by dividing the agarwood seedling to be identified into segments and obtaining the area image corresponding to each segment, the first photo point and the second photo point corresponding to each segment are determined based on the area image. In this way, the N first images and S second images are obtained, which are more consistent with the ratio of the agarwood seedling to be identified, and make the subsequent identification of the agarwood seedling more accurate.
[0053] Methods for selecting the first target image set from N first images include:
[0054] Convert all N first images into grayscale images and obtain the corresponding first grayscale values. Take the average and median of the N first grayscale values. Take the N first grayscale values and the average to determine the first target grayscale value. The first target grayscale value is the grayscale value that is closest to the average among the N first grayscale values. Form a first target image set by combining the first image corresponding to the median value and the first image corresponding to the average value.
[0055] Understandably, taking agarwood seedlings that produce Kyara agarwood and ordinary seedlings that produce common agarwood as examples, such as... Figure 2 As shown, Figure 2 10 represents a portion of the surface of a Qinan seedling, and 20 represents a portion of the surface of a common seedling. Figure 2 It is known that the surface of the branches of Qinan tree seedlings is smoother than that of ordinary seedlings. Therefore, the first gray value obtained after generating the corresponding image is also different. Therefore, in this embodiment, representative first images are selected from N first images according to their corresponding first gray values to form a first target image set. It is worth noting that when N is odd, the middle value is taken as the median, and when N is even, the two middle values are taken as the median. Similarly, when the first target gray value is the same as the median value, one of the corresponding images is taken.
[0056] Methods for selecting a set of second target images from S second images include:
[0057] S second images are converted into grayscale images and their corresponding second grayscale values are obtained. The average and median values of the S second grayscale values are taken. The S second grayscale values and the average value are used to determine the second target grayscale value. The second target grayscale value is the grayscale value that is closest to the average value among the S second grayscale values. The second target image set is formed by the second image corresponding to the median value and the second image corresponding to the average value.
[0058] Following on the above, taking the saplings of Qinan tree that produce Qinan agarwood and ordinary saplings that produce common agarwood as examples, whether it is the Qinan saplings or the common saplings that are subsequently graded, the grading is determined by the color of the leaves. This is because the color of the leaves can represent the nitrogen content. The higher the nitrogen content, the darker the color of the leaves will be. Therefore, the second grayscale value of the corresponding second image will also be different. Thus, in this embodiment, representative second images are selected from S first images based on their corresponding second grayscale values to form a second target image set. The determination of the median value is consistent with the above content, and will not be elaborated further in this embodiment.
[0059] S20: Obtain the real-time format information of the first target image set and the second target image set, as well as the standard format information of the corresponding standard image; generate a comparison result based on the real-time format information and the standard format information; determine whether to preprocess the first target image set or the second target image set based on the comparison result; the preprocessing refers to converting the real-time format information into standard format information.
[0060] It should be noted that real-time format information includes, but is not limited to, image size and compression type. Standard images refer to images of branches and leaves taken by the same camera. Standard format information includes, but is not limited to, standard image size and standard compression type. It is understood that since standard images are historical data used by this invention to train the model, while the first target image or the second target image may be obtained by different types of cameras, this will result in different image formats, which will affect the subsequent model's judgment. Therefore, it is necessary to form the same format.
[0061] The comparison results include whether the real-time format information is the same as the standard format information and whether the real-time format information is different from the standard format information. Methods for determining whether to preprocess the first target image set or the second target image set based on the comparison results include:
[0062] When the real-time format information is the same as the standard format information, no preprocessing is performed on the first target image set or the second target image set.
[0063] When the real-time format information differs from the standard format information, preprocessing is performed on either the first target image set or the second target image set.
[0064] S30: Input the first target image set into the pre-built agarwood seedling classification model to obtain the agarwood seedling category;
[0065] The aforementioned standard images include a first standard image and a second standard image. The first standard image is an image of the branches and trunks of an agarwood seedling, and the second standard image is an image of the leaves of an agarwood seedling. The categories of agarwood seedlings include Qinan seedlings and whitewood seedlings. Whitewood seedlings refer to ordinary seedlings.
[0066] The methods for constructing a classification model for agarwood seedlings include:
[0067] Obtain i sets of data, where i is a positive integer greater than 1. The data includes historical first standard images and historical agarwood seedling categories. Use the historical first standard images and historical agarwood seedling categories as the sample set. Divide the sample set into a training set and a test set. Construct a classifier. Use the historical first standard images in the training set as the input data and the historical agarwood seedling categories in the training set as the output data. Train the classifier to obtain an initial classifier. Test the initial classifier using the test set. Output a classifier that meets the preset accuracy as the agarwood seedling classification model. The classifier is preferably one of the Naive Bayes model or the Support Vector Machine model.
[0068] It should be noted that the categories of agarwood seedlings mentioned above include both Qinan seedlings and whitewood seedlings. This is only an example. The rougher the surface of the branches in the historical first standard image, the greater the probability that the agarwood seedling is classified as a whitewood seedling. Conversely, the smoother the surface of the branches in the historical first standard image, the greater the probability that the agarwood seedling is classified as a Qinan seedling. Those skilled in the art can use the above logic to train the model to obtain the agarwood classification model.
[0069] S40: Input the agarwood seedling category and the second target image set into the pre-built grading model to obtain the agarwood seedling grade output by the grading model;
[0070] Agarwood seedlings are graded into three levels: first grade, second grade, and third grade.
[0071] Methods for constructing a grading model include:
[0072] Obtain m sets of data, where m is a positive integer greater than 1. The data includes historical second standard images and historical agarwood seedling grades. Use the historical second standard images and historical agarwood seedling grades as the sample set, and divide the sample set into a training set and a test set. Construct a classifier, using the historical second standard images in the training set as input data and the historical agarwood seedling grades in the training set as output data. Train the classifier to obtain an initial classifier. Test the initial classifier using the test set and output a classifier that meets the preset accuracy as the grade division model. The classifier is preferably one of the Naive Bayes model or the Support Vector Machine model.
[0073] It should be noted that the agarwood seedling grades mentioned above include first grade, second grade and third grade, which is only an example. When the leaf surface color in the historical second standard image is darker, the probability of the agarwood seedling being grade first is greater. Conversely, when the branch surface in the historical first standard image is smoother, the probability of the agarwood seedling being grade third is greater. Those skilled in the art can train the model using the above logic to obtain the grade classification model.
[0074] In this embodiment, by acquiring N first images and S second images of the agarwood seedlings to be identified, a first target image set and a second target image set are selected. The first target image set is input into a pre-constructed agarwood seedling classification model to obtain the agarwood seedling category. The agarwood seedling category and the second target image set are input into a pre-constructed grading model to obtain the agarwood seedling grade output by the grading model. By performing image recognition on the agarwood seedlings, the quality grade of agarwood can be accurately classified according to the type of agarwood plant. Furthermore, the N first images and S second images obtained in this embodiment are more consistent with the proportion of the agarwood seedlings to be identified, making the subsequent identification of the agarwood seedlings more accurate.
[0075] Example 2
[0076] Based on Example 1, this embodiment also provides an automated identification system for agarwood seedlings based on image recognition, including:
[0077] Image filtering module: used to acquire N first images and S second images of the agarwood seedling to be identified, filter out a first target image set from the N first images, and filter out a second target image set from the S second images. The first image is a branch image of the agarwood seedling to be identified, and the second image is a leaf image of the agarwood seedling to be identified. N and S are both integers greater than 1.
[0078] In an embodiment of the present invention, the method for acquiring N first images and S second images of the agarwood seedling to be identified includes:
[0079] The agarwood seedling to be identified is segmented and the corresponding area image of each segment is obtained. The number of branches in each area image is identified. The number of collection points in each area image is determined based on the number of branches. Based on the number of collection points in each area image, N first images and S second images of the agarwood seedling to be identified are obtained.
[0080] The method for obtaining N first images and S second images of the agarwood seedling to be identified based on the number of corresponding collection points in each region image includes:
[0081] The number of collection points in each region image is rounded up and summed to obtain H collection points. N first image points are calculated based on the preset first ratio and the H collection points. S second image points are calculated based on the preset second ratio and the H collection points. The agarwood seedling to be identified is photographed based on the N first image points to obtain N first images. The agarwood seedling to be identified is photographed based on the S first image points to obtain S second images.
[0082] It should be noted that the method for segmenting the agarwood seedlings to be identified can be to divide the agarwood seedlings into equal segments according to their length, or to divide them into segments according to a pre-set ratio. After the segmentation is completed, the corresponding area image of each segment is obtained. The area image should contain branches. The number of branches in each area image can be identified by segmenting the branches in the area image using machine vision to form the minimum bounding rectangle corresponding to each branch. Alternatively, it can be achieved by training a model to identify the number of branches in the seedlings. This embodiment will not elaborate further on this.
[0083] Methods for determining the number of sampling points in each region of the image based on the number of branches include:
[0084] The number of corresponding collection points in each region image is obtained based on the number of branches and the preset corresponding rules.
[0085] It is understood that the preset corresponding rules in this embodiment can be implemented by establishing a table. For example, if the number of branches identified in one area image is 6, then the number of branches is divided by 2 to obtain the number of collection points. At this time, the number of collection points is 3, and 3 is entered into the table. If the number of branches identified in another area image is 5, then 2.5 is entered into the table accordingly. The above content is only an illustrative example. Those skilled in the art can also establish corresponding rules in other ways.
[0086] Following the above, since the number of collection points may not be an integer, in this embodiment, the number of collection points is rounded up and summed to obtain a total of H collection points. Based on the first and second ratios, N first photography points and S second photography points are obtained. The first photography point refers to the location where the branches of the agarwood seedling to be identified are photographed, and the second photography point refers to the location where the leaves of the agarwood seedling to be identified are photographed. It should be noted that if a region of the image does not contain branches, the image of the main trunk can be used as the first image, or the tree segment corresponding to that region can be omitted from the photograph. In this embodiment… The first ratio and the second ratio can be equal or unequal. It is worth noting that this embodiment only limits the number of photo points, but does not limit the specific location of the photo points. It is understood that the branch distribution ratio of each agarwood seedling to be identified is different. Therefore, by dividing the agarwood seedling to be identified into segments and obtaining the area image corresponding to each segment, the first photo point and the second photo point corresponding to each segment are determined based on the area image. In this way, the N first images and S second images are obtained, which are more consistent with the ratio of the agarwood seedling to be identified, and make the subsequent identification of the agarwood seedling more accurate.
[0087] Methods for selecting the first target image set from N first images include:
[0088] Convert all N first images into grayscale images and obtain the corresponding first grayscale values. Take the average and median of the N first grayscale values. Take the N first grayscale values and the average to determine the first target grayscale value. The first target grayscale value is the grayscale value that is closest to the average among the N first grayscale values. Form a first target image set by combining the first image corresponding to the median value and the first image corresponding to the average value.
[0089] Understandably, taking agarwood seedlings that produce Kyara agarwood and ordinary seedlings that produce common agarwood as examples, such as... Figure 2 As shown, Figure 2 10 represents a portion of the surface of a Qinan seedling, and 20 represents a portion of the surface of a common seedling. Figure 2 It is known that the surface of the branches of Qinan tree seedlings is smoother than that of ordinary seedlings. Therefore, the first gray value obtained after generating the corresponding image is also different. Therefore, in this embodiment, representative first images are selected from N first images according to their corresponding first gray values to form a first target image set. It is worth noting that when N is odd, the middle value is taken as the median, and when N is even, the two middle values are taken as the median. Similarly, when the first target gray value is the same as the median value, one of the corresponding images is taken.
[0090] Methods for selecting a set of second target images from S second images include:
[0091] S second images are converted into grayscale images and their corresponding second grayscale values are obtained. The average and median values of the S second grayscale values are taken. The S second grayscale values and the average value are used to determine the second target grayscale value. The second target grayscale value is the grayscale value that is closest to the average value among the S second grayscale values. The second target image set is formed by the second image corresponding to the median value and the second image corresponding to the average value.
[0092] Following on the above, taking the saplings of Qinan tree that produce Qinan agarwood and ordinary saplings that produce common agarwood as examples, whether it is the Qinan saplings or the common saplings that are subsequently graded, the grading is determined by the color of the leaves. This is because the color of the leaves can represent the nitrogen content. The higher the nitrogen content, the darker the color of the leaves will be. Therefore, the second grayscale value of the corresponding second image will also be different. Thus, in this embodiment, representative second images are selected from S first images based on their corresponding second grayscale values to form a second target image set. The determination of the median value is consistent with the above content, and will not be elaborated further in this embodiment.
[0093] Format conversion module: used to obtain real-time format information of the first target image set and the second target image set, as well as the standard format information of the corresponding standard image, generate comparison results based on the real-time format information and the standard format information, and determine whether to preprocess the first target image set or the second target image set according to the comparison results. The preprocessing refers to converting the real-time format information into standard format information.
[0094] It should be noted that real-time format information includes, but is not limited to, image size and compression type. Standard images refer to images of branches and leaves taken by the same camera. Standard format information includes, but is not limited to, standard image size and standard compression type. It is understood that since standard images are historical data used by this invention to train the model, while the first target image or the second target image may be obtained by different types of cameras, this will result in different image formats, which will affect the subsequent model's judgment. Therefore, it is necessary to form the same format.
[0095] The comparison results include whether the real-time format information is the same as the standard format information and whether the real-time format information is different from the standard format information. Methods for determining whether to preprocess the first target image set or the second target image set based on the comparison results include:
[0096] When the real-time format information is the same as the standard format information, no preprocessing is performed on the first target image set or the second target image set.
[0097] When the real-time format information differs from the standard format information, preprocessing is performed on either the first target image set or the second target image set.
[0098] Classification module: Input the first set of target images into the pre-built agarwood seedling classification model to obtain the agarwood seedling category;
[0099] The aforementioned standard images include a first standard image and a second standard image. The first standard image is an image of the branches and trunks of an agarwood seedling, and the second standard image is an image of the leaves of an agarwood seedling. The categories of agarwood seedlings include Qinan seedlings and whitewood seedlings. Whitewood seedlings refer to ordinary seedlings.
[0100] The methods for constructing a classification model for agarwood seedlings include:
[0101] Obtain i sets of data, where i is a positive integer greater than 1. The data includes historical first standard images and historical agarwood seedling categories. Use the historical first standard images and historical agarwood seedling categories as the sample set. Divide the sample set into a training set and a test set. Construct a classifier. Use the historical first standard images in the training set as the input data and the historical agarwood seedling categories in the training set as the output data. Train the classifier to obtain an initial classifier. Test the initial classifier using the test set. Output a classifier that meets the preset accuracy as the agarwood seedling classification model. The classifier is preferably one of the Naive Bayes model or the Support Vector Machine model.
[0102] It should be noted that the categories of agarwood seedlings mentioned above include both Qinan seedlings and whitewood seedlings. This is only an example. The rougher the surface of the branches in the historical first standard image, the greater the probability that the agarwood seedling is classified as a whitewood seedling. Conversely, the smoother the surface of the branches in the historical first standard image, the greater the probability that the agarwood seedling is classified as a Qinan seedling. Those skilled in the art can use the above logic to train the model to obtain the agarwood classification model.
[0103] Grading module: Input the agarwood seedling category and the second target image set into the pre-built grading model to obtain the agarwood seedling grade output by the grading model;
[0104] Agarwood seedlings are graded into three levels: first grade, second grade, and third grade.
[0105] Methods for constructing a grading model include:
[0106] Obtain m sets of data, where m is a positive integer greater than 1. The data includes historical second standard images and historical agarwood seedling grades. Use the historical second standard images and historical agarwood seedling grades as the sample set, and divide the sample set into a training set and a test set. Construct a classifier, using the historical second standard images in the training set as input data and the historical agarwood seedling grades in the training set as output data. Train the classifier to obtain an initial classifier. Test the initial classifier using the test set and output a classifier that meets the preset accuracy as the grade division model. The classifier is preferably one of the Naive Bayes model or the Support Vector Machine model.
[0107] It should be noted that the agarwood seedling grades mentioned above include first grade, second grade, and third grade, which is only an example. When the leaf surface color in the historical second standard image is darker, the probability of the agarwood seedling being grade first is greater. Conversely, when the branch surface in the historical first standard image is smoother, the probability of the agarwood seedling being grade third is greater. Those skilled in the art can use the above logic to train the model to obtain the grade classification model.
[0108] Example 3
[0109] This embodiment discloses an electronic device, including a power supply, an interface, a keyboard, a memory, a central processing unit, and a computer program stored in the memory and executable on the central processing unit. When the central processing unit executes the computer program, it implements the image recognition-based automated identification method for agarwood seedlings provided by the above methods. The interface includes a network interface and a data interface. The network interface includes a wired or wireless interface, and the data interface includes an input or output interface.
[0110] Since the electronic device described in this embodiment is the electronic device used to implement the image recognition-based automated identification method for agarwood seedlings in this application embodiment, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment based on the image recognition-based automated identification method for agarwood seedlings described in this application embodiment. Therefore, how the electronic device implements the method in this application embodiment will not be described in detail here. Any electronic device used by those skilled in the art to implement the image recognition-based automated identification method for agarwood seedlings in this application embodiment falls within the scope of protection of this application.
[0111] Example 4
[0112] like Figure 3 As shown, this embodiment discloses a computer-readable storage medium storing a computer program, which, when executed, implements the above-described automated identification method for agarwood seedlings based on image recognition.
[0113] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters, weights, and thresholds in the formulas are set by those skilled in the art according to the actual situation.
[0114] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired or wireless network. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0115] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0116] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0117] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only one method, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0118] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0119] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0120] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
[0121] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An automatic identification method for Aquilaria tree seedlings based on image recognition, characterized in that, The method comprises the following steps: S10: obtaining N first images and S second images of an agallochum seedling to be identified, screening a first target image set from the N first images, and screening a second target image set from the S second images, wherein the first images are branch images of the agallochum seedling to be identified, the second images are leaf images of the agallochum seedling to be identified, and N and S are integers greater than 1; The method for obtaining the N first images and the S second images of the agallochum seedling to be identified comprises the following steps: segmenting the agallochum seedling to be identified and obtaining a region image corresponding to each segment, identifying the number of branches in each region image, determining the number of corresponding collection points in each region image according to the number of branches, and obtaining the N first images and the S second images of the agallochum seedling to be identified based on the number of corresponding collection points in each region image; The method for screening the first target image set from the N first images comprises the following steps: converting the N first images into grayscale images and obtaining corresponding first grayscale values, taking the average value and the median value of the N first grayscale values, taking the first grayscale value closest to the average value from the N first grayscale values as a first target grayscale value, forming the first target image set from the first image corresponding to the median value and the first image corresponding to the average value, and taking the first target grayscale value as a first target grayscale value. S20: obtaining real-time format information of the first target image set and the second target image set and standard format information of a corresponding standard image, generating a comparison result based on the real-time format information and the standard format information, and determining whether to perform preprocessing on the first target image set or the second target image set according to the comparison result, wherein the preprocessing refers to converting the real-time format information into the standard format information. S30: inputting the first target image set into a pre-constructed agallochum seedling classification model to obtain an agallochum seedling category. S40: inputting the agallochum seedling category and the second target image set into a pre-constructed grade division model to obtain an agallochum seedling grade output by the grade division model.
2. The image recognition-based automatic identification method of Aquilaria seedlings according to claim 1, characterized in that, The method for obtaining the N first images and the S second images of the agallochum seedling to be identified based on the number of corresponding collection points in each region image comprises the following steps: performing upward rounding and summation on the number of corresponding collection points in each region image to obtain H collection points, calculating N first photographing points according to a preset first proportion and the H collection points, calculating S second photographing points according to a preset second proportion and the H collection points, photographing the agallochum seedling to be identified according to the N first photographing points to obtain the N first images, and photographing the agallochum seedling to be identified according to the S second photographing points to obtain the S second images.
3. The image recognition-based aquilaria seedling automatic identification method according to claim 2, characterized in that, The method for determining the number of corresponding collection points in each region image according to the number of branches comprises the following steps: obtaining the number of corresponding collection points in each region image according to the number of branches and a preset corresponding rule.
4. The image recognition-based automatic identification method of Aquilaria seedlings according to claim 1, characterized in that, The method for screening the second target image set from the S second images comprises the following steps: The S second images are all converted into gray images and the corresponding second gray values are obtained, the average value and the median value of the S second gray values are taken, the second target gray value is determined by taking the S second gray values and the average value, the second target gray value is the gray value closest to the average value in the S second gray values, and the second image corresponding to the median value and the second image corresponding to the average value form a second target image set.
5. The image recognition-based automatic identification method of Aquilaria seedlings according to claim 1, characterized in that, The comparison result includes that the real-time format information is the same as the standard format information and the real-time format information is different from the standard format information, and the method for judging whether to perform preprocessing on the first target image set or the second target image set according to the comparison result includes: When the real-time format information is the same as the standard format information, the first target image set or the second target image set is not preprocessed; When the real-time format information is different from the standard format information, the first target image set or the second target image set is preprocessed.
6. The image recognition-based aquilaria seedling automatic identification method according to claim 1, characterized in that, The standard image includes a first standard image and a second standard image, the first standard image is a branch image of the aquilaria tree seedling, the second standard image is a leaf image of the aquilaria tree seedling, and the aquilaria tree seedling category includes a chimonocalyx tree seedling and a white wood tree seedling; The method for constructing the aquilaria tree seedling classification model includes: i groups of data are obtained, i is a positive integer greater than 1, the data includes historical first standard images and historical aquilaria tree seedling categories, the historical first standard images and the historical aquilaria tree seedling categories are taken as a sample set, the sample set is divided into a training set and a test set, a classifier is constructed, the historical first standard images in the training set are taken as input data, the historical aquilaria tree seedling categories in the training set are taken as output data, the classifier is trained, an initial classifier is obtained, the initial classifier is tested by using the test set, and the classifier meeting a preset accuracy is output as the aquilaria tree seedling classification model.
7. An image recognition-based Aquilaria seedling automatic identification system for implementing the image recognition-based Aquilaria seedling automatic identification method according to any one of claims 1-6, characterized in that, It includes: An image screening module: used for obtaining N first images and S second images of an aquilaria tree seedling to be identified, screening a first target image set from the N first images, and screening a second target image set from the S second images, the first image being a branch image of the aquilaria tree seedling to be identified, the second image being a leaf image of the aquilaria tree seedling to be identified, and N and S both being integers greater than 1; A format conversion module: used for obtaining real-time format information of the first target image set and the second target image set and standard format information of corresponding standard images, generating a comparison result based on the real-time format information and the standard format information, and judging whether to perform preprocessing on the first target image set or the second target image set according to the comparison result, the preprocessing referring to converting the real-time format information into the standard format information; A classification module: used for inputting the first target image set into a pre-constructed aquilaria tree seedling classification model to obtain an aquilaria tree seedling category; A grade division module: used for inputting the aquilaria tree seedling category and the second target image set into a pre-constructed grade division model to obtain an aquilaria tree seedling grade output by the grade division model.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed to implement the image recognition-based automatic aquilaria tree seedling identification method in any one of claims 1 to 6.
Citation Information
Patent Citations
A computer vision-based method for identifying and classifying the grades of tea buds
CN112633212B
Multispectral vision imaging big-leaf crop leaf classification method and system
CN106326905A
Trunk texture recognition method based on four-channel convolutional neural network
CN110689039A
Finished tea type and grade identification method based on image color and texture features
CN112418161A