Search

CN-121599044-B - Migration learning method, system and application of fruit internal quality detection model

CN121599044BCN 121599044 BCN121599044 BCN 121599044BCN-121599044-B

Abstract

The invention provides a method, a system and an application for migration learning of a fruit internal quality detection model. The transfer learning method comprises the steps of providing a training set, training a plurality of original network architectures, selecting an optimal network architecture, selecting a key characteristic wave band subset, retraining the optimal network architecture in a key characteristic wave band, performing full-wave-band transfer learning and key wave-band transfer learning from a source quality index to a target quality index, and selecting one of the source quality index and the target quality index as a quality detection model of the target quality index. According to the method, the key characteristic wave bands are identified by adopting an interpretability analysis method, and knowledge migration and generalization among different quality indexes are realized by utilizing a migration learning technology, so that the accuracy and stability of the model in a cross-quality prediction task are remarkably improved; the method effectively solves the problem of difficult model training under the condition of small samples through transfer learning, enhances the generalization capability of the model, and provides a new technical approach for nondestructive testing of the internal quality of fruits.

Inventors

  • LIU WEI
  • GUO JUNJIE
  • LIU CHANGHONG
  • ZHENG LEI
  • GAO CHUN

Assignees

  • 合肥大学

Dates

Publication Date
20260508
Application Date
20260127

Claims (6)

  1. 1. A method for migrating and learning a fruit internal quality detection model based on multispectral and interpretability, which is characterized in that the fruit comprises any one of blueberries, strawberries and bananas, and the method comprises the following steps: providing a training set comprising multispectral image data of the fruit, and a plurality of physicochemical analysis label data concerning a plurality of quality metrics inside the fruit; As for the source quality index(s), Training a plurality of original network architectures based on the multispectral image data of the full wave band, and selecting an optimal network architecture from training results to obtain a full wave band initial prediction model, wherein the plurality of original network architectures belong to residual multi-layer perceptron network architectures; Analyzing the training process of the optimal network architecture based on an interpretability analysis method, and selecting a partial wave band with high contribution to a predicted result as a key characteristic wave band subset, wherein a SHAP value is used as a characteristic quantity of the contribution, and for any characteristic wave band, the calculation mode of the SHAP value is expressed as follows: ; Wherein, the Expressed in a sample Mid-characteristic band of wavelengths And takes the average value of the sample SHAP values of all samples as the characteristic wave band Performing contribution screening on the band SHAP value of (B); Is a set of all characteristic bands; to not include characteristic wave bands Is a subset of features of (a); representing usage subsets The prediction output of the optimal network architecture; sign symbol The difference operation of the set is represented, Representing a slave set Is removed from The obtained collection; Is a collection Is marked as any subset of Symbol(s) And (3) with Respectively represent the collection And (3) with The number of elements in- Representing subsets With a single set Is a union of (1); retraining the optimal network architecture in the key characteristic band subset to obtain a key band initial prediction model; As for the target quality index(s), Migrating the network parameters of the full-band initial prediction model to a prediction task of a target quality index, and constructing a full-band migration learning model by finely adjusting the network parameters; migrating the network parameters of the key wave band initial prediction model to a prediction task of a target quality index, and constructing a key wave band migration learning model by fine tuning the network parameters; verifying the performance of the full-band shift learning model and the key band shift learning model based on the physicochemical analysis tag data, and preferentially selecting one as a quality detection model of the target quality index; Selecting the target quality index from more than 3 quality indexes, and selecting one of the rest quality indexes as the source quality index, wherein the method specifically comprises the steps of respectively obtaining key characteristic wave band subsets of a plurality of quality indexes based on an interpretability analysis method, and selecting one quality index with highest overlapping degree with the key wave band subset of the target quality index as the source quality index; Executing the pre-training and transfer learning processes until all the quality indexes are traversed, and constructing a total index detection model of the internal quality of the fruit; Wherein, the preferred evaluation indexes of the optimal network architecture and the quality detection model comprise any one or more than two of root mean square error, correlation coefficient and residual error prediction deviation; the calculation mode of the root mean square error is expressed as follows: ; The calculation mode of the correlation coefficient is expressed as follows: ; The calculation mode of the residual prediction deviation is expressed as follows: ; Wherein, the Representing the root mean square error; representing the correlation coefficient; representing the residual prediction bias; Representing the physical and chemical analysis tag data, A multi-sample average value representing the physicochemical analysis label data; represents the predicted value of the physical and chemical analysis data, A multi-sample average value representing a predicted value of the physicochemical analysis data; Representing the number of samples; A sequence number representing a sample; representing the standard deviation of the physicochemical analytical label data.
  2. 2. The transfer learning method according to claim 1, wherein the acquiring process of the multispectral image data specifically includes: collecting original light intensity data of a fruit sample by utilizing a multispectral imaging system; converting the original light intensity data into reflectivity data by whiteboard correction; And preprocessing the reflectivity data to obtain the multispectral image data, wherein the preprocessing modes comprise any one or combination of two of moving average and multiplicative scattering correction, and the preprocessing modes are preferentially selected from a plurality of preprocessing modes based on training.
  3. 3. The method according to claim 1, wherein the residual multi-layer perceptron network architecture comprises an input layer, a residual block, and an output layer; and in the transfer learning process, only the parameters of the full-connection layer in the output layer are finely adjusted, and the rest layers are frozen.
  4. 4. The method according to claim 1, wherein the screening process of the key feature band subset specifically includes: In the characteristic wave band The band SHAP values are ordered from high to low, and the characteristic bands with the preset number before the ordering are selected As the critical feature band subset.
  5. 5. The full spectrum detection method for the internal quality of the fruits is characterized by comprising the following steps of: Providing multispectral image data of a target fruit and a quality detection model obtained by training the migration learning method according to any one of claims 1-4; And inputting the multispectral image data into the quality detection model to obtain a predicted value of the quality index of the target fruit.
  6. 6. A transfer learning system based on a multispectral and interpretable fruit internal quality detection model, wherein the transfer learning system is configured to perform the transfer learning method of any one of claims 1-4, the fruit including any one of blueberries, strawberries, bananas, the transfer learning system comprising: The original data module is used for providing a training set, wherein the training set comprises multispectral image data of fruits and various physicochemical analysis label data related to a plurality of quality indexes inside the fruits; The full-band pre-training module is used for training a plurality of original network architectures based on the multispectral image data of the full band aiming at the source quality index, and selecting an optimal network architecture from training results to obtain a full-band initial prediction model; The characteristic wave band screening module is used for analyzing the training process of the optimal network architecture based on an interpretability analysis method and selecting a partial wave band with high contribution to a prediction result as a key characteristic wave band subset; The key wave band pre-training module is used for retraining the optimal network architecture in the key characteristic wave band subset aiming at the source quality index to obtain a key wave band initial prediction model; The full-band migration module is used for migrating the network parameters of the full-band initial prediction model to a prediction task of a target quality index, and constructing a full-band migration learning model by fine-tuning the network parameters; the key wave band migration module is used for migrating the network parameters of the key wave band initial prediction model to a prediction task of a target quality index, and constructing a key wave band migration learning model by fine tuning the network parameters; The model selection module is used for verifying the performances of the full-band transfer learning model and the key band transfer learning model based on the physicochemical analysis label data, and preferentially selecting one as a quality detection model of the target quality index; The method further comprises the steps of selecting the target quality index from a plurality of quality indexes, selecting one of the remaining quality indexes as the source quality index, and selecting one quality index with the highest overlapping degree with the key wave band subset of the target quality index as the source quality index on the basis of an interpretability analysis method; And executing the pre-training and transfer learning processes until all the quality indexes are traversed, and constructing a module of a total index detection model of the internal quality of the fruit.

Description

Migration learning method, system and application of fruit internal quality detection model Technical Field The invention belongs to the technical field of nondestructive testing and artificial intelligence intersection of agricultural products, and particularly relates to a migration learning method, a migration learning system and application of a fruit internal quality detection model. Background Traditional detection methods for the internal quality of fruits mainly rely on destructive physicochemical analysis, and the methods have low efficiency and cannot realize rapid screening of batch products. In recent years, a spectral imaging technique has been widely used as an effective nondestructive testing means, which can acquire spectral information and a spatial image of a sample at the same time. However, in practical application, the technology still faces significant challenges, namely, firstly, full-band spectrum data is high in dimensionality and information redundancy, direct modeling is easy to cause large calculation load and poor in model robustness, secondly, a deep learning model is high in prediction accuracy, but the decision process is like a black box, the interpretation is lacking, a user is difficult to trust and deeply understand a quality formation mechanism, furthermore, a model built for a specific variety or a growth environment is generally insufficient in generalization capability, when the model is applied to a new variety or different batches of products, performance is obviously reduced, a large amount of training data is re-labeled, modeling cost is high, development of a modeling method capable of adapting to a small amount of labeling data is urgently needed, and finally, a mode for independently constructing the model for different quality indexes cannot fully utilize potential correlations among different quality indexes, so that further improvement of detection efficiency is limited. Therefore, developing a nondestructive testing method that has high precision, strong interpretation, excellent generalization capability and can realize the task-crossing migration of knowledge has become an urgent technical need in the art. Disclosure of Invention The invention mainly aims to provide a migration learning method, a migration learning system and application of a fruit internal quality detection model, so as to overcome the defects of the prior art. In order to achieve the above object, the present invention adopts the following technical scheme: In a first aspect, the present invention provides a method for migration learning of a model for detecting internal quality of fruit based on multispectral and interpretability, wherein the fruit includes any one of blueberry, strawberry and banana, and the method for migration learning includes: providing a training set comprising multispectral image data of the fruit, and a plurality of physicochemical analysis label data concerning a plurality of quality metrics inside the fruit; As for the source quality index(s), Training a plurality of original network architectures based on the multispectral image data of the full wave band, and selecting an optimal network architecture from training results to obtain a full wave band initial prediction model; Analyzing the training process of the optimal network architecture based on an interpretability analysis method, and selecting a partial wave band with high contribution to a prediction result as a key characteristic wave band subset; retraining the optimal network architecture in the key characteristic band subset to obtain a key band initial prediction model; As for the target quality index(s), Migrating the network parameters of the full-band initial prediction model to a prediction task of a target quality index, and constructing a full-band migration learning model by finely adjusting the network parameters; migrating the network parameters of the key wave band initial prediction model to a prediction task of a target quality index, and constructing a key wave band migration learning model by fine tuning the network parameters; And verifying the performances of the full-band transfer learning model and the key band transfer learning model based on the physicochemical analysis tag data, and preferentially selecting one as a quality detection model of the target quality index. In a second aspect, the present invention also provides a full spectrum detection method for internal quality of fruits, as an application of the above migration learning method, comprising: Providing multispectral image data of the target fruit and a quality detection model obtained by training by the migration learning method; And inputting the multispectral image data into the quality detection model to obtain a predicted value of the quality index of the target fruit. In a third aspect, corresponding to the above-mentioned transfer learning method, the present invention further provides a transfer learning s