Rice variety classification method based on hyperspectral pixel-level information

By using hyperspectral pixel-level information and dynamically adjusting pixel thresholds in rice variety classification, the problem of insufficient classification accuracy and adaptability in the prior art is solved, and a more efficient and reliable rice variety classification is achieved.

CN119942223AActive Publication Date: 2025-05-06BEIJING FORESTRY UNIVERSITY
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510109807.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-06
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

The existing crop classification methods based on remote sensing image data have insufficient image segmentation and dynamic environmental adaptability, resulting in poor classification accuracy and timeliness.

Method used

The rice variety classification method based on hyperspectral pixel-level information is adopted. By obtaining the real-time average pixel value, reflectivity and spectral angle of the hyperspectral image, the pixel threshold is dynamically adjusted, and the variety classification is carried out in combination with weighted summing.

Benefits of technology

It improves the accuracy and adaptability of rice variety classification, and can automatically optimize classification accuracy under different sampling environments and conditions, reduce misclassification, and improve the accuracy and reliability of classification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942223A_ABST
    Figure CN119942223A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a hyperspectral pixel-level information-based rice variety classification method, which comprises the following steps of: acquiring pixel data of a hyperspectral image; determining a first temporary grid according to the pixel value; determining a second temporary grid according to the reflectivity; determining a sample grid through the spectrum angle; pixel-level labels and spectral reflectivity are obtained, and variety classification is carried out; and according to a classification result, adjusting a pixel threshold and determining a variety. Through multi-level image processing and feature extraction steps, different rice varieties can be effectively distinguished, through extraction of real-time average pixel values, reflectivity, spectral angles and other features, fine differences of rice can be accurately captured, the pixel threshold value process can be dynamically adjusted, and through combination of variety deviation and fluctuation analysis, the rice variety identification accuracy is improved. The method can automatically optimize the classification precision under different sampling environments and conditions, and effectively solves the problems of insufficient classification accuracy and poor adaptability caused by dependence on static remote sensing data and low-resolution images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a rice variety classification method based on hyperspectral pixel-level information. Background Art

[0002] In agricultural production, rice is an important food crop, and the identification of its varieties is crucial to crop management and planting strategies. With the development of remote sensing technology and hyperspectral imaging technology, it has become a trend to use hyperspectral image data to identify crop varieties. Hyperspectral imaging can provide spectral information for each pixel. Through hyperspectral image processing, more detailed features can be obtained. These features provide new technical means for variety classification, quality assessment and production management in the agricultural field.

[0003] The patent document with publication number CN115761518A discloses a crop classification method based on remote sensing image data, which method includes: S1, collecting remote sensing image data of crops; S2, extracting crop features from the remote sensing image data of crops, wherein the crop features include: spectral features, color features and texture features; step S2 includes the following steps: S21, extracting the amplitude of each spectral band of the remote sensing image data by wavelet transform; S22, segmenting the remote sensing image data according to the amplitude of each spectral band to obtain multiple segmented areas; S23, obtaining the spectral features on each segmented area according to the amplitude of each spectral band; S24, extracting color features from each segmented area; S25, extracting texture features from each segmented area; S3, using a crop classification model to process the crop features to obtain the crop type; in step S3, when training the crop classification model, the loss function is used to train the crop classification model, and the trained crop classification model processes the crop features to obtain the crop type.

[0004] It can be seen that the crop classification method based on remote sensing image data has the following problems: the remote sensing image is segmented in step S22, and the segmentation effect has a great influence on the subsequent feature extraction and classification results, but the image segmentation method itself cannot accurately process complex scenes or image features in different environments, affecting the classification effect; this method relies on static remote sensing image data and cannot reflect the dynamic growth state of crops or environmental changes in real time. Therefore, its adaptability is poor and it may not be able to capture the changes that may occur in the crop growth process in time, affecting the accuracy and timeliness of the classification. Summary of the invention

[0005] To this end, the present invention provides a rice variety classification method based on hyperspectral pixel-level information, which is used to overcome the problems of insufficient classification accuracy and poor adaptability in the prior art due to reliance on static remote sensing data and low-resolution images by accurately extracting the spectral spatial features of hyperspectral images and combining them with real-time data processing.

[0006] To achieve the above object, the present invention provides a rice variety classification method based on hyperspectral pixel-level information, comprising:

[0007] Obtaining the real-time average pixel value, real-time average reflectance and real-time average spectral angle of each grid to be determined in the rice hyperspectral image divided into a number of square grids;

[0008] Determine a plurality of first temporary grids according to the real-time average pixel value and a preset pixel threshold;

[0009] Determine a plurality of second temporary grids according to the real-time average reflectivity and the real-time average pixel value of each of the temporary grids;

[0010] Determine a number of sample grids according to the real-time average spectral angles of any two adjacent second temporary grids;

[0011] Determine the actual variety value according to the real-time average pixel value, the average reflectivity and the real-time average spectral angle of each of the sample grids;

[0012] Obtaining pixel-level labels and spectral reflectances in the rice hyperspectral image, and inputting them into a preset classification model to obtain classified varieties;

[0013] Determine the classification variety value according to the classification variety and the preset variety table;

[0014] Adjust the preset pixel threshold according to the classified variety value and the actual variety value to form an adjusted pixel threshold;

[0015] The rice variety is determined according to the preset variety table and the actual variety value determined based on the adjusted pixel threshold.

[0016] Further, determining a plurality of second temporary grids according to the real-time average reflectivity and the real-time average pixel value of each of the temporary grids comprises:

[0017] Calculating the standard deviation of the real-time average reflectivity within a preset first determined time period to form a reflection fluctuation value;

[0018] Calculating the standard deviation of the real-time average pixel value within the preset first determined time period to form a pixel fluctuation value;

[0019] A plurality of second temporary grids are determined according to the reflection fluctuation value and the pixel fluctuation value.

[0020] Further, determining a plurality of second temporary grids according to the reflection fluctuation value and the pixel fluctuation value comprises:

[0021] Draw a change curve according to the reflection fluctuation value within the preset first determined time period to form a reflection fluctuation curve;

[0022] Draw a change curve according to the pixel fluctuation value within the preset first determined time period to form a pixel fluctuation curve;

[0023] Calculating the cosine similarity of the reflection fluctuation curve and the pixel fluctuation curve to form a change consistency;

[0024] When the change consistency is greater than a preset consistency threshold, the first temporary grid is determined to be a second temporary grid, and a plurality of second temporary grids are formed.

[0025] Further, determining a number of sample grids according to the real-time average spectral angles of any two adjacent second temporary grids includes:

[0026] Calculating the standard deviation of the relative deviation of the real-time average spectral angles of any two adjacent second temporary grids within a preset second determined time length to form a spectral angle deviation fluctuation value;

[0027] When the spectral angle deviation fluctuation value is less than a preset spectral angle deviation fluctuation threshold, it is determined that the corresponding two second temporary grids are both sample grids to form a plurality of sample grids.

[0028] Further, determining the actual variety value according to the real-time average pixel value, the average reflectivity and the real-time average spectral angle of each sample grid includes:

[0029] The real-time average pixel value, the average reflectivity, the real-time average spectral angle, the preset pixel value weight, the reflectivity weight and the angle weight are weighted and summed to form an actual variety value.

[0030] Furthermore, the pixel-level labels and spectral reflectances in the rice hyperspectral image are obtained and input into a preset classification model, and the classified varieties include:

[0031] Performing black and white calibration correction on the rice hyperspectral image to form a calibration image;

[0032] Acquire a single binary mask of the calibration image that includes only rice sample pixel regions;

[0033] Assigning corresponding variety category labels to the rice sample pixel regions in the binary mask;

[0034] Extracting the spectral reflectance of each pixel point in the rice sample pixel area by a preset extraction model;

[0035] Inputting the variety category label and the spectral reflectance into a preset classification model to obtain a number of undetermined varieties;

[0036] The undetermined variety containing the most pixels is determined to be the classified variety.

[0037] Further, determining the classification variety value according to the classification variety and the preset variety table includes:

[0038] Select the preset variety value corresponding to the classification variety in the preset variety table as the classification variety value.

[0039] Further, adjusting the preset pixel threshold according to the classified variety value and the actual variety value to form the adjusted pixel threshold comprises:

[0040] Calculating the relative deviation between the classified variety value and the actual variety value to form a variety deviation value;

[0041] The preset pixel threshold is adjusted according to the variety deviation value to form an adjusted pixel threshold.

[0042] Further, adjusting the preset pixel threshold according to the variety deviation value to form the adjusted pixel threshold includes:

[0043] Calculate the standard deviation of the variety deviation value within the preset adjustment determination time to form the variety deviation fluctuation value;

[0044] When the variety deviation fluctuation value is greater than the preset variety deviation fluctuation threshold, the preset pixel threshold is increased according to the relative deviation between the variety deviation fluctuation value and the preset variety deviation fluctuation threshold and the preset adjustment coefficient to form an adjusted pixel threshold.

[0045] Further, determining a plurality of first temporary grids according to the real-time average pixel value and a preset pixel threshold comprises:

[0046] When the real-time average pixel value is greater than the preset pixel threshold, the grid to be determined is determined to be a first temporary grid, and a plurality of first temporary grids are formed.

[0047] Compared with the prior art, the beneficial effect of the present invention is that, through multi-level image processing and feature extraction steps, different rice varieties can be effectively distinguished, which has significant advantages. First, through the extraction of features such as real-time average pixel value, reflectivity and spectral angle, the subtle differences of rice can be accurately captured, avoiding the problem of traditional classification methods relying too much on specific varieties. Secondly, the process of dynamically adjusting the pixel threshold, combined with variety deviation and fluctuation analysis, can automatically optimize the classification accuracy under different sampling environments and conditions, overcome the challenges of spectral overlap or external interference between different varieties, and in addition, by comprehensively considering multiple features in a weighted summation manner, the robustness of the model is enhanced, and it can effectively cope with the influence of illumination changes, background noise, etc., and effectively solve the problem of insufficient classification accuracy and poor adaptability caused by relying on static remote sensing data and low-resolution images.

[0048] Furthermore, by calculating the fluctuations in reflectance and pixel values, the unstable and noisy grids can be effectively eliminated, thereby improving the accuracy and robustness of the classification model for hyperspectral data. By screening and optimizing the grids, the high quality and credibility of the data in subsequent variety classification are ensured, the possibility of misclassification is reduced, and the accuracy and reliability of the classification results are improved.

[0049] Furthermore, by utilizing the consistency of reflection fluctuations and pixel fluctuations, areas with similar spectral features can be accurately identified, and misjudgment can be reduced by setting a consistency threshold, ensuring the accuracy of grid division, thereby improving the accuracy of variety classification.

[0050] Furthermore, by calculating the spectral angle deviation fluctuation value and comparing it with the preset threshold, grids with similar spectral angles can be accurately screened out as samples to ensure the consistency of the spectral characteristics of the samples, which helps to improve classification precision and accuracy and reduce classification errors.

[0051] Furthermore, by using the weighted summation method, the influence of different features on the final variety value can be flexibly adjusted, making the model more in line with the actual situation and improving the accuracy of variety classification. By using the weighted method, a higher weight can be given to a feature according to actual needs to optimize the classification results, thereby improving the robustness and adaptability of the system in complex environments.

[0052] Furthermore, by calibrating the image in black and white, the error caused by environmental changes or equipment limitations can be effectively reduced, and the accuracy and stability of the image can be improved. The extraction of spectral spatial features can more comprehensively reflect the characteristics of rice varieties and enhance the recognition ability of the classification model. Finally, by selecting the undetermined variety containing the most pixels as the classification result, the accuracy of classification can be improved, the probability of misjudgment can be reduced, and the efficient and accurate classification of rice varieties can be ensured.

[0053] Furthermore, by directly referencing the standard data in the preset variety table, the risks caused by errors or inconsistencies in the classification process are avoided, the accuracy of the classified variety values ​​is ensured, the reliability and practicality of the system are improved, and the final variety classification results are more accurate.

[0054] Furthermore, by adjusting the preset pixel threshold to adapt to the deviation between different varieties, the classification accuracy can be further improved. This method can effectively reduce the error caused by inaccurate initial threshold setting, enhance the adaptability and accuracy of the model, and ensure that the classification results are more in line with the actual variety characteristics.

[0055] Furthermore, when the variety deviation fluctuation value is greater than the preset variety deviation fluctuation threshold, by calculating the relative deviation between the variety deviation fluctuation value and the preset variety deviation fluctuation threshold, and increasing the preset pixel threshold in combination with the preset adjustment coefficient, it is possible to effectively avoid misclassification caused by excessive feature differences between varieties.

[0056] Furthermore, by setting the pixel value threshold, the region with significant features can be effectively extracted from the image, avoiding the interference of irrelevant or noisy regions, and improving the accuracy and efficiency of subsequent analysis. By setting a reasonable pixel threshold, it is possible to ensure that important regions are given priority during the recognition process, thus enhancing the accuracy of the classification results. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 This is a flow chart of the rice variety classification method based on hyperspectral pixel-level information in this embodiment;

[0058] Figure 2 A decision logic diagram for determining the second temporary grid in this embodiment;

[0059] Figure 3 This is a decision logic diagram for determining a sample grid in this embodiment;

[0060] Figure 4 As shown, it is a decision logic diagram for increasing the preset pixel threshold in this embodiment. DETAILED DESCRIPTION

[0061] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0062] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0063] See also Figure 1As shown, it is a flow chart of the rice variety classification method based on hyperspectral pixel-level information of this embodiment;

[0064] This embodiment provides a rice variety classification method based on hyperspectral pixel-level information, including:

[0065] Obtaining the real-time average pixel value, real-time average reflectance and real-time average spectral angle of each grid to be determined in the rice hyperspectral image divided into a number of square grids;

[0066] Determine a plurality of first temporary grids according to the real-time average pixel value and a preset pixel threshold;

[0067] Determine a plurality of second temporary grids according to the real-time average reflectivity and the real-time average pixel value of each of the temporary grids;

[0068] Determine a number of sample grids according to the real-time average spectral angles of any two adjacent second temporary grids;

[0069] Determine the actual variety value according to the real-time average pixel value, the average reflectivity and the real-time average spectral angle of each of the sample grids;

[0070] Obtaining pixel-level labels and spectral reflectances in the rice hyperspectral image, and inputting them into a preset classification model to obtain classified varieties;

[0071] Determine the classification variety value according to the classification variety and the preset variety table;

[0072] Adjust the preset pixel threshold according to the classified variety value and the actual variety value to form an adjusted pixel threshold;

[0073] The rice variety is determined according to the preset variety table and the actual variety value determined based on the adjusted pixel threshold.

[0074] The process of obtaining the real-time average pixel value, real-time average reflectance and real-time average spectral angle of each grid to be determined in the rice hyperspectral image first requires preprocessing the hyperspectral image and dividing the image into several square grids, each of which covers a certain area. Then, by statistically analyzing the pixels in each grid, the real-time average pixel value of each grid is calculated to reflect the brightness or color information of the area. Next, the real-time average reflectance of the grid is calculated using the spectral data of each pixel in the hyperspectral image to reflect the spectral response characteristics of the area. Finally, by analyzing the spectral angles of the pixels in each grid, the real-time average spectral angle is calculated to characterize the spectral similarity or difference of the area. In this way, the spectral spatial characteristics of each grid can be obtained, providing effective data support for subsequent variety classification.

[0075] The preset pixel threshold is a standard value used to determine whether a grid meets specific conditions. It depends on the spectral characteristics of the image, the reflectivity of the target object, and the actual application requirements, and is usually set between 50 and 200. In this embodiment, it is set to 150, which can ensure that the spectral data of the selected grid is sufficiently representative, avoid background noise interference, and optimize the accuracy of variety classification.

[0076] By obtaining the real-time average pixel value, reflectivity and spectral angle information of each grid in the rice hyperspectral image, the image is gridded and feature extracted through technical steps such as threshold segmentation and fluctuation value calculation. First, the first temporary grid is screened out according to the preset pixel threshold, and then the second temporary grid is further determined by the fluctuation of reflectivity and pixel value. Subsequently, the sample grid is screened out by comparing the spectral angles of adjacent grids. The features of these sample grids are synthesized in a weighted manner to calculate the actual variety value. Next, the variety is classified using the preset classification model, and the pixel threshold is adjusted based on the classification results and the actual variety value. Finally, the rice variety is determined based on the adjusted threshold and the preset variety table.

[0077] Through multi-level image processing and feature extraction steps, different rice varieties can be effectively distinguished, which has significant advantages. First, through the extraction of real-time average pixel value, reflectivity, spectral angle and other features, the subtle differences of rice can be accurately captured, avoiding the problem of traditional classification methods relying too much on specific varieties. Secondly, the process of dynamically adjusting pixel thresholds, combined with variety deviation and fluctuation analysis, can automatically optimize classification accuracy under different sampling environments and conditions, overcoming the challenges of spectral overlap or external interference between different varieties. In addition, by comprehensively considering multiple features through weighted summation, the robustness of the model is enhanced, and it can effectively cope with the influence of lighting changes, background noise, etc., effectively solving the problem of insufficient classification accuracy and poor adaptability caused by relying on static remote sensing data and low-resolution images.

[0078] Specifically, determining a plurality of second temporary grids according to the real-time average reflectivity and the real-time average pixel value of each temporary grid comprises:

[0079] Calculating the standard deviation of the real-time average reflectivity within a preset first determined time period to form a reflection fluctuation value;

[0080] Calculating the standard deviation of the real-time average pixel value within the preset first determined time period to form a pixel fluctuation value;

[0081] A plurality of second temporary grids are determined according to the reflection fluctuation value and the pixel fluctuation value.

[0082] The preset first determined time length refers to the length of the time period selected when calculating the reflection fluctuation value and the pixel fluctuation value. It depends on the frequency of data acquisition and the periodicity of the characteristic fluctuation. It is usually set between 1 second and 10 seconds. In this embodiment, it is set to 5 seconds. It can capture enough change information while avoiding noise interference caused by too short a time period, ensuring the accuracy of the fluctuation value calculation, and optimizing the subsequent grid classification and variety determination.

[0083] First, the standard deviation of the real-time average reflectivity of each temporary grid within the preset first determined time period is calculated to obtain the reflection fluctuation value, and the standard deviation of the real-time average pixel value is calculated to obtain the pixel fluctuation value. Then, by combining the reflection fluctuation value and the pixel fluctuation value, it is determined which temporary grids can be classified as the second temporary grids, so as to further screen out grids with consistency and stability as the basis for the next step of variety classification.

[0084] By calculating the fluctuations in reflectance and pixel values, the unstable and noisy grids can be effectively eliminated, thereby improving the accuracy and robustness of the classification model for hyperspectral data. By screening and optimizing the grids, the high quality and credibility of the data in subsequent variety classification are ensured, the possibility of misclassification is reduced, and the accuracy and reliability of the classification results are improved.

[0085] Please continue reading Figure 2 As shown, it is a decision logic diagram for determining the second temporary grid in this embodiment;

[0086] Specifically, determining a plurality of second temporary grids according to the reflection fluctuation value and the pixel fluctuation value includes:

[0087] Draw a change curve according to the reflection fluctuation value within the preset first determined time period to form a reflection fluctuation curve;

[0088] Draw a change curve according to the pixel fluctuation value within the preset first determined time period to form a pixel fluctuation curve;

[0089] Calculating the cosine similarity of the reflection fluctuation curve and the pixel fluctuation curve to form a change consistency;

[0090] When the change consistency is greater than a preset consistency threshold, the first temporary grid is determined to be a second temporary grid, and a plurality of second temporary grids are formed.

[0091] The preset consistency threshold is a standard value used to measure the similarity between the reflection fluctuation curve and the pixel fluctuation curve. It is usually determined according to the specific application scenario and data characteristics, and is usually set between 0.7 and 0.9. In this embodiment, it is set to 0.85, which can avoid excessive grid division while ensuring a high similarity, thereby improving classification accuracy and reducing misjudgment.

[0092] First, based on the preset first determined time length, the reflection fluctuation value and the pixel fluctuation value are calculated and drawn into a reflection fluctuation curve and a pixel fluctuation curve. Then, the cosine similarity of the two curves is calculated to obtain the change consistency. If the change consistency exceeds the preset consistency threshold, it is considered that the reflection fluctuation and the pixel fluctuation have a high similarity, and the grid is determined to be a second temporary grid, and a number of second temporary grids are formed based on this determination.

[0093] By utilizing the consistency of reflection fluctuations and pixel fluctuations, areas with similar spectral features can be accurately identified, and misjudgment can be reduced by setting a consistency threshold, ensuring the accuracy of grid division and thus improving the accuracy of variety classification.

[0094] Please continue reading Figure 3 As shown, it is a decision logic diagram for determining a sample grid in this embodiment;

[0095] Specifically, determining a number of sample grids according to the real-time average spectral angles of any two adjacent second temporary grids includes:

[0096] Calculating the standard deviation of the relative deviation of the real-time average spectral angles of any two adjacent second temporary grids within a preset second determined time length to form a spectral angle deviation fluctuation value;

[0097] When the spectral angle deviation fluctuation value is less than a preset spectral angle deviation fluctuation threshold, it is determined that the corresponding two second temporary grids are both sample grids to form a plurality of sample grids.

[0098] The preset second determination time length refers to the time period used to calculate the real-time average spectral angle deviation of the adjacent second temporary grid, which depends on the time interval of image acquisition and the stability of the spectral angle change between grids. It is usually set between 1 second and 10 seconds. In this embodiment, it is set to 5 seconds. It can balance the dynamic changes and stability of the image, avoid noise interference caused by too short a time, and ensure sufficient data for accurate fluctuation calculation.

[0099] The preset spectral angle deviation fluctuation threshold is a standard for judging whether the spectral angle change of two adjacent grids is small enough, so as to determine whether they belong to the same type of sample grids. It depends on the variation range of the spectral angle and the accuracy and noise level of the image data. It is usually set between 0.01 degrees and 0.5 degrees. In this embodiment, it is set to 0.1 degrees, which can effectively filter out tiny spectral fluctuations and avoid irrelevant noise interference. At the same time, it ensures relatively stable grid classification and improves the accuracy and robustness of classification.

[0100] First, the relative deviation standard deviation of the real-time average spectral angle of any two adjacent second temporary grids is calculated to obtain the spectral angle deviation fluctuation value. Then, the spectral angle deviation fluctuation value is compared with the preset spectral angle deviation fluctuation threshold. If the spectral angle deviation fluctuation value is less than the threshold, the two adjacent grids are determined to be sample grids, thereby forming a number of sample grids.

[0101] By calculating the spectral angle deviation fluctuation value and comparing it with the preset threshold, grids with similar spectral angles can be accurately screened out as samples to ensure the consistency of the spectral characteristics of the samples, which helps to improve classification precision and accuracy and reduce classification errors.

[0102] Specifically, determining the actual variety value according to the real-time average pixel value, the average reflectivity, and the real-time average spectral angle of each sample grid includes:

[0103] The real-time average pixel value, the average reflectivity, the real-time average spectral angle, the preset pixel value weight, the reflectivity weight and the angle weight are weighted and summed to form an actual variety value.

[0104] The preset pixel value weight is a weight coefficient used to assign the pixel value in the weighted summation to the degree of influence in the actual variety value calculation. It depends on the contribution of different features to variety identification and is usually set between 0 and 1. In this embodiment, it is set to 0.4. This is mainly because the pixel value plays a basic role in spectral classification. Assigning a certain weight can balance its role in the comprehensive calculation, thereby improving the classification accuracy.

[0105] The reflectance weight is a coefficient used to assign influence to the reflectance feature when calculating the actual variety value. It depends on the expressiveness of the reflectance in variety identification and is usually set between 0 and 1. In this embodiment, it is set to 0.3 because reflectance plays an important role in the spectral reflectance characteristics of different varieties, but its fluctuation is small. Therefore, assigning a lower weight can more accurately reflect other characteristics.

[0106] The angle weight is a coefficient used to consider the effect of the spectral angle on the variety classification when calculating the actual variety value. It depends on the contribution of the spectral angle in the variety classification and is usually set between 0 and 1. In this embodiment, it is set to 0.3, based on the fact that the angle can provide effective information for distinguishing different rice varieties, but its effect is relatively minor compared to the pixel value and reflectivity, so a lower weight is given, so that the variety classification is more accurate.

[0107] By obtaining the real-time average pixel value, average reflectance and real-time average spectral angle of each sample grid, these spectral data are combined with the preset pixel value weight, reflectance weight and angle weight for weighted summation. The weighted summation process aims to fully consider the influence of different characteristics and form a comprehensive actual variety value. This actual variety value can accurately reflect the spectral characteristics of the rice variety in the grid and provide accurate data support for subsequent variety classification.

[0108] By using the weighted summation method, the influence of different features on the final variety value can be flexibly adjusted, making the model more in line with the actual situation and improving the accuracy of variety classification. By using the weighted method, a higher weight can be given to a feature according to actual needs to optimize the classification results, thereby improving the robustness and adaptability of the system in complex environments.

[0109] Specifically, the pixel-level labels and spectral reflectances in the rice hyperspectral image are obtained and input into a preset classification model to obtain the classified varieties including:

[0110] Performing black and white calibration correction on the rice hyperspectral image to form a calibration image;

[0111] Taking a single binary mask including only rice sample pixel regions in the calibration image by Otsu threshold segmentation method;

[0112] Assigning corresponding variety category labels to the rice sample pixel regions in the binary mask;

[0113] Extracting the spectral reflectance of each pixel point in the rice sample pixel area by a preset extraction model;

[0114] Inputting the variety category label and the spectral reflectance into a preset classification model to obtain a number of undetermined varieties;

[0115] The undetermined variety containing the most pixels is determined to be the classified variety.

[0116] Among them, the preset classification model is a hyperspectral image pixel-level information classification model based on a lightweight residual network (ResNet), which is trained by using pixel-level spectral data in hyperspectral images to learn the spectral characteristics of different varieties of rice. In this embodiment, a simplified version of the ResNet structure is used, which uses a smaller number of network layers and parameters to improve computational efficiency while maintaining a higher classification accuracy. After optimization, the model can effectively handle rice variety classification tasks, especially when performing pixel-level classification of hyperspectral images, with good performance and faster response speed.

[0117] The pixel-level spectral data is the pixel-level label and the spectral reflectance of the pixel point in the pixel area of ​​the rice sample. The pixel-level spectral data is obtained as follows:

[0118] The rice hyperspectral image is preprocessed and calibrated to form a calibration image. Then, the binary mask containing the rice sample pixel area is obtained by the Otsu threshold segmentation method. This process can accurately separate the rice sample area from the image and remove background noise.

[0119] After obtaining the binary mask of the rice sample area, the corresponding variety category labels are assigned to these sample pixel areas according to the known variety information. At the same time, the spectral reflectance of each pixel point is extracted from the rice sample pixel area using a preset extraction model. These spectral reflectance data represent the reflection intensity of each pixel in different spectral bands, reflecting the spectral characteristics of different rice varieties.

[0120] The variety category label and spectral reflectance data are input into a preset classification model (such as a lightweight residual network ResNet), which is trained to handle the classification task of rice varieties. Through training and learning the spectral characteristics of different rice varieties, the model can classify and obtain several undetermined varieties based on the input pixel-level spectral data. Finally, the variety with the most pixels among the undetermined varieties is determined as the classification variety, thereby achieving accurate classification of rice varieties.

[0121] This method can effectively extract and utilize pixel-level spectral data to achieve accurate classification of rice varieties. It is particularly suitable for pixel-level processing of hyperspectral images and has high accuracy and fast response speed.

[0122] Specifically, the Otsu threshold segmentation method is a classic image segmentation technique that aims to automatically select the best threshold by maximizing the inter-class variance, thereby effectively binarizing the image. The core idea is to divide the grayscale histogram of the image into two classes: class 1 (pixels with grayscale values ​​less than threshold t) and class 2 (pixels with grayscale values ​​greater than threshold t). For each potential threshold t, the class probability is calculated, which represents the proportion of pixels in each class.

[0123] Specifically, the 770nm grayscale image was thresholded using the Otsu method, with the threshold parameter t set to 127. This process generated a preliminary binary background and rice grain segmentation, including some very small mis-segmented pixels. These mis-segmented pixels were then accurately corrected through manual visual inspection, and finally an accurate binary segmentation result was obtained.

[0124] The black and white calibration correction of the rice hyperspectral image is to eliminate the experimental errors generated by the uneven light intensity and the equipment acquisition process. First, the original hyperspectral image is corrected for brightness and darkness by using a dark reference image and a white reference image. The dark reference image is obtained by completely blocking the lens with an opaque cap (close to 0% reflectivity), while the white reference image is obtained from a white standard with close to 100% diffuse reflectance. The correction process uses a specific formula to adjust the light intensity in the original image to remove the influence of uneven lighting or equipment errors, so that the corrected image can more accurately reflect the true spectral information. This provides higher accuracy and reliability for subsequent image processing and analysis.

[0125] The preset extraction model refers to a model that is pre-designed and determined in the method for extracting spectral spatial features from rice hyperspectral images. This model is usually based on a specific algorithm or deep learning structure, such as a convolutional neural network (CNN) or other models suitable for image processing, and is specifically used to extract spectral features that can reflect rice variety differences from images. In this embodiment, the preset extraction model is designed as a convolutional neural network (CNN) based on deep learning. The model first processes the black-and-white calibrated rice hyperspectral image and extracts local features of the image through multiple convolutional layers. Each convolutional layer can effectively capture the spectral information of the pixel while taking into account its spatial distribution. The pooling layer in the model further enhances the spatial features of the image and reduces the amount of calculation. The preset extraction model not only retains the spectral information of each pixel through layer-by-layer feature extraction, but also makes full use of spatial relationships, providing more abundant and efficient features for subsequent variety classification.

[0126] First, the rice hyperspectral image is calibrated in black and white to eliminate image deviations caused by illumination changes and equipment errors, thereby obtaining a more accurate calibration image. Then, the spectral spatial features of each pixel in the calibration image are extracted using a preset extraction model to ensure that the extracted features can fully represent the spectral information of the image. Next, these spectral spatial features are input into a preset classification model to obtain several undetermined varieties, and finally the undetermined varieties containing the most pixels are determined as classified varieties.

[0127] By calibrating the image in black and white, the error caused by environmental changes or equipment limitations can be effectively reduced, and the accuracy and stability of the image can be improved. The extraction of spectral spatial features can more comprehensively reflect the characteristics of rice varieties and enhance the recognition ability of the classification model. Finally, by selecting the undetermined variety containing the most pixels as the classification result, the accuracy of classification can be improved, the probability of misjudgment can be reduced, and efficient and accurate classification of rice varieties can be ensured.

[0128] Specifically, determining the classification variety value according to the classification variety and the preset variety table includes:

[0129] Select the preset variety value corresponding to the classification variety in the preset variety table as the classification variety value.

[0130] The preset variety table is a database containing various rice varieties and their related characteristics, which is usually constructed by experts based on actual variety data and experimental results, depending on the sample varieties used and their characteristics. It is usually set to include variety categories of all possible classifications, and the number of varieties in the table depends on the requirements of the classification task. In this embodiment, the preset variety table includes 10 main rice varieties. Through this setting, it can be guaranteed that the characteristics of different rice varieties are covered, ensuring the applicability and accuracy of the classification model.

[0131] The preset variety value refers to the standardized characteristic value or reference value corresponding to each variety in the preset variety table. These values ​​are set based on historical data or experimental results. The preset variety value usually depends on the spectral characteristics and spatial information of the variety, and is usually set between 0 and 1 for standardization.

[0132] In this embodiment, the preset variety table is:

[0133]

[0134]

[0135] According to the classification variety obtained by the classification model, the preset variety value corresponding to the variety in the preset variety table is searched, and then the final classification variety value is determined. This process compares the classification results with the standard variety data table, selects the most matching variety value, and ensures the consistency of the results.

[0136] By directly referencing the standard data in the preset variety table, the risks caused by errors or inconsistencies in the classification process are avoided, the accuracy of the classified variety values ​​is ensured, the reliability and practicality of the system are improved, and the final variety classification results are more accurate.

[0137] Specifically, adjusting the preset pixel threshold according to the classified variety value and the actual variety value to form the adjusted pixel threshold includes:

[0138] Calculating the relative deviation between the classified variety value and the actual variety value to form a variety deviation value;

[0139] The preset pixel threshold is adjusted according to the variety deviation value to form an adjusted pixel threshold.

[0140] According to the difference between the classified variety value and the actual variety value, the relative deviation between the two is first calculated to obtain the variety deviation value. Then, the preset pixel threshold is adjusted according to the variety deviation value to form a new adjusted pixel threshold. This adjustment process ensures that the classification model can more accurately identify the characteristics of different rice varieties by dynamically adjusting the pixel threshold.

[0141] By adjusting the preset pixel threshold to accommodate the deviations between different varieties, the classification accuracy can be further improved. This method can effectively reduce the error caused by inaccurate initial threshold settings, enhance the adaptability and accuracy of the model, and ensure that the classification results are more in line with the actual variety characteristics.

[0142] Please continue reading Figure 4 As shown, it is a decision logic diagram for increasing the preset pixel threshold in this embodiment;

[0143] Specifically, adjusting the preset pixel threshold according to the variety deviation value to form the adjusted pixel threshold includes:

[0144] Calculate the standard deviation of the variety deviation value within the preset adjustment determination time to form the variety deviation fluctuation value;

[0145] When the variety deviation fluctuation value is greater than the preset variety deviation fluctuation threshold, the preset pixel threshold is increased according to the relative deviation between the variety deviation fluctuation value and the preset variety deviation fluctuation threshold and the preset adjustment coefficient to form an adjusted pixel threshold, and the relative deviation between the variety deviation fluctuation value and the preset variety deviation fluctuation threshold is positively correlated with the adjusted pixel threshold.

[0146] The preset adjustment judgment time is the time range used to evaluate the changes in the fluctuation value of variety deviation, which depends on the periodic changes in the rice growth process and the frequency of image data acquisition. It is usually set between a few minutes and a few hours. In this embodiment, it is set to 30 minutes, which can balance the stability and timeliness of the data, ensuring that the changes in variety deviation are captured within a certain period of time, while avoiding too frequent adjustments.

[0147] The preset variety deviation fluctuation threshold is a reference value used to determine whether the variety deviation fluctuation value exceeds the normal fluctuation range. It is usually determined based on the distribution of the data and the fluctuation characteristics in actual applications. It is usually set between 5% and 20%. In this embodiment, it is set to 10%. It can ensure that the model is adjusted only when the deviation fluctuation value is large, avoiding unnecessary changes caused by too small fluctuations.

[0148] The preset adjustment coefficient is used to adjust the preset pixel threshold when the variety deviation fluctuation value is large. It is usually determined based on experimental data and experience, and is usually set between 1 and 3. In this embodiment, it is set to 2, which can effectively increase the adjustment range of the preset pixel threshold and ensure that reasonable adjustments can be made when large deviations occur, thereby improving classification accuracy and stability.

[0149] According to the difference between the classified variety value and the actual variety value, the relative deviation between the two is first calculated to obtain the variety deviation value, and then the preset pixel threshold is adjusted according to the variety deviation value to form a new adjusted pixel threshold. This adjustment process ensures that the classification model can more accurately identify the characteristics of different rice varieties by dynamically adjusting the pixel threshold.

[0150] When the variety deviation fluctuation value is greater than the preset variety deviation fluctuation threshold, by calculating the relative deviation between the variety deviation fluctuation value and the preset variety deviation fluctuation threshold, and increasing the preset pixel threshold in combination with the preset adjustment coefficient, it is possible to effectively avoid misclassification caused by excessive feature differences between varieties.

[0151] Specifically, determining a plurality of first temporary grids according to the real-time average pixel value and a preset pixel threshold comprises:

[0152] When the real-time average pixel value is greater than the preset pixel threshold, the grid to be determined is determined to be a first temporary grid, and a plurality of first temporary grids are formed.

[0153] By comparing the real-time average pixel value with the preset pixel threshold, it is determined whether a certain grid to be determined is divided into the first temporary grid. When the real-time average pixel value is greater than the preset pixel threshold, the grid is determined to be the first temporary grid, and then several first temporary grids are formed. This process screens out key areas by setting the pixel value threshold, which is convenient for subsequent refined classification and feature extraction.

[0154] By setting the pixel value threshold, the area with significant features can be effectively extracted from the image, avoiding the interference of irrelevant or noise areas, and improving the accuracy and efficiency of subsequent analysis. By setting a reasonable pixel threshold, it can ensure that important areas are given priority during the recognition process, enhancing the accuracy of the classification results.

[0155] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

[0156] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A rice variety classification method based on hyperspectral pixel-level information, characterized in that: include: Obtaining the real-time average pixel value, real-time average reflectance and real-time average spectral angle of each grid to be determined in the rice hyperspectral image divided into a number of square grids; Determine a plurality of first temporary grids according to the real-time average pixel value and a preset pixel threshold; Determine a plurality of second temporary grids according to the real-time average reflectivity and the real-time average pixel value of each of the temporary grids; Determine a number of sample grids according to the real-time average spectral angles of any two adjacent second temporary grids; Determine the actual variety value according to the real-time average pixel value, the average reflectivity and the real-time average spectral angle of each of the sample grids; Obtaining pixel-level labels and spectral reflectances in the rice hyperspectral image, and inputting them into a preset classification model to obtain classified varieties; Determine the classification variety value according to the classification variety and the preset variety table; Adjust the preset pixel threshold according to the classified variety value and the actual variety value to form an adjusted pixel threshold; The rice variety is determined according to the preset variety table and the actual variety value determined based on the adjusted pixel threshold.

2. The rice variety classification method based on hyperspectral pixel-level information according to claim 1, characterized in that: Determining a plurality of second temporary grids according to the real-time average reflectivity and the real-time average pixel value of each temporary grid comprises: Calculating the standard deviation of the real-time average reflectivity within a preset first determined time period to form a reflection fluctuation value; Calculating the standard deviation of the real-time average pixel value within the preset first determined time period to form a pixel fluctuation value; A plurality of second temporary grids are determined according to the reflection fluctuation value and the pixel fluctuation value.

3. The rice variety classification method based on hyperspectral pixel-level information according to claim 2, characterized in that: Determining a plurality of second temporary grids according to the reflection fluctuation value and the pixel fluctuation value comprises: Draw a change curve according to the reflection fluctuation value within the preset first determined time period to form a reflection fluctuation curve; Draw a change curve according to the pixel fluctuation value within the preset first determined time period to form a pixel fluctuation curve; Calculating the cosine similarity of the reflection fluctuation curve and the pixel fluctuation curve to form a change consistency; When the change consistency is greater than a preset consistency threshold, the first temporary grid is determined to be a second temporary grid, and a plurality of second temporary grids are formed.

4. The rice variety classification method based on hyperspectral pixel-level information according to claim 3, characterized in that: Determining a number of sample grids according to the real-time average spectral angles of any two adjacent second temporary grids comprises: Calculating the standard deviation of the relative deviation of the real-time average spectral angles of any two adjacent second temporary grids within a preset second determined time length to form a spectral angle deviation fluctuation value; When the spectral angle deviation fluctuation value is less than a preset spectral angle deviation fluctuation threshold, it is determined that the corresponding two second temporary grids are both sample grids to form a plurality of sample grids.

5. The rice variety classification method based on hyperspectral pixel-level information according to claim 4, characterized in that: Determining the actual variety value according to the real-time average pixel value, the average reflectivity, and the real-time average spectral angle of each sample grid comprises: The real-time average pixel value, the average reflectivity, the real-time average spectral angle, the preset pixel value weight, the reflectivity weight and the angle weight are weighted and summed to form an actual variety value.

6. The rice variety classification method based on hyperspectral pixel-level information according to claim 5, characterized in that: The pixel-level labels and spectral reflectance in the rice hyperspectral image are obtained and input into a preset classification model to obtain the classified varieties including: Performing black and white calibration correction on the rice hyperspectral image to form a calibration image; Acquire a single binary mask of the calibration image that includes only rice sample pixel regions; Assigning corresponding variety category labels to the rice sample pixel regions in the binary mask; Extracting the spectral reflectance of each pixel point in the rice sample pixel area by a preset extraction model; Inputting the variety category label and the spectral reflectance into a preset classification model to obtain a number of undetermined varieties; The undetermined variety containing the most pixels is determined to be the classified variety.

7. The rice variety classification method based on hyperspectral pixel-level information according to claim 6, characterized in that: Determining the classification variety value according to the classification variety and the preset variety table includes: Select the preset variety value corresponding to the classification variety in the preset variety table as the classification variety value.

8. The rice variety classification method based on hyperspectral pixel-level information according to claim 7, characterized in that: Adjusting the preset pixel threshold according to the classified variety value and the actual variety value to form the adjusted pixel threshold comprises: Calculating the relative deviation between the classified variety value and the actual variety value to form a variety deviation value; The preset pixel threshold is adjusted according to the variety deviation value to form an adjusted pixel threshold.

9. The rice variety classification method based on hyperspectral pixel-level information according to claim 8, characterized in that: The preset pixel threshold is adjusted according to the variety deviation value, and the adjusted pixel threshold comprises: Calculate the standard deviation of the variety deviation value within the preset adjustment determination time to form the variety deviation fluctuation value; When the variety deviation fluctuation value is greater than the preset variety deviation fluctuation threshold, the preset pixel threshold is increased according to the relative deviation between the variety deviation fluctuation value and the preset variety deviation fluctuation threshold and the preset adjustment coefficient to form an adjusted pixel threshold.

10. The rice variety classification method based on hyperspectral pixel-level information according to claim 9, characterized in that: Determining a plurality of first temporary grids according to the real-time average pixel value and a preset pixel threshold comprises: When the real-time average pixel value is greater than the preset pixel threshold, the grid to be determined is determined to be a first temporary grid, and a plurality of first temporary grids are formed.

Citation Information

Patent Citations

  • Crop classification method based on remote sensing image data

    CN115761518A

  • Hyperspectral image segmentation method based on spectral reflectivity curve correlation difference

    CN115689950A

  • Waterweed coverage detection method based on airborne hyperspectrum

    CN118691989A

  • Crop identification method based on multispectral satellite image

    CN118736436A

  • Method and system for identification and classification of different grain and adulterant types

    EP4125053A1