Honeysuckle origin identification method and device, server and storage medium
By collecting and processing hyperspectral and visible light data of honeysuckle, and using multiple algorithms for feature screening and integration, the problem of inaccurate identification of honeysuckle origin was solved, and high-precision origin identification was achieved.
Patent Information
- Application Number
- CN202510111816.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-01-24
AI Technical Summary
Existing technologies make it difficult to accurately identify the origin of honeysuckle, resulting in inaccurate chemical composition analysis.
Hyperspectral and visible light data of honeysuckle samples were collected. Spectral, texture, and color information were extracted through preprocessing. Feature selection and classification were performed using algorithms such as support vector machines and random forests. Feature integration was carried out by stacked generalization ensemble learning. Finally, support vector machines were used to identify the place of origin.
It enables high-precision identification of honeysuckle origin, improving the accuracy and efficiency of classification results.
Smart Images

Figure CN120106868B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of honeysuckle origin identification, and in particular to a honeysuckle origin identification method and device, a server and a storage medium. BACKGROUND
[0002] Medicinal material honeysuckle is a Lonicera japonica Thunb. and Lonicera japonica Thunb. dry flower buds or early open flowers, which was first recorded in Shennong Bencao Jing, is one of traditional Chinese medicinal materials in China, has the effects of clearing heat and resolving toxicity, and dispersing wind-heat, and is known as "Chinese penicillin". In addition to being used as medicinal material, it can also be used as raw material for herbal tea, functional food and cosmetics. Due to the strong environmental adaptability of honeysuckle, it is widely distributed in China. Henan Fengqiu, Shandong Pingyi and Hebei Julu are the original producing areas of honeysuckle. However, due to the influence of factors such as climate, environment, soil and altitude in different geographical regions, there are great differences in chemical composition between honeysuckles from different producing areas. However, it is difficult to distinguish honeysuckle after processing by appearance.
[0003] Near-infrared spectroscopy and machine vision technology can be used to analyze the chemical composition of honeysuckle to identify the origin of honeysuckle. The composition information can be obtained without damaging the sample. By analyzing the near-infrared spectral information of the honeysuckle sample combined with machine vision, the texture information of the honeysuckle sample is analyzed, so as to classify the origin of the honeysuckle sample. However, since the near-infrared spectrum mainly provides spectral information, and the combination of texture information can only reflect part of the information of the honeysuckle sample, resulting in less data sources, the honeysuckle origin identification is not accurate enough. SUMMARY
[0004] The present application provides a honeysuckle origin identification method, device, server and storage medium to solve the technical problem of not accurate enough honeysuckle origin identification.
[0005] In a first aspect, the present application provides a honeysuckle origin identification method, comprising:
[0006] Collecting hyperspectral data and visible light data of the honeysuckle sample, and preprocessing the collected hyperspectral data and visible light data, the preprocessed hyperspectral data including spectral information, hyperspectral texture information and hyperspectral color information, and the preprocessed visible light data including visible light texture information and visible light color information;
[0007] Using permutation importance algorithm and L1 regularization to perform feature screening on the spectral information to obtain optimized spectral band information;
[0008] According to the optimized spectral band information and the spectral information, the optimized spectral information is determined, and the support vector machine is used to classify the optimized spectral information to obtain a first bottom layer classification feature vector;
[0009] According to the optimized spectral band information and the hyperspectral texture information, determine the optimized hyperspectral texture information, use the permutation importance algorithm to screen the optimized hyperspectral texture information, obtain the screened hyperspectral texture information, use the random forest to classify the screened hyperspectral texture information, and obtain a second bottom layer classification feature vector;
[0010] According to the optimized spectral band information and the hyperspectral color information, determine the optimized hyperspectral color information, use the permutation importance algorithm to screen the optimized hyperspectral color information, obtain the screened hyperspectral color information, use the random forest to classify the screened hyperspectral color information, and obtain a third bottom layer classification feature vector;
[0011] Use the support vector machine to classify the visible light texture information, and obtain a fourth bottom layer classification feature vector;
[0012] Use the random forest to classify the visible light color information, and obtain a fifth bottom layer classification feature vector;
[0013] Integrate the first bottom layer classification feature vector, the second bottom layer classification feature vector, the third bottom layer classification feature vector, the fourth bottom layer classification feature vector and the fifth bottom layer classification feature vector to obtain a top layer input feature vector, use the support vector machine to classify the top layer input feature vector, and use the classification result to identify the honeysuckle origin.
[0014] Further, the integration of the first bottom layer classification feature vector, the second bottom layer classification feature vector, the third bottom layer classification feature vector, the fourth bottom layer classification feature vector and the fifth bottom layer classification feature vector to obtain a top layer input feature vector comprises:
[0015] Based on the stacking generalization, the first bottom layer classification feature vector, the second bottom layer classification feature vector, the third bottom layer classification feature vector, the fourth bottom layer classification feature vector and the fifth bottom layer classification feature vector are respectively feature spliced to form a plurality of top layer feature vector combinations;
[0016] Each top layer feature vector combination is used to train the support vector machine, and the optimal top layer feature vector combination is selected according to the logarithmic loss function;
[0017] According to the optimal top layer feature vector combination and the first bottom layer classification feature vector, the second bottom layer classification feature vector, the third bottom layer classification feature vector, the fourth bottom layer classification feature vector and the fifth bottom layer classification feature vector, a top layer input feature vector is formed.
[0018] Further, the feature screening of the spectral information by using the permutation importance algorithm and L1 regularization to obtain the optimized spectral band information comprises:
[0019] The PI characteristic band of the spectral information is extracted by using a permutation importance algorithm to obtain screened spectral band information;
[0020] The L1 characteristic band of the screened spectral band information is extracted again by using L1 regularization to obtain optimized spectral band information.
[0021] Further, the preprocessing of the hyperspectral data and the visible light data includes:
[0022] The region of interest of the hyperspectral data and the visible light data is extracted respectively to obtain a hyperspectral region of interest gray image and a visible light region of interest gray image respectively;
[0023] The texture information and the color information of the hyperspectral region of interest gray image are extracted to obtain hyperspectral texture information and hyperspectral color information;
[0024] The texture information and the color information of the visible light region of interest gray image are extracted to obtain visible light texture information and visible light color information.
[0025] Further, the method further includes:
[0026] The hyperspectral region of interest gray image is subjected to black and white correction to extract reflectance spectral data;
[0027] The reflectance spectral data is subjected to outlier sample elimination by using a Monte Carlo method;
[0028] The hyperspectral data after the outlier sample elimination is subjected to data enhancement processing to obtain spectral information.
[0029] Further, the extraction of the texture information and the color information of the visible light region of interest gray image to obtain visible light texture information and visible light color information includes:
[0030] The visible light data is converted into an HSV image;
[0031] The images of the H, S, and V color channels in the HSV image are extracted respectively;
[0032] The texture information of each color channel is extracted by using a gray level gradient co-occurrence matrix to obtain visible light texture information;
[0033] The color information of the H, S, and V color channels is extracted according to the pixel point coordinates of the region of interest, and the visible light color information is obtained by using color moment calculation.
[0034] Further, the collection of the hyperspectral data and the visible light data of the honeysuckle flower sample includes:
[0035] The honeysuckle sample is laid flat in a black tray, and the tray is placed on a conveyor belt moving at a constant speed;
[0036] The hyperspectral data of the honeysuckle sample is collected by using a hyperspectral camera;
[0037] The visible light data of the honeysuckle sample is collected by using an industrial camera.
[0038] In a second aspect, the honeysuckle origin identification device comprises:
[0039] The data acquisition module is configured to collect the hyperspectral data and the visible light data of the honeysuckle sample;
[0040] The data preprocessing module is configured to preprocess the collected hyperspectral data and visible light data, wherein the preprocessed hyperspectral data comprises spectral information, hyperspectral texture information and hyperspectral color information, and the preprocessed visible light data comprises visible light texture information and visible light color information;
[0041] The feature screening module is configured to screen the spectral information by using the permutation importance algorithm and L1 regularization to obtain optimized spectral band information;
[0042] The first bottom layer classification module is configured to determine the optimized spectral information according to the optimized spectral band information and the spectral information, and to classify the optimized spectral information by using a support vector machine model to obtain a first bottom layer classification feature vector;
[0043] The second bottom layer classification module is configured to determine the optimized hyperspectral texture information according to the optimized spectral band information and the hyperspectral texture information, to screen the optimized hyperspectral texture information by using the permutation importance algorithm, to obtain screened hyperspectral texture information, and to classify the screened hyperspectral texture information by using a random forest model to obtain a second bottom layer classification feature vector;
[0044] The third bottom layer classification module is configured to generate a third bottom layer classification feature vector according to the optimized spectral band information and the hyperspectral color information;
[0045] The fourth bottom layer classification module is configured to classify the visible light texture information to obtain a fourth bottom layer classification feature vector;
[0046] The fifth bottom layer classification module is configured to classify the visible light color information by using a random forest to obtain a fifth bottom layer classification feature vector;
[0047] The top-layer classification module is configured to integrate features by using the first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector and the fifth bottom-layer classification feature vector to form a top-layer input feature vector, classify the top-layer input feature vector by using a support vector machine, and identify the honeysuckle origin by using a classification result.
[0048] In a third aspect, an embodiment of the present application further provides a server, comprising:
[0049] one or more processors;
[0050] a storage device configured to store one or more programs,
[0051] When the one or more programs are executed by the one or more processors, the one or more processors implement the honeysuckle origin identification method.
[0052] In a fourth aspect, an embodiment of the present application provides a storage medium containing computer executable instructions, which are used to execute the honeysuckle origin identification method when executed by a computer processor.
[0053] The embodiment of the present application extracts spectral information, texture information and color information in the hyperspectral data and texture information and color information in the visible light data of the honeysuckle sample, establishes classification models based on support vector machines or random forests respectively by using five kinds of data sources as bottom-layer classifiers, splices the classification prediction results of the bottom-layer classifiers based on stacked generalization ensemble learning to form a top-layer input feature vector, establishes a top-layer classifier based on a support vector machine to classify and predict the top-layer input feature vector, and uses the final classification result to identify the honeysuckle origin. BRIEF DESCRIPTION OF DRAWINGS
[0054] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and the illustrative embodiments of the present application and their description serve the purpose of explaining the present application. The accompanying drawings should not be regarded as a limitation of the present application. In the drawings:
[0055] Figure 1 A flowchart of a honeysuckle origin identification method according to the first embodiment of the present application;
[0056] Figure 2 A flowchart of a honeysuckle origin identification method according to the second embodiment of the present application;
[0057] Figure 3 The result graph of the classification model established according to different data source combinations compared with the verification set according to the embodiment two of the present application;
[0058] Figure 4 The flow chart of the honeysuckle origin identification method according to the embodiment three of the present application;
[0059] Figure 5 The schematic diagram of the influence of different wave band numbers on the accuracy of the classification model screened by L1 regularization according to the embodiment three of the present application;
[0060] Figure 6 The distribution schematic diagram of the selected 31 characteristic wave bands on the original spectral data according to the embodiment three of the present application;
[0061] Figure 7 The flow chart of the honeysuckle origin identification method according to the embodiment four of the present application;
[0062] Figure 8 The schematic diagram of the detected outlier sample according to the embodiment four of the present application;
[0063] Figure 9 The schematic diagram of the classification prediction performance of the classification model after deleting different outlier samples according to the embodiment four of the present application;
[0064] Figure 10 The schematic diagram of the classification prediction performance of the classification model after combining different pretreatment methods according to the embodiment four of the present application;
[0065] Figure 11 The schematic diagram of the classification prediction performance of the classification model after combining different pretreatment methods and permutation importance screening according to the embodiment four of the present application;
[0066] Figure 12 The structural schematic diagram of the honeysuckle origin identification device according to the embodiment five of the present application;
[0067] Figure 13 The structural diagram of the server according to the embodiment six of the present application. DETAILED DESCRIPTION
[0068] The present application will be further described below in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.
[0069] Embodiment one
[0070] Figure 1A flow chart of the method for identifying the production area of honeysuckle according to the first embodiment of the present application, the present embodiment can be applied to identify the production area of honeysuckle from different production areas, and the method is as follows:
[0071] Honeysuckle in China mainly has three genuine production areas of Fengqiu in Henan, Pingyi in Shandong and Julu in Hebei. Due to the differences in climatic environment, soil, altitude and other factors of different production areas, there will be certain differences in the effective components and content of honeysuckle produced. However, the honeysuckle samples obtained after processing and preparation of honeysuckle from different production areas are extremely similar in shape and appearance, and it is difficult to identify the production area of honeysuckle by naked eye and traditional experience. The wavelength coverage range of hyperspectral imaging is wider, and the band resolution is higher, which can more finely reflect the spectral characteristics of the substance, and can combine spectral information and image information, so that each pixel point contains rich spectral data, and then form a complete spectral curve. Then, the visible light data of the honeysuckle sample is collected by using an industrial camera, the hyperspectral data and the visible light data are combined, the hyperspectral data and the visible light data are classified respectively, the classification results of the hyperspectral data and the visible light data are integrated by using ensemble learning, the production area of honeysuckle can be identified from a more comprehensive perspective by using multiple data sources, and the accuracy of identification is higher. Specifically, the following steps are included:
[0072] S101, collect hyperspectral data and visible light data of honeysuckle samples, and pretreat the collected hyperspectral data and visible light data, the pretreated hyperspectral data includes spectral information, hyperspectral texture information and hyperspectral color information, and the pretreated visible light data includes visible light texture information and visible light color information.
[0073] The high-spectral data and visible light data of honeysuckle samples are collected by a hyperspectral imaging device and an industrial camera after the honeysuckle samples are treated. In order to improve the accuracy of classification, the same batch of honeysuckle samples can be shuffled and tiled repeatedly to increase the amount of data. At the same time, the collected hyperspectral data and visible light data can be preprocessed to reduce the influence of irrelevant data on the classification results. The preprocessing methods include region of interest extraction, denoising, data smoothing and other methods for hyperspectral data and visible light data to improve the accuracy of the classification results. The spectral information, texture information and color information of the honeysuckle samples can be extracted from the hyperspectral data. The texture information and color information of the honeysuckle samples can be extracted from the visible light data. The hyperspectral texture information can be extracted by using a gray level gradient co-occurrence matrix of the image in the hyperspectral data. The hyperspectral color information can be extracted by using a color matrix of the image in the hyperspectral data. The visible light texture information can be extracted by dividing the visible light image into three color channels and using a gray level gradient co-occurrence matrix. The visible light color information can be extracted by using a color matrix of the three channels. The extracted spectral information, hyperspectral texture information, hyperspectral color information, visible light texture information and visible light color information are used to establish a honeysuckle sample data set for identifying the origin of honeysuckle. It should be noted that before training the classification model, the honeysuckle samples in the training data need to be labeled with corresponding origin labels. The result output by the classification model is the origin label feature, which reflects the classification result of the classification model for the input honeysuckle samples.
[0074] In S102, the spectral information is subjected to feature screening by using a permutation importance algorithm and L1 regularization to obtain optimized spectral band information.
[0075] Due to the wide wavelength coverage and high band resolution of hyperspectral, the amount of spectral information extracted from hyperspectral data is large. In order to reduce the amount of calculation in classification, feature screening is needed to extract the most representative part of the spectrum of the wave band under the premise of ensuring the accuracy of classification, so as to quickly obtain the classification result according to the spectrum of fewer wave bands and improve the efficiency of honeysuckle origin identification. The original spectral information is used to establish a classification model of honeysuckle samples based on support vector machine (SVM). According to the prediction accuracy of the trained support vector machine classification model compared with the validation set, the feature of the classification model is optimized by using permutation importance algorithm, and the spectral wave band features that have more important influence on the prediction accuracy are screened. Then the screened spectral wave band features are screened again by using L1 regularization, and the classification model of honeysuckle samples is established based on support vector machine using the screened spectral wave band features. L1 regularization is introduced into the classification model to optimize the classification model. By optimizing the weight coefficient of each wave band spectral information in the classification model, the wave bands with high contribution degree are screened, and different numbers of wave bands are selected based on support vector machine to establish the classification model of honeysuckle samples according to the contribution degree from high to low. According to the prediction performance of the classification model on the validation set, the optimal number of wave bands is selected, and the optimized spectral wave band information is obtained. The optimized spectral wave band information can select fewer important wave band features under the premise of ensuring the prediction accuracy of the classification model, which greatly reduces the calculation amount of the classification model.
[0076] S103, according to the optimized spectral wave band information and the spectral information, the optimized spectral wave band information is determined, and the support vector machine is used for classifying the optimized spectral wave band information to obtain a first bottom layer classification feature vector.
[0077] The important optimized spectral wave band features selected after feature screening are used to form the optimized spectral information, and the classification model is established based on the support vector machine using the optimized spectral information to classify the origin of honeysuckle samples. The classification result is used as the first bottom layer classification feature vector, which can reflect the identification result of the origin of honeysuckle based on spectral information.
[0078] S104, according to the optimized spectral wave band information and the hyperspectral texture information, the optimized hyperspectral texture information is determined, the permutation importance algorithm is used for screening the optimized hyperspectral texture information to obtain the screened hyperspectral texture information, and the random forest is used for classifying the screened hyperspectral texture information to obtain a second bottom layer classification feature vector.
[0079] According to the optimized spectral band information, a hyperspectral image corresponding to the band in the hyperspectral data is selected, and texture information is extracted. After extracting the texture information, the texture information is screened by using the permutation importance algorithm, a classification model is established based on the extracted texture information using random forest (RF), and according to the prediction accuracy of the trained classification model on the validation set, the texture information features that have a greater influence on the prediction accuracy are screened, and the screened hyperspectral texture information is obtained. The classification model is established based on the screened hyperspectral texture information using random forest, and the result of the classification model is taken as the second bottom layer classification feature vector, which can reflect the result of identifying the origin of honeysuckle based on the texture information in the hyperspectral image.
[0080] In S105, the optimized hyperspectral color information is determined according to the optimized spectral band information and the hyperspectral color information, the permutation importance algorithm is used to screen the optimized hyperspectral color information, the screened hyperspectral color information is obtained, and the random forest is used to classify the screened hyperspectral color information to obtain the third bottom layer classification feature vector.
[0081] According to the optimized spectral band information, a hyperspectral image corresponding to the band in the hyperspectral data is selected, and color information is extracted. After extracting the color information, a classification model is established based on the extracted color information using random forest, and according to the prediction accuracy of the trained classification model on the validation set, the permutation importance algorithm is used to screen the color information features that have a greater influence on the prediction accuracy, and the screened hyperspectral color information is obtained. The random forest classification model is established based on the screened hyperspectral color information, and the result of the classification model is taken as the third bottom layer classification feature vector, which can reflect the result of identifying the origin of honeysuckle based on the color information in the hyperspectral image.
[0082] In S106, the visible light texture information is classified using a support vector machine to obtain a fourth bottom layer classification feature vector.
[0083] The visible light texture information extracted from the visible light data is used to establish a classification model based on a support vector machine, and the classification result is taken as the fourth bottom layer classification feature vector, which can reflect the result of identifying the origin of honeysuckle based on the texture information in the visible light image.
[0084] In S107, the visible light color information is classified using a random forest to obtain a fifth bottom layer classification feature vector.
[0085] The visible light color information extracted from the visible light data is used to establish a classification model based on a random forest, and the classification result is taken as the fifth bottom layer classification feature vector, which can reflect the result of identifying the origin of honeysuckle based on the color information in the visible light image.
[0086] S108, the first bottom layer classification feature vector, the second bottom layer classification feature vector, the third bottom layer classification feature vector, the fourth bottom layer classification feature vector and the fifth bottom layer classification feature vector are used for feature integration to obtain a top layer input feature vector, the support vector machine is used for classifying the top layer input feature vector, and the classification result is used for identifying the honeysuckle origin.
[0087] The first bottom layer classification feature vector, the second bottom layer classification feature vector, the third bottom layer classification feature vector, the fourth bottom layer classification feature vector and the fifth bottom layer classification feature vector can respectively reflect the classification of the honeysuckle sample from five different data sources, and then the origin is identified. The classification results of the five different data sources are used for vector splicing to form a top layer input feature vector. The top layer input feature vector contains the classification results of the honeysuckle sample origin from multiple angles. The top layer classification model is built based on the support vector machine using the top layer input feature vector. The classification result of the top layer classification model is used as a reference for identifying the honeysuckle origin.
[0088] In the embodiment, the spectral data in the hyperspectral data and the visible light data are extracted respectively. The spectral features of part of the wave bands are optimized under the premise of ensuring the prediction accuracy. The spectral information after the optimization is used for classifying the honeysuckle origin based on the support vector machine. The texture information and the color information in the hyperspectral image corresponding to the spectral wave band after the optimization are used for classifying the honeysuckle origin based on the random forest respectively. The texture information and the color information in the visible light data are used for classifying the origin of the honeysuckle sample based on the support vector machine and the random forest respectively. The origin prediction classification results of the five different data sources after the classification by different models are spliced into a vector. The top layer input feature vector obtained after the splicing is classified based on the support vector machine. The classification result is used as a reference for finally identifying the origin of the honeysuckle sample. Based on the characteristics of the hyperspectral and visible light, the spectral information with higher wave band resolution can be collected, and the image data of the honeysuckle sample at different levels can be obtained. The multiple data sources obtained are used for origin identification and prediction respectively. The classification results of the multiple data sources are integrated through the top layer input feature vector. The final classification result can consider the origin of the honeysuckle sample from multiple angles. Compared with the classification model using only a single data source, the origin of the honeysuckle sample can be identified and predicted from a more comprehensive angle, and the identification accuracy is improved.
[0089] Specifically, when collecting hyperspectral data and visible light data of honeysuckle samples, the honeysuckle samples are laid flat in a black tray, and the tray is placed on a conveyor belt moving at a constant speed; the hyperspectral data of the honeysuckle samples are collected by using a hyperspectral camera; and the visible light data of the honeysuckle samples are collected by using an industrial camera. For example, the hyperspectral camera used in this embodiment is a Specim FX17, with a resolution of 8 nm and a pixel of 3.5 mm, and can collect 224-band hyperspectral images in a wavelength range of 750-1700 nm; the industrial camera used is an MVCL042-90GC, with a resolution of 4096x2, a gain of 0 dB, an exposure time of 40 us, and an aperture size of f / 4. The distance between the hyperspectral camera and the industrial camera and the top surface of the conveyor belt is 50 cm. The honeysuckle samples after being cleaned are laid flat in the black tray, forming a strong contrast, which is conducive to the extraction of image features. The movement speed of the conveyor belt is 4.0 m / min. The tray containing the samples is placed on the conveyor belt and sequentially passes through the collection range of the hyperspectral camera and the industrial camera to complete one data collection. Then, the samples can be rearranged and laid flat again for data collection, so as to obtain the data amount of the current batch of samples and improve the prediction accuracy of the origin identification model.
[0090] Embodiment Two
[0091] Figure 2 A flowchart of a honeysuckle origin identification method according to Embodiment Two of the present application is provided. Based on the above-mentioned embodiment, the first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector and the fifth bottom-layer classification feature vector are integrated to obtain a top-layer input feature vector in this embodiment. The specific optimization is as follows:
[0092] The first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector and the fifth bottom-layer classification feature vector are respectively spliced based on stacked generalization to form a plurality of top-layer feature vector combinations.
[0093] Each top-layer feature vector combination is used to train a support vector machine, and the optimal top-layer feature vector combination is selected according to a logarithmic loss function.
[0094] The optimal top-layer feature vector combination and the first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector and the fifth bottom-layer classification feature vector are used to form a top-layer input feature vector.
[0095] Correspondingly, the honeysuckle origin identification method provided by this embodiment specifically includes the following steps:
[0096] S201, collect hyperspectral data and visible light data of honeysuckle samples, and pre-process the collected hyperspectral data and visible light data, the pre-processed hyperspectral data including spectral information, hyperspectral texture information and hyperspectral color information, and the pre-processed visible light data including visible light texture information and visible light color information.
[0097] S202, performing feature screening on the spectral information by using permutation importance algorithm and L1 regularization to obtain optimized spectral band information.
[0098] S203, determining optimized spectral information according to the optimized spectral band information and the spectral information, performing classification on the optimized spectral information by using a support vector machine to obtain a first bottom-layer classification feature vector.
[0099] S204, determining optimized hyperspectral texture information according to the optimized spectral band information and the hyperspectral texture information, performing screening on the optimized hyperspectral texture information by using a permutation importance algorithm to obtain screened hyperspectral texture information, and performing classification on the hyperspectral texture information by using a random forest to obtain a second bottom-layer classification feature vector.
[0100] S205, determining optimized hyperspectral color information according to the optimized spectral band information and the hyperspectral color information, performing screening on the optimized hyperspectral color information by using a permutation importance algorithm to obtain screened hyperspectral color information, and performing classification on the hyperspectral color information by using a random forest to obtain a third bottom-layer classification feature vector.
[0101] S206, performing classification on the visible light texture information by using a support vector machine to obtain a fourth bottom-layer classification feature vector.
[0102] S207, performing classification on the visible light color information by using a random forest to obtain a fifth bottom-layer classification feature vector.
[0103] S208, performing feature splicing on the first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector and the fifth bottom-layer classification feature vector respectively based on stacked generalization to form a plurality of top-layer feature vector combinations.
[0104] Based on the idea of stacking ensemble learning, the classification results obtained by integrating multiple bottom classifiers (predictive classification models) can effectively improve the final classification prediction accuracy. The first bottom classification feature vector, the second bottom classification feature vector, the third bottom classification feature vector, the fourth bottom classification feature vector and the fifth bottom classification feature vector are respectively derived from five different data sources in the hyperspectral data and the visible light data, which respectively represent different angles for classifying honeysuckle samples, and then identifying the origin of honeysuckle samples. The classification results of different bottom classifiers constructed based on different classification models using five different data sources are combined by feature splicing to form a top-level input feature vector for inputting into a top-level classifier. The classification results obtained by classifying the top-level input feature vector using the top-level classifier can comprehensively consider different angles of multiple data sources, form a comprehensive classification result, consider more comprehensive feature information of honeysuckle samples, and obtain more accurate classification results, which can be used as a reference for honeysuckle classification and identification, and the origin of honeysuckle samples is determined according to the classification results. In this embodiment, the honeysuckle sample origin label prediction results output by the bottom classifier are spliced to form a top-level input feature vector. By combining the output results of different bottom classifiers, a plurality of different bottom classifier combinations are obtained, each combination can reflect the identification angle of considering the data source of the corresponding classifier for identifying the origin of honeysuckle, for example, the first bottom classification feature vector and the fifth bottom classification feature vector are combined, and the classification result of the top-level input feature vector after combination can reflect the identification of the origin of honeysuckle from the two angles of spectral information and visible light color information.
[0105] S209, respectively, using each top-level feature vector combination to train a support vector machine, and selecting an optimal top-level feature vector combination according to a logarithmic loss function.
[0106] Based on the five different data sources of the bottom classifier, 15 different combinations can be formed. The top-level input feature vector obtained in each combination form is used to establish a classification model based on a support vector machine, and the optimal top-level feature vector combination of the optimal combination mode is obtained by comparing the output classification results. As shown in Figure 3 The results obtained by comparing the classification models established by different combinations with the validation set are shown in the figure. Information source 1 is the first bottom classification feature vector, representing the classification result obtained by using the spectral information extracted from the hyperspectral data; information source 2 is the second bottom classification feature vector, representing the classification result obtained by using the texture information extracted from the hyperspectral data; information source 3 is the third bottom classification feature vector, representing the classification result obtained by using the color information extracted from the hyperspectral data; information source 4 is the fourth bottom classification feature vector, representing the classification result obtained by using the texture information extracted from the visible light data; and information source 5 is the fifth bottom classification feature vector, representing the classification result obtained by using the color information extracted from the visible light data. FromFigure 3 As can be seen, the prediction accuracy of the 15 combinations all reaches 100%, and then the optimal combination is selected by a log loss function, wherein the log loss function of the combination of information source 1+5 is 0.029, which is the smallest among all the combinations, and therefore the combination of the bottom classifier and the corresponding data source is selected as the top classifier combination. The corresponding information source of this method is to use the spectral information extracted from the hyperspectral data and the color information extracted from the visible light data, the spectral information is classified and predicted by the support vector machine, the color information is classified and predicted by the random forest, the prediction results of the two models are spliced into a vector, and then the support vector machine of the top classifier is used for classification prediction, and finally the accurate classification result of the honeysuckle origin is obtained, and the honeysuckle origin is identified.
[0107] S210, according to the optimal top layer feature vector combination and the first bottom layer classification feature vector, the second bottom layer classification feature vector, the third bottom layer classification feature vector, the fourth bottom layer classification feature vector and the fifth bottom layer classification feature vector, a top layer input feature vector is formed, a support vector machine is used to classify the top layer input feature vector, and the classification result is used to identify the honeysuckle origin.
[0108] The embodiment combines the classification models for classifying and predicting the honeysuckle samples based on a plurality of different data sources by using the stacked generalization ensemble learning, integrates the prediction results of each combination by feature splicing, and finally predicts by using the top classifier. The optimal bottom classifier combination is selected by the validation set, and the top classifier can be constructed by using the bottom classifier. The top classifier formed by the optimal combination is used for final classification prediction of the classification prediction results of the integrated bottom classifier, and the final classification result can accurately reflect the origin classification result of the honeysuckle sample, and the origin of the honeysuckle sample is accurately identified.
[0109] Embodiment three
[0110] Figure 4 The flowchart of the honeysuckle origin identification method described in embodiment three of the application, the embodiment is optimized based on the above embodiment, in this embodiment, the spectral information is filtered by using the permutation importance algorithm and L1 regularization to obtain optimized spectral band information, the specific optimization is:
[0111] The PI feature band of the spectral information is extracted by using the permutation importance algorithm to obtain the filtered spectral band information;
[0112] The L1 feature band of the filtered spectral band information is extracted again by using the L1 regularization to obtain the optimized spectral band information.
[0113] Correspondingly, the honeysuckle origin identification method provided in the embodiment specifically comprises the following steps.
[0114] S301, collect hyperspectral data and visible light data of the honeysuckle sample, and pretreat the collected hyperspectral data and visible light data, wherein the pretreated hyperspectral data comprises spectral information, hyperspectral texture information and hyperspectral color information, and the pretreated visible light data comprises visible light texture information and visible light color information.
[0115] S302, extract PI characteristic bands from the spectral information by using the permutation importance algorithm to obtain screened spectral band information.
[0116] Since the hyperspectral data collected by the hyperspectral camera has the characteristics of high resolution and wide band coverage, the amount of spectral data generated is large. In order to reduce the calculation amount of the classification model, important bands in the spectral data are extracted, and the spectral information corresponding to the important bands is used to reduce the calculation amount of the classification model and improve the honeysuckle origin identification efficiency on the premise of ensuring the prediction accuracy. The permutation importance algorithm is a method for evaluating the contribution of features to the performance of a model. First, a classification model is established based on the spectral data in the hyperspectral data using a support vector machine. The classification prediction result of the trained classification model is compared with the verification set, and the classification accuracy of the classification model for the original data is recorded as the baseline performance. Then, the features of the original data are shuffled based on the permutation importance algorithm, and the shuffled features are used to classify and predict again by the classification model. According to the classification prediction result of the classification model compared with the verification set, the performance change of the shuffled model is recorded, and the features with high contribution to the prediction accuracy of the classification model are determined, and the spectral band features with important influence on the classification prediction accuracy of the honeysuckle sample are obtained, i.e. the screened spectral band information.
[0117] S303, L1 feature band extraction is performed on the screened spectral band information again by using L1 regularization to obtain optimized spectral band information.
[0118] In order to further reduce the calculation amount of the classification model, L1 regularization is used to screen the bands of the spectrum again. Support vector machine classification models are established by using the number of feature bands between 1 and 50 respectively. L1 regularization is introduced into the classification model to optimize the classification model. By using the weight coefficients of each band, the bands with greater contribution to the prediction accuracy of the classification model are selected. For example, Figure 5As shown, under the premise of preferentially selecting the waveband with a larger contribution degree, when the number of wavebands reaches 23, the prediction accuracy of the classification model compared with the verification set is stable at 100%, and the logarithmic loss function presents a downward trend; when the number of wavebands reaches 31, the prediction accuracy of the classification model compared with the verification set is still 100%, and the logarithmic loss function tends to be stable, so 31 optimal wavebands can be selected as the optimized spectral waveband information, which, under the premise of ensuring the prediction accuracy of the classification model, selects the least number of wavebands, reduces the data volume of the spectral information, reduces the calculation amount of the model, and improves the efficiency of the honeysuckle sample origin identification. In this embodiment, the distribution of the 31 selected characteristic wavebands on the original spectral data is as shown in Figure 6 As shown, the 959~963 nm, 1081~1112 nm, 1203~1213 nm, 1241~1298 nm, 1347~1389 nm, 1421~1431 nm, 1485~1509 nm, 1591~1605 nm and 1645 nm can be regarded as important wavebands with a higher contribution to the prediction accuracy of the classification model.
[0119] S304, according to the optimized spectral waveband information and the spectral information, determining the optimized spectral information, using a support vector machine to classify the optimized spectral information to obtain a first bottom-layer classification feature vector.
[0120] S305, according to the optimized spectral waveband information and the hyperspectral texture information, determining the optimized hyperspectral texture information, using a permutation importance algorithm to screen the optimized hyperspectral texture information to obtain screened hyperspectral texture information, using a random forest to classify the hyperspectral texture information to obtain a second bottom-layer classification feature vector.
[0121] S306, according to the optimized spectral waveband information and the hyperspectral color information, determining the optimized hyperspectral color information, using a permutation importance algorithm to screen the optimized hyperspectral color information to obtain screened hyperspectral color information, using a random forest to classify the hyperspectral color information to obtain a third bottom-layer classification feature vector.
[0122] S307, using a support vector machine to classify the visible light texture information to obtain a fourth bottom-layer classification feature vector.
[0123] S308, using a random forest to classify the visible light color information to obtain a fifth bottom-layer classification feature vector.
[0124] S309, performing feature integration by using the first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector and the fifth bottom-layer classification feature vector to obtain a top-layer input feature vector, performing classification on the top-layer input feature vector by using a support vector machine, and identifying the honeysuckle origin by using a classification result.
[0125] The embodiment optimizes and screens the spectral data in the hyperspectral data by using the arrangement importance algorithm and L1 regularization, extracts wave bands with higher contribution to the prediction accuracy of the classification model, and uses the screened and optimized spectral wave band information to select the spectral information of the least number of wave bands while ensuring the accuracy of the classification model, thereby reducing the calculation amount of the classification model and improving the efficiency of the classification model in identifying the honeysuckle origin.
[0126] Embodiment Four
[0127] Figure 7 A flowchart of the honeysuckle origin identification method according to Embodiment Four of the present application, which is optimized on the basis of the above-mentioned embodiments. In this embodiment, the hyperspectral data and the visible light data are preprocessed, and the specific optimization is as follows:
[0128] The hyperspectral data and the visible light data are respectively subjected to region of interest extraction to obtain a hyperspectral region of interest image and a visible light region of interest image respectively.
[0129] The hyperspectral region of interest image is subjected to texture information extraction and color information extraction to obtain hyperspectral texture information and hyperspectral color information.
[0130] The visible light region of interest image is subjected to texture information extraction and color information extraction to obtain visible light texture information and visible light color information.
[0131] Correspondingly, the honeysuckle origin identification method provided by the embodiment specifically includes the following steps:
[0132] S401, collecting hyperspectral data and visible light data of a honeysuckle sample, and respectively performing region of interest extraction on the hyperspectral data and the visible light data to obtain a hyperspectral region of interest image and a visible light region of interest image respectively.
[0133] After the hyperspectral image and the visible light image of the honeysuckle sample are collected by the hyperspectral camera and the visible light camera, the honeysuckle sample is distributed in a certain area of the image. In order to reduce the influence of irrelevant areas on the classification model, the region of interest of the collected image needs to be extracted to distinguish the area where the honeysuckle sample is distributed from the background. By selecting a gray image with large color difference between the honeysuckle sample and the background in the image of multiple wavebands of the hyperspectral data, the binary image is obtained by threshold segmentation of the gray image in the hyperspectral data. Then, the rectangular area where the sample contour is distributed is found by morphological transformation, and the part outside the contour is shielded by mask processing. The binary image obtained by threshold segmentation can be used for morphological transformation to remove the noise in the background, so as to improve the feature expression ability of the image and reduce the influence of irrelevant factors on the classification model. Finally, the hyperspectral region of interest image is obtained. The visible light image can be converted into a gray image by using the COLOR_BGR2GRAY function in the OpenCV library, and then the above-mentioned region of interest extraction process is performed to obtain the visible light region of interest gray image.
[0134] S402, texture information extraction and color information extraction are performed on the hyperspectral region of interest image to obtain hyperspectral texture information and hyperspectral color information.
[0135] In the hyperspectral image, in addition to spectral information, texture information and color information are also included. The texture information in the hyperspectral image is extracted by using the gray level co-occurrence matrix. In the gray level co-occurrence matrix, the hyperspectral texture information of the hyperspectral image is extracted by using the small gradient dominance, the large gradient dominance, the gray level distribution non-uniformity, the gradient distribution non-uniformity, the energy, the gray level average, the gradient average, the gray level variance, the gradient variance, the correlation, the gray level entropy, the gradient entropy, the mixed entropy, the inertia and the inverse difference moment features. The color information in the hyperspectral image is extracted by using the color moment. The color distribution in the image is extracted by using the first moment (mean), the second moment (variance) and the third moment (skewness) to obtain the hyperspectral color information.
[0136] S403, texture information extraction and color information extraction are performed on the visible light region of interest image to obtain visible light texture information and visible light color information.
[0137] The collected original visible light image is converted into an HSV image, which is more conducive to the identification of color information in the image by the classification model. The images corresponding to the H, S and V (hue, saturation and brightness) channels in the HSV image are extracted, respectively. The texture information of each channel is extracted by using the gray level co-occurrence matrix to obtain the visible light texture information. The color information of the H, S and V channels is extracted by using the color moment to obtain the visible light color information.
[0138] S404, performing feature screening on the spectral information by using the permutation importance algorithm and L1 regularization to obtain optimized spectral band information.
[0139] S405, determining optimized spectral information according to the optimized spectral band information and the spectral information, performing classification on the optimized spectral information by using a support vector machine to obtain a first bottom-layer classification feature vector.
[0140] S406, determining optimized hyperspectral texture information according to the optimized spectral band information and the hyperspectral texture information, performing screening on the optimized hyperspectral texture information by using the permutation importance algorithm to obtain screened hyperspectral texture information, performing classification on the hyperspectral texture information by using a random forest to obtain a second bottom-layer classification feature vector.
[0141] S407, determining optimized hyperspectral color information according to the optimized spectral band information and the hyperspectral color information, performing screening on the optimized hyperspectral color information by using the permutation importance algorithm to obtain screened hyperspectral color information, performing classification on the hyperspectral color information by using a random forest to obtain a third bottom-layer classification feature vector.
[0142] S408, performing classification on the visible light texture information by using a support vector machine to obtain a fourth bottom-layer classification feature vector.
[0143] S409, performing classification on the visible light color information by using a random forest to obtain a fifth bottom-layer classification feature vector.
[0144] S410, performing feature integration by using the first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector, and the fifth bottom-layer classification feature vector to obtain a top-layer input feature vector, performing classification on the top-layer input feature vector by using a support vector machine, and identifying the origin of honeysuckle by using a classification result.
[0145] The embodiment shields irrelevant areas outside the honeysuckle sample by extracting the region of interest in the hyperspectral data and the visible light data, reduces the influence of irrelevant factors on the classification model, makes the model more focused on the area where the honeysuckle sample is distributed, improves the prediction performance of the classification model, and reduces the calculation amount of the classification model. By extracting spectral information, hyperspectral texture information, and hyperspectral visible light information from the hyperspectral data respectively, and extracting visible light texture information and visible light color information from the visible light data respectively, data sources for honeysuckle origin classification are provided from five different angles, so that the classification model can utilize multiple data sources to consider more comprehensive information of the honeysuckle sample when classifying and identifying the origin of the honeysuckle, and the classification result obtained from multiple angles can improve the accuracy of the classification model.
[0146] An optional implementation of the embodiment is that when extracting spectral information by using hyperspectral data, the hyperspectral image of interest is subjected to black and white correction to extract reflectance spectral data. In the extracted hyperspectral image of interest, by using black and white correction, the coordinates of black pixels are identified, and the hyperspectral image of each waveband and the hyperspectral image after black and white correction are traversed according to the coordinates, and the light intensity curve is corrected to obtain the reflectance spectral data of the honeysuckle sample, The formula is as follows :
[0147]
[0148] wherein R cal is the reflectance of the honeysuckle sample, R raw is the value in the hyperspectral image of the honeysuckle sample, R dark is the system error of the hyperspectral camera, and R white is the value in the hyperspectral image of the white board.
[0149] The Monte Carlo method is used to remove outliers from the reflectance spectral data. The Monte Carlo cross-validation method can monitor outliers in the reflectance spectral data. By randomly extracting 70% of the samples in the reflectance spectral data, repeating multiple times, and respectively establishing a support vector machine-based classification model using each randomly extracted sample, the performance of the classification model is evaluated compared with the remaining 30% of the samples. By using the obtained cumulative probability, the samples that deviate significantly are identified, and after removing the deviated samples, the accuracy of the support vector machine classification model is verified again to verify the influence of the deviated samples on the accuracy of the classification model. The deviated samples that have less influence on the accuracy can be retained, and the deviated samples that have greater influence are regarded as outliers and are removed. As shown in Figure 8 , in a batch of honeysuckle samples, three outliers 53, 68 and 107 are detected, and the three samples are deleted. According to the logarithmic loss function of the support vector machine classification result after deletion, it can be seen that after removing the samples 53, 68 and 107, the prediction performance of the model is equivalent to that after removing only the samples 53 and 107, as shown in Figure 9 , which indicates that the sample 68 has relatively small influence on the model performance, and the sample 68 does not need to be removed.
[0150] Data augmentation is performed on the hyperspectral data after outlier removal to obtain spectral information. First-order derivative (1st Der), second-order derivative (2nd Der), multivariate scattering correction (MSC), standard normal variable transformation (SNV), SG smoothing, mean centering (MC), minimax normalization (MMS), and standardization (AS) are used to augment the hyperspectral data after outlier removal, improving the quality of the spectral data and thus enhancing the performance of the classification model. First-order and second-order derivatives are used to enhance subtle variations in the spectral data; multivariate scattering correction and standard normal variable transformation are used to correct scattering effects in the spectral data; SG smoothing and mean centering are used to smooth the data; and minimax normalization and standardization are used to scale the data. By applying these data augmentation methods and combinations thereof, a classification model based on a support vector machine is built using the processed spectral data, and the performance of different processing methods and combinations is evaluated. Figure 10 As shown, the data processed by the three combinations of first derivative and standardization (1st Der-AS), standard normal variable transformation and standardization (SNV-AS), and SG smoothing and first derivative and standardization (SG-1st Der-AS) have lower log loss function values compared to the validation set after being predicted by the classification model. Therefore, one of these three combinations can be chosen to perform data augmentation processing on the hyperspectral data after removing outliers to obtain spectral information. In this embodiment, the spectral bands can be further filtered using the permutation importance algorithm. After filtering using the permutation importance algorithm, compared to the validation set, the classification model built based on support vector machine has the smallest log loss function value when using the combination of SG smoothing and first derivative and standardization combined with the permutation importance algorithm (SG-1st Der-AS-PI). Figure 11 As shown, the value is 0.029, therefore this combination is used as a preprocessing and screening method for spectral information in hyperspectral data.
[0151] This embodiment removes outliers from the extracted reflectance spectral data to reduce interference with the classification model and improve its predictive performance. Then, data augmentation is performed by selecting a better combination of data processing methods compared with the validation set. The combined data processing methods are then used to process the spectral data, which improves the quality of the spectral data and helps the classification model obtain more accurate classification prediction results.
[0152] Optionally, texture information and color information are extracted from the visible light region of interest to obtain visible light texture information and visible light color information, including:
[0153] The visible light data is converted into a gray scale image. The COLOR_BGR2GRAY function in the OpenCV library is used to convert the RGB image into a gray scale image, and threshold segmentation is performed on the obtained gray scale image of the visible light data to obtain a binary image. Then, a rectangular region of the sample profile distribution is found through morphological transformation, and the region outside the profile is shielded through mask processing to determine the region of interest of the visible light data.
[0154] The visible light data is converted into an HSV image. The H, S and V color channels of the HSV image are extracted respectively. The COLOR_BGR2HSV function in the OpenCV library is used to convert the RGB image of the original visible light image into an HSV image. The HSV image describes the characteristics of the visible light image from different angles through the hue, saturation and brightness channels, which is more conducive to the classification model to identify the color information in the image, instead of using the different color brightness of the RGB three channels to express.
[0155] The region of interest of the visible light data is used to extract the region of interest of each color channel. The region of interest of each color channel is extracted using the region of interest of the visible light data, and the other regions are shielded by the mask to finally form the region of interest of each color channel.
[0156] The texture information is extracted from the region of interest of each color channel to obtain the visible light texture information. The gray scale gradient co-occurrence matrix combines the gray scale co-occurrence matrix (GLCM) and gradient information, which can comprehensively describe the texture information of the image from more angles. Various feature values are used to describe the texture features of the image from different angles to form the visible light texture information.
[0157] The color information is extracted from the region of interest of each color channel, and the color moment calculation is used to obtain the visible light color information. The color information of the three channels is extracted from the images corresponding to the hue, saturation and brightness channels using the color moment. The color moment reflects the average intensity, color distribution dispersion and color distribution asymmetry of each color channel through the first moment (mean), second moment (variance) and third moment (skewness) respectively. Through the color moment features, the recognized honeysuckle sample in the image is represented to form the visible light color information of the honeysuckle sample.
[0158] Embodiment five
[0159] Figure 12 The structure diagram of the honeysuckle origin identification device according to the embodiment five of the present application is shown in the embodiment, the honeysuckle origin identification device comprises:
[0160] The data acquisition module 810 is configured to acquire hyperspectral data and visible light data of the honeysuckle flower sample.
[0161] The data preprocessing module 820 is configured to preprocess the acquired hyperspectral data and visible light data. The preprocessed hyperspectral data includes spectral information, hyperspectral texture information and hyperspectral color information. The preprocessed visible light data includes visible light texture information and visible light color information.
[0162] The feature screening module 830 is configured to screen features of the spectral information by using the permutation importance algorithm and L1 regularization to obtain optimized spectral band information.
[0163] The first bottom layer classification module 840 is configured to determine the optimized spectral information according to the optimized spectral band information and the spectral information, classify the optimized spectral information by using a support vector machine model, and obtain a first bottom layer classification feature vector.
[0164] The second bottom layer classification module 850 is configured to determine the optimized hyperspectral texture information according to the optimized spectral band information and the hyperspectral texture information, screen the optimized hyperspectral texture information by using the permutation importance algorithm, obtain screened hyperspectral texture information, and classify the screened hyperspectral texture information by using a random forest model to obtain a second bottom layer classification feature vector.
[0165] The third bottom layer classification module 860 is configured to determine the optimized hyperspectral color information according to the optimized spectral band information and the hyperspectral color information, screen the optimized hyperspectral color information by using the permutation importance algorithm, obtain screened hyperspectral color information, and classify the screened hyperspectral color information by using a random forest model to obtain a third bottom layer classification feature vector.
[0166] The fourth bottom layer classification module 870 is configured to classify the visible light texture information by using a support vector machine to obtain a fourth bottom layer classification feature vector.
[0167] The fifth bottom layer classification module 880 is configured to classify the visible light color information by using a random forest to obtain a fifth bottom layer classification feature vector.
[0168] The top layer classification module 890 is configured to integrate the first bottom layer classification feature vector, the second bottom layer classification feature vector, the third bottom layer classification feature vector, the fourth bottom layer classification feature vector and the fifth bottom layer classification feature vector to form a top layer input feature vector, classify the top layer input feature vector by using a support vector machine, and identify the honeysuckle flower origin by using a classification result.
[0169] The embodiment collects hyperspectral data and visible light data of honeysuckle samples, and carries out data preprocessing on the collected data, selects spectral information of important waveband spectral data in the hyperspectral data, establishes a classification model based on a support vector machine using the spectral information, takes the result of the model as a first bottom layer classification feature vector, then establishes classification models based on random forests using texture information and color information in the hyperspectral data respectively, takes the results of the models as a second bottom layer classification feature vector and a third bottom layer classification feature vector respectively, and then establishes classification models based on a support vector machine and a random forest using texture information and color information in the visible light data respectively, takes the results of the models as a fourth bottom layer classification feature vector and a fifth bottom layer classification feature vector, uses five different data sources based on different classification models as bottom layer classifiers, uses classification prediction results of the bottom layer classifiers as inputs of a top layer classifier, and uses the top layer classifier to perform final classification prediction, so that the final classification result can comprehensively consider the characteristics of the honeysuckle samples from multiple angles and can accurately identify the origin of the honeysuckle according to the classification result.
[0170] Embodiment six
[0171] Figure 13 A structure diagram of a server according to the embodiment six of the present application, Figure 13 A block diagram of an exemplary server 12 suitable for implementing embodiments of the present application is shown. Figure 13 The server 12 shown is merely one example and should not be taken as limiting the scope of the functionality or use of the embodiments of the present application.
[0172] As shown in Figure 13 The server 12 is shown in the form of a general-purpose computing device. The components of server 12 can include, but are not limited to, one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including system memory 28 and processing unit 16.
[0173] Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics bus, a processor or local bus using any of a variety of bus architectures. By way of example, these architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0174] Server 12 typically includes a variety of computer system readable media. Such media can be any available media that is locally and / or remotely accessible by server 12, and can include both volatile and non-volatile media, removable and non-removable media.
[0175] System memory 28 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Server 12 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 can be provided for reading from and writing to a non-removable, non-volatile magnetic media (e.g., a "hard drive"). Figure 13 Not shown, a non-volatile computer system storage medium can be used to store such computer program instructions. For example, the instructions can be embodied on a magnetic storage medium, an optical storage medium, a solid state storage medium, etc. The instructions can be provided, for example, from a storage media of a storage device such as memory 28, or can be provided from a storage device (not shown) connected to server 12, such as a floppy disc device, a CD-ROM device, a DVD-ROM device, a tape device, a hard disk device, or the like. Figure 13 Although not shown in FIG. 1, a disk controller can be provided for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and a super-video disk controller can be provided for reading from and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media). Each of these devices can be connected to bus 18 by one or more data media interfaces. Memory 28 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the present application.
[0176] Program / utility 40, having a set (at least one) of program modules 42, can be stored in, for example, memory 28 by way of example, such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination thereof, which can include implementation of a network environment. Program modules 42 generally carry out the functions and / or methodologies of embodiments of the present application as described herein.
[0177] Server 12 can also communicate with one or more external devices 14 such as a keyboard, a pointing device, a display 24, etc. One or more devices enabling a user to interact with an embodiment of the present application can be
[0178] Processing unit 16 can execute the program from system memory 28 in order to carry out various functions as taught herein, such as implementing the honeysuckle origin identification method provided by embodiments of the present application.
[0179] Embodiment Seven
[0180] The embodiment seven of the present application also provides a storage medium comprising computer executable instructions for performing the honeysuckle origin identification method provided by the above embodiment when executed by a computer processor.
[0181] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, be but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device.
[0182] The computer readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave in a propagated data signal, in which the computer readable program code is contained. Such propagated data signal can take many forms, including but not limited to electro-magnetic, optical or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport program for use by or in connection with an instruction execution system, apparatus or device.
[0183] The program code contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire line, optical cable, RF, etc., or any suitable combination thereof.
[0184] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0185] It is to be understood that the above description is directed to the preferred embodiments and that those skilled in the art will be able to devise various modifications which, although not specifically described herein, embody the principles of the application and are included within the spirit and scope of the application. Accordingly, while the preferred embodiments have been described above, those skilled in the art will understand that they are not to be limited to the preferred embodiments, but are to include all such embodiments falling within the scope of the application as defined by the appended claims.
Claims
1. A method for identifying the origin of honeysuckle, characterized in that, The application relates to a method for identifying the origin of honeysuckle flowers. High-spectrum data and visible light data of honeysuckle samples are collected, and the collected high-spectrum data and visible light data are preprocessed; the preprocessed high-spectrum data comprises spectrum information, high-spectrum texture information and high-spectrum color information, and the preprocessed visible light data comprises visible light texture information and visible light color information; The spectrum information is screened by using a permutation importance algorithm and L1 regularization to obtain optimized spectrum band information; According to the optimized spectrum band information and the spectrum information, optimized spectrum information is determined, and the optimized spectrum information is classified by using a support vector machine model to obtain a first bottom-layer classification feature vector; According to the optimized spectrum band information and the high-spectrum texture information, optimized high-spectrum texture information is determined, the optimized high-spectrum texture information is screened by using a permutation importance algorithm to obtain screened high-spectrum texture information, and the screened high-spectrum texture information is classified by using a random forest model to obtain a second bottom-layer classification feature vector; According to the optimized spectrum band information and the high-spectrum color information, optimized high-spectrum color information is determined, the optimized high-spectrum color information is screened by using a permutation importance algorithm to obtain screened high-spectrum color information, and the screened high-spectrum color information is classified by using a random forest model to obtain a third bottom-layer classification feature vector; The visible light texture information is classified by using a support vector machine to obtain a fourth bottom-layer classification feature vector; The visible light color information is classified by using a random forest to obtain a fifth bottom-layer classification feature vector; The first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector and the fifth bottom-layer classification feature vector are integrated to form a top-layer input feature vector, the top-layer input feature vector is classified by using a support vector machine, and the classification result is used to identify the origin of the honeysuckle flowers.
2. The method of claim 1, wherein, The first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector and the fifth bottom-layer classification feature vector are integrated to form a top-layer input feature vector, the first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector and the fifth bottom-layer classification feature vector are respectively feature-spliced based on stacked generalization to form a plurality of top-layer input feature vector combinations; Each top-layer feature vector combination is used to train a support vector machine, and an optimal top-layer input feature vector combination is selected according to a logarithmic loss function; The optimal top-layer input feature vector combination and the first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector and the fifth bottom-layer classification feature vector are used to form a top-layer input feature vector. The spectrum information is screened by using a permutation importance algorithm and L1 regularization to obtain optimized spectrum band information, which comprises the following steps:
3. The method of claim 1, wherein, The spectrum information is subjected to PI feature band extraction by using a permutation importance algorithm to obtain screened spectrum band information; The L1 feature band extraction is performed on the screened spectral band information again by using L1 regularization to obtain optimized spectral band information.
4. The method of claim 1, wherein, The preprocessing of the hyperspectral data and the visible light data comprises: The hyperspectral data and the visible light data are respectively subjected to region of interest extraction to obtain a hyperspectral region of interest image and a visible light region of interest image respectively; The hyperspectral region of interest image is subjected to texture information extraction and color information extraction to obtain hyperspectral texture information and hyperspectral color information; The visible light region of interest image is subjected to texture information extraction and color information extraction to obtain visible light texture information and visible light color information.
5. The method of claim 4, wherein, The method further comprises: The hyperspectral region of interest image is subjected to black and white correction to extract reflectance spectral data; The reflectance spectral data is subjected to outlier sample elimination by using a Monte Carlo cross-validation method; The hyperspectral data after the outlier sample elimination is subjected to data enhancement processing to obtain spectral information.
6. The method of claim 4, wherein, The visible light region of interest image is subjected to texture information extraction and color information extraction to obtain visible light texture information and visible light color information, which comprises: The region of interest of the visible light data is determined by using a gray-scale image of the visible light data; The visible light data is converted into an HSV image, and images of three color channels H, S and V in the HSV image are extracted respectively; The region of interest image of each color channel is extracted by using the region of interest of the visible light data; The texture information is extracted from the region of interest image of each color channel by using a gray-scale gradient co-occurrence matrix to obtain visible light texture information; The color information is extracted from the region of interest image of each color channel respectively, and the visible light color information is obtained by using color moment calculation.
7. The method of claim 1, wherein, The hyperspectral data and the visible light data of the honeysuckle samples are collected, which comprises: The honeysuckle samples are laid flat in a black tray, and the tray is placed on a conveyor belt moving at a constant speed; The hyperspectral data of the honeysuckle samples are collected by using a hyperspectral camera; The visible light data of the honeysuckle samples are collected by using an industrial camera.
8. A device for identifying the origin of honeysuckle, characterized in that, It comprises: a data collection module for collecting the hyperspectral data and the visible light data of the honeysuckle samples; a data preprocessing module for preprocessing the collected hyperspectral data and visible light data, wherein the preprocessed hyperspectral data comprises spectral information, hyperspectral texture information and hyperspectral color information, and the preprocessed visible light data comprises visible light texture information and visible light color information; a feature screening module for screening features of the spectral information by using a permutation importance algorithm and L1 regularization to obtain optimized spectral band information; a first bottom layer classification module for determining optimized spectral information according to the optimized spectral band information and the spectral information, and classifying the optimized spectral information by using a support vector machine model to obtain a first bottom layer classification feature vector; The second bottom-layer classification module is configured to determine optimized hyperspectral texture information according to the optimized spectral band information and the hyperspectral texture information, screen the optimized hyperspectral texture information by using a permutation importance algorithm to obtain screened hyperspectral texture information, and classify the screened hyperspectral texture information by using a random forest model to obtain a second bottom-layer classification feature vector. The third bottom-layer classification module is configured to determine optimized hyperspectral color information according to the optimized spectral band information and the hyperspectral color information, screen the optimized hyperspectral color information by using a permutation importance algorithm to obtain screened hyperspectral color information, and classify the screened hyperspectral color information by using a random forest model to obtain a third bottom-layer classification feature vector. The fourth bottom-layer classification module is configured to classify the visible light texture information by using a support vector machine to obtain a fourth bottom-layer classification feature vector. The fifth bottom-layer classification module is configured to classify the visible light color information by using a random forest to obtain a fifth bottom-layer classification feature vector. The top-layer classification module is configured to integrate the first bottom-layer classification feature vector, the second bottom-layer classification feature vector, the third bottom-layer classification feature vector, the fourth bottom-layer classification feature vector, and the fifth bottom-layer classification feature vector to form a top-layer input feature vector, classify the top-layer input feature vector by using a support vector machine, and identify the honeysuckle flower origin by using a classification result.
9. A server, characterized by The server includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the honeysuckle flower origin identification method as claimed in any one of claims 1-7.
10. A storage medium containing computer executable instructions for executing the honeysuckle flower origin identification method as claimed in any one of claims 1-7 when executed by a computer processor.
Citation Information
Patent Citations
Chrysanthemum production place identification method, model construction method and electronic equipment
CN116933043A
Terahertz time-domain spectroscopy detection method for identifying millets from multiple producing areas
CN118837324A