A citrus quality classification method and system based on random forest model and fuzzy clustering

By adopting a random forest model and an improved semi-supervised fuzzy clustering algorithm (SSFCM) in citrus quality classification, the problem of fuzzy boundaries and low efficiency is solved, and more efficient and accurate quality screening is achieved.

CN114692770BActive Publication Date: 2025-04-04CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210365637.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-08
Publication Date
2025-04-04
Estimated Expiration
2042-04-08

AI Technical Summary

Technical Problem

The prior art has problems such as blurred boundaries, low efficiency, and inaccurate classification in the quality classification of citrus, and relies on manual operations to consume time and effort.

Method used

The citrus quality classification method based on random forest model and improved semi-supervised fuzzy clustering algorithm (SSFCM) is adopted. By acquiring citrus images, preprocessing and feature extraction, fuzzy samples are constructed, and clustering is used by the SSFCM algorithm to obtain quality classification results.

Benefits of technology

It improves the accuracy and efficiency of citrus quality classification, overcomes the problem of sample imbalance, and achieves more accurate and efficient citrus quality screening.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114692770B_ABST
    Figure CN114692770B_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer vision application, and particularly relates to a citrus quality classification method and system based on a random forest model and fuzzy clustering; the method comprises: obtaining a citrus image to be identified, inputting the obtained citrus image into a trained random forest model, and obtaining an initial fuzzy sample; clustering data in the initial fuzzy sample using an improved semi-supervised fuzzy algorithm SSFCM, and obtaining a quality classification result; and marking the citrus with a quality label according to the quality classification result; the invention adopts a machine learning method to classify the quality of the citrus, and improves the efficiency and accuracy of the classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer vision application, and in particular relates to a citrus quality classification method and system based on a random forest model and fuzzy clustering. Background Art

[0002] Citrus is a fruit that can be found everywhere in daily life. It is fragrant, delicious and nutritious, and is deeply loved by consumers. However, major citrus plantations now mainly rely on manual screening of fruit seedlings and planting of fruit trees, regular pruning of branches, plowing of the plantations, and cleaning of insect-infested young fruits every year. This wastes a lot of time and energy, and increases manpower and material costs. When citrus is ripe and about to enter the sales stage, it relies on manual classification of the quality of citrus fruits based on experience, which is labor-intensive, time-consuming, inefficient, and inaccurate. Summary of the invention

[0003] In order to solve the problems existing in the above prior art, the present invention proposes a citrus quality classification method based on random forest model and fuzzy clustering, which not only solves the problem of fuzzy boundaries of citrus quality classification, but also improves the robustness of sample quality by using pure samples to construct fuzzy samples. The method includes: obtaining a citrus image to be identified, inputting the obtained citrus image into a trained random forest model to obtain an initial fuzzy sample; clustering the data in the initial fuzzy sample using an improved semi-supervised fuzzy algorithm SSFCM to obtain a quality classification result; and marking the citrus with a quality label according to the quality classification result.

[0004] Preferably, the process of training the random forest model includes:

[0005] Step 1: Obtain an image dataset and preprocess the image dataset;

[0006] Step 2: Extract features from the preprocessed image; the feature extraction includes the extraction of fruit surface color feature parameters, fruit size parameter extraction, fruit morphology parameter extraction, and fruit surface smoothness parameter extraction;

[0007] Step 3: Encapsulate all extracted feature parameters; and randomly sample the encapsulated data;

[0008] Step 4: Calculate the Gini coefficient of the randomly selected sample and use the calculated Gini coefficient as the attribute measurement of the sample;

[0009] Step 5: Construct a classification regression decision tree based on the Gini coefficient;

[0010] Step 6: Input the encapsulated feature parameters into the constructed classification regression decision tree for classification voting to obtain the classification voting results;

[0011] Step 7: Aggregate the classification voting results of each image in the image dataset to obtain fuzzy samples and complete the model training.

[0012] Furthermore, preprocessing the image data set includes: performing median filtering on the images in the image data set using a cvSmooth function to obtain a denoised image.

[0013] Preferably, the process of extracting the color characteristic parameters of the fruit surface includes: obtaining the grayscale values ​​of the color channels of the image, the grayscale values ​​of the color channels include the grayscale value G of the green channel, the grayscale value R of the red channel, and the grayscale value B of the blue channel; calculating the color characteristic parameters according to the grayscale values ​​of the color channels, and the calculation expression is: Ccolor=2G-RB; calculating the percentage of the typical color area of ​​citrus according to the calculated color characteristic parameters; grading the color of the fruit according to the percentage of the typical color area to obtain the color characteristic parameters of the fruit surface;

[0014] Fruit size parameter extraction includes grading the fruit size by using projection area, perimeter, maximum transverse diameter and volume to obtain fruit size parameters;

[0015] The extraction of fruit morphological parameters includes detecting citrus defects using a brightness component grayscale image, edge processing the detection results to obtain the defect characteristics of the citrus surface; grading the fruit morphology according to the defect characteristics to obtain the fruit morphological parameters;

[0016] The extraction of fruit surface smoothness parameters includes using the gradient method to measure the smoothness of the citrus peel and obtain the fruit surface smoothness parameters.

[0017] Furthermore, the process of grading fruit color according to the typical color area percentage includes: classifying citrus with a typical color area percentage greater than 99% as first-class products, classifying citrus with a typical color area percentage between 75% and 99% as second-class products, classifying citrus with a typical color area percentage between 35% and 75% as third-class products, and discarding citrus with other typical color area percentages.

[0018] Preferably, the process of clustering the data in the initial fuzzy sample using the improved semi-supervised fuzzy algorithm includes:

[0019] Step 1: Set the number of clusters c and the balance index α; obtain the binary vector b of the sample according to the label information in the initial fuzzy sample = [b j ] and the initial membership matrix F = [f ij ];

[0020] Step 2: Calculate the distance between the samples with grade labels and the samples without grade labels in the initial fuzzy samples and the cluster center;

[0021] Step 3: Calculate a new membership matrix based on the binary vector of the sample, the initial membership matrix, and the distance between the sample and the cluster center;

[0022] Step 4: Calculate new cluster centers based on the new membership matrix;

[0023] Step 5: Compare the new cluster center with the original cluster center. When the cluster center does not change or the maximum number of iterations is reached, the algorithm stops and outputs the cluster center; otherwise, return to step 2.

[0024] Furthermore, the cluster center does not change, which means the objective function of the SSFCM algorithm converges; the objective function of the SSFCM algorithm is:

[0025]

[0026] Among them, m represents the weighted index, c represents the number of clusters, and N represents the total number of samples. represents the membership matrix, represents the distance between sample j and the cluster center, α represents the balance index, and f ij represents the initial membership matrix, b j Represents a binary vector.

[0027] A citrus quality classification system based on random forest model and fuzzy clustering, the system comprising: a data acquisition module, a citrus quality classification module and a result output module;

[0028] The data acquisition module is used to acquire the citrus image to be classified by quality, and input the image into the citrus quality classification module;

[0029] The citrus quality classification module includes a data preprocessing module, a feature extraction module, a random forest module and a fuzzy clustering module;

[0030] The data preprocessing module is used to preprocess the citrus images to be classified by quality, and the preprocessing includes using the cvSmooth function to perform median filtering on the images in the image data set to obtain a denoised image;

[0031] The feature extraction module is used to extract features from the denoised image, and the feature extraction includes the extraction of fruit surface color feature parameters, fruit size parameter extraction, fruit morphology parameter extraction and fruit surface smoothness parameter extraction;

[0032] The random forest module is used to process the features extracted by the feature extraction module, obtain quality classification votes, and construct fuzzy samples;

[0033] The fuzzy clustering module is used to cluster fuzzy samples to obtain citrus quality classification results.

[0034] The result output module is used to output the quality classification result.

[0035] To achieve the above objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, it implements any of the above-mentioned citrus quality classification methods based on random forest model and fuzzy clustering.

[0036] To achieve the above-mentioned purpose, the present invention also provides a citrus quality classification device based on a random forest model and fuzzy clustering, comprising a processor and a memory; the memory is used to store a computer program; the processor is connected to the memory and is used to execute the computer program stored in the memory, so that the citrus quality classification device based on a random forest model and fuzzy clustering performs any of the above-mentioned citrus quality classification methods based on a random forest model and fuzzy clustering.

[0037] Beneficial effects of the present invention:

[0038] 1. The present invention designs a citrus quality classification method, which improves the accuracy and efficiency of citrus quality classification by adopting a random forest model and a fuzzy clustering method, is beneficial to users in screening the quality of citrus and improves the user experience.

[0039] 2. In the process of constructing fuzzy samples, the present invention uses a random forest model, which has strong generalization ability. For unbalanced data sets such as citrus quality classification, it can balance errors and eliminate the impact of sample imbalance.

[0040] 3. The present invention uses the SSFCM algorithm in the fuzzy clustering method, through which a small number of samples with completely determined classification (membership degree is 1) can be used as supervisory information, thereby improving the accuracy of the model; compared with SFCM, it overcomes the adverse effects brought about by less prior information. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is the flow chart of the fuzzy classification algorithm of the present invention;

[0042] Figure 2 It is the overall flow chart of the present invention;

[0043] Figure 3 The quality classification decision tree structure of the present invention;

[0044] Figure 4 This is a grading effect diagram based on the fruit surface color characteristic parameters of the present invention;

[0045] Figure 5 This is a grading effect diagram based on fruit morphological parameters of the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] A citrus quality classification method based on random forest model and fuzzy clustering, such as Figure 1 As shown, the method includes: obtaining a citrus image to be identified, inputting the obtained citrus image into a trained random forest model to obtain an initial fuzzy sample, and then clustering through an improved SSFCM to obtain a quality classification result; classifying the citrus according to the quality classification result, and marking the citrus after quality classification with a quality label.

[0048] A specific implementation method of a citrus quality classification method based on a random forest model and fuzzy clustering, such as Figure 2 As shown, the method includes:

[0049] Step 1: Get the citrus image dataset;

[0050] Step 2: Preprocess the collected image data;

[0051] Step 3: Build a random forest model;

[0052] Step 4: Extract features from the preprocessed image;

[0053] Step 5: Input the extracted features into the random forest model to construct fuzzy samples;

[0054] Step 6: Use SSFCM clustering algorithm to classify fuzzy samples;

[0055] Step 7: Determine whether the classification result is correct. If so, output the classification data. Otherwise, perform parameter tuning and return to step 4.

[0056] Step 8: Upload the classification results to the database and web platform.

[0057] A specific implementation method of a citrus quality classification method based on a random forest model and fuzzy clustering, such as Figure 3 As shown, the process of training a random forest model includes:

[0058] Step 1: Obtain an image dataset and preprocess the image dataset;

[0059] Step 2: Extract features from the preprocessed image; the feature extraction includes the extraction of fruit surface color feature parameters, fruit size parameter extraction, fruit morphology parameter extraction, and fruit surface smoothness parameter extraction;

[0060] Step 3: Encapsulate all extracted feature parameters; and randomly sample the encapsulated data;

[0061] Step 4: Calculate the Gini coefficient of the randomly selected sample and use the calculated Gini coefficient as the attribute measurement of the sample;

[0062] Step 5: Construct a classification regression decision tree based on the Gini coefficient;

[0063] Step 6: Input the encapsulated feature parameters into the constructed classification regression decision tree for classification voting to obtain the classification voting results;

[0064] Step 7: Aggregate the classification voting results of each image in the image dataset to obtain fuzzy samples and complete the model training.

[0065] Image acquisition includes collecting citrus-related images from the Internet and major public data sets, as well as field visits to agricultural bases to take images of citrus fruits.

[0066] The data in the dataset are preprocessed as follows: The main purpose of image dataset preprocessing is to eliminate irrelevant information in the image, restore useful real information, enhance the detectability of relevant information and simplify data to the maximum extent, thereby improving the reliability of feature extraction, image segmentation, matching and recognition. First, the cvSmooth function in OpenCV is called to use the median filter method to remove noise from the collected citrus fruit image. Regarding the next feature extraction step, different image processing methods will be used for different feature parameters. The process of extracting the color feature parameters of the fruit surface includes: obtaining the grayscale value of the color channel of the image, which includes the grayscale value of the green channel G, the grayscale value of the red channel R and the grayscale value of the blue channel B; calculating the color feature parameters according to the grayscale value of the color channel, and the calculation expression is: Ccolor = 2G-RB; calculating the percentage of the typical color area of ​​citrus according to the calculated color feature parameters; grading the fruit color according to the percentage of the typical color area to obtain the color feature parameters of the fruit surface.

[0067] Specifically, the color feature parameters of the fruit surface are extracted: the color of the fruit surface represents the maturity and taste of the citrus fruit in a certain sense. In the fruit color grading, most of the feature parameters are extracted based on the RGB (1) or HSI (6) color space to establish a grading model. In the citrus grading standard, citrus fruit is divided into first-class (more than 99% of the fruit surface is evenly colored, with the typical color of the variety), second-class (75%-99% of the fruit surface is evenly colored, with the typical color of the variety), and third-class (35%-75% of the fruit surface is evenly colored, with the typical characteristics of the variety) according to the color of the fruit surface. The color feature parameter Ccolor = 2G-RB (R, G, B are the grayscale values ​​of the R, G, and B color channels respectively) can better distinguish between the typical color area and the atypical color area of ​​the fruit surface. Based on this, the percentage of the typical color area of ​​citrus can be calculated, and then color grading can be performed. The grading results are as follows: Figure 4 shown.

[0068] Fruit size parameter extraction: Projection area, perimeter, maximum transverse diameter, volume, etc. can be used as size classification parameters. The present invention adopts the projection area method to calculate the projection area of ​​the citrus image target as the characteristic parameter of size classification.

[0069] Fruit morphological parameter extraction: Common types of citrus morphological defects mainly include insect-damaged fruit, cracked fruit, and deformed fruit. The main colors of the defect area are gray and dark brown. In view of the dark color of the defect, the present invention uses the brightness V component grayscale image to detect citrus defects, then performs edge processing on the grayscale image, and combines morphological methods to extract the defect characteristics of the citrus surface; the fruit is graded according to the fruit morphological parameters; the results of the classification are as follows: Figure 5 shown.

[0070] Fruit surface smoothness parameter extraction: The smoothness of the citrus skin represents the growth condition of the fruit to a certain extent. The present invention adopts a gradient method to measure the smoothness of the citrus skin.

[0071] The decision tree generated by the present invention is as follows Figure 3 As shown in the figure, random forest has strong generalization ability. For unbalanced datasets such as citrus quality classification, it can balance errors and eliminate the impact of sample imbalance.

[0072] The present invention uses a method based on random forest (RF) and fuzzy clustering for the quality classification of citrus.

[0073] Among them, the random forest (RF) algorithm is based on statistical learning theory. It uses the bagging (bootstrap aggregating) sampling method to extract several samples from the original sample, uses the Gini coefficient (Gini coefficient) as the attribute measurement for the extracted samples, and gradually regresses to establish a classification regression decision tree (CART). The principle of the CART tree is to make the originally chaotic sample set relatively pure through the division of each layer of the decision tree, which is reflected in the attribute measurement by reducing the Gini coefficient. The RF algorithm uses multiple decision trees to predict the classified pixels, determines the category by the number of votes, and evaluates the prediction accuracy by treating the samples that do not participate in the tree construction as "out-of-bag data".

[0074] The method based on RF and fuzzy clustering is based on the idea of ​​classifier fusion. Its main process is: use RF classifier for classification, randomly select several sample points for each category in the classification result, record the RF classification voting results of these points (that is, the membership of each sample to each category), construct a fuzzy sample set, and then perform fuzzy classification.

[0075] The RF algorithm does not refer to the theories and methods of traditional probability theory, but only evaluates and votes on the data through statistical learning methods, so the selected fuzzy samples are reliable. In addition, RF has strong stability to the noise and outliers of sample data, and fuzzy clustering has certain robustness to the accuracy of fuzzy samples, so the classification accuracy of this method has strong stability to the quality of the original samples.

[0076] The SFCM algorithm is based on the FCM algorithm and takes the category labels of a small amount of labeled data as supervisory information, which improves the accuracy of the model. However, it is difficult to obtain a large amount of labeled data, so the prior information is scarce, which reduces the performance metric of clustering. Therefore, the present invention selects the improved SSFCM algorithm.

[0077] The process of clustering the data in the initial fuzzy sample using the improved semi-supervised fuzzy algorithm includes:

[0078] Step 1: Initialization, i.e. setting the number of clusters c and the balance index α; obtaining the binary vector b of the sample according to the label information in the initial fuzzy sample = [b j ] and the initial membership matrix F = [f ij ];

[0079] Step 2: Calculate the distance between the samples with grade labels and the samples without grade labels in the initial fuzzy samples and the cluster center;

[0080] Step 3: Calculate a new membership matrix based on the binary vector of the sample, the initial membership matrix, and the distance between the sample and the cluster center; the expression for calculating the membership matrix is:

[0081]

[0082] Step 4: Calculate the new cluster center based on the new membership matrix; the expression for calculating the cluster center is:

[0083]

[0084] Step 5: Compare the new cluster center with the original cluster center. When the cluster center does not change or the maximum number of iterations is reached, the algorithm stops and outputs the cluster center; otherwise, return to step 2.

[0085] The cluster center does not change when the objective function of the SSFCM algorithm converges; the SSFCM algorithm is an algorithm based on the objective function. Divided into c categories, the cluster center is represented by C, and the objective function of the SSFCM algorithm is as follows:

[0086]

[0087] In the formula, m represents the weighted index, which is an empirical value and is usually taken as 2; α (α ≥ 0) represents the balance factor, which is used to adjust the balance between unsupervised information and supervised information in the formula. The specific value of α is related to the total number of samples L and the number of labeled samples L. 1 The ratio is directly proportional to the value of; c represents the number of clusters; N represents the total number of samples; f ij is the membership matrix of the labeled sample, and its value is specifically expressed as x j attributed to c j The degree of j is a Boolean binary vector, which can be used to judge x according to its actual value j Is it labeled data?

[0088] Finally, the citrus quality classification model data and various image label data are uploaded to the BS network model database, linked to the cloud server, and finally presented to the browser web page. The BS network model database is: the client browses the web page on the web server through the browser. Such a model is called a BS model, where b refers to the client browser and s refers to the server. This model can be combined with the data of the citrus pest and disease identification system in the above structure, and the data of citrus quality classification based on random forest and fuzzy clustering can be integrated and processed, and uploaded to the database for storage, so that it can be called at any time and displayed to users.

[0089] The database system consists of a database and its management software. It is a software system that provides data for the actual operable storage, maintenance and application system. It is a collection of storage media, processing objects and management systems. MySQL is a relational database management system with the characteristics of fast speed and strong flexibility. The present invention will use the MySQL database management system to store citrus image data sets, videos and pictures taken by drones in the database, establish a database of the citrus quality classification system, and extract and use it at any time.

[0090] Web server generally refers to a website server. Cloud server is a product derived from cloud computing technology. It is a kind of elastically scalable computing, network, and storage service with efficient and simple management. The present invention takes into account the data volume, cost, etc., and chooses to use cloud server technology, and then links the cloud server with the MySQL database.

[0091] The browser makes a request to the cloud server for access data in the form of hypertext, and the browser generates a data packet and sends it to the server. The web server responds to the request sent by the browser, and the client browser parses the server's response and displays it in the form of a friendly web page.

[0092] In addition, we have formulated the citrus quality classification standards as shown in the following table.

[0093] Table 1 Citrus quality classification standards

[0094]

[0095]

[0096] The specific implementation of the system of the present invention is the same as the implementation of the method.

[0097] In one embodiment of the present invention, the present invention also includes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned citrus quality classification methods based on random forest and fuzzy clustering.

[0098] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

[0099] A citrus quality classification device based on a random forest model and fuzzy clustering comprises a processor and a memory; the memory is used to store a computer program; the processor is connected to the memory and is used to execute the computer program stored in the memory, so that the citrus quality classification device based on a random forest model and fuzzy clustering executes the above-mentioned citrus quality classification method based on a random forest model and fuzzy clustering.

[0100] Specifically, the memory includes: ROM, RAM, magnetic disk, USB flash drive, memory card or optical disk, etc., which can store program codes.

[0101] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0102] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A citrus quality classification method based on random forest model and fuzzy clustering, characterized in that: The method comprises: obtaining a citrus image to be identified, inputting the obtained citrus image into a trained random forest model to obtain an initial fuzzy sample; clustering the data in the initial fuzzy sample using an improved semi-supervised fuzzy algorithm SSFCM to obtain a quality classification result; and marking the citrus with a quality label according to the quality classification result.

2. According to the citrus quality classification method based on random forest model and fuzzy clustering according to claim 1, the process of training the random forest model comprises: Step 1: Obtain an image dataset and preprocess the image dataset; Step 2: Extract features from the preprocessed image; The feature extraction includes the extraction of fruit surface color feature parameters, fruit size parameter extraction, fruit morphology parameter extraction and fruit surface smoothness parameter extraction; Step 3: Encapsulate all extracted feature parameters; and randomly sample the encapsulated data; Step 4: Calculate the Gini coefficient of the randomly selected sample and use the calculated Gini coefficient as the attribute measurement of the sample; Step 5: Construct a classification regression decision tree based on the Gini coefficient; Step 6: Input the encapsulated feature parameters into the constructed classification regression decision tree for classification voting to obtain the classification voting results; Step 7: Aggregate the classification voting results of each image in the image dataset to obtain fuzzy samples and complete the model training.

3. According to the citrus quality classification method based on random forest model and fuzzy clustering in claim 2, preprocessing the image data set comprises: The cvSmooth function is used to perform median filtering on the images in the image dataset to obtain the denoised image.

4. According to the citrus quality classification method based on random forest model and fuzzy clustering in claim 2, the process of extracting the color characteristic parameters of the fruit surface comprises: Get the grayscale value of the color channel of the image, which includes the green channel grayscale value G, the red channel grayscale value R and the blue channel grayscale value B; calculate the color feature parameters according to the grayscale value of the color channel, and the calculation expression is: Ccolor =2G-RB ; Calculate the percentage of the typical color area of ​​citrus according to the calculated color characteristic parameters; Classify the color of the fruit according to the percentage of the typical color area to obtain the color characteristic parameters of the fruit surface; Extract the fruit size parameters including classifying the fruit size by using the projection area, perimeter, maximum transverse diameter and volume to obtain the fruit size parameters; Extract the fruit morphology parameters including detecting citrus defects by using the brightness component grayscale image, performing edge processing on the detection results to obtain the defect characteristics of the citrus surface; The fruit morphology is graded according to the defect characteristics to obtain the fruit morphology parameters; the fruit surface smoothness parameter extraction includes using the gradient method to measure the smoothness of the citrus skin to obtain the fruit surface smoothness parameter.

5. According to the method for citrus quality classification based on random forest model and fuzzy clustering of claim 4, the process of grading the fruit color according to the percentage of typical color area comprises: Citrus with a typical color area percentage greater than 99% are classified as first-class products, citrus with a typical color area percentage between 75% and 99% are classified as second-class products, citrus with a typical color area percentage between 35% and 75% are classified as third-class products, and citrus with other typical color area percentages are discarded.

6. According to the method for citrus quality classification based on random forest model and fuzzy clustering as claimed in claim 1, the process of clustering the data in the initial fuzzy sample using the improved semi-supervised fuzzy algorithm comprises: Step 1: Set the number of clusters c , balance index α ; Get the binary vector of the sample according to the label information in the initial blurred sample and the initial membership matrix ; Step 2: Calculate the distance between the samples with grade labels and the samples without grade labels in the initial fuzzy samples and the cluster center; Step 3: Calculate a new membership matrix based on the binary vector of the sample, the initial membership matrix, and the distance between the sample and the cluster center; Step 4: Calculate new cluster centers based on the new membership matrix; Step 5: Compare the new cluster center with the original cluster center. When the cluster center does not change or the maximum number of iterations is reached, the algorithm stops and outputs the cluster center; otherwise, return to step 2.

7. According to the citrus quality classification method based on random forest model and fuzzy clustering according to claim 6, the cluster center does not change when the objective function of the SSFCM algorithm converges; the objective function of the SSFCM algorithm is: in, m represents the weighted index, c represents the number of clusters, and N represents the total number of samples. represents the membership matrix, represents the distance between sample j and the cluster center, represents the balance index, represents the initial membership matrix, Represents a binary vector.

8. A citrus quality classification system based on a random forest model and fuzzy clustering, the system being used to execute any one of the citrus quality classification methods based on a random forest model and fuzzy clustering according to claims 1 to 7, characterized in that: The system includes: a data acquisition module, an image preprocessing module, a citrus quality classification module and a result output module; The data acquisition module is used to acquire the citrus image to be classified by quality, and input the image into the citrus quality classification module; The image preprocessing module is used to preprocess the citrus images to be classified by quality. The preprocessing includes pixel normalization of each image in the data set, feature normalization of the normalized images, and PCA / ZCA whitening of the feature-normalized images. The citrus quality classification module includes a data preprocessing module, a feature extraction module, a random forest module and a fuzzy clustering module; The data preprocessing module is used to preprocess the citrus images to be classified by quality, and the preprocessing includes using the cvSmooth function to perform median filtering on the images in the image data set to obtain a denoised image; The feature extraction module is used to extract features from the denoised image, and the feature extraction includes the extraction of fruit surface color feature parameters, fruit size parameter extraction, fruit morphology parameter extraction and fruit surface smoothness parameter extraction; The random forest module is used to process the features extracted by the feature extraction module, obtain quality classification votes, and construct fuzzy samples; The fuzzy clustering module is used to cluster the fuzzy samples to obtain citrus quality classification results; The result output module is used to output the quality classification result.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement the citrus quality classification method based on random forest model and fuzzy clustering according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Liver cancer image automatic segmentation method based on random forest and fuzzy clustering

    CN107845098A

  • Methods for constructing and predicting leaf trait of woody plant and photosynthetic characteristic model based on DNA methylation level

    CN108319984A