Traditional Chinese medicine extract analysis method and system based on cross-platform spectrum and feature fusion
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG UNIV
- Filing Date
- 2026-06-09
- Publication Date
- 2026-07-10
Smart Images

Figure CN122361344A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medicinal material testing technology, specifically to a method and system for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Near-infrared spectroscopy, due to its non-destructive nature, rapid detection, and suitability for online deployment, has become an important tool for process analysis in the pharmaceutical industry. In the field of traditional Chinese medicine production, this technology enables real-time monitoring of key quality attributes during the extraction process, supporting endpoint determination, batch consistency control, and process optimization. With the increasing demand for process analysis technologies in the pharmaceutical industry, portable near-infrared devices, with their low cost, small size, and flexible installation, have increasingly broad application prospects on production lines, providing the hardware foundation for large-scale online quality monitoring.
[0004] However, portable near-infrared devices are limited by weak signal quality and low resolution, making it difficult to establish quantitative models that meet the requirements of high-precision analysis. Existing calibration transfer methods mostly rely on linear transformations, which have limited effectiveness in handling complex nonlinear spectral differences between different platforms and cannot fully preserve the fine-grained spectral structure information crucial for quantitative analysis. More importantly, existing technologies often directly replace the original portable spectra with generated reference style spectra for analysis, ignoring the effectiveness of the original field information. This results in insufficient improvement in analytical performance and makes it difficult to effectively utilize the complementary advantages of the two data sources to improve the accuracy of online quantitative analysis. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a method and system for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion. This method improves the accuracy and reliability of online monitoring of key quality attributes of traditional Chinese medicine extracts, and provides strong support for quality control, endpoint determination, and process optimization in the production process of traditional Chinese medicine.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion.
[0007] An analytical method for traditional Chinese medicine extracts based on cross-platform spectral and feature fusion includes the following steps: A portable near-infrared spectra of the herbal extract to be tested; Portable near-infrared spectra are input into a pre-trained cross-platform spectral generation model to obtain a reference platform style spectrum. The cross-platform spectral generation model is trained based on the portable near-infrared spectrum of the sample, the laboratory-grade near-infrared reference spectrum, and the true content values of key quality markers in the sample. The portable near-infrared spectrum and the reference platform style spectrum are respectively input into two independent processing branches of the feature fusion module to obtain the original features and their corresponding original feature scores, the generated features and their corresponding generated feature scores; The original feature scores and generated feature scores are normalized to obtain the original feature fusion weights and generated feature fusion weights. The original features are weighted using the original feature fusion weights, and the generated features are weighted using the generated feature fusion weights. The two weighted results are added together to obtain the fused comprehensive features. The fused comprehensive features are input into a pre-trained quantitative analysis modeling module to obtain the predicted content of key quality markers in the extract of the Chinese herbal medicine to be tested.
[0008] In one implementation of the first aspect of the present invention, the loss function used when training the cross-platform spectral generation model includes reconstruction loss, derivative loss and adversarial loss. The reconstruction loss is used to constrain the difference in the overall profile between the generated reference platform style spectrum and the laboratory-grade near-infrared reference spectrum. The derivative loss is used to constrain the local variation trend of spectral lines and peak details. The adversarial loss is used to enhance the reference platform style authenticity of the generated reference platform style spectrum.
[0009] In one implementation of the first aspect of the present invention, the feature fusion module performs normalization processing on the original feature score and the generated feature score to obtain the original feature fusion weight and the generated feature fusion weight, including: The original feature score and the generated feature score are used as inputs to the exponential function, and then divided by the sum of the outputs of the two exponential functions to obtain the original feature fusion weight and the generated feature fusion weight.
[0010] In one implementation of the first aspect of the present invention, the quantitative analysis modeling module adopts a convolutional regression structure, inputting the fused comprehensive features into the quantitative analysis modeling module to obtain the predicted content of key quality markers in the extract of the Chinese herbal medicine to be tested, including: The fused composite features are then subjected to convolution processing to obtain the convolution output features; The convolution output features are flattened to obtain a one-dimensional feature vector; One-dimensional feature vectors are input into a multilayer perceptron for high-level nonlinear mapping to obtain linear mapping results for the output layer. The predicted content is obtained by performing a Softplus transformation on the linear mapping result.
[0011] As a further limitation of the first aspect of the present invention, when performing convolution processing on the fused comprehensive features, the fused comprehensive features are locally scanned by several convolution kernels to extract local feature patterns related to changes in the content of key quality markers. Flattening the convolution output features to obtain a one-dimensional feature vector involves treating the convolution output features as a multi-channel one-dimensional feature map and rearranging all elements into a single one-dimensional vector according to the channel order and the positional order within each channel.
[0012] In one implementation of the first aspect of the present invention, before obtaining the portable near-infrared spectrum of the herbal extract to be tested, the method further includes: driving the herbal extract to be tested to flow through the pipeline of the online detection platform to update the herbal extract in the pipeline; controlling the temperature of the herbal extract in the pipeline to a specified temperature; and allowing the herbal extract after being kept at a constant temperature to enter the flow cell and remain stationary.
[0013] In one implementation of the first aspect of the present invention, the key quality markers include naringin or paeoniflorin. After obtaining the predicted content of the key quality markers in the extract of the Chinese herbal medicine to be tested, the method further includes: displaying the predicted content, the trend of the predicted content, and production suggestion information in real time on a display terminal.
[0014] Secondly, the present invention provides a traditional Chinese medicine extract analysis system based on cross-platform spectral and feature fusion.
[0015] A cross-platform spectral and feature fusion-based analysis system for traditional Chinese medicine extracts includes: The spectral acquisition unit is configured to acquire the portable near-infrared spectrum of the herbal extract to be tested. The spectral generation unit is configured to input portable near-infrared spectra into a pre-trained cross-platform spectral generation model to obtain a reference platform style spectrum. The cross-platform spectral generation model is trained based on the portable near-infrared spectrum of the sample, the laboratory-grade near-infrared reference spectrum, and the true content values of key quality markers in the sample. The feature extraction unit is configured to input portable near-infrared spectroscopy and reference platform style spectroscopy into two independent processing branches of the feature fusion module to obtain the original features and their corresponding original feature scores, and the generated features and their corresponding generated feature scores. The weight calculation unit is configured to: perform normalization processing on the original feature scores and generated feature scores to obtain the original feature fusion weights and generated feature fusion weights; The feature fusion unit is configured to: weight the original features using the original feature fusion weights, and weight the generated features using the generated feature fusion weights, and add the two weighted results to obtain the fused comprehensive features; The content prediction unit is configured to input the fused comprehensive features into a pre-trained quantitative analysis modeling module to obtain the predicted content of key quality markers in the extract of the Chinese herbal medicine to be tested.
[0016] Thirdly, the present invention provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor and executed by the method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion according to the first aspect of the present invention.
[0017] Fourthly, the present invention provides a computer device, comprising: a processor and a computer-readable storage medium; A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion, which is the first aspect of the present invention.
[0018] Compared with the prior art, the beneficial effects of the present invention are: This invention effectively solves the problems of complementary information loss and insufficient quantitative accuracy caused by directly replacing the original spectrum in existing technologies by constructing a cross-platform spectral generation model and a dual-branch feature fusion mechanism. Specifically, this invention first uses a cross-platform spectral generation model to transform portable near-infrared spectra into high-quality spectra with a reference platform style, preserving key fine-grained structural information. At the same time, the original portable spectrum is not discarded, but it and the generated spectrum are respectively input into two independent branches of the feature fusion module to extract original features and generated features in parallel, and each generated feature is scored. The dynamic fusion weight obtained by normalization based on the score can adaptively measure the reliability of the two feature sources and achieve weighted fusion. This invention fully explores and synergistically utilizes the authenticity of the original field data and the high fidelity of the generated data, overcoming the inherent limitations of a single data source, thereby significantly improving the accuracy and robustness of portable near-infrared devices for online quantitative analysis of key quality markers in traditional Chinese medicine extracts.
[0019] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0020] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0021] Figure 1A schematic diagram of the overall design of a quantitative analysis system for traditional Chinese medicine extracts based on cross-platform spectral generation and feature fusion, provided as an exemplary embodiment of the present invention; Figure 2 A schematic diagram of the overall system framework provided for an exemplary embodiment of the present invention; Figure 3 A schematic diagram of an online detection platform provided as an exemplary embodiment of the present invention; Figure 4 A schematic diagram of a cross-platform spectrum generation module structure is provided as an exemplary embodiment of the present invention; Figure 5 A schematic diagram of a feature fusion module provided in an exemplary embodiment of the present invention; Figure 6 A schematic diagram of a quantitative analysis modeling module provided as an exemplary embodiment of the present invention; Figure 7 A schematic diagram of the online operation phase workflow provided as an exemplary embodiment of the present invention; Figure 8 A schematic flowchart of a method for quantitative analysis of traditional Chinese medicine extracts based on cross-platform spectral generation and feature fusion, provided as an exemplary embodiment of the present invention; Figure 9 A schematic diagram of a quantitative analysis system for traditional Chinese medicine extracts based on cross-platform spectral generation and feature fusion, provided as another exemplary embodiment of the present invention; Figure 10 A schematic diagram of a computer device provided as an exemplary embodiment of the present invention; The components include: 1. Pilot-scale extraction tank; 2. High-end Bruker MATRIX-F II spectrometer; 3. Optical fiber; 4. Near-infrared light source; 5. First flow cell; 6. Second flow cell; 7. Portable Optosky ATP8000 spectrometer; 8. Sampling port; 9. Computer; 10. Temperature control device; and 11. Diaphragm pump. Detailed Implementation
[0022] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0023] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0024] In the extraction process of traditional Chinese medicine (TCM), the concentration of key quality markers in the extract continuously changes with time, temperature, raw material differences, and extraction conditions. Online tracking of these substances' content would facilitate endpoint determination, batch consistency control, and process optimization. The production process of TCM preparations is complex, involving multiple stages such as extraction and concentration. Differences in the composition and quality of different batches of medicinal materials pose a significant challenge to CQA consistency control during production. Currently, the determination of key quality attributes in TCM production still largely relies on offline analytical methods such as high-performance liquid chromatography (HPLC). While these methods offer high accuracy, they suffer from long detection cycles, cumbersome sample processing, and a lack of real-time feedback, hindering timely decision-making and closed-loop control during production.
[0025] Laboratory-grade near-infrared instruments typically offer high resolution, good optical stability, and enhanced quantitative modeling capabilities. However, their high cost, large size, and demanding on-site deployment requirements make them difficult to deploy on a large scale in production lines. In contrast, portable near-infrared spectrometers, while offering advantages such as low cost, small size, and flexible installation, often suffer from weaker signal quality, fewer sampling points, lower resolution, and greater sensitivity to environmental changes. Consequently, quantitative models built directly based on their spectra are limited in terms of predictive accuracy and stability.
[0026] To reduce the differences in quantitative analysis between different instruments, existing technologies often employ calibration transfer and domain adaptation methods such as direct standardization, segmented direct standardization, canonical correlation analysis, and migration component analysis. These methods typically rely on linear transformations or shallow feature alignment to mitigate instrument differences, and are applicable to cases with small discrepancies. However, when there are strong nonlinear differences between different instruments, as well as inconsistencies in local peak shapes, baselines, and signal representations, these methods struggle to fully extract and retain the fine-grained spectral structure information that is practically meaningful for quantitative modeling, thus affecting the final prediction accuracy and model stability.
[0027] While some existing deep learning methods can achieve cross-instrument spectral translation, they often only focus on whether the generated spectrum is similar to the laboratory-grade reference spectrum. If the generated spectrum is simply used to replace the original spectrum, some effective original information acquired by the portable device in the field is easily lost. A more critical issue to be addressed at this stage is whether the generated spectrum can complement the original portable spectrum, thereby truly improving the performance of industrial online quantitative analysis.
[0028] In view of the problems existing in the current solution, this implementation proposes an online quantitative analysis system for traditional Chinese medicine extracts based on cross-platform spectral generation and feature fusion, such as... Figure 1As shown, the system is divided into three core modules: a data acquisition and reference modeling module, a cross-platform spectral generation and fusion analysis module, and an online detection and result output module. The data acquisition and reference modeling module includes a portable near-infrared acquisition unit, a laboratory-grade near-infrared reference unit (used only in the modeling stage), and a reference value detection unit (HPLC, used only in the modeling stage), responsible for acquiring multi-source data and constructing a high-quality training sample set. The cross-platform spectral generation and fusion analysis module is further subdivided into a spectral generation module, a feature fusion module, a quantitative modeling module, and a model training and update module, realizing the generation of high-fidelity reference style spectra from raw spectra, dual-path feature extraction, and adaptive weighted fusion, and establishing and continuously optimizing the quantitative prediction model accordingly. The online detection and result output module consists of an online spectral input unit, a content prediction unit, a result display unit, and a data storage unit, completing real-time input, prediction calculation, result presentation, and data archiving in the actual detection process, ensuring that the system can stably and efficiently achieve online quantitative analysis of key quality markers in traditional Chinese medicine extracts after deployment.
[0029] This invention focuses on the high-precision online detection of key quality markers in the extraction process of traditional Chinese medicine (TCM). By introducing modeling analysis with laboratory-grade near-infrared instruments as a reference, a cross-platform generation model is established. Combined with feature fusion analysis of the original portable near-infrared spectrum and the generated spectrum, real-time and accurate prediction of the target component content is achieved. Simultaneously, this invention fully considers the practical needs of portable near-infrared devices in industrial field deployments. While maintaining their advantages of low cost, small size, and flexible installation, it effectively compensates for their shortcomings in signal quality, resolution, and model stability, significantly improving their online quantitative analysis performance. In summary, this invention improves the accuracy and reliability of online monitoring of key quality attributes of TCM extracts, providing strong support for quality control, endpoint determination, and process optimization in TCM production.
[0030] In the model building phase, this invention simultaneously collects samples, as well as portable and laboratory-grade near-infrared spectra. Then, HPLC analysis is performed on the samples to obtain corresponding reference content values. Using laboratory-grade near-infrared spectra as a reference standard, a cross-platform generation model for converting portable near-infrared spectra to laboratory-grade reference spectra is established. This ensures that the spectra acquired by portable near-infrared devices closely approximate the detection performance of laboratory-grade instruments, providing a foundation for subsequent high-precision quantitative analysis.
[0031] After completing cross-platform spectrum generation, this invention does not directly replace the original portable near-infrared spectrum with the generated spectrum. Instead, it uses both the original and generated spectra for subsequent modeling and analysis. By using feature fusion, it simultaneously utilizes the on-site detection information from the original portable spectrum and the enhancement information from the generated spectrum to establish a quantitative analysis model for key quality markers, thereby improving the accuracy and stability of online detection results.
[0032] This invention constructs an online near-infrared detection and data analysis system for traditional Chinese medicine extracts. The system uses a portable near-infrared device as the primary online detection unit. During the model building phase, it incorporates laboratory-grade near-infrared reference data for model training. In the actual online detection phase, it primarily utilizes the portable near-infrared device and the established model to achieve real-time prediction of the content of target quality markers. Simultaneously, the system can display, store, and analyze the trends of the detection results, providing a reference for quality monitoring and process adjustment during production.
[0033] This invention addresses the challenges of dynamic component changes, significant batch-to-batch variations, and stringent online monitoring requirements in the extraction process of traditional Chinese medicine (TCM). It employs a multi-batch sample analysis model to enhance its suitability for practical production applications. In actual use, the system rapidly outputs predicted results of key quality markers based on online-acquired portable near-infrared spectroscopy, thereby improving the practicality and reliability of online quality monitoring in the TCM extraction process.
[0034] The system framework of this invention is as follows: Figure 2 As shown, the left side represents the online detection platform, which includes a traditional Chinese medicine extract sample, a portable near-infrared detection platform, and a laboratory-grade near-infrared reference platform. All three are connected to the detection cell for spectral acquisition. The raw spectrum acquired by the portable platform is input to the generator G, and the high-precision spectrum acquired by the laboratory reference platform is input to the discriminator D. The two form a generative adversarial structure to train a cross-platform spectral generation model. Simultaneously, an Agilent 1260 high-performance liquid chromatograph performs offline analysis on the same batch of samples, outputting the peak area ratio of each component as reference content data for supervised modeling and model validation. The generated spectrum output by the generator G and the raw portable spectrum enter the feature fusion stage, where multi-dimensional feature extraction and fusion are performed before being sent to the quantitative prediction module to finally output the content of the target quality marker. The discrimination result of the discriminator D is fed back to the generator G for fine-tuning training, forming a closed-loop optimization mechanism to ensure the authenticity and usability of the generated spectrum. The entire process realizes full-chain collaboration from sample acquisition, multi-source spectral acquisition, reference value calibration, spectral generation and fusion to online quantitative prediction.
[0035] The overall solution of this invention can be divided into two parts: the modeling stage and the online operation stage.
[0036] The modeling phase primarily focuses on establishing the analytical models required for subsequent online detection. This phase necessitates simultaneously acquiring portable near-infrared spectra, laboratory-grade near-infrared spectra, and corresponding true component content values for the samples. Using this data, a cross-platform correspondence between the portable near-infrared spectra and the laboratory-grade reference spectra is established, and further, a quantitative analytical model for key quality markers is developed. Specifically, this includes the following processes: (1) Sample and spectral acquisition.
[0037] like Figure 3 As shown, all samples came from a certain Xuefu Zhuyu oral liquid industrial production line. An online detection platform based on external circulation was designed and deployed on this production line, enabling simultaneous sample collection and acquisition of online near-infrared (NIR) spectra from portable and laboratory-grade instruments. Specifically, the online detection platform is driven by a diaphragm pump 11 to circulate the drug solution. The solution flows out from the pilot-scale extraction tank 1, passes through a temperature control device 10 and two flow cells (first flow cell 5 and second flow cell 6), and finally flows back to the pilot-scale extraction tank 1, completing the external circulation. The two flow cells are connected via optical fiber 3 to a portable Optosky ATP8000 spectrometer 7 and a high-end Bruker MATRIX-F II spectrometer 2, respectively. The spectrometers are powered by a near-infrared light source 4. Sampling ports 8 are set in front of the two flow cells for sample collection. For each sample, the following three types of data were collected simultaneously: portable near-infrared spectra acquired by the portable Optosky ATP8000 spectrometer 7, laboratory-grade near-infrared spectra acquired by the high-end Bruker MATRIX-F II spectrometer 2, and HPLC reference values of naringin and paeoniflorin, which were finally analyzed by computer 9.
[0038] A total of 631 extract samples were collected from the industrial production line of Xuefu Zhuyu Oral Liquid. The samples came from four independent production batches (A, B, C, and D), each containing three consecutive extraction stages, corresponding to the first, second, and third extractions. At the beginning of each stage, the extraction tanks were refilled with purified water. As the extraction process proceeded, key quality markers were gradually released into the solution, resulting in a significant concentration gradient over time.
[0039] Of the four production batches, batches AC were used as model development batches, and batch D was used as independent test batches. For the model development batches (A–C), the extraction process was continuously monitored for 8 hours, with one sample collected every 3 minutes, resulting in approximately 168 samples per batch. For the independent test batch (D), continuous monitoring was also conducted for 8 hours, but the sampling interval was 4 minutes, resulting in 126 samples. This high-frequency sampling scheme, combined with a staged extraction design, ensures that the dataset exhibits significant variations in both time and concentration dynamics, thereby guaranteeing a wide dynamic range and good representativeness and diversity of the data under real industrial conditions.
[0040] (2) Cross-platform spectrum generation module.
[0041] In the cross-platform spectrum generation stage, the system uses portable near-infrared spectroscopy as input and laboratory-grade near-infrared reference platform spectroscopy as the target to establish a mapping relationship between the two types of spectra, such as... Figure 4 As shown. During modeling, three types of data need to be acquired simultaneously for the same sample: the first type is portable near-infrared spectroscopy, denoted as... The second category is laboratory-grade near-infrared reference spectrum, denoted as... The third category represents the actual content value of the target quality marker in the sample, denoted as y. This is data that can be collected directly in real time during the subsequent online operation phase. The high-quality spectra used in the early modeling stage to improve the reference characterization capability, and y obtained by high-performance liquid chromatography, are used as the true reference value for subsequent regression model training. Thus, the system forms sample triples ( , ,y), and then conduct subsequent model training based on this.
[0042] The goal of this phase is to base it on portable near-infrared spectroscopy. Generate spectra that are closer to those of laboratory-grade reference platforms. Its basic input-output relationship can be expressed as: (1); Among them, G( ) represents a cross-platform spectrum generation model. This represents the generated reference platform style spectrum. "Generation" here does not simply replicate the laboratory-grade reference spectrum, nor does it mechanically smooth the original portable spectrum. Instead, it learns the differences between the two types of spectra in terms of sampling point count, resolution, peak detail, baseline state, and overall style representation. This allows the portable spectrum to achieve a spectral representation closer to that of a laboratory-grade platform while preserving the information inherent in the sample itself.
[0043] The cross-platform spectrum generation module adopts a one-dimensional encoder-decoder structure to generate reference platform style spectra based on portable near-infrared spectra. In order to preserve local peak details, skip connections are set between the encoder and decoder layers. To enhance the consistency of the generated results in terms of overall style and local details, a discriminant structure is set in this module for auxiliary training.
[0044] Specifically, the encoding part extracts spectroscopic features layer by layer from the portable spectrum, while the decoding part recovers the reference platform style spectrum based on the encoded features. Considering that some local peak shapes and details in the near-infrared spectrum of traditional Chinese medicine extracts play an important role in subsequent quantitative analysis, skip connections are preferably set between the encoding and decoding layers to reduce the loss of local details during deep feature extraction. Furthermore, to enhance the realism of the generated results in terms of overall style and local details, a discriminant structure is set to provide auxiliary constraints on the generated spectrum. This discriminant structure adopts a two-branch structure, with one branch focusing on the consistency of the overall spectral profile and the other branch focusing on the consistency of local band peak shapes and details.
[0045] To ensure that the generated spectra (i.e., the reference platform-style spectra) not only closely resemble the reference platform spectra but also can be used for subsequent online quantitative analysis of key quality markers in the drug solution, this invention employs a multi-constraint approach when training the generation module. Its loss function... It can be represented as: (2); in, The reconstruction loss is used to constrain the generated spectrum. Compared with reference spectrum Differences in overall outline; The derivative loss is used to constrain local variation trends and peak shape details of spectral lines; To combat the loss, a reference platform style is used to enhance the realism of the generated spectrum; These correspond to the weighting coefficients. Through the above joint constraints, the system can simultaneously approximate the generated spectra with a laboratory-grade reference platform in terms of overall style, local peak shape, and variation trends, thereby providing higher-quality input information for subsequent quantitative analysis.
[0046] (3) Feature fusion module.
[0047] While the generated reference platform-style spectra promise to provide enhanced cross-platform spectral representation, the original portable near-infrared spectra still retain the raw information acquired directly under field conditions, reflecting the current process status. The generated spectra, on the other hand, compensate to some extent for the shortcomings of portable platforms in spectral representation quality; that is, the two are not simply substitutes but complementary. Therefore, these two types of information are combined through an attention fusion module using a dual-input, dual-feature extraction approach for subsequent online quantitative analysis of key quality markers.
[0048] like Figure 5 As shown, specifically, the generated spectrum Compared with the original portable near-infrared spectrum Two independent processing branches are input separately. The spectral generation branch passes sequentially through the linear mapping module and the attention scoring module to obtain the generated features. and its rating Similarly, the original portable spectral branch passes sequentially through the linear mapping module and the attention scoring module to obtain the original features. and its rating .
[0049] Feature extraction can be represented as: (3); (4); in, This represents the feature extraction process of the original portable spectrum. This represents the feature extraction process for generating the spectrum. and These represent the feature results of the two inputs respectively.
[0050] After obtaining the two features, the scoring module evaluates the two features to obtain: (5); (6); in, This represents the scoring process corresponding to the original features. This represents the scoring process corresponding to the generated features. Represents the original feature score. This indicates the generation of feature scores.
[0051] After receiving two ratings and Then, the module normalizes the two scores to obtain the fusion weights corresponding to the generated features and the original features. and : (7); (8); Then the modules generate features respectively. and original features The weighted values are then summed to obtain the integrated features. : (9) In summary, this module can automatically determine whether to rely more on the original portable spectral information or the generated reference platform style spectral information based on the current sample's state. For example, for some samples, the original spectral signal is relatively stable, so the system can assign higher weights to the original features; while for other samples, the original spectrum is significantly affected by noise or operating condition fluctuations, so the system can appropriately increase the weights of the generated features. This dynamically determines the proportion of generated and original features in the final fusion result, thus preserving the field information from the original portable spectrum while utilizing the reference platform enhancement information from the generated spectrum, thereby making the features used for subsequent quantitative analysis more effective.
[0052] (4) Quantitative analysis modeling module.
[0053] The integrated characteristics obtained after fusion Then, it is input into the quantitative analysis modeling module to quantitatively predict the content of the target quality marker. The quantitative analysis modeling module in this invention employs a convolutional regression structure. Its function is to further extract local patterns and combination information related to the content of the target quality marker from the fused features and map them to the final content prediction value, specifically as follows: Figure 6 As shown.
[0054] (4-1) Convolution process.
[0055] Fusion features The process begins with convolutional processing. This part uses several convolutional kernels to perform local scanning and response extraction on the fused features, enabling the model to identify local feature patterns related to changes in the content of key quality markers. After convolutional processing, a high-level regression feature representation is obtained.
[0056] Specifically, let's define the fusion features. Given a one-dimensional input feature sequence, after convolution processing, the convolutional output feature is obtained. .
[0057] The convolution response of the m-th output channel at position t can be expressed as: (t)= (10); in, Indicates the number of input channels. Indicates the length of the one-dimensional convolution kernel; These are the convolution weight parameters. Indicates the first The bias term for each output channel; Indicates the fill length; The non-linear activation function after convolution. These are the output features of the convolution.
[0058] (4-2) Flattening process.
[0059] Convolution output features Typically, these are multi-channel one-dimensional feature maps. To facilitate their entry into the subsequent fully connected mapping section, they need to be flattened first. This process rearranges the multi-channel local features output by the convolution into a single vector representation in a predetermined order, resulting in a one-dimensional feature vector. : (11); If Consider the size as The characteristic tensor, where, Indicates the number of output channels. Let h represent the feature length of each channel. Then, the flattened vector h can be expressed as: (12); in, For the index in the expanded one-dimensional vector, Represents the first in a one-dimensional vector One element, Represents the output channel index.
[0060] (4-3) Multilayer perceptron mapping process.
[0061] The flattened feature vector h is input into the head of the multilayer perceptron to complete the high-level nonlinear mapping, thereby obtaining the input z of the output layer: =h(13) ; (14); (15); in, The input feature vector; For the first Hidden layer output; The first Layer weight matrix and bias vector; Let z be the activation function of the hidden layer; z is the linear mapping result of the output layer. Representing the Hidden layer output; Representing the Hidden layer output.
[0062] (4-4) Output layer process.
[0063] The output layer uses a Softplus architecture, therefore the predicted values... It can be represented as: (16); This can be further expanded to: (17); This transforms the linear mapping result into the final quantitative prediction output, and ensures that the output value has a smooth nonlinear response in continuous prediction scenarios.
[0064] Subsequently, the convolution output is flattened, expanding the multidimensional features into a one-dimensional feature vector for later use in the fully connected mapping part.
[0065] (4-5) Regression loss process.
[0066] During the training phase, the true content value y and the predicted results are used. With supervision and constraints, the regression loss can be expressed as (18); Where: N represents the number of training samples; This represents the predicted content of the key quality marker in the i-th sample; This represents the true content of the key quality marker in the i-th sample; This represents the single-sample regression error function.
[0067] During the online operation phase, no laboratory-grade near-infrared equipment is required for detection. Only a portable near-infrared device is needed to collect the spectrum. Then, the model that has been trained during the modeling phase can be used to achieve laboratory-level accurate analysis and real-time prediction of the content of key quality markers. Figure 7 This demonstrates the workflow during the online operation phase: S701: Update the test solution in the circulation pipeline.
[0068] Start the diaphragm pump in the online testing platform and simultaneously open the valve on the pipeline to drive the medicinal solution from the herbal extraction equipment through the pipeline into the online testing platform. Continue for a period of time until the medicinal solution in the pipeline is fully replenished.
[0069] S702: The liquid medicine is controlled to a specified temperature by a temperature control device.
[0070] The diaphragm pump is shut off, and the valves on the pipeline are also closed, stopping the flow of the medicinal solution. A temperature control device then maintains a constant temperature in the internal pipeline until the solution reaches the preset, designated temperature.
[0071] S703: The constant-temperature solution enters the flow tank.
[0072] The diaphragm pump is restarted, and the valve on the pipeline is opened to drive the flow of the reagent, allowing it to circulate briefly and reach the test area in the flow cell, fully covering the surrounding area. Then, the diaphragm pump and valve are closed, allowing the liquid to remain still, thus eliminating interference from air bubbles and liquid flow on the detection accuracy.
[0073] S704: Portable near-infrared device for spectral acquisition.
[0074] Portable near-infrared spectrometers acquire portable near-infrared spectral data through precisely aligned fiber optic probes, and then transmit this spectral data to a processor in real time for subsequent quantitative analysis.
[0075] S705: Analyze content using a quantitative model within the processor.
[0076] The spectral data collected online is transmitted to the processor in real time. The processor then uses the quantitative analysis model that has been trained in the modeling stage to process the spectral data quickly and perform high-precision quantitative analysis of the content of key quality markers in the medicine liquid in real time, which is equivalent to the laboratory level. This results in a very accurate predicted content. This process enables laboratory-level accurate real-time monitoring of the content of key quality markers in the production process of traditional Chinese medicine using only portable near-infrared devices.
[0077] S706: The display terminal displays the substance content and historical trends in real time.
[0078] The processor displays the predicted substance content information, changing trends, and possible production suggestions on the terminal in real time. This step not only provides producers with intuitive and timely production data feedback, but also helps them better understand the stability of the Chinese medicine extraction process and the consistency of product quality, providing support for their subsequent adjustment and optimization decisions.
[0079] In summary, this invention improves the detection accuracy and stability of portable near-infrared devices in the online quantitative analysis of traditional Chinese medicine extracts through innovative features such as modeling and analysis using laboratory-grade near-infrared instruments as a reference, cross-platform spectral generation, fusion analysis of raw and generated spectra, and an online near-infrared detection and data analysis system. It solves the problems of poor direct modeling effect of portable devices, insufficient adaptability of traditional transfer methods, and insufficient utilization of generated spectra and raw information in existing technologies, and has broad application value and huge market prospects.
[0080] Figure 8 This paper presents an analytical method for traditional Chinese medicine extracts based on cross-platform spectral and feature fusion, executed by a processor, and includes the following processes: S801: Portable near-infrared spectra of the extract of the Chinese herbal medicine to be tested; S802: Input the portable near-infrared spectrum into the pre-trained cross-platform spectrum generation model to obtain the reference platform style spectrum. The cross-platform spectrum generation model is trained based on the portable near-infrared spectrum of the sample, the laboratory-grade near-infrared reference spectrum, and the true content values of key quality markers in the sample. S803: Input the portable near-infrared spectrum and the reference platform style spectrum into two independent processing branches of the feature fusion module to obtain the original features and their corresponding original feature scores, and the generated features and their corresponding generated feature scores; S804: Normalize the original feature scores and generated feature scores to obtain the original feature fusion weights and generated feature fusion weights; S805: The original features are weighted using the original feature fusion weights, and the generated features are weighted using the generated feature fusion weights. The two weighted results are added together to obtain the fused comprehensive features. S806: Input the fused comprehensive features into the pre-trained quantitative analysis modeling module to obtain the predicted content of key quality markers in the extract of the Chinese herbal medicine to be tested.
[0081] Figure 9 This paper presents an analytical system for traditional Chinese medicine extracts based on cross-platform spectral and feature fusion, comprising: The spectral acquisition unit 901 is configured to acquire the portable near-infrared spectrum of the Chinese herbal extract to be tested. The spectrum generation unit 902 is configured to input portable near-infrared spectra into a pre-trained cross-platform spectrum generation model to obtain a reference platform style spectrum. The cross-platform spectrum generation model is trained based on the portable near-infrared spectrum of the sample, the laboratory-grade near-infrared reference spectrum, and the true content values of key quality markers in the sample. The feature extraction unit 903 is configured to input portable near-infrared spectroscopy and reference platform style spectroscopy into two independent processing branches of the feature fusion module to obtain the original features and their corresponding original feature scores, and the generated features and their corresponding generated feature scores. The weight calculation unit 904 is configured to: perform normalization processing on the original feature scores and the generated feature scores to obtain the original feature fusion weights and the generated feature fusion weights; The feature fusion unit 905 is configured to: weight the original features using the original feature fusion weights, and weight the generated features using the generated feature fusion weights, and add the two weighted results to obtain the fused comprehensive features; The content prediction unit 906 is configured to input the fused comprehensive features into a pre-trained quantitative analysis modeling module to obtain the predicted content of key quality markers in the extract of the Chinese herbal medicine to be tested.
[0082] It is understood that the aforementioned units can be individually or entirely merged into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The aforementioned units are based on logical functional division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the system may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.
[0083] According to another embodiment of this application, the system of this embodiment can be constructed by running a computer program (including program code) capable of performing the steps involved in the corresponding method of the present invention on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). The computer program can be recorded on, for example, a computer-readable recording medium, loaded into the aforementioned computing device through the computer-readable recording medium, and run therein.
[0084] Figure 10 A computer device is shown, which includes a processor 1001, a communication interface 1002, and a computer-readable storage medium 1003. The processor 1001, communication interface 1002, and computer-readable storage medium 1003 can be connected via a bus or other means.
[0085] The communication interface 1002 is used to receive and send data. The computer-readable storage medium 1003 can be stored in the memory of the electronic device. The computer-readable storage medium 1003 is used to store computer programs, which include program instructions. The processor 1001 is used to execute the program instructions stored in the computer-readable storage medium 1003.
[0086] The processor 1001 is the computing and control core of the electronic device. It is suitable for implementing one or more instructions, specifically for loading and executing one or more instructions to achieve the corresponding method flow or corresponding function.
[0087] Processor 1001 is configured to perform the following procedure: A portable near-infrared spectra of the herbal extract to be tested; Portable near-infrared spectra are input into a pre-trained cross-platform spectral generation model to obtain a reference platform style spectrum. The cross-platform spectral generation model is trained based on the portable near-infrared spectrum of the sample, the laboratory-grade near-infrared reference spectrum, and the true content values of key quality markers in the sample. The portable near-infrared spectrum and the reference platform style spectrum are respectively input into two independent processing branches of the feature fusion module to obtain the original features and their corresponding original feature scores, the generated features and their corresponding generated feature scores; The original feature scores and generated feature scores are normalized to obtain the original feature fusion weights and generated feature fusion weights. The original features are weighted using the original feature fusion weights, and the generated features are weighted using the generated feature fusion weights. The two weighted results are added together to obtain the fused comprehensive features. The fused comprehensive features are input into a pre-trained quantitative analysis modeling module to obtain the predicted content of key quality markers in the extract of the Chinese herbal medicine to be tested.
[0088] This invention also provides a computer-readable storage medium, which is a memory device in an electronic device for storing programs and data. It is understood that the computer-readable storage medium here may include both built-in storage media in the electronic device and extended storage media supported by the electronic device. The computer-readable storage medium provides storage space for storing the processing system of the electronic device.
[0089] Furthermore, this storage space also contains one or more instructions suitable for loading and execution by the processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory; alternatively, it can also be at least one computer-readable storage medium located remotely from the aforementioned processor.
[0090] In one embodiment, the computer-readable storage medium stores one or more instructions; the processor loads and executes the one or more instructions stored in the computer-readable storage medium to perform the following process: A portable near-infrared spectra of the herbal extract to be tested; Portable near-infrared spectra are input into a pre-trained cross-platform spectral generation model to obtain a reference platform style spectrum. The cross-platform spectral generation model is trained based on the portable near-infrared spectrum of the sample, the laboratory-grade near-infrared reference spectrum, and the true content values of key quality markers in the sample. The portable near-infrared spectrum and the reference platform style spectrum are respectively input into two independent processing branches of the feature fusion module to obtain the original features and their corresponding original feature scores, the generated features and their corresponding generated feature scores; The original feature scores and generated feature scores are normalized to obtain the original feature fusion weights and generated feature fusion weights. The original features are weighted using the original feature fusion weights, and the generated features are weighted using the generated feature fusion weights. The two weighted results are added together to obtain the fused comprehensive features. The fused comprehensive features are input into a pre-trained quantitative analysis modeling module to obtain the predicted content of key quality markers in the extract of the Chinese herbal medicine to be tested.
[0091] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can implement the described functions using different methods for each specific application, but such implementation should not be considered beyond the scope of this application.
[0092] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic cable, digital cable) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data processing device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0093] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion, characterized in that, Includes the following processes: A portable near-infrared spectra of the herbal extract to be tested; Portable near-infrared spectra are input into a pre-trained cross-platform spectral generation model to obtain a reference platform style spectrum. The cross-platform spectral generation model is trained based on the portable near-infrared spectrum of the sample, the laboratory-grade near-infrared reference spectrum, and the true content values of key quality markers in the sample. The portable near-infrared spectrum and the reference platform style spectrum are respectively input into two independent processing branches of the feature fusion module to obtain the original features and their corresponding original feature scores, the generated features and their corresponding generated feature scores; The original feature scores and generated feature scores are normalized to obtain the original feature fusion weights and generated feature fusion weights. The original features are weighted using the original feature fusion weights, and the generated features are weighted using the generated feature fusion weights. The two weighted results are added together to obtain the fused comprehensive features. The fused comprehensive features are input into a pre-trained quantitative analysis modeling module to obtain the predicted content of key quality markers in the extract of the Chinese herbal medicine to be tested.
2. The method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion as described in claim 1, characterized in that, The loss functions used when training the cross-platform spectral generation model include reconstruction loss, derivative loss, and adversarial loss. The reconstruction loss is used to constrain the difference in the overall profile between the generated reference platform style spectrum and the laboratory-grade near-infrared reference spectrum. The derivative loss is used to constrain the local variation trend of spectral lines and peak details. The adversarial loss is used to enhance the reference platform style authenticity of the generated reference platform style spectrum.
3. The method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion as described in claim 1, characterized in that, In the feature fusion module, the original feature scores and generated feature scores are normalized to obtain the original feature fusion weights and generated feature fusion weights, including: The original feature score and the generated feature score are used as inputs to the exponential function, and then divided by the sum of the outputs of the two exponential functions to obtain the original feature fusion weight and the generated feature fusion weight.
4. The method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion as described in claim 1, characterized in that, The quantitative analysis modeling module employs a convolutional regression structure. The fused comprehensive features are input into the module to obtain the predicted content of key quality markers in the herbal extract, including: The fused composite features are then subjected to convolution processing to obtain the convolution output features; The convolution output features are flattened to obtain a one-dimensional feature vector; One-dimensional feature vectors are input into a multilayer perceptron for high-level nonlinear mapping to obtain linear mapping results for the output layer. The predicted content is obtained by performing a Softplus transformation on the linear mapping result.
5. The method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion as described in claim 4, characterized in that, When performing convolution processing on the fused comprehensive features, several convolution kernels are used to perform local scanning on the fused comprehensive features in order to extract local feature patterns related to changes in the content of key quality markers; Flattening the convolution output features to obtain a one-dimensional feature vector involves treating the convolution output features as a multi-channel one-dimensional feature map and rearranging all elements into a single one-dimensional vector according to the channel order and the positional order within each channel.
6. The method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion as described in claim 1, characterized in that, Before obtaining the portable near-infrared spectrum of the Chinese herbal extract to be tested, the process also includes: driving the extract to be tested through the pipeline of the online detection platform to refresh the extract in the pipeline; controlling the temperature of the extract in the pipeline to a specified temperature; and allowing the extract after being kept at a constant temperature to enter the flow cell and remain stationary.
7. The method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion as described in claim 1, characterized in that, Key quality markers include naringin or paeoniflorin. After obtaining the predicted content of key quality markers in the extract of the Chinese herbal medicine to be tested, the method also includes: displaying the predicted content, the trend of the predicted content, and production suggestions on the display terminal in real time.
8. A system for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion, characterized in that, include: The spectral acquisition unit is configured to acquire the portable near-infrared spectrum of the herbal extract to be tested. The spectral generation unit is configured to input portable near-infrared spectra into a pre-trained cross-platform spectral generation model to obtain a reference platform style spectrum. The cross-platform spectral generation model is trained based on the portable near-infrared spectrum of the sample, the laboratory-grade near-infrared reference spectrum, and the true content values of key quality markers in the sample. The feature extraction unit is configured to input portable near-infrared spectroscopy and reference platform style spectroscopy into two independent processing branches of the feature fusion module to obtain the original features and their corresponding original feature scores, and the generated features and their corresponding generated feature scores. The weight calculation unit is configured to: perform normalization processing on the original feature scores and generated feature scores to obtain the original feature fusion weights and generated feature fusion weights; The feature fusion unit is configured to: weight the original features using the original feature fusion weights, and weight the generated features using the generated feature fusion weights, and add the two weighted results to obtain the fused comprehensive features; The content prediction unit is configured to input the fused comprehensive features into a pre-trained quantitative analysis modeling module to obtain the predicted content of key quality markers in the extract of the Chinese herbal medicine to be tested.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and executed as described in any one of claims 1 to 7: the method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion.
10. A computer device, characterized in that, include: Processor and computer-readable storage media; A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the method for analyzing traditional Chinese medicine extracts based on cross-platform spectral and feature fusion as described in any one of claims 1 to 7.