Forest seedling grading method based on image recognition
By employing methods such as illumination equalization, edge detection, and feature fusion, combined with support vector machines and incremental learning, the problems of image quality and multi-source data fusion in forest seedling grading were solved, achieving precise and intelligent seedling grading.
Patent Information
- Application Number
- CN202511661067.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-01-23
AI Technical Summary
Existing methods for grading forest tree seedlings suffer from problems such as uneven image data quality, difficulty in fusing multi-source heterogeneous data, and difficulty in adapting grading models to changes in seedling growth, resulting in poor grading accuracy.
Preprocessing was performed using illumination equalization and distributed data transformation. Seedling outlines were extracted using edge detection and morphological filtering. Multidimensional features were extracted using convolutional neural networks, and the feature vectors were fused with structured data. Support vector machines were used for grading, and incremental learning was introduced to update the model to optimize grading accuracy.
It significantly improves the precision and intelligence of seedling grading, and by continuously learning and adapting to changes in seedling growth, it enhances the accuracy and efficiency of grading.
Smart Images

Figure CN121392425A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a forest seedling grading method based on image recognition. BACKGROUND
[0002] At present, in the process of automatic grading of forest seedlings, there are many technical challenges. First, the features such as shape, size and color of seedlings are different, and there is also great difference between seedlings of the same variety, which puts high requirements on the generalization ability and robustness of image recognition algorithm. Secondly, due to the complexity of the growth environment of seedlings, the quality of the collected seedling image data is uneven, there are problems such as uneven light, angle deviation, and partial occlusion, which makes it difficult to extract image features. Thirdly, relying only on single morphological image data is difficult to fully depict the multi-aspect features of seedlings, while the fusion of multi-source heterogeneous data faces problems such as inconsistent data format, large difference in spatial resolution, and deep semantic gap. Finally, in the actual seedling grading process, due to the great change of the growth and development of seedlings, the previously established grading model often cannot adapt to the new seedling characteristics, and it is necessary to re-label data and train the model, resulting in low efficiency of grading. In summary, an automatic forest seedling grading method is needed to overcome a series of technical difficulties such as image data quality control, multi-source heterogeneous data fusion, continuous learning and evolution of grading model, in order to realize the precision, automation and intelligence of seedling grading.
[0003] In one prior art, in the process of automatic grading of forest seedlings, an image recognition algorithm is used to analyze the collected seedling images. In implementation, first, a high-resolution camera is used to take pictures of the seedlings to obtain their appearance feature images, then image processing technology is used to extract morphological, size and color information, and finally the extracted data is input into a classification model for automatic grading.
[0004] However, in the prior art, the multi-dimensional features of the collected seedlings are not continuously updated and optimized, resulting in poor accuracy of seedling grading. SUMMARY
[0005] The present application provides a forest seedling grading method based on image recognition, model and storage medium, to solve the problem that in the prior art, the multi-dimensional features of the collected seedlings are not continuously updated and optimized, resulting in poor accuracy of seedling grading.
[0006] In a first aspect, to solve the above technical problems, the present application provides a forest seedling grading method based on image recognition, comprising:
[0007] Step 1: Obtain original image data and multi-source data;
[0008] Step 2: preprocessing according to the original image data and the multi-source data to obtain an equalized image and standard data; Step 3: edge processing according to the equalized image to obtain a contour image; Step 4: extraction according to the contour image to obtain a feature vector;
[0009] Step 5: fusion of the feature vector and the standard data to obtain a fusion data set;
[0010] Step 6: training according to the fusion data set to obtain a hierarchical model;
[0011] Step 7: prediction according to the hierarchical model to obtain a hierarchical result;
[0012] Step 8: comparison of the hierarchical result with pre-stored historical data to obtain an accuracy rate;
[0013] Step 9: judgment according to the accuracy rate; if the accuracy rate reaches a preset threshold, the hierarchical result is determined to be a qualified result; otherwise, the original image data is reacquired for optimization to obtain a new hierarchical model, and steps 7-9 are repeated until the qualified result is obtained;
[0014] Step 10: output of the qualified result to obtain a final hierarchical result.
[0015] In an implementable manner of the first aspect, the preprocessing according to the original image data and the multi-source data to obtain an equalized image and standard data comprises:
[0016] Optimization using an illumination equalization algorithm according to the original image data to obtain an equalized image;
[0017] Conversion according to the multi-source data to obtain standard data.
[0018] In an implementable manner of the first aspect, the fusion of the feature vector and the standard data to obtain a fusion data set comprises:
[0019] Comparison and analysis according to the feature vector and the standard data to obtain an analysis result;
[0020] Extraction according to the analysis result to obtain difference information;
[0021] Coordinate matching according to the difference information to obtain coordinate information;
[0022] Semantic gap elimination according to the difference information to obtain semantic bridging information;
[0023] The feature vector and the standard data are integrated based on the coordinate information and the semantic bridging information to obtain a fused dataset.
[0024] In one possible implementation of the first aspect, the difference information refers to the differences between the feature vector and the standard data in terms of time dimension, spatial dimension, and semantic expression.
[0025] In one possible implementation of the first aspect, training the hierarchical model based on the fused dataset includes:
[0026] The training dataset is obtained by extracting data from the fused dataset according to the pre-stored grading criteria.
[0027] The initial model is obtained by training using the support vector machine algorithm on the training dataset.
[0028] The data to be analyzed is input into the initial model for real-time acquisition, resulting in original dynamic data and newly acquired dynamic data.
[0029] The distribution degree difference is obtained by evaluating the original dynamic data and the newly collected dynamic data.
[0030] The distribution degree difference is compared with a preset distribution degree threshold; if the distribution degree difference is less than the preset distribution degree threshold, the initial model is determined to be a hierarchical model; otherwise, the initial model is trained by increasing the training dataset until a hierarchical model is obtained.
[0031] In one possible implementation of the first aspect, the evaluation based on the original dynamic data and the newly acquired dynamic data to obtain the distributional dissimilarity includes:
[0032] The distributional variability is calculated using the following formula:
[0033]
[0034] in, Indicates the degree of distributional variability, Indicates the number of pre-stored data features, Indicates the first in the original dynamic data The probability distribution of each feature Indicates the first of the newly collected dynamic data The probability distribution of each feature.
[0035] In one possible implementation of the first aspect, the step of predicting based on the hierarchical model to obtain a hierarchical result includes:
[0036] Input the data to be analyzed into the hierarchical model for hierarchical prediction to obtain a seedling grade category;
[0037] Number according to the seedling grade category to obtain a hierarchical label;
[0038] According to the seedling grade category and the hierarchical label, a hierarchical result is obtained.
[0039] In an implementable manner of the first aspect, the reacquisition of the original image data for optimization to obtain a new hierarchical model comprises:
[0040] Acquiring original image data;
[0041] According to the original image data, an enhancement algorithm is used for light balance processing to obtain an optimized balanced image;
[0042] According to the optimized balanced image, a data conversion strategy is used for conversion to obtain an optimized feature vector;
[0043] According to the optimized feature vector, a feature selection method is used for selection to obtain a feature subset;
[0044] According to the feature subset, a feature fusion algorithm is used for fusion to obtain an optimized fusion feature vector;
[0045] According to the optimized fusion feature vector, a support vector machine algorithm is used to construct a model to obtain a new hierarchical model.
[0046] In a second aspect, the present application provides a forest seedling grading device based on image recognition, comprising:
[0047] A data acquisition module is used to acquire original image data and multi-source data;
[0048] A data preprocessing module is used to preprocess the original image data and the multi-source data to obtain a balanced image and standard data; A contour extraction module is used to perform edge processing on the balanced image to obtain a contour image; a feature extraction module is used to extract the contour image to obtain a feature vector;
[0049] A data fusion module is used to fuse the feature vector and the standard data to obtain a fusion data set;
[0050] A model construction module is used to train the fusion data set to obtain a hierarchical model;
[0051] A result prediction module is used to predict the hierarchical model to obtain a hierarchical result;
[0052] An accuracy evaluation module is configured to compare the grading result with historical data stored in advance to obtain an accuracy rate;
[0053] A judgment module is configured to judge according to the accuracy rate; if the accuracy rate reaches a preset threshold, it is determined that the grading result is a qualified result; otherwise, the original image data is reacquired to obtain a new grading model, and the operations of the result prediction module, the accuracy evaluation module and the judgment module are repeated until the qualified result is obtained;
[0054] A result output module is configured to output the qualified result to obtain a final grading result.
[0055] In an implementable manner of the second aspect, the preprocessing according to the original image data and the multi-source data to obtain an equalized image and standard data comprises:
[0056] Optimizing according to the original image data using an illumination equalization algorithm to obtain an equalized image;
[0057] Converting according to the multi-source data to obtain standard data.
[0058] In an implementable manner of the second aspect, the fusion of the feature vector and the standard data to obtain a fusion data set comprises:
[0059] Comparing and analyzing according to the feature vector and the standard data to obtain an analysis result;
[0060] Extracting according to the analysis result to obtain difference information;
[0061] Matching coordinates according to the difference information to obtain coordinate information;
[0062] Eliminating semantic gaps according to the difference information to obtain semantic bridging information;
[0063] Integrating the feature vector and the standard data according to the coordinate information and the semantic bridging information to obtain a fusion data set.
[0064] In an implementable manner of the second aspect, the difference information refers to the differences between the feature vector and the standard data in time dimension, space dimension and semantic expression.
[0065] In an implementable manner of the second aspect, the training according to the fusion data set to obtain a grading model comprises:
[0066] Extracting the fusion data set according to a pre-stored grading standard to obtain a training data set;
[0067] The initial model is obtained by training using the support vector machine algorithm on the training dataset.
[0068] The data to be analyzed is input into the initial model for real-time acquisition, resulting in original dynamic data and newly acquired dynamic data.
[0069] The distribution degree difference is obtained by evaluating the original dynamic data and the newly collected dynamic data.
[0070] The distribution degree difference is compared with a preset distribution degree threshold; if the distribution degree difference is less than the preset distribution degree threshold, the initial model is determined to be a hierarchical model; otherwise, the initial model is trained by increasing the training dataset until a hierarchical model is obtained.
[0071] In one possible implementation of the second aspect, the evaluation based on the original dynamic data and the newly acquired dynamic data to obtain the distributional dissimilarity includes:
[0072] The distributional variability is calculated using the following formula:
[0073]
[0074] in, Indicates the degree of distributional variability, Indicates the number of pre-stored data features, Indicates the first in the original dynamic data The probability distribution of each feature Indicates the first of the newly collected dynamic data The probability distribution of each feature.
[0075] In one possible implementation of the second aspect, the step of predicting based on the hierarchical model to obtain a hierarchical result includes:
[0076] The data to be analyzed is input into the grading model for grading prediction to obtain the seedling grade category;
[0077] The seedlings are numbered according to their grade category to obtain grade labels;
[0078] The grading results are obtained by associating the seedling grade category with the grading label.
[0079] In one possible implementation of the second aspect, the re-acquisition of the original image data for optimization to obtain a new hierarchical model includes:
[0080] Obtain the raw image data;
[0081] Based on the original image data, an enhancement algorithm is used to perform illumination equalization processing to obtain an optimized equalized image;
[0082] According to the optimization balanced image, data conversion strategy is used for conversion, and an optimization feature vector is obtained.
[0083] According to the optimization feature vector, a feature selection method is used for selection, and a feature subset is obtained.
[0084] According to the feature subset, a feature fusion algorithm is used for fusion, and an optimization fusion feature vector is obtained.
[0085] According to the optimization fusion feature vector, a support vector machine algorithm is used to construct a model, and a new grading model is obtained.
[0086] In a third aspect, the present application further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the image recognition-based forest seedling grading method according to any one of the above.
[0087] In a fourth aspect, the present application further provides a computer readable storage medium, comprising a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the image recognition-based forest seedling grading method according to any one of the above when the computer program runs.
[0088] Compared with the prior art, the present application has the following beneficial effects:
[0089] The present application discloses an image recognition-based forest seedling grading method, comprising obtaining original image data and multi-source data; pre-processing the original image data and the multi-source data to obtain a balanced image and standard data; performing edge processing on the balanced image to obtain a contour image; extracting the contour image to obtain a feature vector; fusing the feature vector and the standard data to obtain a fusion data set; training the fusion data set to obtain a grading model; predicting the grading model to obtain a grading result; comparing the grading result with pre-stored historical data to obtain an accuracy rate; judging the accuracy rate; if the accuracy rate reaches a preset threshold, determining that the grading result is a qualified result; otherwise, re-obtaining original image data for optimization to obtain a new grading model, and repeating the judgment operation until the qualified result is obtained; and outputting the qualified result to obtain a final grading result.
[0090] The present application adopts illumination equalization and distributed data conversion for preprocessing in view of the problems of poor seedling image quality and multi-source heterogeneous data; the seedling contour is extracted through edge detection and morphological filtering, and then multi-dimensional features are extracted by using a convolutional neural network; the feature vector is fused with structured data, and a feature alignment algorithm is used to solve the difference in spatial and temporal resolution. According to the fused features, a support vector machine is used for seedling grading; the present application also introduces incremental learning to update the model, continuously optimizing the grading accuracy; through continuous acquisition of new data, the model continuously learns and evolves, significantly improving the precision and intelligence level of seedling grading. BRIEF DESCRIPTION OF DRAWINGS
[0091] Figure 1 is a flowchart of a forest seedling grading method based on image recognition provided by the first embodiment of the present application;
[0092] Figure 2 is a structural diagram of a forest seedling grading device based on image recognition provided by the second embodiment of the present application. DETAILED DESCRIPTION
[0093] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0094] With reference to Figure 1 The first embodiment of the present application provides a forest seedling grading method based on image recognition, comprising the following steps:
[0095] S1, acquiring original image data and multi-source data;
[0096] S2, preprocessing according to the original image data and the multi-source data to obtain an equalized image and standard data; S3, performing edge processing according to the equalized image to obtain a contour image; S4, extracting according to the contour image to obtain a feature vector;
[0097] S5, fusing the feature vector and the standard data to obtain a fused data set;
[0098] S6, training according to the fused data set to obtain a grading model;
[0099] S7, predicting according to the grading model to obtain a grading result;
[0100] S8, compare the grading result with pre-stored historical data to obtain an accuracy rate;
[0101] S9, judge according to the accuracy rate; if the accuracy rate reaches a preset threshold, determine that the grading result is a qualified result; otherwise, reacquire the original image data to optimize to obtain a new grading model and repeat steps 7-9 until the qualified result is obtained;
[0102] S10, output the qualified result to obtain a final grading result.
[0103] In step S1, original image data and multi-source data are acquired.
[0104] It should be noted that the original image data in this embodiment refers to seedling original image data; and the multi-source data refers to multi-source heterogeneous data.
[0105] For example, multi-source heterogeneous data can include soil, climate, growth environment, etc. These data come from various sources and have different formats. For example, soil pH value can be stored in CSV file, while temperature data can come from Internet of Things sensor in JSON format.
[0106] In step S2, the original image data and the multi-source data are preprocessed to obtain balanced images and standard data.
[0107] In one specific embodiment, seedling original image data and multi-source heterogeneous data are acquired, distributed conversion processing is performed on the heterogeneous data, the heterogeneous data is converted into a unified standard structured data format, the influence of data heterogeneity is eliminated, and standard data is obtained. In view of the problem of poor quality of seedling images, an adaptive histogram equalization algorithm is used to perform illumination balancing processing on the images. According to the image histogram distribution, the image pixel value is adaptively adjusted, the overall contrast of the image is improved, the influence of uneven illumination is eliminated, and standard data is obtained.
[0108] For example, in order to unify the processing, it is necessary to convert these heterogeneous data into a standard format, such as a unified relational database table structure. This not only simplifies subsequent analysis, but also improves data integration efficiency. The quality of seedling images is often affected by factors such as uneven illumination and shadows. The adaptive histogram equalization algorithm can effectively improve this problem. This algorithm dynamically adjusts the pixel value by analyzing the pixel distribution of the image, enhancing the contrast of the image. For example, for a seedling image with insufficient illumination, the algorithm may increase the brightness of the dark area while maintaining the details of the bright area, making the leaf texture more clear and visible. In step S3, edge processing is performed on the balanced image to obtain a contour image.
[0109] In one specific embodiment, the seedling image after illumination equalization is obtained as a to-be-processed image; an edge detection algorithm is used to perform edge detection on the to-be-processed image to obtain a preliminary seedling contour image; a pre-set morphological filtering method is used to perform denoising processing on the preliminary seedling contour image to eliminate noise interference; if there are still noise points in the seedling contour image after the denoising processing, the denoising processing of the morphological filtering is repeatedly performed until the noise points in the seedling contour image are completely removed; after the noise points are removed, the contour of the seedling is determined according to the edge information of the seedling contour image.
[0110] Exemplarily, for a leaf image locally overexposed due to direct sunlight, the equalization processing can reduce the intensity of the highlight area while improving the details of the shadow part, so that the overall contour is clearer. Edge detection is a key step for determining the seedling contour. Commonly used edge detection algorithms include Sobel, Canny, etc. Taking the Canny algorithm as an example, it can effectively identify the boundary between the seedling leaf and the background through steps such as Gaussian filtering, gradient calculation, non-maximum suppression, and double-threshold detection.
[0111] In step S4, a feature vector is extracted according to the contour image.
[0112] In one specific embodiment, the image is pre-processed according to the seedling contour image, including image denoising, enhancement, etc., to obtain an optimized seedling contour image. According to the pre-processed seedling contour image, the shape, size, ground diameter, root width, etc. of the seedling are extracted to obtain a multi-dimensional feature vector representing the shape of the seedling. For the extracted multi-dimensional feature vector of the seedling, a convolutional neural network model is used for feature learning and representation, and high-level features of the seedling shape are extracted through convolution, pooling, etc. On the basis of the convolutional neural network model, an attention mechanism is introduced to weight process the key feature area of the seedling shape, highlighting the representation of important features such as the shape and size of the seedling. Through multi-layer feature extraction and fusion of the convolutional neural network model, a deep feature representation of the seedling shape is obtained, which is used to depict the shape diversity and size difference of the seedling.
[0113] In step S5, the feature vector and the standard data are fused to obtain a fusion data set.
[0114] In step S5, the feature vector and the standard data are fused to obtain a fusion data set, which further includes the following steps:
[0115] S51, according to the feature vector and the standard data, a comparative analysis is performed to obtain an analysis result;
[0116] S52, according to the analysis result, difference information is extracted;
[0117] S53, performing coordinate matching according to the difference information to obtain coordinate information;
[0118] S54, performing semantic gap elimination according to the difference information to obtain semantic bridging information;
[0119] S55, integrating the feature vector and the standard data according to the coordinate information and the semantic bridging information to obtain a fusion data set.
[0120] It should be noted that the specific implementation process of the above steps S51 to S55 includes: a multi-dimensional feature vector data set and a structured standard data set, the format and content of the two data sets are analyzed and compared; according to the analysis result, the differences existing in the time dimension, the space dimension and the semantic expression of the multi-dimensional feature vector and the structured data are determined; a feature alignment algorithm is designed, the time and space coordinates of the multi-dimensional feature vector are matched and aligned with the time and space coordinates of the structured data by establishing a mapping relationship; natural language processing technology is used to analyze the semantic expression of the multi-dimensional feature vector and the structured data, and a semantic bridging dictionary is constructed to eliminate the semantic gap; the aligned time and space coordinate information and the semantic bridging information are integrated into the original multi-dimensional feature vector and the structured data to realize feature fusion; the fused feature data is standardized to unify the data format and data representation, and a standardized fusion feature data set is generated.
[0121] Exemplarily, taking seedling morphological characteristics as an example, the multi-dimensional feature vector can include continuous numerical values such as ground diameter, plant height, leaf area, etc., while the structured data can describe the seedling growth stage in a discrete form. In the time dimension, the feature vector records the accurate time stamp at the time of collection, and the structured data records the observation date in units of days. In the space dimension, the feature vector uses accurate coordinates, and the structured data uses field block numbers to represent the location. To solve these differences, a feature alignment algorithm needs to be designed. Time alignment can use the sliding window method to map the time stamp of the feature vector to the nearest observation date. Spatial alignment can convert accurate coordinates to corresponding field block numbers through a geographic information system. In this way, the correspondence between the two kinds of data in the time and space dimensions is established. The semantic difference is also important. For example, “ground diameter” in the feature vector may correspond to “stem diameter” in the structured data. Through natural language processing technology, such as word embedding model, the semantic similarity of the two expressions can be analyzed. A semantic bridging dictionary is constructed to establish a correspondence between “ground diameter” and “stem diameter”, thereby eliminating the semantic gap. The integrated and aligned time and space coordinates and semantic bridging information realize feature fusion.
[0122] In step S6, a hierarchical model is obtained by training according to the fusion data set.
[0123] It should be noted that, in step S6 above, the step of training the hierarchical model based on the fused dataset further includes the following steps:
[0124] S61, the fused dataset is extracted according to the pre-stored grading criteria to obtain the training dataset;
[0125] S62, The initial model is obtained by training the model using the support vector machine algorithm based on the training dataset;
[0126] S63, input the data to be analyzed into the initial model for real-time acquisition to obtain the original dynamic data and the newly acquired dynamic data;
[0127] S64, Evaluate the distribution degree difference based on the original dynamic data and the newly collected dynamic data;
[0128] S65, compare the distribution degree difference with the preset distribution degree threshold; if the distribution degree difference is less than the preset distribution degree threshold, determine that the initial model is a hierarchical model; otherwise, increase the training dataset to train the initial model until a hierarchical model is obtained.
[0129] In one specific embodiment, steps S61 to S65 above are specifically implemented as follows: a training dataset is constructed based on multi-dimensional dynamic data during seedling growth and development, including morphological, physiological, and biochemical indicators; reasonable seedling grading standards are set according to business needs, and the original data is preprocessed to extract key features; an initial seedling grading model is trained using a support vector machine algorithm combined with labeled training data; new dynamic data is continuously collected during seedling growth, compared with the original training data, and the data distribution difference is calculated; if the data distribution difference exceeds a preset threshold, an incremental learning mode is triggered, and the original model is fine-tuned and updated using the new data; in this embodiment of the invention, the preset threshold is not described. Through the gradient boosting decision tree algorithm, a more dynamically adaptable seedling grading model is continuously trained and generated based on the original model until a grading model that meets the requirements is obtained.
[0130] It should be noted that the distributional variability is calculated using the following formula:
[0131]
[0132] in, Indicates the degree of distributional variability, Indicates the number of pre-stored data features, Indicates the first in the original dynamic data The probability distribution of each feature Indicates the first of the newly collected dynamic data a probability distribution of the features.
[0133] Exemplarily, when constructing the original data set, multi-dimensional dynamic data of rice seedlings can be collected. Morphological indicators include plant height, leaf number, tiller number, etc.; physiological indicators such as photosynthetic rate, transpiration rate; biochemical indicators include chlorophyll content, nitrogen, phosphorus and potassium content, etc. These indicators change with the growth stage and jointly reflect the quality of seedlings. In the preprocessing stage, outliers need to be removed, such as data deviation caused by extreme weather. Key feature extraction can use principal component analysis to select the most significant features that affect seedling quality from numerous indicators. For example, it may be found that plant height and chlorophyll content are the most representative indicators. The development of seedling grading standards needs to consider multiple factors. Taking rice as an example, seedlings can be divided into four grades: excellent, good, medium and poor. High-quality seedlings may require plant height of 15-20 cm, leaf number of not less than 4, and chlorophyll content of more than 35 SPAD. These standards should be adjusted appropriately according to the characteristics of the variety and the planting area. The support vector machine algorithm plays an important role in the initial model training. It can effectively handle high-dimensional features and is suitable for handling multi-dimensional indicators such as morphology, physiology, and biochemistry. Through kernel function conversion, the optimal classification hyperplane can be found in high-dimensional space to accurately divide seedlings of different grades. As seedlings grow, changes in environmental conditions and management measures may cause the data distribution to shift. For example, due to climate change, the newly collected plant height data is generally higher. By calculating the KL divergence of the new and old data, the distribution difference can be quantified. When the difference exceeds a preset threshold, such as 0.5, the incremental learning mode is triggered. Incremental learning allows the model to adapt to the new data distribution without retraining the entire model. Taking gradient boosting decision trees as an example, new decision trees can be added to the original model to correct the previous prediction bias.
[0134] In step S7, a prediction is made according to the grading model to obtain a grading result.
[0135] In step S7, the prediction according to the grading model to obtain a grading result further includes the following steps:
[0136] S71, input the data to be analyzed into the grading model for grading prediction to obtain a seedling grade category;
[0137] S72, number according to the seedling grade category to obtain a grading label;
[0138] S73, associate according to the seedling grade category and the grading label to obtain a grading result.
[0139] In one specific embodiment, during the above steps S71 to S73, the specific implementation process includes: according to the fusion feature data set, using a feature extraction algorithm to extract the key feature vector of the seedling. Through normalization processing of the extracted feature vector, a standardized feature vector representation is obtained. According to the standardized feature vector, a support vector machine classification model is constructed, and model parameters and classification labels are set. Using a cross-validation method, the support vector machine model is trained and optimized to obtain the optimal classification model. The seedling data to be classified is input into the trained support vector machine model for classification prediction. According to the classification prediction result, the grade category to which the seedling belongs is judged, and the corresponding classification label is generated. The classification result is associated with the seedling number, and the final seedling classification result data set is output.
[0140] Exemplarily, by extracting morphological, physiological and biochemical indicators and other multi-dimensional features, the growth state of the seedling can be better reflected. For example, for rice seedlings, morphological features such as plant height, leaf number, stem diameter, and physiological indicators such as chlorophyll content and photosynthetic efficiency can be extracted. These features together constitute a feature vector that describes the growth state of the seedling. Normalization processing of the feature vector is an important link to ensure the comparability of different dimensional features. Taking rice seedlings as an example, the plant height may be in centimeters, and the chlorophyll content may be in milligrams. Through normalization processing, all features can be mapped to the same scale, such as between 0 and 1. In this way, the relative relationship between features is preserved, and the influence of dimensional differences on the model is avoided. Support vector machine is an excellent classification algorithm and has good application prospects in seedling classification. Taking rice seedling classification as an example, three level labels of “excellent”, “qualified” and “unqualified” can be set. The selection of model parameters such as kernel function type and penalty factor directly affects the classification effect. Cross-validation can effectively avoid overfitting and improve the generalization ability of the model. In practical application, 5-fold cross-validation can be used, and the data set is divided into 5 parts, and 4 parts are used as the training set and 1 part is used as the validation set. Through multiple training and validation, stable and reliable model performance evaluation can be obtained. For example, assuming that the average accuracy of the model in cross-validation reaches 95%, the model is considered to have good classification ability. For newly collected seedling data, it is input into the trained support vector machine model for prediction. The model will calculate the probability of the sample belonging to each class according to the input feature vector, and select the class with the highest probability as the prediction result.
[0141] In step S8, the accuracy is obtained by comparing the classification result with the pre-stored historical data.
[0142] In an implementable manner, the hierarchical result data to be analyzed and the corresponding historical hierarchical data are acquired, feature extraction is performed on the two groups of data to obtain hierarchical result feature vectors and historical hierarchical feature vectors. Similarity between the hierarchical result feature vectors and the historical hierarchical feature vectors is calculated, and the similarity is used as a measurement index of the accuracy rate.
[0143] For example, feature extraction of the hierarchical result data and the historical hierarchical data is a key step of analyzing the accuracy rate. By calculating the similarity between the feature vectors, the accuracy of the hierarchical classification can be evaluated. For example, for rice seedling classification, features such as leaf color, plant height, and tiller number can be extracted, the Euclidean distance is calculated to measure the similarity, and the similarity is used as the accuracy rate to determine.
[0144] In step S9, the accuracy rate is determined; if the accuracy rate reaches a preset threshold, the hierarchical result is determined to be a qualified result; otherwise, the original image data is re-acquired to optimize a new hierarchical model, and steps 7-9 are repeated until the qualified result is obtained.
[0145] In an embodiment, the similarity is used as a measurement index of the accuracy rate, and a preset threshold is set; if the accuracy rate reaches the preset threshold, the hierarchical result is determined to be a qualified result; if the accuracy rate is lower than the preset threshold, the original image data is acquired, the image is processed for light balance by an image enhancement algorithm to eliminate shadows and overexposed areas in the image, and a light-balanced image is obtained. For the light-balanced image, a data conversion strategy is used, a key region in the image is extracted by an image segmentation algorithm, and key region data is converted into a feature vector. For the converted feature vector data, a feature selection algorithm is used to select a feature subset with the highest discriminability, and a feature fusion algorithm is used to fuse multiple feature subsets to obtain a fused feature vector. Based on the fused feature vector, a support vector machine algorithm is used to construct a hierarchical model, the hyperparameters of the model are optimized by a grid search method, and an optimized hierarchical model is obtained. The optimized hierarchical model is applied to the hierarchical result data to be analyzed, hierarchical prediction is performed again, and the prediction result is compared with the historical hierarchical data to determine whether the accuracy rate reaches the preset threshold. If the threshold is reached, the output hierarchical result is determined to be a qualified result; if the threshold is not reached, the original image information is re-acquired, the optimization strategy is adjusted, the model is optimized to obtain a new hierarchical model, and steps S7-S9 are repeated until a qualified result is obtained.
[0146] Exemplarily, the accuracy of the grading can be evaluated by calculating the similarity between the feature vectors. For example, for rice seedling grading, features such as leaf color, plant height, and tiller number can be extracted, and the Euclidean distance can be calculated to measure the similarity. If the similarity is lower than a preset threshold (e.g., 0.8), further optimization is needed. Image enhancement is an effective means to improve accuracy. Taking greenhouse tomato seedlings as an example, uneven lighting can lead to a decline in image quality. Through methods such as histogram equalization, shadows and overexposed areas can be eliminated, making leaf color and morphological features more obvious. The processed image is more conducive to subsequent feature extraction and analysis. Image segmentation and data conversion are important steps for extracting effective information from the optimized image. Taking apple tree seedling grading as an example, the watershed algorithm can be used to segment single seedlings, and then the height, crown width, and trunk diameter of each seedling can be extracted. Converting these features into numerical vectors facilitates subsequent feature selection and fusion. Feature selection and fusion aim to improve the efficiency and accuracy of the classification model. For grape seedling grading, dozens or even hundreds of features can be extracted. Through methods such as principal component analysis (PCA), the most discriminative feature subset can be selected. Then, decision-level fusion algorithms are used to integrate multiple feature subsets to obtain more representative feature vectors. Support vector machine (SVM) is a powerful classification algorithm suitable for multi-class problems such as seedling grading. Taking citrus seedling grading as an example, a multi-class SVM model can be constructed to classify seedlings into four grades: excellent, good, medium, and poor. Through grid search optimization of kernel function parameters and penalty factors, the model performance can be significantly improved. Model optimization is an iterative process. If the optimized model still does not meet the preset threshold (e.g., accuracy 95%), the previous steps need to be reprocessed. For example, different image enhancement methods can be tried, or new feature extraction techniques can be explored. This process may need to be iterated several times until the preset accuracy is reached.
[0147] S10, output the qualified result to obtain a final grading result.
[0148] Exemplarily, the final grading result is output in the form of data in the form of a chart or data.
[0149] In summary, the application discloses a forest seedling grading method based on image recognition, which comprises the following steps: acquiring original image data and multi-source data; pre-processing the original image data and the multi-source data to obtain balanced images and standard data; performing edge processing on the balanced images to obtain contour images; extracting the contour images to obtain feature vectors; fusing the feature vectors and the standard data to obtain a fused data set; training the fused data set to obtain a grading model; predicting the grading model to obtain a grading result; comparing the grading result with pre-stored historical data to obtain an accuracy rate; judging the accuracy rate; if the accuracy rate reaches a preset threshold, determining that the grading result is a qualified result; otherwise, reacquiring original image data to optimize a new grading model and repeating steps 7-9 until the qualified result is obtained; and outputting the qualified result to obtain a final grading result.
[0150] The application adopts illumination equalization and distributed data conversion for preprocessing to solve the problems of poor seedling image quality and multi-source heterogeneous data; extracts seedling contours through edge detection and morphological filtering, and then extracts multi-dimensional features by using a convolutional neural network; fuses feature vectors and structured data, and uses a feature alignment algorithm to solve the difference in temporal and spatial resolution. According to the fused features, a support vector machine is used for seedling grading; the application also introduces incremental learning to update the model and continuously optimize the grading accuracy; through continuous acquisition of new data, the model continuously learns and evolves, which significantly improves the precision and intelligence level of seedling grading.
[0151] Reference Figure 2 The second embodiment of the application provides a forest seedling grading device based on image recognition, comprising:
[0152] The data acquisition module 101 is configured to acquire original image data and multi-source data.
[0153] The data preprocessing module 102 is configured to pre-process the original image data and the multi-source data to obtain balanced images and standard data. The contour extraction module 103 is configured to perform edge processing on the balanced images to obtain contour images. The feature extraction module 104 is configured to extract the contour images to obtain feature vectors.
[0154] The data fusion module 105 is configured to fuse the feature vectors and the standard data to obtain a fused data set.
[0155] The model construction module 106 is configured to train the fused data set to obtain a grading model.
[0156] The result prediction module 107 is configured to perform prediction according to the hierarchical model to obtain a hierarchical result.
[0157] The precision evaluation module 108 is configured to compare the hierarchical result with pre-stored historical data to obtain an accuracy rate.
[0158] The judgment module 109 is configured to judge according to the accuracy rate; if the accuracy rate reaches a preset threshold, it is determined that the hierarchical result is a qualified result; otherwise, the original image data is re-acquired to obtain a new hierarchical model, and the steps 7-9 are repeated until the qualified result is obtained.
[0159] The result output module 110 is configured to output the qualified result to obtain a final hierarchical result.
[0160] It should be noted that the device provided in the embodiment of the present application is used to execute all process steps of the method provided in the above embodiment, and the working principles and advantages of the device and the method are one-to-one corresponding, and thus will not be repeated.
[0161] The embodiment of the present application further provides an electronic device. The electronic device comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, for example, a method for grading forest seedlings based on image recognition program. The processor implements the steps in the above various embodiments of the method for grading forest seedlings based on image recognition when executing the computer program, for example Figure 1 The processor implements the functions of each module / unit in the above various device embodiments when executing the computer program, for example, the data acquisition module.
[0162] For example, the computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device.
[0163] The electronic device can be a desktop computer, a notebook, a palm computer, and a smart tablet, etc. The electronic device can include, but is not limited to, a processor, a memory. Those skilled in the art can understand that the above components are only examples of the electronic device, and do not constitute a limitation on the electronic device, and can include more or fewer components than the above, or combine certain components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus, etc.
[0164] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The processor is a control center of the electronic device, and connects various parts of the electronic device through various interfaces and lines.
[0165] The memory can be used to store the computer program and / or modules, and the processor realizes various functions of the electronic device by running or executing the computer program and / or modules stored in the memory, and calling data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc.; and the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a nonvolatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory device.
[0166] The modules / units integrated in the electronic device, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can implement the steps of each method embodiment when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer readable medium can include any entity or device, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. that can carry the computer program code. It should be noted that the contents included in the computer readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0167] It should be noted that the above-described device embodiments are only schematic, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. In addition, the connection relationship between the modules in the device embodiment provided by the present application indicates that there is a communication connection between them, which can be realized as one or more communication buses or signal lines. Those skilled in the art can understand and implement it without creative labor.
[0168] The above-described specific embodiments further illustrate the purpose, technical solutions, and beneficial effects of the present application. It should be understood that the above-described specific embodiments are only for the specific embodiments of the present application and do not limit the protection scope of the present application. It is particularly pointed out that any modification, equivalent replacement, improvement, etc. made by those skilled in the art within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for grading forest tree seedlings based on image recognition, characterized in that, Executed by a computer, including: Step 1: Acquire raw image data and multi-source data; Step 2: Preprocess the original image data and the multi-source data to obtain the balanced image and standard data; Step 3: Perform edge processing on the equalized image to obtain a contour image; Step 4: Extract feature vectors from the contour image; Step 5: Fuse the feature vectors and the standard data to obtain a fused dataset; Step 6: Train the model using the fused dataset to obtain the hierarchical model; Step 7: Make predictions based on the grading model to obtain the grading results; Step 8: Compare the grading results with pre-stored historical data to obtain the accuracy rate; Step 9: Make a judgment based on the accuracy rate; if the accuracy rate reaches the preset threshold, the classification result is determined to be a qualified result; otherwise, reacquire the original image data, optimize it to obtain a new classification model, and repeat steps 7-9 until the qualified result is obtained. Step 10: Output the qualified results to obtain the final grading results.
2. The method for grading forest tree seedlings based on image recognition according to claim 1, characterized in that, The step of preprocessing the original image data and the multi-source data to obtain the balanced image and standard data includes: The original image data is optimized using an illumination equalization algorithm to obtain an equalized image; Standard data is obtained by transforming the multi-source data.
3. The method for grading forest tree seedlings based on image recognition according to claim 1, characterized in that, The process of fusing the feature vectors and the standard data to obtain a fused dataset includes: The analysis results are obtained by comparing and analyzing the feature vectors and the standard data. Based on the analysis results, the difference information is extracted. Based on the difference information, coordinate matching is performed to obtain coordinate information; Semantic gap elimination is performed based on the aforementioned difference information to obtain semantic bridging information; The feature vector and the standard data are integrated based on the coordinate information and the semantic bridging information to obtain a fused dataset.
4. The method for grading forest tree seedlings based on image recognition according to claim 3, characterized in that, The difference information refers to the differences between the feature vector and the standard data in terms of time dimension, spatial dimension, and semantic expression.
5. The method for grading forest tree seedlings based on image recognition according to claim 1, characterized in that, The step of training a hierarchical model based on the fused dataset includes: The training dataset is obtained by extracting data from the fused dataset according to the pre-stored grading criteria. The initial model is obtained by training using the support vector machine algorithm on the training dataset. The data to be analyzed is input into the initial model for real-time acquisition, resulting in original dynamic data and newly acquired dynamic data. The distribution degree difference is obtained by evaluating the original dynamic data and the newly collected dynamic data. The distribution degree difference is compared with a preset distribution degree threshold; if the distribution degree difference is less than the preset distribution degree threshold, the initial model is determined to be a hierarchical model; otherwise, the initial model is trained by increasing the training dataset until a hierarchical model is obtained.
6. The method for grading forest tree seedlings based on image recognition according to claim 5, characterized in that, The evaluation based on the original dynamic data and the newly collected dynamic data to obtain the distribution difference degree includes: The distributional variability is calculated using the following formula: ; in, Indicates the degree of distributional variability, Indicates the number of pre-stored data features, Indicates the first in the original dynamic data The probability distribution of each feature Indicates the first of the newly collected dynamic data The probability distribution of each feature.
7. The method for grading forest tree seedlings based on image recognition according to claim 1, characterized in that, The step of predicting according to the hierarchical model to obtain the hierarchical result includes: The data to be analyzed is input into the grading model for grading prediction to obtain the seedling grade category; The seedlings are numbered according to their grade category to obtain grade labels; The grading results are obtained by associating the seedling grade category with the grading label.
8. The method for grading forest tree seedlings based on image recognition according to claim 1, characterized in that, The process of re-acquiring the original image data and optimizing it to obtain a new hierarchical model includes: Obtain the raw image data; Based on the original image data, an enhancement algorithm is used to perform illumination equalization processing to obtain an optimized equalized image; The optimized equalization image is transformed using a data transformation strategy to obtain an optimized feature vector. Based on the optimized feature vector, a feature selection method is used to select a feature subset; The feature subsets are fused using a feature fusion algorithm to obtain an optimized fused feature vector; Based on the optimized fusion feature vectors, a support vector machine algorithm is used to construct a model, resulting in a new hierarchical model.
9. A forest tree seedling grading device based on image recognition, characterized in that, include: The data acquisition module is used to acquire raw image data and multi-source data; The data preprocessing module is used to preprocess the original image data and the multi-source data to obtain a balanced image and standard data. The contour extraction module is used to perform edge processing based on the equalization image to obtain a contour image; The feature extraction module is used to extract feature vectors from the contour image. The data fusion module is used to fuse the feature vectors and the standard data to obtain a fused dataset; The model building module is used to train a hierarchical model based on the fused dataset. The result prediction module is used to predict the classification result based on the classification model. The accuracy assessment module is used to compare the grading results with pre-stored historical data to obtain the accuracy rate; The judgment module is used to make a judgment based on the accuracy rate; if the accuracy rate reaches a preset threshold, the grading result is determined to be a qualified result. Otherwise, after reacquiring the original image data and optimizing it to obtain a new grading model, repeat the operations contained in the result prediction module, accuracy evaluation module, and judgment module until the qualified result is obtained. The result output module is used to output the qualified results to obtain the final grading result.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the image recognition-based forest tree seedling grading method as described in any one of claims 1 to 8.