Hyperspectral selfheal producing area identification method based on large model reprogramming
By using a large model reprogramming method, combined with hyperspectral imaging and chemometrics, the problems of low accuracy and high cost in identifying the origin of Prunella vulgaris were solved, achieving rapid, non-destructive, and low-cost high-precision identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-17
AI Technical Summary
Existing methods for identifying the origin of Prunella vulgaris rely on traditional experience and physicochemical analysis, which suffer from low accuracy, long processing time, high cost, and destructive damage. Furthermore, deep learning models require a large number of labeled samples and computational resources, making it difficult to achieve fast, low-cost, and high-precision identification.
By employing a large model reprogramming approach, and designing input adaptation and label mapping functions, the pre-trained large model is applied to the identification of the origin of Prunella vulgaris from hyperspectral data. Transfer learning is used to reduce the dependence on labeled data and computational resources. Combined with hyperspectral imaging system and chemometrics, accurate identification of the origin of Prunella vulgaris is achieved.
This method enables rapid, accurate, and non-destructive detection of the origin of Prunella vulgaris, reducing the need for large-scale labeled data and computing resources, and providing an efficient and low-cost identification method.
Smart Images

Figure CN121678554A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical hyperspectral intelligent detection, and particularly relates to a hyperspectral prunella vulgaris origin identification method based on large model reprogramming. BACKGROUND
[0002] Prunella vulgaris, as a traditional Chinese medicinal material, has significant effects on clearing heat and reducing fire, improving eyesight, resolving knots and detumescence, and is widely used in clinical prescriptions and herbal tea drinks. Due to the differences in growth environment, climate, soil composition, etc., the types and contents of effective chemical components and trace elements contained in prunella vulgaris from different origins are also significantly different, which directly affects its efficacy and clinical application value. Therefore, rapid and accurate origin identification of prunella vulgaris is an important link to ensure drug quality, maintain market order and ensure medication safety.
[0003] At present, the origin identification method of prunella vulgaris mainly relies on traditional experience identification, physicochemical component analysis, etc. Traditional experience identification methods, such as appearance and odor observation, are highly subjective, low in accuracy, and require identification personnel to have rich practical experience. Physicochemical component analysis methods, such as high performance liquid chromatography or gas chromatography-mass spectrometry, etc., although have high accuracy, have the disadvantages of complicated operation, long time consumption, high cost, and destructive damage to samples, etc., and are not suitable for large-scale, rapid on-site detection.
[0004] In recent years, as a non-destructive and rapid detection technology, hyperspectral imaging (HSI) technology has shown great potential in the field of traditional Chinese medicinal material identification. This technology can simultaneously obtain image information and spectral information of the sample, and combined with chemometrics or conventional machine learning methods, an origin identification model can be established. However, with the development of deep learning technology, although the use of convolutional neural network models to process hyperspectral data can achieve higher accuracy, such methods usually require a large number of labeled samples for model training. For the field of traditional Chinese medicinal materials, it is often costly and challenging to obtain a large number of standardized origin samples. In addition, training a deep neural network from scratch requires a large amount of computing resources and time. Therefore, a new type of prunella vulgaris origin identification method that does not rely on large-scale labeled samples, has low computing cost and can achieve high-precision identification is needed. SUMMARY
[0005] The present application proposes a hyperspectral prunella vulgaris origin identification method based on large model reprogramming to solve the problems in the background art,
[0006] To achieve the above-mentioned purpose, the present application adopts the following technical solutions:
[0007] A hyperspectral prunella vulgaris origin identification method based on large model reprogramming is designed, comprising the following steps:
[0008] S1, collect hyperspectral data of Prunella vulgaris samples from different origins;
[0009] S2, Correct and preprocess the collected hyperspectral data to obtain one-dimensional Prunella vulgaris hyperspectral data;
[0010] S3, design an input adaptation function to convert one-dimensional Prunella vulgaris hyperspectral data into a pseudo-spectral signal that meets the input requirements of a large model;
[0011] S4. Input the pseudo-spectral signal into the pre-trained large model, and then map the original output category of the large model to the origin category of Prunella vulgaris. By training only the reprogrammed vector in the adaptation function, the accurate identification of the origin of Prunella vulgaris can be achieved.
[0012] Furthermore, in step S1, samples of Prunella vulgaris from different origins are prepared, and all samples of Prunella vulgaris from different origins are subjected to spectral scanning using a hyperspectral imaging system to collect hyperspectral data within a specific wavelength range of the samples.
[0013] Furthermore, in step S2, after the hyperspectral data acquisition is completed, in order to eliminate the influence of external factors such as instrument noise and current on the sample data, the original hyperspectral image is first corrected using the instrument's built-in RAD correction software. Then, the corrected hyperspectral data is subjected to black and white correction. The black and white correction calculation formula is as follows:
[0014]
[0015] Where I O Indicates the spectral image before correction, I C I represents the corrected spectral image. D Represents a black reference image, I W The whiteboard reference image is used. The region of interest (ROI) for each sample is selected using ENVI software after correction. The average spectral value of the ROI for each sample is then exported. Different correction methods are used to preprocess the average spectral value of the ROI to obtain one-dimensional Prunella vulgaris hyperspectral data.
[0016] Furthermore, in step S3: an input adaptation function is designed, which mainly consists of transformation operations and a trainable reprogrammable vector. The transformation operations include, but are not limited to, zero-padding, median padding (average of the maximum and minimum sample values), and operations such as copying, flipping, mirroring, and truncation. The original hyperspectral data is converted into a signal that meets the input length requirements of a large model through these transformation operations. This signal is then added to a trainable reprogrammable vector of the same dimension to form the final pseudo-spectral signal that meets the input requirements of the large model.
[0017] Furthermore, in step S4: the pre-trained large models used include audio classification models (AttentionRNN, Attention RNN(unet), Yamnet) and time series classification models (InceptionTime, TimesNet, OS-CNN). The original task prediction categories of the large models used are usually larger than the categories of Prunella vulgaris origin. The pseudo-spectral signal is input into the pre-trained large models, and then the prediction results of the large models for the original tasks are obtained. Through a fixed label mapping function, these original task category labels are mapped to the Prunella vulgaris origin categories according to a many-to-one rule. The formula for calculating the label mapping function is as follows:
[0018]
[0019] Where y s These are the category labels for the original task of the large model, y t This is the origin label for Prunella vulgaris. B refers to the origin label y mapped to Prunella vulgaris. t The category labels of those original tasks, |B| refers to how many category labels of the original tasks are mapped to the Prunella vulgaris origin label y. t f s It is a pre-trained large model, H is the input adaptation function, and θ is a trainable and reprogrammable vector.
[0020] By training only the reprogrammed vectors in the input adaptation function, using spectral data of Prunella vulgaris from known origins, and employing a backpropagation algorithm with cross-entropy loss as the optimization objective, the optimized input adaptation function, the large model with frozen parameters, and the label mapping function together constitute the final Prunella vulgaris origin identification model.
[0021] Compared with the prior art, the present invention has the following beneficial effects:
[0022] This invention applies the transfer learning method, which utilizes the powerful feature extraction capabilities of large models. It eliminates the need to train complex deep learning models from scratch, significantly reducing the dependence on large-scale labeled hyperspectral data and the consumption of computational resources, and providing a new paradigm for the identification of the origin of Prunella vulgaris. Attached Figure Description
[0023] The accompanying drawings are part of this invention and are primarily intended to facilitate understanding and explanation of the invention. They should not be construed as undue limitations on the invention.
[0024] Figure 1 This is a flowchart of the method described in this invention.
[0025] Figure 2 This is a schematic diagram of the model reprogramming method described in this invention. Detailed Implementation
[0026] The specific embodiments of the present invention will be described below with reference to the accompanying drawings and examples. However, the following examples are only used to illustrate the present invention in detail and do not limit the scope of the present invention in any way.
[0027] Example 1: As Figure 1 As shown, it includes the following steps:
[0028] S1. All experiments were conducted in a sealed, dark environment to avoid light interference. Since the various optical components of the hyperspectral imaging system are sensitive to temperature, and preheating the light source system helps provide stable illumination and reduce distortion of spectral reflectance intensity, a 30-minute preheating period was taken before data acquisition to avoid light source interference. The *Prunella vulgaris* samples were evenly placed on the stage, and the distance between the lens and the sample was adjusted to 25 cm. Then, the hyperspectral imaging system was activated to perform a spectral scan. The measured spectral wavelength range of the hyperspectral image data was 970-2500 nm.
[0029] S2. First, the original hyperspectral image is corrected using the instrument's built-in RAD correction software. Then, black and white correction is performed on the corrected hyperspectral data. The black and white correction calculation formula is as follows:
[0030]
[0031] Where I O Indicates the spectral image before correction, I C I represents the corrected spectral image. D Represents a black reference image, I W The whiteboard reference image is used. The region of interest (ROI) for each sample is selected using ENVI software after correction. The average spectral value of the ROI for each sample is then exported. The average spectral value of the ROI is preprocessed using multivariate scattering correction to obtain one-dimensional Prunella vulgaris hyperspectral data.
[0032] S3. Design different input adaptation functions to convert one-dimensional Prunella vulgaris hyperspectral data into pseudospectral signals that meet the input requirements of large models; among them, there are four candidate filling methods:
[0033] (1) Uniform copying and filling: The original hyperspectral signal is copied and spliced multiple times. If the length of the spliced signal is less than the length required by the model input, zeros are added at the end. If it is greater than the length, it is truncated directly.
[0034] (2) Interpolation copy padding: The original spectral signal is upsampled to 5 times its original length using bilinear interpolation, and the interpolated signal is directly copied and spliced. If the spliced length is less than the length required by the model input, the remaining part is padded with dynamic values (the average of the maximum and minimum values of the original hyperspectral signal) at the end; if it is greater, it is truncated.
[0035] (3) Interpolation average filling: Bilinear interpolation is used to upsample the original spectral data to 5 times the original length. Through a loop, the gap size between each repeated segment and between the beginning and end is calculated. Then, the interpolated signal segments are evenly placed one by one into the entire input of the model, and the remaining part is filled with dynamic values (the average of the maximum and minimum values of the original hyperspectral signal).
[0036] (4) Symmetrical copy filling: The original spectral signal is concatenated with its flipped signal to obtain SU1. Then SU1 is concatenated with its flipped reversed_SU1 again to obtain SU2. This basic unit SU2 is repeated several times, and then the remaining part is filled with dynamic values (the average of the maximum and minimum values of the original hyperspectral signal).
[0037] The padded signal is then added to a trainable reprogrammable vector of the same dimension to form a pseudospectral signal that finally meets the input requirements of a large model.
[0038] S4, taking the Attention RNN for audio classification and the InceptionTime for time series classification as examples, pseudospectral signals are input into the Attention RNN and InceptionTime to obtain the model's prediction results for the original task. Then, through a fixed label mapping function, the category labels of these original tasks are mapped to the origin category of Prunella vulgaris according to a many-to-one rule. The formula for calculating the label mapping function is as follows:
[0039]
[0040] Where y s These are the class labels for the Attention RNN and the original InceptionTime task, y t This is the origin label for Prunella vulgaris. B refers to the origin label y mapped to Prunella vulgaris. t The class labels of those Attention RNNs and the original InceptionTime task, |B| refers to how many class labels of the Attention RNNs and the original InceptionTime task are mapped to the Prunella vulgaris origin label y. t f sIt consists of a pre-trained Attention RNN and an InceptionTime model, where H is the input adaptation function and θ is a trainable and reprogrammable vector.
[0041] The reprogrammed vectors in the input adaptation function are trained using spectral data of Prunella vulgaris from known origins. The backpropagation algorithm is employed, with cross-entropy loss as the optimization objective. After training, the optimized input adaptation function, the large model with frozen parameters, and the label mapping function together constitute the final Prunella vulgaris origin identification model.
[0042] The present invention has been described in detail above with reference to the accompanying drawings and embodiments; however, those skilled in the art will understand that, without departing from the concept of the present invention, various specific parameters in the above embodiments can be changed, or relevant components and structures can be equivalently substituted, thereby forming multiple specific embodiments, all of which are common variations of the present invention, and will not be described in detail one by one.
Claims
1. A hyperspectral Prunella vulgaris provenance identification method based on large model reprogramming, characterized by, The method comprises the following steps: S1, collecting hyperspectral data of Prunella vulgaris samples from different producing areas; S2, correcting and preprocessing the collected hyperspectral data to obtain one-dimensional Prunella vulgaris hyperspectral data; S3, designing an input adaptation function to convert the one-dimensional Prunella vulgaris hyperspectral data into a pseudo-spectral signal conforming to the input requirements of the large model; S4, inputting the pseudo-spectral signal into the pre-trained large model, then mapping the original output category of the large model to the producing area category of Prunella vulgaris, and realizing accurate identification of the producing area of Prunella vulgaris by only training the reprogramming vector in the input adaptation function.
2. The hyperspectral Prunella vulgaris L. origin identification method based on large model reprogramming according to claim 1, characterized in that: In step S1, the hyperspectral imaging system is used to scan the spectrum of all Prunella vulgaris samples from different producing areas, and the hyperspectral data of the samples in a specific wavelength range is collected.
3. The hyperspectral Prunella vulgaris L. origin identification method based on large model reprogramming according to claim 1, characterized in that: In step S2, after the hyperspectral data is collected, the original hyperspectral image is first corrected using the RAD correction software to eliminate the influence of instrument noise, current and other external factors on the sample data, and then the corrected hyperspectral data is black and white corrected. The average spectral value of the interested region of each sample is selected by using ENVI software, and the average spectral value of the interested region is preprocessed by using different correction methods to obtain one-dimensional Prunella vulgaris hyperspectral data.
4. The hyperspectral Prunella vulgaris L. origin identification method based on large model reprogramming according to claim 1, characterized in that: In step S3, an input adaptation function composed of conversion operations and trainable reprogramming vectors is designed. The conversion operation expands the short original spectral data to a length matching the input of the large model through copying and flipping, symmetry and padding operations, and then adds the signal to a trainable reprogramming vector with the same dimension to form a pseudo-spectral signal conforming to the input requirements of the large model.
5. The hyperspectral Prunella vulgaris L. origin identification method based on large model reprogramming according to claim 1, characterized in that: In step S4, the pseudo-spectral signal is input into the pre-trained large model to obtain the prediction result of the large model for the original task, and then a fixed label mapping function is used to map the category labels of these original tasks to the producing area category of Prunella vulgaris according to the one-to-many rule.
6. The hyperspectral Prunella vulgaris L. origin identification method based on large model reprogramming according to claim 1, characterized in that: In step S5, only the reprogramming vector in the input adaptation function is trained, and the hyperspectral data of Prunella vulgaris with known producing areas is used to train the reprogramming vector through the back propagation algorithm with cross-entropy loss as the optimization objective. After training, the optimized input adaptation function, the large model with frozen parameters and the label mapping function together constitute the final Prunella vulgaris producing area identification model.