A method and system for classifying japonica rice seeds based on support vector machines

By integrating elite optimization strategies and hidden mechanisms to improve the rime ice optimization algorithm and optimizing support vector machine parameters, the problem of reduced classification accuracy of rice and japonica rice seeds was solved, achieving higher classification accuracy and robustness.

CN121505461BActive Publication Date: 2026-03-24JILIN AGRICULTURAL UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, the reliance on experience to select support vector machine parameters leads to a decrease in the accuracy of rice and japonica rice seed classification, making it impossible to find the optimal solution.

Method used

An improved rime optimization algorithm is adopted by combining elite optimization strategy and hidden mechanism. The penalty coefficient and kernel function parameters of support vector machine are optimized, and a mapping law is designed to perform iterative optimization to generate the optimal solution.

Benefits of technology

It improves the accuracy and robustness of rice and japonica rice seed classification, enhances the algorithm's global exploration and adaptive adjustment capabilities, and avoids the blindness of manual parameter tuning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121505461B_ABST
    Figure CN121505461B_ABST
Patent Text Reader

Abstract

A rice japonica seed classification method and system based on a support vector machine belong to the technical field of computing intelligence and optimization algorithm, and solve the technical problem that the existing technology depends on experience to select support vector machine parameters, thus missing the optimal solution to the problem, resulting in reduced rice japonica seed classification accuracy. High spectral image data of rice japonica seeds is collected; based on a fusion elite optimization strategy, a fog optimization algorithm is initialized to generate an initial solution; a hidden mechanism is used to improve the greedy strategy for population updating; the improved fog optimization algorithm is used to optimize the penalty coefficient and kernel function parameters in the support vector machine, and a mapping rule is designed to iteratively optimize the kernel function in the support vector machine to obtain an optimal solution; the optimal solution is set as the support vector machine parameters, a rice japonica seed variety classification model is constructed, and rice japonica seed variety classification is realized. The present application is used to realize efficient and accurate rice japonica seed classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computational intelligence and optimization algorithm technology, specifically to a method and system for classifying rice and japonica rice seeds based on support vector machines. Background Technology

[0002] Ensuring the safety of germplasm resources is of great significance for sustainable agricultural development and ecological balance. Rapid and non-destructive variety identification is crucial for screening japonica rice seeds for different uses, such as food, feed, and breeding.

[0003] Currently, machine learning technology has been widely applied in the field of rice seed variety classification for tasks such as variety identification, disease detection, growth status assessment, and suitable planting area recommendation. The mainstream methods include support vector machines, random forests, and convolutional neural networks, which, combined with UAV imagery, hyperspectral data, or field images, achieve high accuracy.

[0004] In recent years, with the increasing maturity of artificial intelligence technology, scholars have attempted to apply it to rice seed variety classification tasks to establish a complex nonlinear mapping relationship between seed phenotypic features and variety categories. Among these techniques, Support Vector Machines (SVMs) have received widespread attention due to their solid theoretical foundation and excellent classification performance. Numerous studies have shown that SVM-based rice seed variety classification methods can effectively distinguish different varieties under various feature inputs (such as image color, texture, morphological parameters, spectral information, etc.), exhibiting high classification accuracy and good generalization ability on small or medium-sized datasets. For example, SVM models combined with gray-level co-occurrence matrices, HOG features, or principal component analysis for dimensionality reduction have achieved good results in classification tasks such as indica rice versus japonica rice, and hybrids versus conventional varieties.

[0005] However, this field still faces significant challenges: First, the phenotypic differences among rice seed varieties are subtle, especially among closely related varieties or hybrid offspring with highly similar appearances. Relying solely on artificially designed low-dimensional features (such as aspect ratio, mean color, etc.) is insufficient to fully represent discriminative information. Second, SVM itself has limited modeling capabilities for high-dimensional and nonlinear features, and the choice of kernel function is sensitive to performance, lacking an adaptive optimization mechanism. Third, there are many interfering factors in the field or actual sorting environment, such as light, background, and seed posture, which lead to a decrease in the robustness of extracted features and limit the generalization ability of SVM models.

[0006] In traditional machine learning models, much research focuses on Support Vector Machines (SVMs), utilizing swarm intelligence algorithms to optimize their penalty parameter C and kernel function parameter gamma. While the Frost Optimization algorithm demonstrated superior or comparable performance to other algorithms in its initial paper, it also suffers from inherent drawbacks and limitations, a common problem with all metaheuristic algorithms and due to its own design characteristics. According to the "no free lunch" theorem, no optimization algorithm can perform optimally on all possible problems. Although the algorithm employs soft / hard frosting mechanisms to balance exploration and exploitation, it may still prematurely converge to a non-global local optimum when dealing with complex multimodal functions with numerous local optima. Once most "condensed particles" cluster in a local optimum region, the algorithm may lack an effective mechanism to escape this region. Furthermore, in the later stages of iteration, when the search region is concentrated near the global optimum, the algorithm merely employs a greedy, piercing mechanism, which may not be efficient enough in terms of exploitation, leading to slower convergence and requiring more function evaluations to achieve higher accuracy.

[0007] In the prior art, Chinese patent document CN114298208A discloses a "Support Vector Machine Parameter Optimization Algorithm for Transformer Fault Diagnosis." However, this technical solution uses fixed kernel function parameters, which are not applicable to all data distributions. It cannot find the truly optimal parameter combination, lacks adaptive adjustment capabilities, and is difficult to handle complex datasets. If directly applied to rice seed variety classification tasks, the fixed use of kernel functions may prevent the model from fully exploring and adapting to the discriminative characteristics of the data itself, thereby limiting further improvements in classification accuracy and robustness.

[0008] In summary, existing technologies suffer from the problem of missing the optimal solution to the problem due to reliance on experience in selecting support vector machine parameters, leading to a decrease in the accuracy of rice and japonica rice seed classification. Summary of the Invention

[0009] This invention solves the technical problem that existing technologies, due to their reliance on experience in selecting support vector machine parameters, miss the optimal solution to the problem, leading to a decrease in the accuracy of rice and japonica rice seed classification.

[0010] The present invention discloses a rice seed classification method based on support vector machine, comprising the following steps:

[0011] Step 1: Collect hyperspectral image data of japonica rice seeds as sample input;

[0012] Step 2: Based on the fusion elite optimization strategy, initialize the rime optimization algorithm and generate an initial solution;

[0013] Step 3: Based on the initial solution, the population is updated by using a hidden generation mechanism to improve the greedy strategy, resulting in an improved rime optimization algorithm;

[0014] Step 4: Optimize the penalty coefficient and kernel function parameters in the support vector machine using the improved rime optimization algorithm, and design a mapping rule to iteratively optimize the kernel function in the support vector machine to obtain the optimal solution;

[0015] Step 5: Set the optimal solution as the parameters of the support vector machine, construct a rice and japonica rice seed variety classification model, input samples, and realize the classification of rice and japonica rice seed varieties.

[0016] Furthermore, in one embodiment of the present invention, step 2, which initializes the rime optimization algorithm based on the fusion elite optimization strategy, specifically involves:

[0017] Elite individuals are selected using an elite population. Based on these elite individuals and the rime population in the rime optimization algorithm, a new rime population is generated for searching to obtain an initial solution.

[0018] Furthermore, in one embodiment of the present invention, step 3 employs a hidden mechanism to improve the greedy strategy for population renewal, specifically as follows:

[0019] The maximum record value allowed for recording an individual's historical position is N. During the iterative optimization process, the variable a=0 is set for each individual. In the (N+1)th iteration, the hidden generation mechanism is executed. If the current individual's optimal value is greater than the recorded optimal value of the historical individual, then a=a+1 is updated. When a=record, the global optimal individual is replaced at the current individual's position. If a>record, the resurrection optimal individual is triggered to replace the current individual.

[0020] Furthermore, in one embodiment of the present invention, step 4 uses C, gamma, and kernel of the support vector machine as three dimensions, and uses an improved rime optimization algorithm to iteratively optimize the kernel function in the support vector machine. The F1 score in the classification result is used as the objective function to evaluate the result. After the iteration is completed, the solution with the highest F1 score is taken as the optimal solution.

[0021] Furthermore, in one embodiment of the present invention, the mapping rule in step 4 is as follows:

[0022] ;

[0023] in, To round down, The value of the kernel function variable. The final kernel function types are sigmoid, rbf, poly, and linear, which are the four types of kernel functions.

[0024] The present invention discloses a rice seed classification system based on support vector machines, comprising the following steps:

[0025] The data acquisition module collects hyperspectral image data of rice and japonica rice seeds as sample input;

[0026] The initialization module initializes the rime optimization algorithm based on the fusion elite optimization strategy and generates an initial solution;

[0027] The improved module, based on the initial solution, adopts a hidden mechanism to improve the greedy strategy for population update, resulting in an improved rime optimization algorithm;

[0028] The optimization module uses an improved rime optimization algorithm to optimize the penalty coefficient and kernel function parameters in the support vector machine, and designs a mapping rule to iteratively optimize the kernel function in the support vector machine to obtain the optimal solution;

[0029] The classification module sets the optimal solution as the parameters of the support vector machine, constructs a classification model for rice and japonica rice seed varieties, and inputs samples to achieve the classification of rice and japonica rice seed varieties.

[0030] The present invention provides a computer program product comprising a computer program or instructions which, when executed by a processor, implement any of the above-described methods for classifying rice and japonica rice seeds based on support vector machines.

[0031] The electronic device of the present invention includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus.

[0032] Memory, used to store computer programs;

[0033] The processor, when executing the program stored in the memory, implements any of the above-described rice and japonica rice seed classification methods based on support vector machines.

[0034] The present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described rice and japonica rice seed classification methods based on support vector machines.

[0035] This invention solves the technical problem in existing technologies where the reliance on experience in selecting support vector machine parameters leads to missed optimal solutions to the problem, resulting in reduced accuracy in rice and japonica rice seed classification. Specific beneficial effects include:

[0036] 1. This invention proposes a rice and japonica rice seed classification method based on support vector machine. From the initialization of the algorithm, the original population is optimized by using an elite population, so that the algorithm can generate a better quality population in the initial stage, which guides the search direction of the algorithm in the solution space. The hidden mechanism is adopted to improve the greedy selection strategy, thereby ensuring that the entire population has global exploration ability. At the same time, individuals can be replaced under specific conditions, which effectively guarantees the quality of the population. A mapping law is also designed to optimize the hyperparameters in the support vector machine, avoiding the technical problem of missing the optimal solution to the problem due to the reliance on experience to select the support vector machine parameters, which leads to a decrease in the accuracy of rice and japonica rice seed classification.

[0037] 2. This invention proposes a rice and japonica rice seed classification method based on support vector machine. By introducing an elite population to optimize the original population, the search direction is actively guided, and a high-quality population is generated in the initial stage of the algorithm, which significantly improves the search efficiency of the solution space and lays the foundation for subsequent optimization steps, thereby improving the algorithm framework.

[0038] 3. This invention proposes a rice and japonica rice seed classification method based on support vector machine. By using a dormant mechanism, it retains the local optimization ability of the greedy strategy and enhances the global search ability through dynamic exploration and development balance. It solves the problem that traditional hoarse rice optimization algorithm is prone to getting trapped in local optima. The biological dormancy mechanism is introduced into the algorithm design, which realizes the synergistic improvement of population diversity and convergence. It allows individuals to be replaced under specific conditions, avoids the accumulation of inferior individuals, breaks through the limitation of fixed population size, and deeply couples the adaptive adjustment mechanism with genetic operations to form a closed-loop optimization system.

[0039] 4. This invention proposes a rice and japonica rice seed classification method based on support vector machine. By designing mapping rules, the selection of support vector machine parameters is transformed from experience-dependent to mathematically driven optimization, establishing an explicit correlation between parameter space and performance indicators, thus avoiding the blindness of manual parameter tuning. Attached Figure Description

[0040] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0041] Figure 1 This is a flowchart of the ICRIME optimization of SVM hyperparameters as described in Implementation Method 1;

[0042] Figure 2 This is a schematic diagram of the fusion elite optimization strategy described in Implementation Method 2;

[0043] Figure 3 This is a schematic diagram of the convergence curves of different algorithms under the F5, F13 and F20 test functions described in Implementation Method 6;

[0044] Figure 4 This is a schematic diagram of the convergence curves of different algorithms under the F8, F18 and F23 test functions described in Implementation Method Six;

[0045] Figure 5 This is a schematic diagram of the convergence curves of different algorithms under the F15, F19 and F24 test functions described in Implementation Method 6;

[0046] Figure 6 This is a schematic diagram of the accuracy curves of the unimproved rime optimization algorithm and the improved rime optimization algorithm described in Implementation Method 10 after 150 rounds.

[0047] Figure 7 This is a schematic diagram of the confusion matrix described in Implementation Method 10. Detailed Implementation

[0048] Various embodiments of the present invention will now be clearly and completely described with reference to the accompanying drawings. The embodiments described with reference to the drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0049] Implementation Method 1: A rice seed classification method based on support vector machine, comprising the following steps:

[0050] Step 1: Collect hyperspectral image data of japonica rice seeds as sample input;

[0051] Step 2: Based on the fusion elite optimization strategy, initialize the rime optimization algorithm and generate an initial solution;

[0052] Step 3: Based on the initial solution, the population is updated by using a hidden generation mechanism to improve the greedy strategy, resulting in an improved rime optimization algorithm;

[0053] Step 4: Optimize the penalty coefficient and kernel function parameters in the support vector machine using the improved rime optimization algorithm, and design a mapping rule to iteratively optimize the kernel function in the support vector machine to obtain the optimal solution;

[0054] Step 5: Set the optimal solution as the parameters of the support vector machine, construct a rice and japonica rice seed variety classification model, input samples, and realize the classification of rice and japonica rice seed varieties.

[0055] In existing technologies, regarding the optimization of hyperparameters in machine learning models using swarm intelligence algorithms, in 2023, Ling Han et al. utilized an improved particle swarm optimization algorithm to optimize the penalty factor C and the width parameter γ of the Gaussian radial basis kernel function of a support vector machine (SVM), solving the lithology classification problem of multi-source remote sensing data in semi-arid regions. In 2025, Issa Qiqieh et al. proposed an improved SVM model based on the Harris Eagle optimization algorithm to optimize C and γ, addressing the detection problem of various cybersecurity threats. Existing optimization methods all optimize C and γ in the SVM, often relying on manual experience to select the kernel function type. However, this leads to suboptimal optimization results because the actual result of hyperparameter optimization is a Cartesian product of C, γ, and the kernel function type. Manually determining the kernel function misses the optimal solution for the problem. While general optimization algorithms are suitable for continuous space problems and have good adaptability to the C and γ parameters of SVMs, this is not favorable for kernel functions. The reason is that there are generally four kernel functions to choose from: sigmoid, rbf, poly, and linear. The algorithm cannot map the continuous values ​​of the variable itself to one of these four kernel functions.

[0056] To solve the above problems, such as Figure 1 As shown, this embodiment proposes a rice and japonica rice seed classification method based on support vector machine. From the algorithm initialization, the original population is optimized using an elite population, enabling the algorithm to generate a higher-quality population in the initial stage, guiding the search direction in the solution space. A hidden generation mechanism is adopted to improve the greedy selection strategy, thereby ensuring that the entire population has global exploration capabilities. At the same time, individuals can be replaced under specific conditions, effectively ensuring the quality of the population. A mapping law is also designed to optimize the hyperparameters in the support vector machine, avoiding the technical problem of missing the optimal solution to the problem due to relying on experience to select support vector machine parameters, which would lead to a decrease in the accuracy of rice and japonica rice seed classification.

[0057] Implementation Method 2: This implementation method further defines the rice seed classification method based on support vector machine described in Implementation Method 1. In step 2, the rime ice optimization algorithm is initialized based on the fusion elite optimization strategy, specifically as follows:

[0058] Elite individuals are selected using an elite population. Based on these elite individuals and the rime population in the rime optimization algorithm, a new rime population is generated for searching to obtain an initial solution.

[0059] The initialization algorithm for rime ice uses a single rime ice population without drawing on much prior knowledge. To address this, we employ an elite preservation strategy to enable the population to learn from some superior individuals during the initialization phase, guiding it towards better optimization and improving the quality of the optimal solution.

[0060] In swarm intelligence optimization algorithms, the agent iterates through positions while searching for the optimal position. These previously iterated positions, relative to subsequent particles, are equivalent to prior knowledge. Numerous studies have shown that using prior knowledge to expertly adjust the agent's position can effectively enhance algorithm performance. The elite preservation strategy borrows this idea, optimizing the original population with an elite population from the algorithm's initialization stage. This allows the algorithm to generate a higher-quality population in the initial phase, guiding its search direction in the solution space.

[0061] like Figure 2 As shown, For the elite population, This refers to the first dimension of the first individual in an elite population. It refers to the nth dimension of the first individual in the elite population. This refers to the first dimension of the nth individual in the elite population. This refers to the nth dimension of the nth individual in the elite population; the entire matrix represents the initial generated... Population.

[0062] For the selected elite individuals, Represents the first individual selected from the elite population. Represents the i-th individual selected from the elite population, and the entire matrix represents the individual selected from the elite population. The set of selected individuals in a population.

[0063] It is a rime ice species. This refers to the first dimension of the first individual in the rime ice population. This refers to the nth dimension of the first individual in the rime ice population. This refers to the first dimension of the nth individual in the rime ice population. This refers to the nth dimension of the nth individual in the rime ice population. The entire matrix represents the rime ice population generated during initialization.

[0064] For the new rime ice species, the new rime ice species consists of the initial rime ice species. A portion and selected elite individuals composition.

[0065] Implementation Method 3: This implementation method further defines the rice seed classification method based on support vector machine described in Implementation Method 1. In step 3, a hidden mechanism is used to improve the greedy strategy for population update, specifically as follows:

[0066] The maximum record value allowed for recording an individual's historical position is N. During the iterative optimization process, the variable a=0 is set for each individual. In the (N+1)th iteration, the hidden generation mechanism is executed. If the current individual's optimal value is greater than the recorded optimal value of the historical individual, then a=a+1 is updated. When a=record, the global optimal individual is replaced at the current individual's position. If a>record, the resurrection optimal individual is triggered to replace the current individual.

[0067] The rime optimization algorithm uses a greedy strategy to replace and record the best fitness value and the best proxy individual after each update. A typical strategy is to compare the updated fitness value of the proxy individual with the current global optimum; if the updated value is better, the best fitness value is replaced and the proxy is recorded as the best individual. This type of operation is simple and efficient, but it does not contribute to the exploration and development process of the population; it only serves a recording purpose.

[0068] To address the aforementioned issues, this implementation method employs a hidden mechanism to improve the greedy strategy, thereby ensuring that the entire population possesses global exploration capabilities. On the other hand, individuals can be replaced under specific conditions, effectively guaranteeing population quality.

[0069] The cryptobiosis mechanism is inspired by the cryptobiosis phenomenon in mosses, which refers to the ability of mosses to recover and flourish after a period of dormancy or drought. Inspired by cryptobiosis, the cryptobiosis mechanism proposes a mechanism for recording individual historical information to improve greedy strategies.

[0070] The hidden generation mechanism pre-sets a `record` parameter, typically `record=10`, which is the maximum allowed number of historical positions for an individual. During iteration, for each individual, `a=0`. The hidden generation mechanism is executed starting on the 11th iteration. If the current individual's optimal value is better than the recorded optimal value of a historical individual, `a=a+1`. When `a=record`, it means there is no better historical position than the current individual's. In this case, the global optimal position replaces the current individual's position, enhancing global exploration capabilities. Furthermore, if `a>record` during iteration, this mechanism is triggered to revive the best individual and replace the current individual.

[0071] This implementation utilizes cryptobiosis to enable moss individuals to ensure the global exploration capability of the entire population, and individuals can be replaced under specific conditions, thus ensuring the quality of the population.

[0072] Implementation Method 4: This implementation method further defines the rice and japonica rice seed classification method based on support vector machine described in Implementation Method 1. In step 4, C, gamma, and kernel of the support vector machine are used as three dimensions. An improved hoarfrost optimization algorithm is used to iteratively optimize the kernel function in the support vector machine. The f1 score in the classification result is used as the objective function to evaluate the result. After the iteration is completed, the solution with the highest f1 score is taken as the optimal solution.

[0073] This implementation uses an improved algorithm to optimize the three hyperparameters of the support vector machine. ICRIME (an improved haze optimization algorithm) is suitable for problems in continuous spaces and has good adaptability to the C and gamma parameters of the support vector machine. However, this is not friendly to kernel functions because there are generally four kernel functions to choose from: sigmoid, rbf, poly, and linear. The algorithm cannot map the continuous values ​​of the variable itself to one of these four kernel functions.

[0074] To address the aforementioned technical problems, this implementation method designs a mapping rule, assuming that the value of the variable in the kernel function is... The mapping rule can be expressed by the following formula:

[0075] ;

[0076] in, To round down, The value of the kernel function variable. The range is between 0 and 4. The final kernel function types are sigmoid, rbf, poly, and linear, representing the four kernel function types. This mapping rule makes it easy to use algorithms to optimize the kernel function in a support vector machine.

[0077] This implementation uses C, gamma, and kernel as the three dimensions of the algorithm, uses ICRIME to optimize the hyperparameters in the support vector machine, and uses the F1 score in the classification results as the objective function of the algorithm to evaluate the results.

[0078] The F1 score is one of the metrics in classification experiment reports, which includes Precision and Recall. It uses a harmonic average method to consider both precision and recall, avoiding evaluation bias caused by a single metric.

[0079] f1Score=2×(Precision×Recall) / (Precision+Recall);

[0080] Using the F1 score as the objective function, a higher F1 score indicates that the hyperparameters found by the algorithm are better for the model.

[0081] Implementation Method 5: The rice seed classification system based on support vector machine described in this implementation method includes the following steps:

[0082] The data acquisition module collects hyperspectral image data of rice and japonica rice seeds as sample input;

[0083] The initialization module initializes the rime optimization algorithm based on the fusion elite optimization strategy and generates an initial solution;

[0084] The improved module, based on the initial solution, adopts a hidden mechanism to improve the greedy strategy for population update, resulting in an improved rime optimization algorithm;

[0085] The optimization module uses an improved rime optimization algorithm to optimize the penalty coefficient and kernel function parameters in the support vector machine, and designs a mapping rule to iteratively optimize the kernel function in the support vector machine to obtain the optimal solution;

[0086] The classification module sets the optimal solution as the parameters of the support vector machine, constructs a classification model for rice and japonica rice seed varieties, and inputs samples to achieve the classification of rice and japonica rice seed varieties.

[0087] Implementation Method Six: This implementation method further verifies the effects of the methods described in Implementation Methods One through Five. To more comprehensively demonstrate the superiority of ICRIME, it is compared with twelve well-known high-performance primitive algorithms, including RIME (Rime Algorithm), PSO (Particle Swarm Optimization Algorithm), WOA (Whale Algorithm), SCA (Sine and Cosine Algorithm), MFO (Moth to a Flame Algorithm), GWO (Grey Wolf Algorithm), BA (Bat Algorithm), DE (Differential Evolutionary Algorithm), SSA (Sparrow Search Algorithm), GOA (Grasshopper Algorithm), FA (Firefly Algorithm), and HHO (Harris Eagle Algorithm). Partial convergence curves of the thirteen algorithms are shown below. Figure 3 , Figure 4 and Figure 5As shown in the figure, the horizontal axis represents the number of function evaluations, and the vertical axis represents the best score obtained so far. F5, F8, F15, F13, F18, F19, F20, F23, and F24 are different test function numbers. As can be seen from the figure, ICRIME's convergence curve is at the bottom, meaning that ICRIME has the highest convergence accuracy among the 13 algorithms. Although ICRIME's convergence speed is not optimal, its exploration ability is superior to the other 12 algorithms, especially in mixed and combined functions, where it can find better solutions. Furthermore, ICRIME is better at escaping local optima and maintains a certain global search capability in the later stages of iteration. Overall, ICRIME demonstrates significant advantages in comparative experiments with the aforementioned classic algorithms and newer algorithms.

[0088] Implementation Method Seven: A computer program product according to this implementation method includes a computer program or instructions, characterized in that, when the computer program or instructions are executed by a processor, they implement any of the above-described rice and japonica rice seed classification methods based on support vector machines.

[0089] Implementation Method 8: An electronic device according to this implementation method includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus.

[0090] Memory, used to store computer programs;

[0091] The processor, when executing the program stored in the memory, implements any of the above-described rice and japonica rice seed classification methods based on support vector machines.

[0092] Implementation Method Nine: A computer-readable storage medium according to this implementation method, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any of the above-described rice and japonica rice seed classification methods based on support vector machines.

[0093] Implementation Method 10: This implementation method is a specific embodiment based on the methods described in Implementation Methods 1 to 5.

[0094] In rice seed variety classification tasks, if certain varieties differ significantly and are approximately linearly separable in morphological characteristics (such as aspect ratio, outline, and mean color), linear kernels often achieve better generalization performance with lower computational complexity. However, when there is a clear polynomial dependency between input features (such as combinations of hyperspectral reflectance bands), polynomial kernels may better fit the inherent structure of the data. Using a fixed kernel function may prevent the model from fully exploring and adapting to the discriminative characteristics of the data itself, thus limiting further improvements in classification accuracy and robustness. The selection of kernel functions and the optimization of parameters are often not simply a matter of "optimal + optimal = best," but rather finding the optimal combination in the Cartesian product of the kernel function and the optimized parameters. Furthermore, agronomy often provides prior knowledge about genetic or phenotypic relationships between varieties (such as the differentiation of indica and japonica subspecies and the relationship between hybrid parents). Using learnable kernel functions (such as custom kernels constructed based on similarity metrics) can embed this knowledge into the kernel matrix, while fixed kernel functions rely solely on Euclidean distance, making it difficult to incorporate expert knowledge and weakening the model's interpretability and credibility.

[0095] This implementation method selected nine varieties of japonica rice seeds with high appearance similarity. All seeds were obtained from the Rice Research Institute of the Jilin Academy of Agricultural Sciences, China. Approximately 200 seeds of each variety were included, resulting in a total dataset of about 1800 seeds, which were randomly divided into training and validation sets at an 8:2 ratio. During data collection, 200 rice seeds of the same category were first randomly selected and arranged in a 10 × 20 template. Then, without seed overlap or adhesion, they were inverted on a black translation stage and scanned by a hyperspectral camera to obtain hyperspectral images. This process was repeated until all hyperspectral images of the samples were obtained. Spectral features of the japonica rice seeds were extracted from the hyperspectral images, including the maximum, minimum, median, mode, and mean values ​​of the japonica rice seed spectra.

[0096] Comparative analysis revealed that the average value had the highest accuracy; therefore, the average spectrum was used for subsequent research. To improve the accuracy and reliability of the spectral data, the SG smoothing method was employed to reduce noise in the average spectrum while preserving the integrity of the spectral information to the greatest extent possible. Based on the noise reduction, the average spectrum underwent maximum-minimum normalization to make the differences between spectral features more apparent. Then, the SPA (Continuous Projection) algorithm was used to select the ten features that contributed most to the classification, thereby improving the performance and efficiency of the classification model while reducing the complexity of the features.

[0097] Finally, the hyperparameters of the SVM algorithm were optimized using a rime optimization algorithm based on an elite preservation strategy and a hidden generation mechanism. The algorithm parameters were set as follows: population size 30, dimension 3, and number of iterations 150.

[0098] Input: 10×1802 spectral images (10 features, 1802 rice spectral samples) are divided into training and test sets in a 7:3 ratio.

[0099] Output: Hyperspectral classification results for the test set.

[0100] like Figure 6 The figure shows the accuracy curves of the unimproved and improved frost optimization algorithms after 150 rounds. Figure 7 As shown in the figures, Figure (a) is the confusion matrix after optimizing the support vector machine using the ICRIME algorithm, Figure (b) is the confusion matrix after optimizing the support vector machine using the RIME algorithm, and Figure (c) is the confusion matrix of the support vector machine without any parameter settings. Comparing Figures (a) and (c), it can be seen that after optimizing the hyperparameters using the ICRIME algorithm, the classification performance of the support vector machine is significantly improved compared to before, with a substantial increase in classification accuracy for each category. Figures (a) and (b) also show that the performance of the ICRIME algorithm optimized using the elitist strategy and hidden mechanism is superior to that of the RIME algorithm. Its classification performance for varieties 1 to 8 is also improved.

[0101] Table 1 shows the classification reports of ICRIME-SVM, RIME-SVM, and SVM on nine rice varieties (e.g., Jing809, Jing812, etc.). Evaluation metrics include precision (P), recall (R), and f1 score. ICRIME-SVM performs exceptionally well, with significantly higher P, R, and f1 scores than RIME-SVM and traditional SVM in most categories, indicating that optimizing the three hyperparameters of SVM using the ICRIME algorithm has a clear advantage in classification tasks. The precision of ICRIME-SVM is generally above 0.91, reaching a maximum of 1.00 in three categories, indicating a very high proportion of truly positive samples among those predicted as positive. Similarly, ICRIME-SVM achieves a recall of 1.00 in multiple categories, demonstrating extremely strong positive example identification capabilities. Finally, ICRIME-SVM outperformed RIME-SVM and SVM in F1 scores across all categories, demonstrating the improvement of the algorithm and the superiority of using ICRIME to optimize the three hyperparameters in SVM.

[0102] Table 1. Classification reports before and after support vector machine optimization

[0103]

[0104] The optimal value found by ICRIME after 150 iterations is shown in Table 2.

[0105] Table 2 Results of ICRIME-optimized SVM hyperparameters

[0106]

[0107] The above provides a detailed description of the rice and japonica rice seed classification method and system based on support vector machine proposed in this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A rice seed classification method based on support vector machine, characterized in that, Includes the following steps: Step 1: Collect hyperspectral image data of japonica rice seeds as sample input; Step 2: Based on the fusion elite optimization strategy, initialize the rime optimization algorithm and generate an initial solution; Step 3: Based on the initial solution, the population is updated by using a hidden generation mechanism to improve the greedy strategy, resulting in an improved rime optimization algorithm; Step 4: Optimize the penalty coefficient and kernel function parameters in the support vector machine using the improved rime optimization algorithm, and design a mapping rule to iteratively optimize the kernel function in the support vector machine to obtain the optimal solution; Step 5: Set the optimal solution as the parameters of the support vector machine, construct a rice and japonica rice seed variety classification model, input samples, and realize the classification of rice and japonica rice seed varieties.

2. The rice seed classification method based on support vector machine according to claim 1, characterized in that, In step 2, the rime optimization algorithm is initialized based on the fusion elite optimization strategy, specifically as follows: Elite individuals are selected using an elite population. Based on these elite individuals and the rime population in the rime optimization algorithm, a new rime population is generated for searching to obtain an initial solution.

3. The rice seed classification method based on support vector machine according to claim 1, characterized in that, In step 3, a hidden mechanism is used to improve the greedy strategy for population renewal, specifically as follows: The maximum record value allowed for recording an individual's historical position is N. During the iterative optimization process, the variable a=0 is set for each individual. In the (N+1)th iteration, the hidden generation mechanism is executed. If the current individual's optimal value is greater than the recorded optimal value of the historical individual, then a=a+1 is updated. When a=record, the global optimal individual is replaced at the current individual's position. If a>record, the resurrection optimal individual is triggered to replace the current individual.

4. The rice seed classification method based on support vector machine according to claim 1, characterized in that, Step 4 uses C, gamma, and kernel of the support vector machine as three dimensions, and uses an improved frost optimization algorithm to iteratively optimize the kernel function in the support vector machine. The F1 score in the classification result is used as the objective function to evaluate the result. After the iteration is completed, the solution with the highest F1 score is taken as the optimal solution.

5. The rice seed classification method based on support vector machine according to claim 1, characterized in that, The mapping rule in step 4 is as follows: ; in, To round down, The value of the kernel function variable. The final kernel function types are sigmoid, rbf, poly, and linear, which are the four types of kernel functions.

6. A rice seed classification system based on support vector machine, characterized in that, Includes the following steps: The data acquisition module collects hyperspectral image data of rice and japonica rice seeds as sample input; The initialization module initializes the rime optimization algorithm based on the fusion elite optimization strategy and generates an initial solution; The improved module, based on the initial solution, adopts a hidden mechanism to improve the greedy strategy for population update, resulting in an improved rime optimization algorithm; The optimization module uses an improved rime optimization algorithm to optimize the penalty coefficient and kernel function parameters in the support vector machine, and designs a mapping rule to iteratively optimize the kernel function in the support vector machine to obtain the optimal solution; The classification module sets the optimal solution as the parameters of the support vector machine, constructs a classification model for rice and japonica rice seed varieties, and inputs samples to achieve the classification of rice and japonica rice seed varieties.

7. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, they implement the rice and japonica rice seed classification method based on any one of claims 1-5.

8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the rice and japonica rice seed classification method based on support vector machine as described in any one of claims 1-5.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the rice and japonica rice seed classification method based on support vector machine as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Support vector machine parameter optimization algorithm for transformer fault diagnosis

    CN114298208A

  • Method for constructing milling force prediction model for milling variable-curvature part based on RIME-SVM

    CN119272601A

  • Corn germination image segmentation method based on elite adaptive rime algorithm

    CN120510170A