A method for extracting key growth characteristics of seafood mushrooms at multiple stages and classifying the stages

By extracting the multi-dimensional growth characteristics of seafood mushroom images and combining the random forest and support vector machine algorithm, the accuracy and real-time identification of seafood mushroom growth status are solved, and intelligent regulation of seafood mushroom growth environment is realized, and yield and quality are improved.

CN115512123BActive Publication Date: 2025-07-29SHANGHAI SECOND POLYTECHNIC UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211279673.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-19
Publication Date
2025-07-29
Estimated Expiration
2042-10-19

AI Technical Summary

Technical Problem

In the factory cultivation of seafood mushrooms, the existing manual inspection methods are difficult to accurately identify the growth status and period of seafood mushrooms, resulting in deviations and lags in environmental regulation, and lack of effective intelligent growth status characterization methods.

Method used

The random forest algorithm is used to extract the multi-dimensional growth characteristics of seafood mushroom images, including color, shape and texture characteristics, and the growth period is classified through the support vector machine, and the HSL color space, Hu invariant moment and grayscale symbiosis matrix features are used, combined with the RBF radial base kernel function and one-to-many support vector machine algorithm to achieve accurate identification of seafood mushroom growth period.

Benefits of technology

It realizes accurate and unified characterization of the growth status of seafood mushrooms, reduces labor intensity, improves the real-time and accuracy of growth environment regulation, and improves yield and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115512123B_ABST
    Figure CN115512123B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for extracting key growth characteristics and classifying growth periods of seafood mushrooms at multiple times. Based on obtaining the target area image of seafood mushrooms, 28 different features, including 9 low-order color moment features in the HSL color space, 7 Hu invariant moments, and eigenvalue features of gray-level co-occurrence matrices in 4 directions, are respectively extracted according to the growth characteristics of seafood mushrooms for comprehensive analysis. According to the importance of the features, the features are re-sorted in descending order, and the sample data is successively intercepted and input into the random forest RF model to select the feature combination with the highest classification accuracy, that is, the key feature set. Finally, the support vector machine SVM is used to classify and identify the growth periods of seafood mushroom images characterized by the key features. The present invention can uniformly characterize the growth state of seafood mushrooms during the entire fruiting management stage by using the key feature combination, and realize accurate classification of the growth periods of seafood mushrooms, thereby guiding the real-time regulation of the cultivation environment of seafood mushrooms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent cultivation of edible fungi, and particularly to a method for extracting key growth characteristics of seafood mushrooms in multiple periods and classifying periods. Background Art

[0002] With the continuous development of edible mushroom cultivation technology, the cultivation of edible mushrooms has formed industrialized production. In order to continuously improve the yield and quality of edible mushrooms, the cultivation of edible mushrooms is developing towards intelligence. The intelligent cultivation of edible mushrooms not only requires intelligent recognition of fruiting bodies in the actual mushroom house, but also needs to judge different growth periods according to the phenotypic characteristics of fruiting bodies and mushroom bags, so as to adjust production parameters such as light, humidity, temperature and wind speed or give early warnings to production personnel.

[0003] In the current industrialized cultivation of seafood mushrooms, the manual inspection method is still used for environmental adjustment and intervention, that is, production personnel regularly adjust the cultivation environment according to the growth status of seafood mushrooms in each mushroom house on site. However, due to the small and difficult-to-distinguish characteristics of some seafood mushrooms, the different characteristics in different periods and the instability of human factors, the adjustment of the environment is prone to deviation and lag.

[0004] Therefore, in the process of the transformation of the industrialized cultivation of seafood mushrooms to intelligent cultivation, how to characterize the growth status of seafood mushrooms during the entire fruiting management stage and accurately judge the growth period is an urgent problem to be solved at present. However, there are few reports on the group phenotypic technology and application of edible mushrooms at home and abroad, so it is necessary to propose a method that can uniformly characterize the different growth states of seafood mushrooms and accurately and quickly identify the growth period of seafood mushrooms. Summary of the Invention

[0005] Aiming at the problem that the characteristics of seafood mushrooms are different in multiple periods during the fruiting management stage and it is difficult to uniformly characterize them, the purpose of the present invention is to provide a method for extracting key growth characteristics of seafood mushrooms in multiple periods and classifying periods, which can uniformly characterize the growth status of seafood mushrooms during the entire fruiting management stage, accurately classify the growth periods of seafood mushrooms in different periods, and provide guidance for the real-time regulation of the cultivation environment of seafood mushrooms.

[0006] A method for extracting key growth characteristics of seafood mushrooms in multiple periods and classifying periods includes the following steps:

[0007] Step A: Make a sample image data set covering each period of the fruiting management stage of seafood mushrooms, and read the sample images of seafood mushrooms;

[0008] Step B: Preprocess the sample images of seafood mushrooms in Step A, remove the irrelevant parts in the images, and obtain the target area images of seafood mushrooms;

[0009] Step C: Convert the target region image of the enoki mushroom in Step B from the RGB color space to the HSL color space, and extract the low-order color moments of the color components in each of the 3 channels: the first-order moment, the second-order moment, and the third-order moment, a total of 9 feature parameters to form a 9-dimensional feature vector describing the color characteristics of the enoki mushroom region in the sample image;

[0010] Step D: Convert the target region image of the enoki mushroom in Step B from the RGB color space to the grayscale space, and extract 7 Hu invariant moments to form a 7-dimensional feature vector describing the shape characteristics of the enoki mushroom region in the sample image;

[0011] Step E: Convert the target region image of the enoki mushroom in Step B from the RGB color space to the grayscale space, and extract 12 texture features based on the gray-level co-occurrence matrix in 4 different directions to form a 12-dimensional feature vector describing the texture characteristics of the enoki mushroom region in the sample image;

[0012] Step F: Based on the multi-dimensional growth feature vectors extracted in Step C, Step D, and Step E, use the random forest RF algorithm to perform key feature selection according to the feature importance, eliminate redundant features, and form the optimal multi-dimensional key growth feature vector of the enoki mushroom;

[0013] Step G: Construct an SVM classifier, use the optimal multi-dimensional key growth feature vector of the enoki mushroom obtained in Step F as the input of the classifier, and train the classifier to converge;

[0014] Step H: Preprocess the enoki mushroom region in the test image set, obtain the target region image of the enoki mushroom to be measured, extract the optimal multi-dimensional key growth feature vector, and substitute it into the trained SVM classifier to obtain the classification result of the growth period of the enoki mushroom to be measured in the test image.

[0015] As a preferred method, in Step A, the fruiting management stage of the enoki mushroom is divided into four major periods: the recovery period, the primordium induction period, the pinhead formation period, and the elongation period.

[0016] As a preferred method, in Step C, the HSL color model can resist the influence of certain light changes, and it is more accurate in characterizing the characteristics of white objects such as enoki mushrooms. The color distribution information is mainly concentrated in the low-order moments. Usually, the first-order moment (mean), the second-order moment (variance), and the third-order moment (skewness) of the color are sufficient to characterize the color distribution of the image, and compared with other color features, this feature representation method is more concise. The specific steps include:

[0017] Step C1: Convert the enoki mushroom picture from the RGB color model to the HSL color model:

[0018]

[0019]

[0020]

[0021] Step C2: Calculate a total of 9 color features, which are the low-order color distances of the 3 color components in the HSL color model respectively, and calculate the first-order moment μ i , the second-order moment σ i and the third-order moment s i using the following formulas:

[0022]

[0023]

[0024]

[0025] As a preferred method, the said step D includes:

[0026] Step D1: Convert the enoki mushroom picture from the RGB color space to the grayscale space;

[0027] Step D2: For the enoki mushroom image with the grayscale distribution of f(x, y), calculate its normalized second-order and third-order central moments:

[0028]

[0029]

[0030]

[0031]

[0032] where m pq is the (p + q)-order moment of the image, and represent the centroid of the image, μ pq is the (p + q)-order central moment of the image, η pq is the normalized (p + q)-order central moment;

[0033] Step D3: Calculate seven Hu invariant moments based on the second-order and third-order central moments calculated in step D2:

[0034] M1 = η 20 + η 02

[0035]

[0036] M3 = (η 30 - 3η 12 ) 2 + (3η21 -η 03 ) 2

[0037] M4 = (η 30 + η 12 ) 2 +(η 21 + η 03 ) 2

[0038] M5 = (η 30 - 3η 12 )(η 30 + η 12 )[(η 30 + η 12 ) 2 - 3(η 21 + η 03 ) 2

[0039] +(3η 21 - η 03 )(η 21 + η 03 )[3(η 30 + η 12 ) 2 -(η 21 + η 03 ) 2

[0040] M6 = (η 20 - η 02 )[(η 30 + η 12 ) 2 -(η 21 + η 03 ) 2 + 4η 12 (η 30 + η 12 )(η 21 + η 03 )

[0041] M7 = (3η 21 - η 03 )(η 30 + η 12 )[(η 30 + η 12 ) 2 - 3(η 21 + η 03 ) 2

[0042] +(3η 21 - η 30 )(η​​​21 +η 03 )[3(η 30 +η 12 ) 2 -(η 21 +η 03 ) 2

[0043] The shape features of the enoki mushroom area in the image can be described by a feature vector composed of seven invariant moments (M1 to M7). Since it has the invariance of translation, rotation, and scale, it can improve the accuracy of the shape feature parameters.

[0044] As a preferred method, in step E, the 12 texture features include: the means (m) and standard deviations (s) of six features including contrast (CON), dissimilarity (DIS), local homogeneity (HOM), entropy (ENT), correlation (COR), and energy (ASM) in the gray-level co-occurrence matrices in four directions of 0°, 45°, 90°, and 135°. Step E includes:

[0045] Step E1: Calculate the gray-level co-occurrence matrix p(i,j) of the enoki mushroom image in four directions of 0°, 45°, 90°, and 135° respectively.

[0046] Step E2: Extract the contrast in the texture features based on the gray-level co-occurrence matrix calculated in step E1. The contrast is used to represent the clarity of the image and the depth of the texture. Calculate the contrast CON:

[0047]

[0048] Step E3: Extract the dissimilarity in the texture features based on the gray-level co-occurrence matrix calculated in step E1. It is a linear measure of the local changes in the image. Calculate the dissimilarity DIS:

[0049]

[0050] Step E4: Extract the local homogeneity in the texture features based on the gray-level co-occurrence matrix calculated in step E1. It reflects the homogeneity of the image texture and shows the amount of local texture changes in the image. Calculate the local homogeneity HOM:

[0051]

[0052] Step E5: Extract the entropy in the texture features based on the gray-level co-occurrence matrix calculated in step E1. The entropy represents the non-uniformity or complexity of the texture in the image and is a measure of the amount of information in the image. Calculate the entropy ENT:

[0053]

[0054] ​Step E6: Extract the correlation in the texture features based on the gray-level co-occurrence matrix calculated in Step E1. The correlation refers to the degree of similarity of the elements in the normalized gray-level co-occurrence matrix in the row and column directions. Calculate the correlation COR:

[0055]

[0056] Step E7: Extract the energy in the texture features based on the gray-level co-occurrence matrix calculated in Step E1, which reflects the degree of uniformity of the gray-level distribution and the thickness of the texture in the gray-scale image of the enoki mushroom. Calculate the energy ASM:

[0057]

[0058] Step E8: Obtain the values of the six texture features calculated respectively in Steps E2, E3, E4, E5, E6, and E7 under the gray-level co-occurrence matrices in four directions (0°, 45°, 90°, 135°). Take the mean and standard deviation of each feature in the four directions to form a total of 12 eigenvalue texture feature vectors;

[0059] As a preferred method, the said Step F includes:

[0060] Step F1: Compose a multi-dimensional growth feature vector with the feature vectors extracted in Steps C, D, and E. Combine the multi-dimensional growth feature vectors extracted from each image in the sample dataset and the category of each image to form a sample feature dataset. Then, use the entire feature column and the category column of the sample dataset as the input of the random forest RF classifier. Subsequently, calculate the importance value of each feature variable in the dataset according to the Gini coefficient function.

[0061] Step F2: Re-sort the features and the sample feature dataset respectively from large to small according to the feature importance values obtained in Step F1;

[0062] Step F3: Divide the sorted sample feature dataset into a training set and a test set. After training the RF model with the training set, take the first feature column intercepted from the test dataset as the input of the RF model to obtain the classification accuracy result. Then, take the first two feature columns intercepted from the test dataset as the input to obtain the corresponding classification accuracy result. Continuously iterate until all feature columns are used as inputs and the corresponding classification accuracy results are obtained; finally, according to the results graph between the number of features and the classification accuracy obtained in the iterative process, find the number of features n corresponding to the result with the highest classification accuracy, and select the top n features after sorting as the optimal multi-dimensional key growth feature vector of the enoki mushroom.

[0063] As a preferred method, in step G, the SVM classifier is designed in terms of the number of input feature vectors, the number of output classification categories, the selection of kernel functions, and the selection of classification algorithms. The number of input feature vectors is determined by step F, and the number of output classification categories is the four major periods in the mushroom primordium management stage of Pleurotus eryngii var. tuoliensis: the recovery period, the primordium induction period, the primordium emergence period, and the elongation period. Since the RBF radial basis kernel function has high flexibility, and the one-versus-rest classification algorithm (OVR-SVMs) can construct fewer SVM binary classifiers, enabling SVM to achieve good results in solving multi-classification problems, the RBF radial basis kernel function is selected as the kernel function and OVR-SVMs is selected as the classification algorithm to create a support vector machine classifier for training.

[0064] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0065] The method of the present invention can replace the existing manual on-site inspection of the growth state of Pleurotus eryngii var. tuoliensis, effectively reducing the labor intensity; for the captured images of Pleurotus eryngii var. tuoliensis, multi-dimensional features such as the color, shape, and texture of the target area of Pleurotus eryngii var. tuoliensis are extracted, and the random forest algorithm is used to select key features according to the feature importance, eliminating redundant features, making the unified characterization of the growth state of Pleurotus eryngii var. tuoliensis more accurate. At the same time, it uses SVM to classify and identify the growth periods of Pleurotus eryngii var. tuoliensis images characterized by key features, selects RBF as the kernel function and OVR-SVMs as the classification algorithm, and the classification results of the growth periods of Pleurotus eryngii var. tuoliensis are more accurate, the recognition and classification time is less, and it can provide real-time feedback for the regulation of the growth environment of Pleurotus eryngii var. tuoliensis, making a certain contribution to improving the yield and quality of Pleurotus eryngii var. tuoliensis. Description of the Drawings

[0066] Figure 1 It is a flowchart for extracting key growth features and classifying and identifying growth periods of Pleurotus eryngii var. tuoliensis in multiple periods.

[0067] Figure 2 It is a flowchart for extracting multi-dimensional growth features of Pleurotus eryngii var. tuoliensis.

[0068] Figure 3 It is a graph of the H, S, and L components of a sample image of Pleurotus eryngii var. tuoliensis in the primordium emergence period.

[0069] Figure 4 It is a graph of the sorted importance scores of each feature extracted under the random forest algorithm.

[0070] Figure 5 It is a graph of the classification accuracy results of the random forest algorithm under different numbers of features after sorting the feature importance.

[0071] Figure 6 It is a graph of the test classification results of the support vector machine algorithm under different kernel functions.

[0072] Figure 7Classification test results for the growth stages of some Pleurotus eryngii var. tuoliensis. Detailed implementation manners

[0073] The following further describes specific embodiments of the present invention with reference to the accompanying drawings.

[0074] The flowchart of the present invention is as Figure 1 shown:

[0075] 1. Acquisition and preprocessing of Pleurotus eryngii var. tuoliensis images

[0076] The Pleurotus eryngii var. tuoliensis sample images were taken from a Pleurotus eryngii var. tuoliensis cultivation base in Jiangsu. Images of the actual growth states of Pleurotus eryngii var. tuoliensis with the same quantity but different periods were collected to make a sample data set. Each image in the sample data set was cropped to a unified size, and irrelevant parts such as cultivation bags in the images were removed to obtain the regional images of Pleurotus eryngii var. tuoliensis;

[0077] 2. Extraction of growth characteristics of Pleurotus eryngii var. tuoliensis

[0078] For crop images, three types of characteristics, namely color, shape, and texture, are commonly used to describe their characteristics. Since the growth conditions of Pleurotus eryngii var. tuoliensis vary in different periods, it is not enough to characterize it only by using a certain one of these characteristics. Comprehensive research on the three types of characteristics is also required to more accurately characterize the growth characteristics of the crop. The present invention extracts a 28-dimensional feature vector, including 9 color characteristics, 7 shape characteristics, and 12 texture characteristics. As Figure 2 shown, first, the Pleurotus eryngii var. tuoliensis regional images are converted to the HSL color model and the grayscale color model, and color, shape, and texture characteristics are extracted respectively. Then, the combined multi-dimensional growth feature vector data set is used as the input of the random forest key feature extraction algorithm. Extracting key features in this way can make the key growth features of Pleurotus eryngii var. tuoliensis in each period more accurate and comprehensive.

[0079] 3. Extraction of color characteristics

[0080] Compared with the RGB color model that is more sensitive to light changes, the HSL color model can resist the influence of certain light changes. It is more accurate in characterizing the characteristics of white objects such as Pleurotus eryngii var. tuoliensis, and its H, S, and L components are as Figure 3 shown. Since the color feature values are relatively static during the feature extraction process, the color difference of relevant sub-entities in the target area can be better reflected through the color feature values. In addition, because the color distribution information is mainly concentrated in the low-order moments, and the first-order moment (μ i ), second-order moment (σ i ), and third-order moment (s i ) of the color are sufficient to characterize the color distribution of the image, and compared with other color characteristics, this feature representation method is more concise. Therefore, the Pleurotus eryngii var. tuoliensis region is converted from the RGB color model to the HSL model:

[0081]

[0082]

[0083]

[0084] Then, calculate nine color features, namely the three low-order color distances of each of the three color components in the HSL color model respectively:

[0085]

[0086]

[0087]

[0088] 4. Shape feature extraction

[0089] Shape features are another important feature for describing image content. For images of dense and clustering crops such as enoki mushrooms, shape features that describe a single object, such as convexity, compactness, straightness, and ellipticity, are not applicable. The moment invariants proposed by Hu are one of the earliest successful global shape recognition techniques and have been applied to research such as image retrieval, plant classification, and even medical image analysis. Therefore, the present invention selects seven invariant moments proposed by Hu to characterize the shape features of enoki mushroom images. After converting the enoki mushroom region from the RGB color model to the grayscale color model, for an image with a grayscale distribution of f(x, y), the (p + q)-th moment is defined as:

[0090]

[0091] (p + q)-th central moment is defined as:

[0092]

[0093]

[0094] where and represent the centroid of the image, where N and M are the height and width of the image respectively.

[0095] Normalized central moment is defined as:

[0096]

[0097] Finally, seven invariant moments M1 to M7 with the characteristics of translation, rotation, and scale invariance are constructed based on the normalized second-order and third-order central moments:

[0098] M1 = η 20 + η02

[0099]

[0100] M3 = (η 30 - 3η 12 ) 2 + (3η 21 - η 03 ) 2

[0101] M4 = (η 30 + η 12 ) 2 + (η 21 + η 03 ) 2

[0102] M5 = (η 30 - 3η 12 )(η 30 + η 12 )[(η 30 + η 12 ) 2 - 3(η 21 + η 03 ) 2 )

[0103] + (3η 21 - η 03 )(η 21 + η 03 )[3(η 30 + η 12 ) 2 - (η 21 + η 03 ) 2 )

[0104] M6 = (η 20 - η 02 )[(η 30 + η 12 ) 2 - (η 21 + η 03 ) 2 + 4η 12 (η 30 + η 12 )(η 21 + η 03 )

[0105] M7 = (3η 21 - η 03 )(η 30 + η 12 )[(η 30 + η12 ) 2 -3(η 21 +η 03 ) 2

[0106] +(3η 21 -η 30 )(η 21 +η 03 )[3(η 30 +η 12 ) 2 -(η 21 +η 03 ) 2

[0107] 5. Texture Feature Extraction

[0108] Texture is a description of the gray level of image pixels. Compared with color features and shape features, texture can better balance the overall and details. Since texture is formed by the repeated occurrence of gray level distribution in spatial positions, there will be a certain gray level relationship between two pixels separated by a certain distance in the image space, that is, the spatial correlation characteristics of gray level in the image. For crop images such as seafood mushrooms with similar shapes and similar growth intervals, it is necessary to consider the gray level changes in the whole space, so as to extract and analyze the texture features of the image. The gray level co-occurrence matrix of the seafood mushroom image in four directions of 0°, 45°, 90° and 135° is mainly calculated, and then the means and standard deviations of 6 features including contrast (CON), dissimilarity (DIS), homogeneity (HOM), entropy (ENT), correlation (COR), and energy (ASM) in 4 directions are extracted respectively to describe the texture features.

[0109] The gray level co-occurrence matrix reflects the distribution characteristics of brightness and the distribution of pixels with the same brightness and adjacent brightness, and is a second-order statistical feature of the brightness change in the image. Assuming that f(x, y) is a two-dimensional digital image of size m×n with a gray level of N, the gray level co-occurrence matrix that satisfies a certain spatial relationship is:

[0110]

[0111] Among them represents the number of elements in set x, and P is an N g ×N g matrix. Assuming that the distance between (x1, y1) and (x2, y2) is d, and the angle between the two and the coordinate axes is θ, the gray level co-occurrence matrix P(i, j, d, θ) can be obtained, and this matrix is normalized with the number of occurrences of (i, j) as the base to obtain the normalized gray level co-occurrence matrix.

[0112] ​​Contrast CON: Contrast is used to represent the clarity of an image and the depth of texture. When the texture is deeper, its contrast is greater and the texture is clearer. The more pixels with a large contrast, the larger the CON value.

[0113]

[0114] Differential DIS: It is a linear measure of local changes in an image:

[0115]

[0116] Local homogeneity HOM: It reflects the homogeneity of the image texture and embodies the amount of local texture changes in the image.

[0117]

[0118] Entropy value ENT: The entropy value represents the non-uniformity or complexity of the texture in the image and is a measure of the amount of information in the image. When the elements in the normalized gray-level co-occurrence matrix are more dispersed, the entropy value is larger.

[0119]

[0120] Correlation COR: It reflects the similarity degree of the elements in the normalized gray-level co-occurrence matrix in the row and column directions.

[0121]

[0122] Energy ASM: It reflects the evenness of the gray-level distribution and the thickness of the texture in the gray-scale image of enokitake mushrooms.

[0123]

[0124] Among them, in the above formulas, N is the order of the normalized gray-level co-occurrence matrix, and p(i, j) is the element of the normalized gray-level co-occurrence matrix.

[0125] 6. Selection of Key Features of Enokitake Mushrooms

[0126] For the multi-dimensional growth feature vectors extracted based on Step C, Step D, and Step E, not all features have representational value. Therefore, key features of the samples need to be selected through feature selection methods, redundant features need to be removed, the curse of dimensionality needs to be avoided, and the classification efficiency of the period needs to be improved.

[0127] Using the random forest algorithm, key features are optimized according to feature importance, mainly including: First, the multi-dimensional growth feature vectors extracted from each image in the sample dataset and the category of each image are combined to form a sample feature dataset. Then, the entire feature column and the category column of the sample dataset are used as the input of the random forest RF classifier, and the importance value of each feature variable in the dataset is calculated according to the Gini coefficient function. Then, the features and the sample dataset are sorted in descending order again according to the feature importance value. The sorting result of the features is as Figure 4 shown. Then, the sorted sample feature dataset is divided into a training set and a test set. After the RF model is trained through the training set, the first feature column in the intercepted test dataset is used as the input of the RF model. After obtaining the classification accuracy result, the first two feature columns of the test dataset are intercepted as the input to obtain the corresponding classification accuracy result, and the iteration continues until all feature columns are used as the input and the corresponding classification accuracy results are obtained; The result graph of the number of features and the classification accuracy is as Figure 5 shown, Figure 5 in which the highest classification accuracy is 83.93%, and the corresponding number of features is 17. Then select Figure 4 the first 17 features from left to right in

[0128] 7. Design of SVM Classifier for the Growth Period of Seafood Mushroom

[0129] An SVM classifier is used to classify and judge the four growth periods of seafood mushroom, mainly including the following stages:

[0130] (1) Sample data production: Prepare the sample images of each period, segment the sample images, remove the culture bag area with a color similar to that of the seafood mushroom, obtain the seafood mushroom area, and select the optimized key feature vector as the input of the classifier;

[0131] (2) Constructing the classifier: Initialize the kernel function, type parameters, etc. required for the support vector machine classifier, and send the feature vectors extracted from the samples into the classifier for training to make the classifier converge;

[0132] (3) Classification and recognition: Segment the input image, directly extract the key feature vector as the input, substitute it into the trained SVM to calculate the result and perform classification, and give the classification result of the input image.

[0133] Design the SVM classifier from aspects such as the number of input feature vectors, the number of output classification categories, the selection of kernel functions, and the selection of classification algorithms. Extract 17-dimensional key feature vectors of the color, shape, and texture of the Pleurotus eryngii var. tuoliensis images optimized by the random forest algorithm. Because through experimental data statistics, when other parameters are the same, the classification success rate using 17-dimensional key feature vectors is 90%, and the classification accuracy rate under the 28-dimensional feature vectors before optimization is 89.4%. From the perspective of classification efficiency, the time for the former to detect a single picture is 0.1875 s, while the latter is 0.5625 s, and the time is reduced by 66.7%, but the detection efficiency is increased by 200%. Therefore, the number of input feature vectors of the SVM classifier is 17, and the number of output classification categories is 4, namely the four major periods in the fruiting management stage of Pleurotus eryngii var. tuoliensis: the recovery period, the primordium induction period, the pinhead formation period, and the elongation period. Collect 480 Pleurotus eryngii var. tuoliensis images in the Pleurotus eryngii var. tuoliensis base for experiments, and compare the classification results with different kernel functions. The selected kernel functions are the linear kernel function, the radial basis kernel function, the sigmoid kernel function, and the polynomial kernel function. As Figure 6 shown, after using the radial basis kernel function, the classification effect of the test set is the best, and the classification accuracy rate in each period can reach more than 89%. The classification algorithm selects the one-vs-rest SVMs (OVR-SVMs) that can construct fewer SVM binary classifiers.

[0134] Therefore, finally select the radial basis kernel function as the kernel function, and use OVR-SVMs as the method for classification and recognition to create a support vector machine classifier for training, and finally identify and classify the Pleurotus eryngii var. tuoliensis test set. The classification detection results of some Pleurotus eryngii var. tuoliensis periods are as Figure 7 shown. In addition, to prove the superiority of the proposed method, at the same time, use RF and KNN to perform period classification and recognition on the Pleurotus eryngii var. tuoliensis image dataset characterized by key features. The results are shown in Table 1. The method RF-SVM proposed by the present invention not only has the highest classification success rate, which is 91.875%, but also the recognition speed of a single picture is the fastest.

[0135] Table 1 Comparison results of different classification methods

[0136]

[0137] References

[0138] [1].Mariana Belgiu,Lucian Random forest in remote sensing: A review of applications and future directions[J]. ISPRS Journal of Photogrammetry and Remote Sensing, 2016, 114.

[0139] [2]. Kezhu Tan, Won Suk Lee, Hao Gan, Shuwen Wang. Recognising blueberry fruit of different maturity using histogram oriented gradients and colour features in outdoor scenes[J]. Biosystems Engineering, 2018, 17。

Claims

1. A method for extracting key growth characteristics of seafood mushrooms at multiple stages and classifying the stages, characterized in that, It includes the following steps: Step A: Make a sample image dataset covering each period of the pleurotus eryngii var. tuoliensis fruiting management stage, and read the pleurotus eryngii var. tuoliensis sample images; Step B: Preprocess the pleurotus eryngii var. tuoliensis sample images in Step A, remove the irrelevant parts in the images, and obtain the target region images of the pleurotus eryngii var. tuoliensis; Step C: Convert the target region images of the pleurotus eryngii var. tuoliensis in Step B from the RGB color space to the HSL color space, and extract the low-order color distances of the color components in each of the 3 channels: the first moment, the second moment, and the third moment. A total of 9 feature parameters form a 9-dimensional feature vector describing the color characteristics of the pleurotus eryngii var. tuoliensis region in the sample images; Step D: Convert the target region images of the pleurotus eryngii var. tuoliensis in Step B from the RGB color space to the grayscale space, and extract 7 Hu invariant moments to form a 7-dimensional feature vector describing the shape characteristics of the pleurotus eryngii var. tuoliensis region in the sample images; Step E: Convert the target region images of the pleurotus eryngii var. tuoliensis in Step B from the RGB color space to the grayscale space, and extract 12 texture features based on the gray-level co-occurrence matrices in 4 different directions to form a 12-dimensional feature vector describing the texture characteristics of the pleurotus eryngii var. tuoliensis region in the sample images; Step F: Based on the multi-dimensional growth feature vectors extracted in Step C, Step D, and Step E, use the random forest RF algorithm to perform key feature selection according to the feature importance, remove redundant features, and form the optimal multi-dimensional key growth feature vector of the pleurotus eryngii var. tuoliensis; Step G: Construct an SVM classifier, use the optimal multi-dimensional key growth feature vector of the pleurotus eryngii var. tuoliensis obtained in Step F as the input of the classifier, and train the classifier to make it converge; Step H: Preprocess the pleurotus eryngii var. tuoliensis region in the test image set, obtain the target region images of the pleurotus eryngii var. tuoliensis to be measured, extract the optimal multi-dimensional key growth feature vector, substitute it into the trained SVM classifier, and obtain the classification result of the growth period of the pleurotus eryngii var. tuoliensis to be measured in the test image.

2. The method for extracting key growth characteristics of seafood mushrooms at multiple stages and classifying the stages according to claim 1, characterized in that, In Step A, the pleurotus eryngii var. tuoliensis fruiting management stage is divided into four major growth periods: the recovery period, the primordium induction period, the primordium emergence period, and the elongation period.

3. The method for extracting key growth characteristics of seafood mushrooms at multiple stages and classifying the stages according to claim 1, wherein, In Step E, the 12 texture features include: the means and standard deviations of six features: contrast (CON), dissimilarity (DIS), local homogeneity (HOM), entropy (ENT), correlation (COR), and energy (ASM) in the gray-level co-occurrence matrices in four directions of 0°, 45°, 90°, and 135°.

4. The method for extracting key growth characteristics of seafood mushrooms at multiple stages and classifying the stages according to claim 1, characterized in that, Step F includes: Step F1: Use the feature vectors extracted in Step C, Step D, and Step E to form a multi-dimensional growth feature vector. Combine the multi-dimensional growth feature vector extracted from each image in the sample data set and the category of each image to form a sample feature data set. Then, use the entire feature column and the category column of the sample data set as the input of the random forest RF classifier. Subsequently, calculate the importance value of each feature variable in the data set according to the Gini coefficient function; Step F2: Reorder the features and the sample feature data set from largest to smallest according to the importance values of the feature variables; Step F3: Divide the sorted sample feature dataset into a training set and a test set. After training the RF model with the training set, take the first feature column from the intercepted test dataset as the input of the random forest RF model. After obtaining the classification accuracy result, then take the first two feature columns of the test dataset as the input to obtain the corresponding classification accuracy result, and iterate continuously until all feature columns have been used as inputs and the corresponding classification accuracy results have been obtained; finally, based on the iterative process, obtain a result graph between the number of features and the classification accuracy, find the number of features n corresponding to the result with the highest classification accuracy, and select the first n features after sorting as the optimal multi-dimensional key growth feature vector of the enokitake mushroom.

5. The method for extracting key growth characteristics of seafood mushrooms in multiple periods and classifying periods according to claim 1, wherein, In step G, the number of classification categories output by the SVM classifier is 4, corresponding to the four major periods in the enokitake mushroom fruiting management stage: the recovery period, the primordium induction period, the pinhead formation period, and the elongation period; the kernel function uses the radial basis kernel function, and the classification algorithm uses the one-versus-rest classification OVR-SVMs algorithm.