A rice variety classification method based on hyperspectral pixel-level information

By acquiring the real-time features of the hyperspectral image and dynamically adjusting the pixel threshold, the problems of insufficient classification accuracy and poor adaptability of rice varieties in the prior art are solved, and high-precision rice varieties recognition is achieved.

CN119942223BActive Publication Date: 2025-08-12BEIJING FORESTRY UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The reliance of the prior art on static remote sensing data and lower resolution images leads to insufficient classification accuracy and poor adaptability of rice varieties, which cannot reflect crop growth status and environmental changes in real time.

Method used

By obtaining the real-time average pixel value, reflectivity and spectral angle of the hyperspectral image, dynamically adjusting the pixel threshold, combining weighted sum and preset variety tables, the classification model is optimized to adapt to different environments and conditions.

Benefits of technology

It realizes high-precision rice variety classification under different environments and conditions, reduces misclassification, improves the robustness and adaptability of the classification model, and enhances the recognition ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942223B_ABST
    Figure CN119942223B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and in particular to a rice variety classification method based on hyperspectral pixel-level information, comprising the following steps: acquiring pixel data from a hyperspectral image; determining a first temporary grid based on pixel values; determining a second temporary grid based on reflectivity; determining a sample grid based on spectral angle; acquiring pixel-level labels and spectral reflectivity and performing variety classification; and adjusting pixel thresholds and determining the variety based on the classification results. The present invention effectively distinguishes different rice varieties through multi-level image processing and feature extraction steps. By extracting features such as real-time average pixel values, reflectivity, and spectral angles, it accurately captures subtle differences in rice. The dynamic adjustment of pixel thresholds, combined with variety deviation and fluctuation analysis, automatically optimizes classification accuracy under different sampling environments and conditions, effectively addressing the issues of insufficient classification accuracy and poor adaptability caused by reliance on static remote sensing data and lower-resolution imagery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Rice, as an important food crop in agricultural production, is crucial for crop management and planting strategies. With the development of remote sensing and hyperspectral imaging technologies, the use of hyperspectral image data for crop variety identification has become a trend. Hyperspectral imaging provides spectral information for each pixel. Through hyperspectral image processing, more detailed features can be obtained, providing new technical means for variety classification, quality assessment, and production management in the agricultural sector.

[0003] Patent document with publication number CN115761518A discloses a crop classification method based on remote sensing image data, which 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 through wavelet transform; S22, segmenting the remote sensing image data according to the amplitude of each spectral band to obtain multiple segmented areas; S23, obtaining 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 crop classification model is trained using a loss function, 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 status 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 during the crop growth process in time, affecting the accuracy and timeliness of 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 existing technology 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 objectives, the present invention provides a rice variety classification method based on hyperspectral pixel-level information, comprising:

[0007] Obtain 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 several 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 an 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;

[0012] Obtaining pixel-level labels and spectral reflectances from 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] Adjusting 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 includes:

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

[0018] Calculating a 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] Furthermore, determining a plurality of second temporary grids according to the reflection fluctuation value and the pixel fluctuation value includes:

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

[0022] Drawing 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] Furthermore, 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 period 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, forming a plurality of sample grids.

[0028] Furthermore, 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, 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:

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

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

[0033] Assigning a corresponding variety category label to the rice sample pixel area 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] Furthermore, 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] Furthermore, adjusting the preset pixel threshold according to the classified variety value and the actual variety value to form the adjusted pixel threshold includes:

[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] Furthermore, 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] Furthermore, 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 existing technology, the beneficial effect of the present invention is that it can effectively distinguish different rice varieties through multi-level image processing and feature extraction steps, which has significant advantages. First, by extracting features such as real-time average pixel value, reflectivity and spectral angle, it can accurately capture the subtle differences in rice, 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, 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.

[0048] Furthermore, by calculating the fluctuations in reflectance and pixel values, grids affected by instability and noise 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 characteristics 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.

[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, through a weighted summation approach, the impact of different features on the final variety value can be flexibly adjusted, making the model more realistic and improving the accuracy of variety classification. Using a weighted approach, a higher weight can be assigned to a feature based on actual needs, optimizing classification results and improving the system's robustness and adaptability in complex environments.

[0052] Furthermore, by performing black-and-white calibration on the image, errors caused by environmental variations or equipment limitations can be effectively reduced, improving image accuracy and stability. Extracting spectral spatial features can more comprehensively reflect the characteristics of rice varieties and enhance the recognition capabilities of the classification model. Finally, by selecting the candidate variety containing the most pixels as the classification result, classification accuracy can be improved, the probability of misclassification can be reduced, and 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 accommodate the deviations between different varieties, classification accuracy can be further improved. This method can effectively reduce the errors caused by inaccurate initial threshold settings, enhance the adaptability and accuracy of the model, and ensure that the classification results are more consistent 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 pixel thresholds, we can effectively extract regions with significant features from the image, avoiding interference from irrelevant or noisy areas and improving the accuracy and efficiency of subsequent analysis. By setting reasonable pixel thresholds, we can ensure that important regions are prioritized during the recognition process, enhancing the accuracy of classification results. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 Flowchart of the rice variety classification method based on hyperspectral pixel-level information in this embodiment;

[0058] Figure 2 This is 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 in FIG. , it is a decision logic diagram for determining whether to increase 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 merely used to explain the present invention and are not intended 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 scope of protection 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 in this embodiment;

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

[0065] Obtain 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 several 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 an 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;

[0070] Obtaining pixel-level labels and spectral reflectances from 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] Adjusting 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 for each grid to be determined within a rice hyperspectral image first requires preprocessing the hyperspectral image, dividing it into several square grids, each covering a specific area. Next, by statistically analyzing the pixels within each grid, the real-time average pixel value for each grid is calculated, reflecting the brightness or color information of that area. Next, using the spectral data of each pixel in the hyperspectral image, the real-time average reflectance of that grid is calculated, reflecting the spectral response characteristics of that area. Finally, by analyzing the spectral angles of the pixels within each grid, the real-time average spectral angle is calculated to characterize the spectral similarity or difference within that area. In this way, the spectral spatial characteristics of each grid are 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 actual application requirements, and is typically set between 50 and 200. In this embodiment, it is set to 150 to ensure that the spectral data of the selected grid is sufficiently representative, avoid background noise interference, and optimize the accuracy of species classification.

[0076] By obtaining the real-time average pixel value, reflectivity, and spectral angle information for 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 based on the preset pixel threshold, and the second temporary grid is further determined based on the fluctuation of reflectivity and pixel value. Subsequently, the sample grids are screened by comparing the spectral angles of adjacent grids. The features of these sample grids are combined in a weighted manner to calculate the actual variety value. Next, the variety is classified using a 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, it is possible to effectively distinguish different rice varieties, which has significant advantages. First, by extracting features such as real-time average pixel value, reflectivity, and spectral angle, it can accurately capture subtle differences in rice, avoiding the problem of traditional classification methods being overly dependent on specific varieties. Second, 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 imagery.

[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 includes:

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

[0080] Calculating a 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 determination 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 over a predetermined first duration is calculated to obtain the reflectivity fluctuation value. Simultaneously, the standard deviation of the real-time average pixel value is calculated to obtain the pixel fluctuation value. Next, by combining the reflectivity fluctuation and pixel fluctuation values, the temporary grids are determined to be classified as the second temporary grid. This allows for further screening of consistent and stable grids, which serve as the basis for the next step in product classification.

[0084] By calculating the fluctuations in reflectance and pixel values, the grids affected by instability and noise 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] Drawing a change curve according to the reflection fluctuation value within the preset first determined time period to form a reflection fluctuation curve;

[0088] Drawing 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. It can avoid excessive grid division while ensuring a high similarity, thereby improving classification accuracy and reducing misjudgment.

[0092] First, based on a preset first determined duration, the reflection fluctuation value and the pixel fluctuation value are calculated and plotted as reflection fluctuation curves and pixel fluctuation curves. Next, the cosine similarity of these two curves is calculated to obtain the change consistency. If the change consistency exceeds a preset consistency threshold, the reflection fluctuation and pixel fluctuation are considered to have a high degree of similarity, and the grid is determined to be a second temporary grid. Based on this determination, several second temporary grids are formed.

[0093] By utilizing the consistency of reflection fluctuations and pixel fluctuations, areas with similar spectral characteristics can be accurately identified, and misjudgment can be reduced by setting the 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 period 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, forming 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 used to judge whether the spectral angle change of two adjacent grids is small enough to determine whether they belong to the same type of sample grids. It depends on the range of spectral angle change and the accuracy and noise level of 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 standard deviation of the relative 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 a 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, thus 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 fundamental 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 account for the effect of spectral angle on variety classification when calculating the actual variety value. It depends on the contribution of spectral angle to variety classification and is typically set between 0 and 1. In this example, it is set to 0.3. This is because angle can provide effective information for distinguishing different rice varieties, but its influence is less significant than that of pixel value and reflectance. Therefore, a lower weight is assigned to it, resulting in more accurate variety classification.

[0107] The real-time average pixel value, average reflectance, and real-time average spectral angle of each sample grid are obtained. These spectral data are then combined with preset pixel value weights, reflectance weights, and angle weights for a weighted summation. This weighted summation process is designed to fully account for the influence of different characteristics, resulting in a comprehensive actual variety value. This actual variety value accurately reflects the spectral characteristics of the rice variety in the grid, providing precise data support for subsequent variety classification.

[0108] By using a weighted summation approach, we can flexibly adjust the impact of different features on the final variety value, making the model more realistic and improving the accuracy of variety classification. Using a weighted approach, we can assign higher weights to specific features based on actual needs, optimizing classification results and improving the system's robustness and adaptability 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] A single binary mask including only rice sample pixel regions in the calibration image is obtained by Otsu threshold segmentation method;

[0112] Assigning a corresponding variety category label to the rice sample pixel area 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). It is trained by using pixel-level spectral data in hyperspectral images to learn the spectral characteristics of different rice varieties. In this embodiment, a simplified version of the ResNet structure is used, which uses fewer network layers and parameters to improve computational efficiency while maintaining high classification accuracy. After optimization, this model can effectively handle rice variety classification tasks, especially when performing pixel-level classification of hyperspectral images, with good performance and fast response speed.

[0117] Pixel-level spectral data refers to the pixel-level labels and the spectral reflectance of the pixel points in the rice sample pixel area. The pixel-level spectral data is obtained as follows:

[0118] The rice hyperspectral image is preprocessed and subjected to black-and-white calibration to generate a calibrated image. Next, the Otsu threshold segmentation method is used to obtain a binary mask containing the rice sample pixel region. This process accurately isolates the rice sample region from the image and removes background noise.

[0119] After obtaining a binary mask for the rice sample area, the algorithm assigns a corresponding variety label to each pixel based on known rice variety information. Simultaneously, a pre-defined extraction model is used to extract the spectral reflectance of each pixel in the rice sample area. This spectral reflectance data represents the reflectance 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 fed into a pre-trained classification model (such as a lightweight residual network (ResNet)) that has been trained to handle rice variety classification. By learning the spectral characteristics of different rice varieties, the model can classify them based on the input pixel-level spectral data and identify several candidate varieties. Ultimately, the variety containing the most pixels among the candidate varieties is selected as the candidate, achieving accurate classification of the rice variety.

[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 designed to automatically select the optimal threshold by maximizing the between-class variance, thereby effectively binarizing the image. Its core idea is to classify the image's grayscale histogram into two classes: class 1 (pixels with grayscale values less than a threshold t) and class 2 (pixels with grayscale values greater than a threshold t). For each potential threshold t, the class probability is calculated, representing 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 segmentation of the background and rice grains, including some very small mis-segmented pixels. These mis-segmented pixels were then accurately corrected through manual visual inspection, ultimately resulting in a precise binary segmentation result.

[0124] The purpose of performing black and white calibration correction on the rice hyperspectral image is to eliminate the experimental errors generated during the light intensity unevenness and 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, thereby removing 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 this 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 from images that can reflect the differences in rice varieties. 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 convolution layers. Each convolution 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 richer and more efficient features for subsequent variety classification.

[0126] First, a black-and-white calibration correction is performed on the rice hyperspectral image to eliminate image deviations caused by lighting variations and equipment errors, thereby obtaining a more accurate calibration image. A pre-set extraction model is then used to extract the spectral spatial features of each pixel in the calibration image, ensuring that the extracted features fully represent the image's spectral information. These spectral spatial features are then input into a pre-set classification model to generate several candidate varieties. The candidate variety containing the most pixels is ultimately determined as the classified variety.

[0127] By calibrating the image to black and white, errors caused by environmental variations or equipment limitations can be effectively reduced, improving image accuracy and stability. Extracting spectral spatial features can more comprehensively reflect the characteristics of rice varieties and enhance the recognition capabilities of the classification model. Finally, by selecting the candidate variety containing the most pixels as the classification result, classification accuracy can be improved, the probability of misclassification 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 associated characteristics. It is typically constructed by experts based on actual variety data and experimental results, depending on the sample varieties used and their characteristics. It is typically set to include all possible variety categories, with the number of varieties in the table depending on the requirements of the classification task. In this example, the preset variety table includes 10 major rice varieties. This setup ensures that the characteristics of different rice varieties are covered, ensuring the applicability and accuracy of the classification model.

[0131] Preset variety values refer to the standardized characteristic values or reference values corresponding to each variety in the preset variety table. These values are set based on historical data or experimental results. Preset variety values generally depend on the variety's spectral characteristics and spatial information and are usually set between 0 and 1 for standardization.

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

[0133]

[0134]

[0135] Based on the classification variety obtained by the classification model, the preset variety value corresponding to the variety in the preset variety table is searched to determine the final classification variety value. This process ensures the consistency of the results by comparing the classification results with the standard variety data table and selecting the most matching variety value.

[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] Based on 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. The preset pixel threshold is then adjusted based on this variety deviation value to form a new adjusted pixel threshold. This adjustment process, by dynamically adjusting the pixel threshold, ensures that the classification model can more accurately identify the characteristics of different rice varieties.

[0141] By adjusting the preset pixel threshold to accommodate variations between varieties, classification accuracy can be further improved. This method effectively reduces errors caused by inaccurate initial threshold settings, enhances the model's adaptability and accuracy, and ensures that classification results are more consistent with 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. 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 variety deviation fluctuation value. It 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 overly 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 when the deviation fluctuation value is large, the model is adjusted to avoid 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] Based on 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. The preset pixel threshold is then adjusted based on this variety deviation value to form a new adjusted pixel threshold. This adjustment process dynamically adjusts the pixel threshold to ensure that the classification model can more accurately identify the characteristics of different rice varieties.

[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 a preset pixel threshold, a decision is made as to whether a particular grid should be classified as a first provisional grid. When the real-time average pixel value exceeds the preset pixel threshold, the grid is determined to be a first provisional grid, and several first provisional grids are then formed. This process uses pixel thresholds to identify key areas, facilitating subsequent refined classification and feature extraction.

[0154] By setting pixel thresholds, we can effectively extract regions with significant features from an image, avoiding interference from irrelevant or noisy regions and improving the accuracy and efficiency of subsequent analysis. By setting reasonable pixel thresholds, we can ensure that important regions are prioritized during the recognition process, enhancing the accuracy of classification results.

[0155] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.

[0156] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that the present invention is susceptible to various modifications and variations. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A rice variety classification method based on hyperspectral pixel-level information, characterized in that: include: Obtain 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 several 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 an 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; Obtaining pixel-level labels and spectral reflectances from 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; Adjusting the preset pixel threshold according to the classified variety value and the actual variety value to form an adjusted pixel threshold; determining a rice variety according to the preset variety table and an actual variety value determined based on the adjusted pixel threshold; 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, determining that the grid to be determined is a first temporary grid, and forming a plurality of first temporary grids; 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 a standard deviation of the real-time average reflectivity within a preset first determined time period to form a reflection fluctuation value; Calculating a standard deviation of the real-time average pixel value within the preset first determined time period to form a pixel fluctuation value; Drawing a change curve according to the reflection fluctuation value within the preset first determined time period to form a reflection fluctuation curve; Drawing 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.

2. The rice variety classification method based on hyperspectral pixel-level information according to claim 1, characterized in that: Determining a number of sample grids according to the real-time average spectral angles of any two adjacent second temporary grids includes: 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 period 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, forming a plurality of sample grids.

3. The rice variety classification method based on hyperspectral pixel-level information according to claim 2, 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 includes: 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.

4. The rice variety classification method based on hyperspectral pixel-level information according to claim 3, characterized in that: Obtain pixel-level labels and spectral reflectances from the rice hyperspectral image and input them into a preset classification model to obtain the following classified varieties: Performing black and white calibration correction on the rice hyperspectral image to form a calibration image; obtaining a single binary mask in the calibration image that includes only rice sample pixel regions; Assigning a corresponding variety category label to the rice sample pixel area 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.

5. The rice variety classification method based on hyperspectral pixel-level information according to claim 4, 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.

6. The rice variety classification method based on hyperspectral pixel-level information according to claim 5, 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 includes: 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.

7. The rice variety classification method based on hyperspectral pixel-level information according to claim 6, characterized in that: Adjusting the preset pixel threshold according to the variety deviation value to form the adjusted pixel threshold includes: 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.

Citation Information

Patent Citations

  • Crop classification method based on remote sensing image data

    CN115761518A

  • Crop identification method based on multispectral satellite image

    CN118736436A

  • Method for classifying hyperspectral images on basis of adaptive multi-scale feature extraction model

    WO2022160771A1