Method and system for grading and detecting imported American cotton based on neural network

By comprehensively using a variety of data collection methods and threshold setting and clustering algorithms in neural network models, combined with manual calibration, the problem of insufficient sample size is solved, and a high confidence and accuracy of US cotton grading detection is achieved.

CN118968201BActive Publication Date: 2025-02-14COMPREHENSIVE TECH CENT FOR INSPECTION & QUARANTINE OF ZHANGJIAGANG ENTRY EXIT INSPECTION & QUARANTINE BUREAU
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411448385.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-14
Estimated Expiration
2044-10-17

AI Technical Summary

Technical Problem

When the sample size is insufficient, the existing automated cotton grading detection system is difficult to effectively solve the problem of high data collection costs, difficult to obtain cotton samples under specific types of defects or conditions, resulting in poor model training results.

Method used

By comprehensively using a variety of data collection methods, the diversity and coverage of samples are improved, and threshold setting and clustering algorithms are introduced in the neural network model to process uncertain samples, and combined with manual calibration, a multi-level processing strategy is formed.

Benefits of technology

It significantly improves the high confidence and accuracy of the detection results, ensures that accurate cotton graded detection can still be achieved in the case of insufficient sample size, and improves the model's adaptability to new situations and the stability of detection performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968201B_ABST
    Figure CN118968201B_ABST
Patent Text Reader

Abstract

The present invention discloses a neural network-based imported U.S. cotton grading detection method and system, and relates to the technical field of cotton detection. The present invention can further enhance the recognition capability of abnormal and edge cases by setting thresholds and adopting clustering algorithms to process uncertain samples, thereby ensuring high confidence in the detection results. This multi-level processing strategy enables the present invention to achieve accurate U.S. cotton grading detection even when the sample size is insufficient. In addition, by introducing a manual calibration link based on the threshold and clustering algorithm, the problem of insufficient sample size that is difficult to overcome in the prior art is effectively solved. When the clustering algorithm cannot classify the uncertain sample into a known classification, manual calibration is adopted to ensure the accuracy and reliability of the detection result. At the same time, by feeding back the manually calibrated samples to the training set, continuous learning and self-optimization are effectively achieved, thereby improving the model's adaptability to new situations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cotton detection, and in particular to a neural network-based imported U.S. cotton grading detection method and system. Background Art

[0002] U.S. cotton is a widely grown cotton variety around the world, famous for its fiber length, strength and color. Grading and testing of U.S. cotton is a key link in ensuring its quality and market competitiveness. Traditionally, this process relies on manual visual inspection, but due to its low efficiency and high subjectivity, it has gradually been replaced by automated technology.

[0003] In the existing automated U.S. cotton grading and detection systems, neural network models are widely used for image recognition and classification tasks. However, these models often face the problem of insufficient sample size during training. The reasons for insufficient sample size include: high data collection costs, difficulty in obtaining cotton samples of specific types of defects or under specific conditions, and limitations of data collection technology. Existing technologies usually use methods such as data enhancement and transfer learning to overcome this problem. Data enhancement generates more training samples through image transformation, while transfer learning uses the features learned by pre-trained models on large data sets. Although these methods have alleviated the problem of insufficient sample size to a certain extent, there are still some defects. For example, data enhancement can easily lead to overfitting, while transfer learning is easily limited by the adaptability of pre-trained models to specific tasks.

[0004] Therefore, the existing technology urgently needs a technical solution for the imported American cotton grading detection method and system based on neural network. Summary of the invention

[0005] In order to solve the above technical problems, the present invention provides a neural network-based imported American cotton grading detection method, which specifically includes the following steps:

[0006] Step S1, data processing: collecting and preprocessing the image data of American cotton, and then obtaining a data set according to the preprocessing results;

[0007] Step S11, data collection: collecting image data of American cotton by comprehensively using at least two data collection methods;

[0008] Step S12, preprocessing: preprocessing the collected image data of beautiful cotton;

[0009] The preprocessing includes feature extraction, denoising and standardization;

[0010] Step S13, data classification and grading: classifying and grading the pre-processed image data of American cotton according to different quality indicators to obtain a classified and graded data set;

[0011] Step S2, sample set construction: construct a sample set according to the data set;

[0012] Step S3, model construction and training: constructing a neural network model, and using the sample set to train the neural network model to obtain a trained neural network model;

[0013] Step S4, obtaining prediction results: inputting the image data of the American cotton to be predicted into the trained neural network model, and outputting the prediction results, wherein the prediction results are determined based on the highest probability value output by the fully connected layer of the neural network model;

[0014] The prediction results output by the neural network model are the classification and grading of American cotton;

[0015] The neural network model adopts a convolutional neural network model;

[0016] Step S5, threshold setting: setting a first threshold for the highest probability value;

[0017] Step S6, output result judgment: compare the highest probability value with the first threshold, and directly output the prediction result or generate a new sample set according to the comparison result;

[0018] Step S61: When the highest probability value is greater than or equal to the first threshold, the output prediction result is determined to be certain, and the prediction result can be directly output;

[0019] Step S62: When the highest probability value is less than the first threshold value, the output prediction result is determined to be uncertain. At this time, the uncertain prediction result is processed by an algorithm and manual calibration to obtain a new sample of the classification and grading of American cotton, and the new sample is returned to step S2 to generate a new sample set of the classification and grading of American cotton;

[0020] Step S621: When the output prediction result is uncertain, a clustering algorithm is used to process the uncertain prediction result so that it is classified into a known sample set of classification and grading of American cotton;

[0021] Step S6211: construct a clustering model, and use the data set classified and graded in step S13 as training data to train the clustering model to determine the number and parameters of clusters;

[0022] Step S6212: input the feature representation of the beautiful cotton image data after feature extraction in step S12 into the clustering model, and perform cluster analysis to determine the center of each cluster;

[0023] Step S6213: assign each uncertain prediction result to the nearest cluster center, and assign a temporary classification and grade to each uncertain prediction result according to the category label of the cluster center;

[0024] Step S6214: for each uncertain prediction result assigned with a temporary classification and grading, evaluate its distance from the cluster center to obtain a confidence level;

[0025] Step S6215, setting a second threshold for the confidence level;

[0026] Step S6216: when the distance between the uncertain prediction result assigned with the temporary classification and grading and the cluster center is lower than the second threshold, the temporary classification and grading of the uncertain prediction result is output and included in the known sample set of classification and grading of American cotton;

[0027] When the distance between the uncertain prediction result assigned with the temporary classification and grading and the cluster center is higher than the second threshold, marking the uncertain prediction result assigned with the temporary classification and grading as a sample set that cannot be classified into the known classification and grading of American cotton;

[0028] Step S622: When the sample cannot be classified into the known sample set of the classification and grading of American cotton after being processed by the algorithm, it is processed by manual calibration to obtain a new sample of the classification and grading of American cotton, and the new sample is returned to step S2 to generate a new sample set of the classification and grading of American cotton;

[0029] The imported U.S. cotton grading detection system based on neural network uses the imported U.S. cotton grading detection method based on neural network as described in any of the above items, and includes the following modules:

[0030] Data processing module: used to collect and preprocess the image data of American cotton, and then obtain the data set based on the preprocessing results;

[0031] Sample set construction module: connected to the data processing module, used to construct a sample set according to the data set;

[0032] Model building and training module: connected to the sample set building module, used to build a neural network model, and use the sample set to train the neural network model to obtain a trained neural network model;

[0033] Prediction result acquisition module: connected to the model building and training module, used to input the image data of American cotton to be predicted into the trained neural network model, and output the prediction result, which is determined based on the highest probability value output by the fully connected layer of the neural network model;

[0034] Threshold setting module: connected to the prediction result acquisition module, used to set a first threshold for the highest probability value;

[0035] Output result judgment module: connected to the threshold setting module, used to compare the highest probability value with the first threshold, and directly output the prediction result or generate a new sample set according to the comparison result.

[0036] The embodiments of the present invention have the following technical effects:

[0037] The present invention significantly improves the diversity and coverage of samples by comprehensively using a variety of data collection methods. By setting thresholds and using clustering algorithms to process uncertain samples, the ability to identify abnormal and edge cases can be further enhanced, ensuring high confidence in the test results. This multi-level processing strategy enables the present invention to achieve accurate American cotton grading detection even when the sample size is insufficient.

[0038] Secondly, the present invention introduces a manual calibration link on the basis of thresholds and clustering algorithms, which effectively solves the problem of insufficient sample size that is difficult to overcome in the prior art. When the clustering algorithm cannot classify uncertain samples into known categories, manual calibration is used to ensure the accuracy and reliability of the test results. At the same time, by feeding back the manually calibrated samples to the training set, continuous learning and self-optimization are effectively achieved, thereby improving the model's ability to adapt to new situations. This iterative optimization mechanism enables the present invention to maintain the stability and effectiveness of detection performance in a constantly changing application environment. In this way, the present invention not only improves the accuracy of U.S. cotton grading detection, but also provides strong technical support for the automation and intelligent development of the cotton industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 is a flow chart of a neural network-based imported U.S. cotton grading detection method provided by an embodiment of the present invention;

[0041] Figure 2 It is a framework diagram of the neural network-based imported U.S. cotton grading detection system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. 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 belong to the scope of protection of the present invention.

[0043] Embodiment 1: Figure 1 As shown, the invention provides a neural network-based imported U.S. cotton grading detection method, comprising the following steps:

[0044] Step S1, data processing: collecting and preprocessing the image data of American cotton, and then obtaining a data set according to the preprocessing results;

[0045] Step S11, data collection: collecting image data of American cotton by comprehensively using at least two data collection methods;

[0046] Preferably, the data collection means for the US cotton image data can be collected through unmanned aerial vehicle remote sensing platforms, machine vision systems, multispectral imaging technology, ground collection equipment, satellite remote sensing data, existing databases, laboratory simulations or mobile platforms;

[0047] Step S12, preprocessing: preprocessing the collected image data of beautiful cotton;

[0048] The preprocessing includes feature extraction, denoising and standardization;

[0049] Preferably, the preprocessing may also include: image cropping, image scaling, image brightness and contrast adjustment, etc.; to ensure that the data format is consistent with the model input requirements; for image cropping: remove unnecessary parts of the image and only retain the part containing cotton to reduce irrelevant information; for image scaling: adjust the resolution of the image to meet the needs of subsequent processing while maintaining image quality; for image brightness and contrast adjustment: adjust the brightness and contrast of the image to enhance the visibility of features such as cotton fibers; for denoising: use filters such as Gaussian filtering, median filtering, etc. to remove noise in the image and improve image quality; for standardization: standardize or normalize the image pixel values ​​to a certain range, such as [0,1] or [-1,1], to improve the convergence speed and performance of the model; for feature extraction: extract key features in the image, such as the shape, size, texture, color, etc. of cotton, which are crucial for classification and recognition; in addition to the above-mentioned preprocessing methods, it may also include edge detection, image segmentation, etc., which are not described one by one here;

[0050] Step S13, data classification and grading: classifying and grading the pre-processed image data of American cotton according to different quality indicators to obtain a classified and graded data set;

[0051] Preferably, when classifying the image data of American cotton according to different quality indicators, it is necessary to intervene with experienced personnel, who can more accurately identify which features are related to the quality indicators of cotton, thereby providing a more accurate classification result; wherein, for different quality indicators, the classification result can be the fiber length, fiber strength, fineness, color, etc. of cotton, and further, includes the specific length classification of fibers, the specific strength classification of fibers, and the specific fineness and color classification of fibers, etc.;

[0052] Step S2, sample set construction: construct a sample set according to the data set;

[0053] Step S3, model construction and training: constructing a neural network model, and using the sample set to train the neural network model to obtain a trained neural network model;

[0054] Preferably, the sample set can be divided into a training set and a test set, wherein the training set is used to train the neural network model, and the test set is used to input into the trained neural network model, and the trained neural network model is evaluated through the output results to calculate the accuracy and recall rate indicators of the model;

[0055] Step S4, obtaining prediction results: inputting the image data of the American cotton to be predicted into the trained neural network model, and outputting the prediction results, wherein the prediction results are determined based on the highest probability value output by the fully connected layer of the neural network model;

[0056] The prediction results output by the neural network model are the classification and grading of American cotton;

[0057] The neural network model adopts a convolutional neural network model;

[0058] It is worth noting that in the design and application of neural network models, especially in the processing of image classification tasks, the use of fully connected layers as part of the network architecture is a widely recognized and commonly practiced technical means. The reason why fully connected layers are widely used is that they can effectively integrate and process the high-level features extracted by the convolutional layers and pooling layers to facilitate the final classification decision; in a typical convolutional neural network architecture, after a series of convolutional layers and pooling layers, the feature map is flattened into a one-dimensional vector, which is then sent to one or more fully connected layers. The fully connected layer learns the complex mapping relationship between feature vectors and category labels through its large number of parameters. The purpose of these layers is to transform the local features and patterns extracted from the input image into a global understanding of the entire image classification; the fully connected layer at the end of the network is usually followed by a softmax layer, which converts the linear output of the fully connected layer into a probability Distribution, the output of the Softmax layer is a probability vector, in which each element represents the probability that the model predicts that the sample belongs to the corresponding category. In multi-classification problems, this conversion is crucial because it provides a natural way to express the uncertainty and confidence of the classification; the highest probability value output by the fully connected layer, that is, the maximum value in the probability vector output by the softmax layer, represents the model's confidence that the sample belongs to a specific category. Selecting the highest probability value as the basis for classification decisions is a standard practice in the field of machine learning and deep learning. This method is simple, intuitive, and easy to implement. It allows the model to select the most likely category among multiple possible categories, and at the same time provides a way to quantify the certainty of the model's predictions; in short, using a fully connected layer in a neural network model to determine the highest probability value for a classification task is a mature and widely accepted method in the field of deep learning, so I will not go into details one by one.

[0059] Step S5, threshold setting: setting a first threshold for the highest probability value;

[0060] Step S6, output result judgment: compare the highest probability value with the first threshold, and directly output the prediction result or generate a new sample set according to the comparison result;

[0061] Step S61: When the highest probability value is greater than or equal to the first threshold, the output prediction result is determined to be certain, and the prediction result can be directly output;

[0062] Step S62: When the highest probability value is less than the first threshold value, the output prediction result is determined to be uncertain. At this time, the uncertain prediction result is processed by an algorithm and manual calibration to obtain a new sample of the classification and grading of American cotton, and the new sample is returned to step S2 to generate a new sample set of the classification and grading of American cotton;

[0063] Step S621: When the output prediction result is uncertain, a clustering algorithm is used to process the uncertain prediction result so that it is classified into a known sample set of classification and grading of American cotton;

[0064] Step S6211: construct a clustering model, and use the data set classified and graded in step S13 as training data to train the clustering model to determine the number and parameters of clusters;

[0065] Step S6212: input the feature representation of the beautiful cotton image data after feature extraction in step S12 into the clustering model, and perform cluster analysis to determine the center of each cluster;

[0066] Step S6213: assign each uncertain prediction result to the nearest cluster center, and assign a temporary classification and grade to each uncertain prediction result according to the category label of the cluster center;

[0067] Step S6214: for each uncertain prediction result assigned with a temporary classification and grading, evaluate its distance from the cluster center to obtain a confidence level;

[0068] Step S6215, setting a second threshold for the confidence level;

[0069] It is worth noting that when setting the second threshold, we should consider it based on the actual data set and clustering effect. Generally speaking, we can try different thresholds first and observe their effects on the clustering results. A suitable threshold should ensure that most prediction results can be correctly classified into the corresponding clusters while avoiding too many misclassifications. In addition, we should also note that the setting of the threshold may be affected by factors such as the size of the data set, the quality of feature representation, and the choice of clustering algorithm. Therefore, when setting the threshold, we need to consider these factors comprehensively and make appropriate adjustments.

[0070] Step S6216: when the distance between the uncertain prediction result assigned with the temporary classification and grading and the cluster center is lower than the second threshold, the temporary classification and grading of the uncertain prediction result is output and included in the known sample set of classification and grading of American cotton;

[0071] When the distance between the uncertain prediction result assigned with the temporary classification and grading and the cluster center is higher than the second threshold, marking the uncertain prediction result assigned with the temporary classification and grading as a sample set that cannot be classified into the known classification and grading of American cotton;

[0072] Step S622: When the sample cannot be classified into the known sample set of classification and grading of American cotton after being processed by the algorithm, it is processed by manual calibration to obtain a new sample of classification and grading of American cotton, and the new sample is returned to step S2 to generate a new sample set of classification and grading of American cotton.

[0073] For example, in actual application, when a batch of new American cotton needs to be classified and graded, the image of the cotton is first input into the neural network model, and the model will output a prediction result, which is a probability value between 0 and 1, indicating the possibility that the cotton belongs to a certain category and level. This prediction result is compared with the preset first threshold. If the prediction result is higher than the first threshold, it means that the model has a high confidence in this prediction. This prediction result can be directly adopted, and the category and level of the cotton are marked as this category and level. However, if the prediction result is lower than the first threshold, it means that the model's confidence in this prediction is not high enough. At this time, step S62 is entered, and the clustering algorithm is used to process the uncertain prediction results. In the cluster analysis, the K-means algorithm is selected. First, the clustering model is initialized according to the known data set of American cotton classification and grading, and the number of clusters K and the initial cluster center are determined. Then, the feature data of the uncertain prediction results are input into the clustering model for iterative calculation. During the iteration process, each data point will be assigned to the nearest cluster center, and then the cluster center will be recalculated. This process will be repeated until the position of the cluster center no longer changes significantly, and finally K stable cluster centers will be obtained, each cluster center represents a piece of American cotton. Category and level. Next, assign a temporary classification and level to each uncertain prediction result. Specifically, calculate the distance between each uncertain prediction result and each cluster center, and then assign it to the nearest cluster center, and assign it a temporary classification and level according to the level of the cluster center. In order to evaluate the confidence of this temporary classification and level, calculate the distance between the uncertain prediction result and the center of the cluster to which it belongs. The closer the distance, the higher the similarity between the prediction result and the level to which it belongs, so the higher its confidence. Set different confidence levels according to the distance, for example, "high confidence", "medium confidence" and "low confidence". Finally, a second threshold is set for the confidence. The setting of this threshold is based on a large amount of experimental data and experience. If the confidence of an uncertain prediction result is higher than the second threshold, then this temporary classification and grading is adopted and included in the known sample set of American cotton classification and grading. On the contrary, if the confidence is lower than the second threshold, then manual calibration is required. Through such a complete set of processes, not only a large number of American cotton grading tasks can be efficiently processed, but also the accuracy and generalization ability of the model can be continuously improved through the combination of cluster analysis and manual calibration when encountering uncertain prediction results.

[0074] Furthermore, it is worth noting that the technical means of the present invention can effectively avoid the problems of "data enhancement easily leads to overfitting" and "transfer learning is easily limited by the adaptability of the pre-trained model to a specific task", for the following reasons:

[0075] The present invention obtains US cotton image data through at least two different data collection methods. Such multi-source data increases the diversity of samples, reduces the model's dependence on a specific data distribution, and thus reduces the risk of overfitting; in the preprocessing step, not only feature extraction, denoising and standardization are performed, but also image quality improvement operations such as contrast enhancement and sharpening may be included. These operations help to improve the recognizability of the image, while avoiding distortion that may occur during data enhancement and reducing the possibility of overfitting; when the prediction result is uncertain, the present invention uses a clustering algorithm to reclassify these samples. The clustering algorithm can group based on the intrinsic characteristics of the samples instead of relying on label data, which provides a classification method for uncertain samples that is independent of the pre-training state of the model; for samples that are still uncertain after algorithm processing, the present invention introduces a manual calibration link. This manual intervention provides accurate sample annotation, ensuring the accuracy and high quality of the model training data. The method improves the quality of the prediction and avoids the errors that may be introduced by automatic methods. By continuously feeding back the manually calibrated samples into the training set, the model can be iteratively trained and self-optimized. This continuous learning process helps the model to better adapt to specific tasks and improves the adaptability and generalization ability of the model to new situations. The first threshold and the second threshold in the present invention provide strict control over the confidence of the prediction results. This confidence-based decision-making process reduces the dependence on a single prediction result and increases the overall robustness of the model. The present invention does not rely on a single technical means, but combines multiple technologies such as data enhancement, transfer learning, clustering algorithms and manual calibration to form a powerful detection system. This comprehensive application strategy improves the overall performance of the system and avoids the limitations and risks brought by a single method. Through these comprehensive technical means, the present invention not only improves the accuracy and efficiency of American cotton grading detection, but also effectively avoids the problems of overfitting and insufficient adaptability in traditional methods.

[0076] Embodiment 2: Figure 2 As shown, the present invention also proposes an imported American cotton grading detection system based on a neural network, which executes the imported American cotton grading detection method based on a neural network as described above, and includes the following modules:

[0077] Data processing module: used to collect and preprocess the image data of American cotton, and then obtain the data set based on the preprocessing results;

[0078] Sample set construction module: connected to the data processing module, used to construct a sample set according to the data set;

[0079] Model building and training module: connected to the sample set building module, used to build a neural network model, and use the sample set to train the neural network model to obtain a trained neural network model;

[0080] Prediction result acquisition module: connected to the model building and training module, used to input the image data of American cotton to be predicted into the trained neural network model and output the prediction result;

[0081] A threshold setting module: connected to the prediction result acquisition module, and used to set a first threshold for the prediction result output by the neural network model;

[0082] Output result judgment module: connected to the threshold setting module, used to compare the prediction result output by the neural network model with the first threshold, and directly output the prediction result or generate a new sample set based on the comparison result.

[0083] Embodiment three:

[0084] An electronic device, comprising:

[0085] Processor and memory;

[0086] The processor is used to execute the steps of the neural network-based imported American cotton grading detection method as described in any one of Example 1 by calling the program or instructions stored in the memory.

[0087] Embodiment 4:

[0088] A computer-readable storage medium, the computer-readable storage medium comprising computer program instructions, the computer program instructions causing a computer to execute the steps of the neural network-based imported U.S. cotton grading detection method as described in any one of Example 1.

[0089] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0090] It should be noted that the terms used in the present invention are only for describing specific embodiments, rather than limiting the scope of the present application. As shown in the present specification, unless the context clearly indicates an exception, the words "one", "a", "a kind of" and / or "the" do not specifically refer to the singular, but may also include the plural. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method or device. In the absence of more restrictions, the elements defined by the sentence "include one..." do not exclude the presence of other identical elements in the process, method or device including the elements.

[0091] It should also be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", etc. should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.

Claims

1. A neural network-based classification and detection method for imported American cotton, characterized in that: The following steps are involved: Step S1, data processing: collecting and preprocessing the image data of American cotton, and then obtaining a data set according to the preprocessing results; Step S2, sample set construction: construct a sample set according to the data set; Step S3, model construction and training: constructing a neural network model, and using the sample set to train the neural network model to obtain a trained neural network model; Step S4, obtaining prediction results: inputting the image data of the American cotton to be predicted into the trained neural network model, and outputting the prediction results, wherein the prediction results are determined based on the highest probability value output by the fully connected layer of the neural network model; Step S5, threshold setting: setting a first threshold for the highest probability value; Step S6, output result judgment: compare the highest probability value with the first threshold, and directly output the prediction result or generate a new sample set according to the comparison result; Step S61: When the highest probability value is greater than or equal to the first threshold, the output prediction result is determined to be certain, and the prediction result can be directly output; Step S62: When the highest probability value is less than the first threshold value, the output prediction result is determined to be uncertain. At this time, the uncertain prediction result is processed by an algorithm and manual calibration to obtain a new sample of the classification and grading of American cotton, and the new sample is returned to step S2 to generate a new sample set of the classification and grading of American cotton; Step S621: When the output prediction result is uncertain, a clustering algorithm is used to process the uncertain prediction result so that it is classified into a known sample set of classification and grading of American cotton; Step S6211: construct a clustering model, and use the data set classified and graded in step S13 as training data to train the clustering model to determine the number and parameters of clusters; Step S6212: input the feature representation of the beautiful cotton image data after feature extraction in step S12 into the clustering model, and perform cluster analysis to determine the center of each cluster; Step S6213: assign each uncertain prediction result to the nearest cluster center, and assign a temporary classification and grade to each uncertain prediction result according to the category label of the cluster center; Step S6214: for each uncertain prediction result assigned with a temporary classification and grading, evaluate its distance from the cluster center to obtain a confidence level; Step S6215, setting a second threshold for the confidence level; Step S6216: when the distance between the uncertain prediction result assigned with the temporary classification and grading and the cluster center is lower than the second threshold, the temporary classification and grading of the uncertain prediction result is output and included in the known sample set of classification and grading of American cotton; When the distance between the uncertain prediction result assigned with the temporary classification and grading and the cluster center is higher than the second threshold, marking the uncertain prediction result assigned with the temporary classification and grading as a sample set that cannot be classified into the known classification and grading of American cotton; Step S622: When the sample cannot be classified into the known sample set of classification and grading of American cotton after being processed by the algorithm, it is processed by manual calibration to obtain a new sample of classification and grading of American cotton, and the new sample is returned to step S2 to generate a new sample set of classification and grading of American cotton.

2. The neural network-based imported U.S. cotton grading detection method according to claim 1, characterized in that: In step S1, the image data of American cotton is collected and preprocessed, and then a data set is obtained according to the preprocessing result, including: Step S11, data collection: collecting image data of American cotton by comprehensively using at least two data collection methods; Step S12, preprocessing: preprocessing the collected image data of beautiful cotton; The preprocessing includes feature extraction, denoising and standardization; Step S13, data classification and grading: the pre-processed US cotton image data is classified and graded according to different quality indicators to obtain a classified and graded data set.

3. The neural network-based imported U.S. cotton grading detection method according to claim 1, characterized in that: The prediction results output by the neural network model are the classification and grading of American cotton.

4. The neural network-based imported U.S. cotton grading detection method according to claim 3 is characterized in that: The neural network model adopts a convolutional neural network model.

5. A neural network-based imported U.S. cotton grading detection system, used to execute the neural network-based imported U.S. cotton grading detection method according to any one of claims 1 to 4, characterized in that: The system comprises: Data processing module: used to collect and preprocess the image data of American cotton, and then obtain the data set based on the preprocessing results; Sample set construction module: connected to the data processing module, used to construct a sample set according to the data set; Model building and training module: connected to the sample set building module, used to build a neural network model, and use the sample set to train the neural network model to obtain a trained neural network model; Prediction result acquisition module: connected to the model building and training module, used to input the image data of American cotton to be predicted into the trained neural network model, and output the prediction result, which is determined based on the highest probability value output by the fully connected layer of the neural network model; Threshold setting module: connected to the prediction result acquisition module, used to set a first threshold for the highest probability value; Output result judgment module: connected to the threshold setting module, used to compare the highest probability value with the first threshold, and directly output the prediction result or generate a new sample set according to the comparison result.

Citation Information

Patent Citations

  • Model construction method and system for high-speed TDI CCD camera image dark stripe noise recognition

    CN114723952A

  • Unknown type target identification method under open condition

    CN115393628A