CN-122024226-A - Intelligent identification method for fruit grading scene
Abstract
The invention discloses an intelligent identification method for fruit grading scenes, which relates to the technical field of scene identification, and is used for solving the problem of reduced automatic identification efficiency in the fruit grading scenes, determining whether to collect morphological characteristics of the fruit grading scenes by the quantity of marked image data of samples, calculating characteristic difference distances between the morphological characteristics and mature varieties in an existing database, marking the most similar varieties, classifying the samples into different attribute categories by cluster analysis, screening out core samples of each category for model adaptation, completing model training in a preset training period, verifying accuracy by an identification test, determining whether to adjust a threshold value or input new variety information according to the result, reducing the dependence of new fruit variety identification on large-scale marked data, rapidly adapting the new variety under the condition of fewer samples, improving the expansibility and adaptability of an identification system, and effectively improving the automatic identification capability of the fruit grading scenes.
Inventors
- YE YAN
- WANG ZHAOJUN
- TIAN YINGCHUN
- CAI HAI
- Shang Binling
- Zhan yajie
- MA HONGQIANG
Assignees
- 武威职业技术大学
Dates
- Publication Date
- 20260512
- Application Date
- 20260123
Claims (9)
- 1. An intelligent identification method for fruit classification scenes is characterized by comprising the following steps: Step S1, when the fruit samples are identified, variety information of the fruit samples is called, the quantity of marked image data of the fruit samples is called based on the variety information, and whether morphological feature data of the fruit samples are acquired is judged according to the quantity of the marked image data; Step S2, after morphological feature data of the fruit samples are collected, accessing a fruit database to call a variety feature mean value of the input fruits, calculating feature difference distances between the fruit samples and the input fruits by combining the morphological feature data, and marking the input fruits based on the feature difference distances; Step S3, carrying out cluster analysis on morphological feature data of the fruit samples, classifying sample attributes of the fruit samples according to the cluster results, and screening the fruit samples by integrating the classification results and marked input fruits to obtain core samples; And S4, setting a training period, performing model adaptation on the core sample in the training period, formulating an identification accuracy threshold of the fruit sample after the model adaptation, performing an identification test on the fruit sample, and selecting a reproduction identification accuracy threshold or inputting variety information according to a test result.
- 2. The intelligent identification method for fruit grading scenes according to claim 1, wherein the intelligent identification method comprises the following steps: In step S1, when the identification model is used for identifying the fruit samples, the variety index table of the variety management database is accessed, corresponding variety information is searched in the variety index table through sample numbers, and the variety information is a structured data set for distinguishing different fruit categories; According to the unique variety number in the variety information, accessing corresponding sample statistical table entries in a variety management database, and reading the recorded marked image data quantity; the quantity of the marked image data is the total quantity of the marked image samples which can be used for model training, migration adaptation or incremental learning at the current stage of variety information corresponding to the fruit samples.
- 3. The intelligent identification method for fruit grading scenes according to claim 2, wherein the intelligent identification method is characterized in that: in step S1, when the number of the labeled image data is smaller than a preset labeling number threshold, triggering a morphological feature data acquisition process; When the number of the marked image data is larger than or equal to a preset marked number threshold, judging that the morphological feature data are not required to be additionally acquired; After triggering the acquisition process of the morphological feature data, a visual acquisition device acquires Gao Qingtu frames of the fruit samples, and background segmentation and fruit region extraction are performed on the high-definition image frames; Determining the circumscribed rectangle boundary of the fruit sample in the image based on a minimum circumscribed rectangle fitting algorithm, detecting the length of the long side and the length of the short side of the circumscribed rectangle and generating the aspect ratio of the circumscribed rectangle; Respectively counting pixel intensity average values of three color channels of red, green and blue in a fruit area after background segmentation is executed to obtain color values of three channels of RGB; the aspect ratio features are combined with the color values of the RGB three channels to form morphology feature data.
- 4. The intelligent identification method for fruit grading scenes according to claim 1, wherein the intelligent identification method comprises the following steps: In step S2, accessing a fruit database to call the variety characteristic average value of all input fruits, wherein the fruit database is a structured data warehouse constructed for identifying stable mature varieties on a production line; The fruit is input as a variety with high confidence degree discrimination capability for the variety by accumulating sufficient labeling samples and identifying models in long-term operation; when the variety characteristic average value is called, the corresponding variety characteristic average value is read one by one according to the input fruit list, wherein the variety characteristic average value comprises an external rectangular length-width ratio average value and an average value of color values of three RGB channels; Combining morphological feature data of the fruit samples into morphological feature vectors, and combining variety feature averages of the input fruits into feature average vectors; And calling and inputting a characteristic covariance matrix obtained by statistics of the fruits in long-term labeling and recognition training.
- 5. The intelligent identification method for fruit grading scenes according to claim 4, wherein the intelligent identification method comprises the following steps: In step S2, the characteristic difference between the fruit sample and each recorded fruit is quantitatively calculated based on the mahalanobis distance, so as to obtain the characteristic difference distance between the fruit sample and the recorded fruit, wherein the specific calculation formula is as follows: ; Wherein, the For the characteristic difference distance between the fruit sample and the ith recorded fruit, Is the morphological feature vector of the fruit sample, For the characteristic mean value vector of the ith input fruit, Inputting a characteristic covariance matrix of the fruit for the ith input; and (3) carrying out ascending arrangement on the characteristic difference distances of all the input fruits, and selecting the input fruits with the minimum characteristic difference distances for marking.
- 6. The intelligent identification method for fruit grading scenes according to claim 1, wherein the intelligent identification method comprises the following steps: in step S3, clustering analysis is carried out on the aspect ratio of the circumscribed rectangle of the fruit sample and the color values of the RGB three channels; For each fruit sample, respectively carrying out numerical combination after standardization processing on color values of an external rectangular length-width ratio and RGB three channels for each fruit sample to obtain morphological feature vectors, and combining the morphological feature vectors of the fruit samples into a feature set; randomly selecting morphological feature vectors with a preset number K of fruit samples from the feature set as an initial clustering center, and classifying the morphological feature vectors in the feature set based on the initial clustering center; obtaining final category division of the fruit samples after the cluster analysis is completed; And after the final class classification result is obtained, taking the clustering result as a class classification basis of the fruit samples, and taking each clustering class as a class sample attribute.
- 7. The intelligent identification method for fruit grading scenes according to claim 6, wherein the intelligent identification method comprises the following steps: In step S3, for each category group, a preset sample number threshold is used to define the number of core samples of each category group, and sorting the fruit samples from small to large according to the feature difference distance between the marked fruit and the fruit samples; when the number of the fruit samples in the category group is greater than or equal to a preset sample number threshold, selecting the fruit samples with the preset sample number threshold which are ranked at the front as core samples; And when the number of the fruit samples in the category group is smaller than a preset sample number threshold, taking all the fruit samples in the category group as core samples.
- 8. The intelligent identification method for fruit grading scenes according to claim 7, wherein: In step S4, a training period is preset, model adaptation is carried out on the core sample in the training period, the core sample is used as training data to be input into an identification model, and the identification model updates internal parameters according to morphological feature vectors of the core sample; the updated identification model outputs a prediction result aiming at the core sample category; Presetting an identification accuracy threshold of a fruit sample, carrying out an identification test on the fruit sample, wherein the identification test is used for applying the adapted identification model to the fruit samples except the core sample, and comparing the prediction result of the identification model with the real labeling result of the fruit sample; and when the predicted category result is inconsistent with the real labeling result, the method is recorded as one-time correct identification, and when the predicted category result is inconsistent with the real labeling result, the method is recorded as one-time incorrect identification.
- 9. The intelligent identification method for fruit grading scenes according to claim 8, wherein the intelligent identification method comprises the following steps: In step S4, taking the ratio result of the correct recognition times to the total number of test samples as an accuracy test value; when the identification accuracy test value is greater than or equal to the identification accuracy threshold value, inputting variety information of the fruit sample into a fruit database to serve as an identifiable variety of a subsequent identification task; Reproducing the recognition accuracy threshold when the recognition accuracy test value is smaller than the recognition accuracy threshold; when the identification accuracy threshold value is remapped, calculating an identification accuracy test value of each fruit sample variety in the test sample, and remapping the identification accuracy threshold value based on each identification accuracy test value.
Description
Intelligent identification method for fruit grading scene Technical Field The invention relates to the technical field of scene recognition, in particular to an intelligent recognition method for fruit classification scenes. Background On a fruit classification production line, an automatic classification technology based on visual identification has become a key means for improving the consistency of processing efficiency and quality, and the existing fruit identification method generally adopts a supervised deep learning model, such as a Convolutional Neural Network (CNN), and trains through labeling image data with large scale, high quality and balanced categories so as to realize multi-dimensional automatic discrimination and classification of fruit varieties, maturity, sizes, colors, surface defects and the like. The method has higher identification precision and stability in the industrial scene of sufficient data and fixed variety. With the continuous enrichment of fruit market varieties and the diversification of consumption demands, the production line needs to frequently introduce new varieties or deal with seasonal and small-batch special fruit processing tasks. The existing mainstream technical scheme gradually exposes inherent limitations when facing such a scene, and the existing technology has the following defects: 1. The deep learning method essentially belongs to a data-driven model, and the performance of the deep learning method is seriously dependent on the scale and quality of training data. For newly introduced fruit varieties, there is often a lack of a sufficient number of precisely labeled image samples. If a small number of samples are forcedly used for training, the model is extremely easy to fall into overfitting, and the variety characteristics with generalization capability cannot be learned, so that the identification accuracy rate is suddenly reduced on an actual production line; 2. Whenever a variety is newly added, large-scale data is usually required to be collected again and marked, and model training or complex transfer learning from scratch may be required. The process is time-consuming and labor-consuming, requires professionals to carry out data labeling and model tuning, affects the quick switching and flexible response capability of a production line, and is difficult to adapt to the requirements of high efficiency and flexibility of modern agricultural product processing; 3. Under the condition of limited sample number, the existing model is difficult to stably extract the identification characteristics capable of effectively distinguishing new varieties from existing mature varieties from a small amount of data. The model is too sensitive to accidental features (such as special gestures, abnormal illumination and the like of individual fruits) of the sample, and is insufficient in learning intrinsic morphology, color and other common features of varieties, so that an identification result is unstable, and the confidence is low. Disclosure of Invention In order to overcome the defects in the prior art, the embodiment of the invention provides an intelligent identification method for fruit classification scenes, which solves the problems in the background art by applying a core sample self-adaptive training technology combining a morphological feature acquisition mechanism based on labeling data quantity judgment, feature difference distance measurement and cluster screening. In order to achieve the above purpose, the invention provides the following technical scheme, namely an intelligent identification method for fruit classification scenes, which comprises the following steps: Step S1, when the fruit samples are identified, variety information of the fruit samples is called, the quantity of marked image data of the fruit samples is called based on the variety information, and whether morphological feature data of the fruit samples are acquired is judged according to the quantity of the marked image data; Step S2, after morphological feature data of the fruit samples are collected, accessing a fruit database to call a variety feature mean value of the input fruits, calculating feature difference distances between the fruit samples and the input fruits by combining the morphological feature data, and marking the input fruits based on the feature difference distances; Step S3, carrying out cluster analysis on morphological feature data of the fruit samples, classifying sample attributes of the fruit samples according to the cluster results, and comprehensively inputting the classification results and marks into the fruits to screen the fruit samples to obtain core samples; And S4, setting a training period, performing model adaptation on the core sample in the training period, formulating an identification accuracy threshold of the fruit sample after the model adaptation, performing an identification test on the fruit sample, and selecting a reproduction identifica