On-line quality detection method for nerve-calming and brain-nourishing liquid based on multispectral detection technology

Through multi-spectral detection technology and intelligent quality control methods, ultraviolet-visible spectroscopy, near-infrared spectroscopy and fluorescence spectroscopy modules are integrated to solve the problems of timeliness, multi-index synchronous detection and dynamic adaptability of Anshenbu Brain Liquid quality detection, and achieve high-precision and rapid quality detection and abnormal detection.

CN120446023AActive Publication Date: 2025-08-08JIANGSU JURONG PHARM GRP CO LTD

Patent Information

Application Number
CN202510400553.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-08-08
Estimated Expiration
2045-04-01

AI Technical Summary

Technical Problem

The traditional Anshen Bu Brain Liquid Quality Testing Technology has the problems of poor offline detection timeline, weak multi-index synchronous detection capability and insufficient dynamic adaptability. Especially on high-speed production lines, it is easily disturbed by factors such as turbidity and temperature drift of the medicine liquid, resulting in fluctuations in detection accuracy and high missed rate of abnormal detection.

Method used

Multi-spectral detection technology is adopted, ultraviolet-visible spectroscopy, near-infrared spectroscopy and fluorescence spectroscopy modules are integrated, multi-scale residual convolution network, deep separable convolution and spectral attention mechanism, and online detection of Anshen Bu Brain Fluid through dynamic time regularization and cross-modal attention fusion.

Benefits of technology

The detection accuracy of icariin content has been improved by 40%, the lower limit of heavy metal residue detection reaches 0.05ppm, the detection accuracy is improved, the response time of abnormal detection is shortened, and the misjudgment rate is reduced, which is adapted to the batch differences of medicinal materials during the production process, and meets the efficient detection needs of modern extraction workshops.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120446023A_ABST
    Figure CN120446023A_ABST
Patent Text Reader

Abstract

The invention provides an online quality detection method of a nerve-soothing and brain-nourishing liquid based on multispectral fusion, and aims at solving the bottleneck problems of long offline time consumption, weak multi-index detection capability, poor dynamic adaptability and the like in the traditional detection technology, and realizing intelligent quality control of the whole process of the production technology. The device integrates an ultraviolet-visible spectrum module, a near-infrared spectrum module and a fluorescence spectrum module, constructs a multi-scale residual convolutional network to extract near-infrared spectrum characteristics, analyzes a fluorescence excitation-emission matrix through bidirectional LSTM, and cooperates with dynamic baseline correction of an ultraviolet spectrum, so that the icariin content detection precision is improved by 40% compared with that of a traditional HPLC method, the heavy metal residue detection lower limit reaches 0.05 ppm, and the detection accuracy is greatly improved. And an innovative solution is provided for intelligent production of traditional Chinese medicine preparations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of analysis and detection of traditional Chinese medicine, and in particular to an online quality detection method for anesthesia and brain nourishment solution based on multispectral detection technology. Background Art

[0002] There are three core bottlenecks in the quality detection technology of traditional tranquilizing and brain-boosting liquid: First, the offline detection timeliness is poor. The current mainstream method relies on high-performance liquid chromatography (HPLC) to determine the content of icariin, which takes 5-8 hours to complete a single batch of testing, which is seriously mismatched with the 10 tons / day production capacity of the modern extraction workshop. Second, the ability to detect multiple indicators simultaneously is weak. The existing quality control system only performs quantitative analysis on a single component (such as vitamin B1 or icariin), and cannot simultaneously obtain key safety indicators such as the total number of microorganisms and heavy metal residues. Third, the dynamic adaptability is insufficient. Although the traditional near-infrared online monitoring system can realize the monitoring of some parameters, it is subject to technical defects such as low spectral resolution (usually >6nm) and insufficient signal-to-noise ratio (<30000:1). Under complex working conditions, it is easily interfered by factors such as liquid turbidity and temperature drift, resulting in fluctuations in detection accuracy of more than 15%.

[0003] The current technical system has the following specific defects: (1) UV spectroscopy detection uses a fixed window baseline correction, which cannot dynamically adapt to the absorbance fluctuations caused by differences in medicinal material batches during the production process of Anshen Bu Nao Liquid; (2) Near-infrared feature extraction relies on manually designed band selection, making it difficult to capture the weak spectral characteristics of the medicinal material's active ingredients; (3) Fluorescence spectral time series alignment uses a static interpolation algorithm, which is prone to time series misalignment of more than 0.5 seconds in high-speed production lines (single bottle detection <15 seconds). In addition, existing quality control devices mostly use a single spectral modality and lack an effective cross-modal attention mechanism for the fusion decision-making of multi-dimensional quality indicators, resulting in a false negative rate of up to 12% for sudden abnormalities such as microbial contamination. Summary of the Invention

[0004] In order to solve the above problems, the present invention provides an online quality detection device for Anshenbunao liquid based on multi-spectral detection technology.

[0005] It includes a host computer, a conveying device, a spectrum acquisition module, a data processing module and a quality assessment module;

[0006] The host computer is connected to a conveying device, a spectrum acquisition module, a data processing module, and a quality assessment module; the conveying device includes a loading device, a turntable device, and an unloading device; the turntable device is used to transfer the medicine bottles containing the tranquilizing and brain-boosting solution to different inspection stations; the spectrum acquisition module includes an ultraviolet-visible spectrum module, a near-infrared spectrum module, and a fluorescence spectrum module. The spectrum acquisition module collects ultraviolet-visible spectra, near-infrared spectra, and fluorescence spectra, and inputs them into the data processing module for spectrum preprocessing, and then inputs them into the quality assessment module for quality assessment;

[0007] The quality assessment module sends the assessment results to the host computer.

[0008] The upper computer includes a control panel and a cabinet, the loading device includes a loading conveyor belt, the turntable module includes a circular turntable, and the unloading module includes an unloading conveyor belt;

[0009] It also includes ultraviolet-visible spectrum sensors, near-infrared spectrum sensors and fluorescence spectrum sensors.

[0010] In addition, the present invention also provides an online quality detection method for Anshenbunao liquid based on multispectral detection technology, comprising the following steps:

[0011] (a) Real-time acquisition of multispectral data

[0012] The spectrum acquisition module acquires the ultraviolet-visible spectrum, near-infrared spectrum and fluorescence spectrum of the Anshenbunao liquid production process;

[0013] (b) Spectral dynamic preprocessing

[0014] The data processing module performs baseline drift compensation on UV spectral data, eliminates turbidity interference using the adaptive moving average method, performs wavelet denoising and baseline correction on near-infrared spectral data; performs dynamic time warping on fluorescence spectral data to align the excitation-emission timing and complete intensity normalization;

[0015] (c) Key quality indicator extraction

[0016] A multi-scale residual convolutional network is used to extract spectral features from near-infrared spectra, a deep separable convolution and spectral attention mechanism are used to extract features from infrared spectra, and a time-series-spectral bidirectional LSTM is used to extract features from fluorescence spectral data.

[0017] (d) Cross-modal dynamic attention fusion

[0018] A spectral alignment unit is set up to achieve time / frequency domain alignment of different spectra based on the dynamic time warping algorithm. The UV-visible and infrared spectral features are jointly represented through gated attention, and then concatenated with the fluorescence features. The final fusion feature dimension is 768, and L2 regularization is performed before inputting into the fully connected layer.

[0019] (e) Multimodal quality fusion decision

[0020] The fused features are input into the quality prediction network after multi-head bilinear pooling to output three core quality indicators: icariin content, total microbial count and heavy metal residue. The prediction results are compared with the preset thresholds in real time, and the three core quality indicators are calculated to obtain the quality grade of Anshenbu Nao Liquid.

[0021] In step (a), the UV-visible spectroscopy parameters are: detection wavelength range 200-800 nm, sampling frequency 10 Hz, and absorbance dynamic range 0.2-1.5 AU;

[0022] Near-infrared spectral parameters: spectral frequency range is 900-2500nm, corresponding to the wavenumber range of 4000-12000cm-1, using InGaAs array detector, spectral resolution ≤6nm, signal-to-noise ratio ≥30000:1, dynamic adjustment range of integration time 10μs-10s, 12-scan averaging mode to improve signal-to-noise ratio;

[0023] Fluorescence spectrum parameters: excitation wavelength range 250-550 nm, emission wavelength range 280-700 nm, scanning in excitation-emission matrix (EEM) mode, excitation wavelength switching with a step size of 10 nm, emission spectrum acquisition at 2 nm intervals, response time <5 ns, Rayleigh scattering suppression ratio >60 dB, single full spectrum scan time ≤15 seconds.

[0024] In step (b), the UV-visible spectrum baseline drift compensation and turbidity interference elimination were performed by using a sliding window adaptive moving average method for baseline correction: the dynamic window length was set to 30-50 spectral data points, and the window width was dynamically adjusted by calculating the local mean square error of the spectral data in the window. When the mean square error was greater than 0.05 AU, the window was reduced to 20 points, and when the mean square error was less than 0.01 AU, the window was expanded to 60 points. The turbidity interference elimination adopted a dual weight factor correction strategy: based on the absorbance change rate at the characteristic wavelength of 278 nm, the turbidity compensation coefficient α was calculated in real time as 1.2×10 -3 (dA / dt) 2 The baseline was then smoothed to +0.95 and convolved with the moving average baseline of the adjacent band (260-300 nm). After baseline drift compensation, Savitzky-Golay smoothing was performed with an 11-point window and a third-order polynomial fit to eliminate high-frequency noise.

[0025] Wavelet denoising and baseline correction for near-infrared spectra: The wavelet decomposition uses the Symlets8 wavelet basis function for a five-layer decomposition, and the high-frequency coefficients use the improved SURE threshold rule: threshold T = σsqrt[(2lnN) / log2(j+1)], where σ is the noise standard deviation, j is the number of decomposition layers, and N is the signal length. Baseline correction uses segmented multivariate scattering correction (MSC): the spectrum is divided into three bands: 1200-1800nm, 1800-2200nm, and 2200-2500nm. The light scattering path length correction factor is calculated for each band, and orthogonal projection is used to eliminate non-uniform scattering interference. The reconstructed spectrum is subjected to first-order derivative processing: a first-order Savitzky-Golay derivative with a 17-point window width is used to enhance the spectral feature resolution.

[0026] Fluorescence spectra are dynamically time-warped and intensity-normalized. The dynamic time warping (DTW) algorithm is used for excitation-emission timing alignment: the warping window width is set to ±15% of the excitation wavelength switching interval, and the optimal path matching is achieved through the cumulative cost matrix D(i,j)=min{D(i-1,j),D(i,j-1),D(i-1,j-1)}+d(x_i,y_j); after timing alignment, cubic spline interpolation compensation is performed: the emission spectrum data of non-integer multiple sampling points are interpolated and reconstructed to ensure the time resolution error of the excitation-emission matrix (EEM). Intensity normalization uses maximum-minimum normalization combined with PARAFAC decomposition: first, the original fluorescence intensity is mapped to the [0,1] interval, and then the Raman scattering interference is eliminated through the trilinear decomposition model to retain the intensity of the characteristic fluorescence component.

[0027] In step (c), multi-scale residual convolutional network feature extraction:

[0028] A multi-scale atrous residual block (ACRB) is used, which contains three parallel atrous convolutional layers with a dilation rate of r = 1 / 3 / 5. Local spectral features under different receptive fields are extracted respectively. The output of each ACRB is added to the input through a jump connection to alleviate the gradient vanishing problem. The convolution kernel adopts a size of 1×7 to adapt to the banded feature distribution of the near-infrared spectrum. A global residual connection is introduced in the fourth layer of the network to add the original input spectrum to the deep features element by element, retaining the low-frequency information of the original spectrum while enhancing the discrimination of high-frequency features. The fused features are compressed in spatial dimensions through 3×1 maximum pooling to reduce noise interference. The convolution kernel weight is dynamically adjusted based on the spectral signal-to-noise ratio (SNR): when the SNR is less than 45dB, the small-scale convolution r = 1 is activated as the main branch; when the SNR is ≥ 45dB, it switches to the large-scale convolution r = 5 to enhance context association.

[0029] Infrared Spectral Deep Separable Convolution and Spectral Attention Mechanism:

[0030] The depth-wise separable convolutional architecture adopts a dual-branch structure:

[0031] Depth convolution branch: Use 3×3 depth convolution to extract spatial features, each channel is calculated independently, and the number of parameters is reduced to 1 / 8 of the standard convolution;

[0032] Point-by-point convolution branch: 1×1 convolution performs information exchange between channels to generate a 128-dimensional feature map. The outputs of the two branches are fused through channel splicing to preserve details and improve computational efficiency.

[0033] Spectral Attention Mechanism:

[0034] Channel attention: obtain channel weights through global average pooling, use the Sigmoid function to generate a 0-1 attention coefficient, and strengthen the effective band;

[0035] Spatial attention: Asymmetric convolution (1×3 and 3×1 combination) is introduced to capture the lateral fluctuation characteristics of the spectrum. Spatial weights are assigned through Softmax. Finally, the attention weights are multiplied by the convolution features to achieve adaptive feature enhancement.

[0036] Fluorescence spectral time series-spectral bidirectional LSTM modeling

[0037] Bidirectional LSTM structure:

[0038] Set up two LSTM layers to process time series data forward / reverse respectively

[0039] Temporal LSTM: The input is the excitation wavelength switching sequence, the time step Δt = 15s, the hidden layer dimension is 64, and it captures the excitation-emission delay dynamics;

[0040] Spectral dimension LSTM: processes the spectral intensity sequence along the emission wavelength axis 280-700nm, with a step size of 2nm and a hidden layer dimension of 32, and extracts local peak and valley features;

[0041] Gating mechanism optimization: the forget gate uses a dynamic attenuation factor:

[0042] f t =σ(W f ·[h t-1 ,x t ]+b f )×(1-e -αt );

[0043] Where α is the time attenuation coefficient, which increases with the excitation period and suppresses early noise interference.

[0044] Multi-scale feature stitching:

[0045] The bidirectional LSTM output is concatenated with the original fluorescence matrix in three dimensions, time sequence × wavelength × intensity, and compressed to a 256-dimensional fusion feature through 1×1×1 convolution to preserve the spatiotemporal correlation;

[0046] In step (d), the multispectral time-frequency domain alignment module realizes the temporal alignment of the UV-visible spectrum and the near-infrared spectrum based on the dynamic time warping algorithm:

[0047] When constructing the cumulative distance matrix, an improved window limitation strategy is adopted, setting the maximum path offset to 15% of the time series length to avoid feature distortion caused by excessive stretching;

[0048] The distance metric function is defined as d(x i ,y j )=sqrt[(x i UV -y j NIR)2+0.5(x i deriv -y j deriv ) 2 ], where x i deriv Represents the first-order derivative characteristics and enhances the matching accuracy of spectral trend;

[0049] The optimal alignment path is generated by backtracking the reverse path, and the spectral data of non-integer sampling points are compensated by cubic spline interpolation. The time domain alignment error is controlled within ±0.3s.

[0050] Gated Attention Joint Representation Generation

[0051] The ultraviolet-visible spectral features (F_UV) and the near-infrared spectral features (F_NIR) interact through the dual-channel gated attention unit (Dual-GAU):

[0052] Query (Q) and key (K) generation: F_UV generates the Q matrix through 1×5 convolution, and F_NIR generates the K matrix through depth-wise separable convolution, both with dimensions of 256×64

[0053] Gating weight calculation: using the improved Sigmoid gating function G = σ (W g [F UV ∣∣F NIR ]+b g ), where W g is a trainable parameter matrix, || represents the channel splicing operation

[0054] Joint representation output: Through the attention score matrix A = Softmax(QK T / sqrt(d k )) weighted fusion and element-wise multiplication with the gate weight, the formula is F joint =G⊙(A·V)+F UV , where V is the 1×3 convolution map of F_NIR;

[0055] Multimodal feature concatenation and regularization

[0056] Cross-modal concatenation of fluorescence features (F_Flu) and joint representations (F_joint):

[0057] Concatenate F_Flu (192 dimensions) and F_joint (576 dimensions) along the feature dimension to form a 768-dimensional fusion feature vector, and use dynamic dimension scaling technology to eliminate dimensional differences;

[0058] Before splicing, temporal-spectral normalization was performed on F_Flu: Z-score normalization was performed along the excitation wavelength axis, and maximum-minimum normalization was performed along the emission wavelength axis;

[0059] L2 regularization strategy:

[0060] Adaptive regularization constraints are applied before the input of the fully connected layer, and the objective function is:

[0061]

[0062] Where λ = 0.003;

[0063] The regularization coefficient is dynamically adjusted according to the feature importance: when the UV feature variance is greater than 0.15, λ is increased to 0.005 to suppress overfitting;

[0064] Cross-modal feature enhancement mechanism

[0065] Dynamic weight recalibration: Based on feature contribution α=Tanh(W c ·F fusion ) redistribute the modal weights, where Wc is a learnable 768×3 matrix;

[0066] Adversarial training compensation: Introducing the gradient reversal layer (GRL) through domain adversarial loss L adv =E[logD(F fusion )] To enhance cross-device generalization capabilities, the discriminator D consists of a 3-layer MLP.

[0067] In step (e),

[0068] Multi-head bilinear pooling feature interaction module

[0069] 8-head bilinear pooling is used to achieve cross-modal feature interaction: the 768-dimensional fusion feature is split into 8 groups of 96-dimensional sub-features, and each group generates a bilinear interaction matrix B through outer product operation k =F i T W k F j , where W k is a learnable 96×96 parameter matrix, k=1,...,8;

[0070] The pooled output is compressed using a low-rank approximation: Singular value decomposition (SVD) is used to reduce the dimensionality of the eight interaction matrices, retaining the first 32 principal components, ultimately forming a 256-dimensional enhanced feature vector, reducing computational complexity by 57%;

[0071] Dynamic head weight allocation: based on feature contribution α k =Softmax(MLP(B k )) Dynamically adjust the output weight of each head to suppress the influence of noise interference head;

[0072] The quality prediction network architecture adopts a three-level fully connected network design:

[0073] First layer: 256→128 dimensions, using GeLU activation function and applying Dropout rate 0.3 regularization

[0074] Second layer: 128→64 dimensions, introducing residual connections and batch normalization (BN) to prevent gradient disappearance

[0075] Output layer: 64→3D, corresponding to the three indicators of icariin (μg / mL), total microbial count (CFU / mL), and heavy metal residue (ppm), using linear activation;

[0076] Loss function design

[0077] Combined weighted mean square error L = 0.5L 淫羊藿 +0.3L 微生物 +0.2L 重金属 , where the icariin term introduces the second-order derivative constraint to enhance the fitting accuracy of the characteristic peak area;

[0078] Threshold comparison and quality grading

[0079] Dynamic threshold adjustment mechanism: The basic threshold is set in accordance with the 2025 edition of the Chinese Pharmacopoeia: icariin ≥ 80 μg / mL, microorganisms ≤ 100 CFU / mL, and heavy metals ≤ 0.3 ppm. Each batch is dynamically adjusted by ± 5% based on the medicinal material traceability data.

[0080] Three-level quality judgment rules:

[0081] Superior product: all three indicators are more than 20% better than the threshold; qualified product: all three indicators are within the threshold range; unqualified product: any indicator exceeds the threshold;

[0082] Real-time feedback control: When a defective product is detected, a freeze command is sent to the host computer via the OPC UA protocol, triggering the spectrum acquisition module to enter high-density sampling mode, with the frequency increased to 50Hz;

[0083] Uncertainty quantification: Monte Carlo Dropout method was used. Dropout was kept activated during prediction and 50 forward propagations were performed to calculate the confidence interval. When the 95% CI width of the predicted icariin content was greater than 5 μg / mL, HPLC offline retesting was triggered.

[0084] Drift compensation mechanism: An adaptive model update strategy based on the EWMA control chart is established. When the prediction residual MAE of 30 consecutive batches is greater than 0.8, incremental learning is started to update the network weights.

[0085] The beneficial effects of the present invention are:

[0086] Based on the characteristic differences of UV-visible spectra, near-infrared spectra and fluorescence spectra, a customized feature extraction method is adopted to significantly improve detection accuracy and dynamic adaptability.

[0087] A sliding window adaptive moving average method (with a dynamically adjustable window length of 30-50 points) combined with a dual-weight factor correction strategy (real-time calculation of the compensation coefficient based on the rate of change of absorbance at 278 nm) effectively eliminates turbidity interference. Savitzky-Golay smoothing (11-point window + third-order polynomial fitting) controls baseline drift error to ±0.01 AU. Compared to traditional fixed-window methods, the turbidity interference compensation response time is shortened to 50ms, adapting to absorbance fluctuations caused by differences in medicinal material batches.

[0088] Parallel dilated convolutional layers with dilation rates of r = 1 / 3 / 5 are used, combined with global residual connections, to achieve multi-level spectral feature fusion. Through the SNR dynamic convolution kernel weight adjustment mechanism (), 95% feature extraction efficiency can be maintained under low signal-to-noise ratio conditions.

[0089] The dual-branch structure of depthwise separable convolution (3×3 spatial convolution + 1×1 channel interaction) and asymmetric convolution (a combination of 1×3 and 3×1), combined with Sigmoid channel attention and Softmax spatial weight distribution, improves feature discrimination in the 900-2500 cm-1 band by 60%. This technology successfully addresses the 15% prediction error caused by instrumental variations in traditional near-infrared models.

[0090] A bidirectional LSTM network was constructed along the excitation wavelength axis (step size 10 nm) and the emission wavelength axis (step size 2 nm), and the hidden layer dimensions were set to 64 and 32, respectively. t =σ(W f ·[h t -1,x t ]+b f )×(1-e -αt ))Suppresses early noise interference and compresses the excitation-emission matrix timing alignment error from 0.5 seconds to ±0.3 seconds.

[0091] Using an improved DTW algorithm (regularized window ±15% of the excitation wavelength interval) combined with cubic spline interpolation to reconstruct data from non-integer sampling points, experiments showed that this method achieved a Raman scattering suppression ratio of >60dB after normalizing fluorescence intensity, and achieved an accuracy rate of 98.79% for identifying characteristic fluorescent components.

[0092] By integrating three-dimensional data from UV-visible, near-infrared, and fluorescence spectra, we simultaneously detect icariin, total microbial counts, and heavy metal residues, covering the full spectral range of 200-2500 nm. Compared to traditional single near-infrared detection (with correlation coefficients of only 0.95-0.98), this solution utilizes a cross-modal attention mechanism and multi-head bilinear pooling technology to reduce the prediction error of core indicators by over 40% (icariin RMSEP ≤ 0.03 μg / mL, and the detection limit for heavy metals is 0.05 ppm).

[0093] A timing alignment algorithm based on dynamic time warping (DTW) can complete timing compensation of the excitation-emission matrix within 15 seconds, resolving the timing misalignment problem of 0.5 seconds or more that occurs with traditional static interpolation methods on high-speed production lines (single bottle inspection <15 seconds). A sliding window adaptive moving average method combined with a dual-weighting factor correction strategy reduces turbidity interference compensation response time to 50ms and improves baseline drift correction accuracy to ±0.01 AU.

[0094] Compared to traditional offline HPLC testing (requiring 5-8 hours per batch), this system achieves 10Hz high-density online sampling. Combined with real-time feedback control using the OPC UA protocol, this system intercepts abnormal samples in a response time of less than 200ms. Confidence intervals are calculated using 50 forward propagation passes using the Monte Carlo Dropout method. When the 95% CI for icariin exceeds 5μg / mL, retesting is automatically triggered, improving efficiency by 300% compared to manual sampling.

[0095] A three-tier quality grading system (excellent / qualified / unqualified) achieves dynamic threshold adaptation to the 2025 edition of the Chinese Pharmacopoeia. Through L2 regularization and feature importance weight calibration, the misclassification rate for key indicators has been reduced to below 0.8% (compared to approximately 5-8% for traditional methods). A three-dimensional spectral database provides data support for production process optimization. Correlation analysis between the near-infrared characteristic band (1200-2500 cm-1) and the fluorescence excitation wavelength (250-550 nm) allows for the tracing of the impact of batch differences in medicinal materials on the active ingredients. BRIEF DESCRIPTION OF THE DRAWINGS

[0096] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0097] Attachment Figure 1 This is a schematic diagram of the overall architecture of the present invention;

[0098] Attachment Figure 2This is a model framework diagram of the present invention;

[0099] Attachment Figure 3 It is a front view of the detection device of the present invention;

[0100] Attachment Figure 4 A top view of the device of the present invention;

[0101] Attachment Figure 5 It is a front view of the device of the present invention.

[0102] in:

[0103] Cabinet 1, control panel 2, loading conveyor belt 3, unloading conveyor belt 4, ultraviolet-visible spectrum sensor 5, near-infrared spectrum sensor 6, fluorescence spectrum sensor 7, circular turntable 8. DETAILED DESCRIPTION

[0104] Example 1:

[0105] See also Figures 1 to 5 The present invention provides an online quality detection device for Anshenbunao liquid based on multi-spectral detection technology.

[0106] It includes a host computer, a conveying device, a spectrum acquisition module, a data processing module and a quality assessment module;

[0107] The host computer is connected to a conveying device, a spectrum acquisition module, a data processing module, and a quality assessment module; the conveying device includes a loading device, a turntable device, and an unloading device; the turntable device is used to transfer the medicine bottles containing the tranquilizing and brain-boosting solution to different inspection stations; the spectrum acquisition module includes an ultraviolet-visible spectrum module, a near-infrared spectrum module, and a fluorescence spectrum module. The spectrum acquisition module collects ultraviolet-visible spectra, near-infrared spectra, and fluorescence spectra, and inputs them into the data processing module for spectrum preprocessing, and then inputs them into the quality assessment module for quality assessment;

[0108] The quality assessment module sends the assessment results to the host computer.

[0109] The upper computer includes a control panel and a cabinet, the loading device includes a loading conveyor belt, the turntable module includes a circular turntable, and the unloading module includes an unloading conveyor belt;

[0110] It also includes ultraviolet-visible spectrum sensors, near-infrared spectrum sensors and fluorescence spectrum sensors.

[0111] Example 2:

[0112] See also Figures 1 to 2 The online quality detection method of Anshenbunao liquid based on multispectral detection technology includes the following steps:

[0113] (a) Real-time acquisition of multispectral data

[0114] The spectrum acquisition module acquires the ultraviolet-visible spectrum, near-infrared spectrum and fluorescence spectrum of the Anshenbunao liquid production process;

[0115] (b) Spectral dynamic preprocessing

[0116] The data processing module performs baseline drift compensation on UV spectral data, eliminates turbidity interference using the adaptive moving average method, performs wavelet denoising and baseline correction on near-infrared spectral data; performs dynamic time warping on fluorescence spectral data to align the excitation-emission timing and complete intensity normalization;

[0117] (c) Key quality indicator extraction

[0118] A multi-scale residual convolutional network is used to extract spectral features from near-infrared spectra, a deep separable convolution and spectral attention mechanism are used to extract features from infrared spectra, and a time-series-spectral bidirectional LSTM is used to extract features from fluorescence spectral data.

[0119] (d) Cross-modal dynamic attention fusion

[0120] A spectral alignment unit is set up to achieve time / frequency domain alignment of different spectra based on the dynamic time warping algorithm. The UV-visible and infrared spectral features are jointly represented through gated attention, and then concatenated with the fluorescence features. The final fusion feature dimension is 768, and L2 regularization is performed before inputting into the fully connected layer.

[0121] (e) Multimodal quality fusion decision

[0122] The fused features are input into the quality prediction network after multi-head bilinear pooling to output three core quality indicators: icariin content, total microbial count and heavy metal residue. The prediction results are compared with the preset thresholds in real time, and the three core quality indicators are calculated to obtain the quality grade of Anshenbu Nao Liquid.

[0123] In step (a), the UV-visible spectroscopy parameters are: detection wavelength range 200-800 nm, sampling frequency 10 Hz, and absorbance dynamic range 0.2-1.5 AU;

[0124] Near-infrared spectral parameters: spectral frequency range is 900-2500nm, corresponding to the wavenumber range of 4000-12000cm-1, using InGaAs array detector, spectral resolution ≤6nm, signal-to-noise ratio ≥30000:1, dynamic adjustment range of integration time 10μs-10s, 12-scan averaging mode to improve signal-to-noise ratio;

[0125] Fluorescence spectrum parameters: excitation wavelength range 250-550 nm, emission wavelength range 280-700 nm, scanning in excitation-emission matrix (EEM) mode, excitation wavelength switching with a step size of 10 nm, emission spectrum acquisition at 2 nm intervals, response time <5 ns, Rayleigh scattering suppression ratio >60 dB, single full spectrum scan time ≤15 seconds.

[0126] In step (b), the UV-visible spectrum baseline drift compensation and turbidity interference elimination were performed by using a sliding window adaptive moving average method for baseline correction: the dynamic window length was set to 30-50 spectral data points, and the window width was dynamically adjusted by calculating the local mean square error of the spectral data in the window. When the mean square error was greater than 0.05 AU, the window was reduced to 20 points, and when the mean square error was less than 0.01 AU, the window was expanded to 60 points. The turbidity interference elimination adopted a dual weight factor correction strategy: based on the absorbance change rate at the characteristic wavelength of 278 nm, the turbidity compensation coefficient α was calculated in real time as 1.2×10 -3 (dA / dt) 2 The baseline was then smoothed to +0.95 and convolved with the moving average baseline of the adjacent band (260-300 nm). After baseline drift compensation, Savitzky-Golay smoothing was performed with an 11-point window and a third-order polynomial fit to eliminate high-frequency noise.

[0127] Wavelet denoising and baseline correction for near-infrared spectra: The wavelet decomposition uses the Symlets8 wavelet basis function for a five-layer decomposition, and the high-frequency coefficients use the improved SURE threshold rule: threshold T = σ√(2lnN) / log2(j+1), where σ is the noise standard deviation, j is the number of decomposition layers, and N is the signal length. Baseline correction uses segmented multivariate scattering correction (MSC): the spectrum is divided into three bands: 1200-1800nm, 1800-2200nm, and 2200-2500nm. The light scattering path length correction factor is calculated for each band, and orthogonal projection is used to eliminate non-uniform scattering interference. The reconstructed spectrum is subjected to first-order derivative processing: a first-order Savitzky-Golay derivative with a 17-point window width is used to enhance the spectral feature resolution.

[0128] Fluorescence spectra are dynamically time-warped and intensity-normalized. The dynamic time warping (DTW) algorithm is used for excitation-emission timing alignment: the warping window width is set to ±15% of the excitation wavelength switching interval, and the optimal path matching is achieved through the cumulative cost matrix D(i,j)=min{D(i-1,j),D(i,j-1),D(i-1,j-1)}+d(x_i,y_j); after timing alignment, cubic spline interpolation compensation is performed: the emission spectrum data of non-integer multiple sampling points are interpolated and reconstructed to ensure the time resolution error of the excitation-emission matrix (EEM). Intensity normalization uses maximum-minimum normalization combined with PARAFAC decomposition: first, the original fluorescence intensity is mapped to the [0,1] interval, and then the Raman scattering interference is eliminated through the trilinear decomposition model to retain the intensity of the characteristic fluorescence component.

[0129] In step (c), multi-scale residual convolutional network feature extraction:

[0130] A multi-scale atrous residual block (ACRB) is used, which contains three parallel atrous convolutional layers with a dilation rate of r = 1 / 3 / 5. Local spectral features under different receptive fields are extracted respectively. The output of each ACRB is added to the input through a jump connection to alleviate the gradient vanishing problem. The convolution kernel adopts a size of 1×7 to adapt to the banded feature distribution of the near-infrared spectrum. A global residual connection is introduced in the fourth layer of the network to add the original input spectrum to the deep features element by element, retaining the low-frequency information of the original spectrum while enhancing the discrimination of high-frequency features. The fused features are compressed in spatial dimensions through 3×1 maximum pooling to reduce noise interference. The convolution kernel weight is dynamically adjusted based on the spectral signal-to-noise ratio (SNR): when the SNR is less than 45dB, the small-scale convolution r = 1 is activated as the main branch; when the SNR is ≥ 45dB, it switches to the large-scale convolution r = 5 to enhance context association.

[0131] Infrared Spectral Deep Separable Convolution and Spectral Attention Mechanism:

[0132] The depth-wise separable convolutional architecture adopts a dual-branch structure:

[0133] Depth convolution branch: Use 3×3 depth convolution to extract spatial features, each channel is calculated independently, and the number of parameters is reduced to 1 / 8 of the standard convolution;

[0134] Point-by-point convolution branch: 1×1 convolution performs information exchange between channels to generate a 128-dimensional feature map. The outputs of the two branches are fused through channel splicing to preserve details and improve computational efficiency.

[0135] Spectral Attention Mechanism:

[0136] Channel attention: obtain channel weights through global average pooling, use the Sigmoid function to generate a 0-1 attention coefficient, and strengthen the effective band;

[0137] Spatial attention: Asymmetric convolution (1×3 and 3×1 combination) is introduced to capture the lateral fluctuation characteristics of the spectrum. Spatial weights are assigned through Softmax. Finally, the attention weights are multiplied by the convolution features to achieve adaptive feature enhancement.

[0138] Fluorescence spectral time series-spectral bidirectional LSTM modeling

[0139] Bidirectional LSTM structure:

[0140] Set up two LSTM layers to process time series data forward / reverse respectively

[0141] Temporal LSTM: The input is the excitation wavelength switching sequence, the time step Δt = 15s, the hidden layer dimension is 64, and it captures the excitation-emission delay dynamics;

[0142] Spectral dimension LSTM: processes the spectral intensity sequence along the emission wavelength axis 280-700nm, with a step size of 2nm and a hidden layer dimension of 32, and extracts local peak and valley features;

[0143] Gating mechanism optimization: the forget gate uses a dynamic attenuation factor:

[0144] f t =σ(W f ·[h t-1 ,x t ]+b f )×(1-e -αt );

[0145] Where α is the time attenuation coefficient, which increases with the excitation period and suppresses early noise interference.

[0146] Multi-scale feature stitching:

[0147] The bidirectional LSTM output is concatenated with the original fluorescence matrix in three dimensions, time sequence × wavelength × intensity, and compressed to a 256-dimensional fusion feature through 1×1×1 convolution to preserve the spatiotemporal correlation;

[0148] In step (d), the multispectral time-frequency domain alignment module realizes the temporal alignment of the UV-visible spectrum and the near-infrared spectrum based on the dynamic time warping algorithm:

[0149] When constructing the cumulative distance matrix, an improved window limitation strategy is adopted, setting the maximum path offset to 15% of the time series length to avoid feature distortion caused by excessive stretching;

[0150] The distance metric function is defined as d(x i ,y j )=sqrt[(x i UV -y j NIR )2+0.5(xi deriv -y j deriv ) 2 ], where x i deriv Represents the first-order derivative characteristics and enhances the matching accuracy of spectral trend;

[0151] The optimal alignment path is generated by backtracking the reverse path, and the spectral data of non-integer sampling points are compensated by cubic spline interpolation. The time domain alignment error is controlled within ±0.3s.

[0152] Gated Attention Joint Representation Generation

[0153] The ultraviolet-visible spectral features (F_UV) and the near-infrared spectral features (F_NIR) interact through the dual-channel gated attention unit (Dual-GAU):

[0154] Query (Q) and key (K) generation: F_UV generates the Q matrix through 1×5 convolution, and F_NIR generates the K matrix through depth-wise separable convolution, both with dimensions of 256×64

[0155] Gating weight calculation: using the improved Sigmoid gating function G = σ (W g [F UV ∣∣F NIR ]+b g ), where W g is a trainable parameter matrix, || represents the channel splicing operation

[0156] Joint representation output: Through the attention score matrix A = Softmax(QK T / sqrt(d k )) weighted fusion and element-wise multiplication with the gate weight, the formula is F joint =G⊙(A·V)+F UV , where V is the 1×3 convolution map of F_NIR;

[0157] Multimodal feature concatenation and regularization

[0158] Cross-modal concatenation of fluorescence features (F_Flu) and joint representations (F_joint):

[0159] Concatenate F_Flu (192 dimensions) and F_joint (576 dimensions) along the feature dimension to form a 768-dimensional fusion feature vector, and use dynamic dimension scaling technology to eliminate dimensional differences;

[0160] Before splicing, temporal-spectral normalization was performed on F_Flu: Z-score normalization was performed along the excitation wavelength axis, and maximum-minimum normalization was performed along the emission wavelength axis;

[0161] L2 regularization strategy:

[0162] Adaptive regularization constraints are applied before the input of the fully connected layer, and the objective function is:

[0163]

[0164] Where λ = 0.003;

[0165] The regularization coefficient is dynamically adjusted according to the feature importance: when the UV feature variance is greater than 0.15, λ is increased to 0.005 to suppress overfitting;

[0166] Cross-modal feature enhancement mechanism

[0167] Dynamic weight recalibration: Based on feature contribution α=Tanh(W c ·F fusion ) redistribute the modal weights, where Wc is a learnable 768×3 matrix;

[0168] Adversarial training compensation: Introducing the gradient reversal layer (GRL) through domain adversarial loss L adv =E[logD(F fusion )] To enhance cross-device generalization capabilities, the discriminator D consists of a 3-layer MLP.

[0169] In step (e),

[0170] Multi-head bilinear pooling feature interaction module

[0171] 8-head bilinear pooling is used to achieve cross-modal feature interaction: the 768-dimensional fusion feature is split into 8 groups of 96-dimensional sub-features, and each group generates a bilinear interaction matrix B through outer product operation k =F i T W k F j , where W k is a learnable 96×96 parameter matrix, k=1,...,8;

[0172] The pooled output is compressed using a low-rank approximation: Singular value decomposition (SVD) is used to reduce the dimensionality of the eight interaction matrices, retaining the first 32 principal components, ultimately forming a 256-dimensional enhanced feature vector, reducing computational complexity by 57%;

[0173] Dynamic head weight allocation: based on feature contribution α k =Softmax(MLP(B k )) Dynamically adjust the output weight of each head to suppress the influence of noise interference head;

[0174] The quality prediction network architecture adopts a three-level fully connected network design:

[0175] First layer: 256→128 dimensions, using GeLU activation function and applying Dropout rate 0.3 regularization

[0176] Second layer: 128→64 dimensions, introducing residual connections and batch normalization (BN) to prevent gradient disappearance

[0177] Output layer: 64→3D, corresponding to the three indicators of icariin (μg / mL), total microbial count (CFU / mL), and heavy metal residue (ppm), using linear activation;

[0178] Loss function design

[0179] Combined weighted mean square error L = 0.5L 淫羊藿 +0.3L 微生物 +0.2L 重金属 , where the icariin term introduces the second-order derivative constraint to enhance the fitting accuracy of the characteristic peak area;

[0180] Threshold comparison and quality grading

[0181] Dynamic threshold adjustment mechanism: The basic threshold is set in accordance with the 2025 edition of the Chinese Pharmacopoeia: icariin ≥ 80 μg / mL, microorganisms ≤ 100 CFU / mL, and heavy metals ≤ 0.3 ppm. Each batch is dynamically adjusted by ± 5% based on the medicinal material traceability data.

[0182] Three-level quality judgment rules:

[0183] Superior product: all three indicators are more than 20% better than the threshold; qualified product: all three indicators are within the threshold range; unqualified product: any indicator exceeds the threshold;

[0184] Real-time feedback control: When a defective product is detected, a freeze command is sent to the host computer via the OPC UA protocol, triggering the spectrum acquisition module to enter high-density sampling mode, with the frequency increased to 50Hz;

[0185] Uncertainty quantification: Monte Carlo Dropout method was used. Dropout was kept activated during prediction and 50 forward propagations were performed to calculate the confidence interval. When the 95% CI width of the predicted icariin content was greater than 5 μg / mL, HPLC offline retesting was triggered.

[0186] Drift compensation mechanism: An adaptive model update strategy based on the EWMA control chart is established. When the prediction residual MAE of 30 consecutive batches is greater than 0.8, incremental learning is started to update the network weights.

[0187] Thus far, the description of the above-described embodiments has been provided for the purpose of illustration and description. It is not intended to be exhaustive or to limit the present disclosure. The individual elements or features of a particular embodiment are generally not limited to the particular embodiment, but when applicable, they can be interchanged and used for selected embodiments even if not specifically shown or described. In many aspects, the same elements or features can also be changed. Such changes are not considered to depart from the present disclosure, and all such modifications are intended to be included within the scope of the present disclosure.

[0188] Example embodiments are provided so that the present disclosure will be thorough and will fully convey the scope to those skilled in the art. In order to thoroughly understand the embodiments of the present disclosure, numerous details are set forth, such as examples of specific parts, devices, and methods. It will be apparent to those skilled in the art that specific details need not be used, and the example embodiments may be implemented in many different forms, and neither should be construed as limiting the scope of the present disclosure. In certain example embodiments, well-known processes, well-known device structures, and well-known technologies are not described in detail.

[0189] Here, professional vocabulary is used only for the purpose of describing specific example embodiments and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "a" and "the" used herein may be intended to include the plural forms as well. The terms "including" and "having" are inclusive and therefore specify the presence of the claimed features, wholes, steps, operations, elements and / or components, but do not exclude the presence or additional presence of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof. Unless the order of execution is explicitly indicated, the method steps, processes and operations described herein are not to be interpreted as necessarily needing to be performed in the specific order discussed and shown. It should also be understood that additional or optional steps may be adopted.

Claims

1. An online quality detection device for Anshenbunaoye based on multispectral detection technology, characterized by: It includes a host computer, a conveying device, a spectrum acquisition module, a data processing module and a quality assessment module; The host computer is connected to the conveying device, the spectrum acquisition module, the data processing module, and the quality assessment module; the conveying device includes a loading device, a turntable device, and an unloading device; the turntable device is used to transfer the medicine bottles containing the tranquilizing and brain-boosting solution to different inspection stations; the spectrum acquisition module includes an ultraviolet-visible spectrum module, a near-infrared spectrum module, and a fluorescence spectrum module. The spectrum acquisition module collects ultraviolet-visible spectra, near-infrared spectra, and fluorescence spectra, and inputs them into the data processing module for spectrum preprocessing, and then inputs them into the quality assessment module for quality assessment; The quality assessment module sends the assessment results to the host computer.

2. The device according to claim 1, characterized in that: The upper computer includes a control panel (2) and a cabinet (1), the loading device includes a loading conveyor belt (3), the turntable module includes a circular turntable (8), and the unloading module includes a unloading conveyor belt (4); It also includes an ultraviolet-visible spectrum sensor (5), a near-infrared spectrum sensor (6) and a fluorescence spectrum sensor (7).

3. A method for online quality detection of Anshenbunao liquid based on multispectral detection technology, characterized in that The steps include: (a) Real-time acquisition of multispectral data The spectrum acquisition module acquires the ultraviolet-visible spectrum, near-infrared spectrum and fluorescence spectrum of the Anshenbunao liquid production process; (b) Spectral dynamic preprocessing The data processing module performs baseline drift compensation on UV-visible spectral data, eliminates turbidity interference using the adaptive moving average method, performs wavelet denoising and baseline correction on near-infrared spectral data; performs dynamic time warping on fluorescence spectral data to align the excitation-emission timing and complete intensity normalization; (c) Key quality indicator extraction A multi-scale residual convolutional network is used to extract spectral features from near-infrared spectra, a deep separable convolution and spectral attention mechanism are used to extract features from infrared spectra, and a time-series-spectral bidirectional LSTM is used to extract features from fluorescence spectral data. (d) Cross-modal dynamic attention fusion Set the spectrum alignment unit to achieve time / frequency domain alignment of different spectra based on the dynamic time warping algorithm; The UV-visible spectrum features and the infrared spectrum features are jointly represented by gated attention, and then concatenated with the fluorescence features. The final fusion feature dimension is 768, and L2 regularization is performed before entering the fully connected layer. (e) Multimodal quality fusion decision The fused features are input into the quality prediction network after multi-head bilinear pooling to output three core quality indicators: icariin content, total microbial count and heavy metal residue. The prediction results are compared with the preset thresholds in real time, and the three core quality indicators are calculated to obtain the quality grade of Anshenbu Nao Liquid.

4. The method according to claim 3, wherein: In step (a), the UV-visible spectroscopy parameters are: detection wavelength range 200-800 nm, sampling frequency 10 Hz, and absorbance dynamic range 0.2-1.5 AU; Near-infrared spectral parameters: spectral frequency range is 900-2500nm, corresponding to the wavenumber range of 4000-12000cm-1, using InGaAs array detector, spectral resolution ≤6nm, signal-to-noise ratio ≥30000:1, dynamic adjustment range of integration time 10μs-10s, 12-scan averaging mode to improve signal-to-noise ratio; Fluorescence spectrum parameters: excitation wavelength range 250-550 nm, emission wavelength range 280-700 nm, scanning in excitation-emission matrix (EEM) mode, excitation wavelength switching with a step size of 10 nm, emission spectrum acquisition at 2 nm intervals, response time <5 ns, Rayleigh scattering suppression ratio >60 dB, single full spectrum scan time ≤15 seconds.

5. The method according to claim 3, wherein: In step (b), UV-visible spectroscopy baseline drift compensation and turbidity interference elimination The sliding window adaptive moving average method was used for baseline correction: the dynamic window length was set to 30-50 spectral data points, and the window width was dynamically adjusted by calculating the local mean square error of the spectral data within the window. When the mean square error was greater than 0.05 AU, the window was reduced to 20 points, and when the mean square error was less than 0.01 AU, the window was expanded to 60 points. Turbidity interference elimination uses a dual-weight factor correction strategy: based on the absorbance change rate at the characteristic wavelength, the turbidity compensation coefficient is calculated in real time and convolved with the moving average baseline of the adjacent band; after baseline drift compensation, Savitzky-Golay smoothing is performed to eliminate high-frequency noise interference; Wavelet denoising and baseline correction for near-infrared spectra Wavelet decomposition uses the Symlets8 wavelet basis function for a five-layer decomposition, and the high-frequency coefficients use the improved SURE threshold rule. Baseline correction uses segmented multivariate scattering correction: the spectrum is divided into three bands, and the light scattering path length correction factor is calculated for each band separately. Orthogonal projection is used to eliminate non-uniform scattering interference. The reconstructed spectrum is subjected to first-order derivative processing to enhance the resolution of spectral features; Fluorescence spectra dynamic time warping and intensity normalization, excitation-emission timing alignment using dynamic time warping algorithm; After time alignment, cubic spline interpolation compensation is performed to ensure the time resolution error of the excitation-emission matrix. Intensity normalization uses maximum-minimum normalization combined with PARAFAC decomposition to retain the intensity of characteristic fluorescence components.

6. The method according to claim 3, wherein: In step (c), Multi-scale residual convolutional network feature extraction: A multi-scale atrous residual block (ACRB) is used, which contains three parallel atrous convolutional layers with a dilation rate of r = 1 / 3 / 5. It extracts local spectral features under different receptive fields respectively. Each ACRB output is added to the input through a skip connection to alleviate the gradient vanishing problem. A global residual connection is introduced in the fourth layer of the network to add the original input spectrum to the deep features element by element, retaining the low-frequency information of the original spectrum while enhancing the discrimination of high-frequency features. The fused features are compressed in spatial dimensions through 3×1 maximum pooling to reduce noise interference. The convolution kernel weights are dynamically adjusted based on the spectral signal-to-noise ratio (SNR): when the SNR is less than 45dB, a small-scale convolution with r = 1 is activated as the main branch; when the SNR is ≥ 45dB, it switches to a large-scale convolution with r = 5 to enhance contextual association. Infrared Spectral Deep Separable Convolution and Spectral Attention Mechanism: The depth-wise separable convolutional architecture adopts a dual-branch structure: Depth convolution branch: Use 3×3 depth convolution to extract spatial features, each channel is calculated independently, and the number of parameters is reduced to 1 / 8 of the standard convolution; Point-by-point convolution branch: 1×1 convolution performs information exchange between channels to generate a 128-dimensional feature map. The outputs of the two branches are fused through channel splicing to preserve details and improve computational efficiency. Spectral Attention Mechanism: Channel attention: obtain channel weights through global average pooling, use the Sigmoid function to generate a 0-1 attention coefficient, and strengthen the effective band; Spatial attention: Asymmetric convolution is introduced to capture the horizontal fluctuation characteristics of the spectrum, spatial weights are assigned through Softmax, and the final attention weight is multiplied by the convolution feature to achieve adaptive feature enhancement; Fluorescence spectral time series-spectral bidirectional LSTM modeling Bidirectional LSTM structure: Set up two LSTM layers to process time series data forward / reverse respectively Temporal LSTM: The input is the excitation wavelength switching sequence, the time step Δt = 15s, the hidden layer dimension is 64, and it captures the excitation-emission delay dynamics; Spectral dimension LSTM: processes the spectral intensity sequence along the emission wavelength axis, with a hidden layer dimension of 32, and extracts local peak and valley features; In the gating mechanism optimization, the forget gate adopts a dynamic attenuation factor; Multi-scale feature stitching: The bidirectional LSTM output and the original fluorescence matrix were three-dimensionally spliced, time × wavelength × intensity, and compressed to a 256-dimensional fusion feature through 1 × 1 × 1 convolution to preserve the spatiotemporal correlation.

7. The method according to claim 3, wherein: In step (d), the multispectral time-frequency domain alignment module realizes the temporal alignment of the UV-visible spectrum and the near-infrared spectrum based on the dynamic time warping algorithm: When constructing the cumulative distance matrix, an improved window limitation strategy is adopted, setting the maximum path offset to 15% of the time series length to avoid feature distortion caused by excessive stretching; The distance metric function is defined as d(x i ,y j )=sqrt[(x i UV -y j NIR )2+0.5(x i deriv -y j deriv ) 2 ], where x i deriv Represents the first-order derivative characteristics and enhances the matching accuracy of spectral trend; The optimal alignment path is generated by backtracking the reverse path, and the spectral data of non-integer sampling points are compensated by cubic spline interpolation. The time domain alignment error is controlled within ±0.3s. Gated Attention Joint Representation Generation The ultraviolet-visible spectrum feature F_UV and the near-infrared spectrum feature F_NIR interact through a dual-channel gated attention unit: Query and key generation: F_UV generates the Q matrix through 1×5 convolution, and F_NIR generates the K matrix through depth-wise separable convolution, both with dimensions of 256×64 Gating weight calculation: using the improved Sigmoid gating function G = σ (W g [F UV ∣∣F NIR ]+b g ), where W g is a trainable parameter matrix, || represents the channel splicing operation Joint representation output: Through the attention score matrix A = Softmax(QK T / sqrt(d k )) weighted fusion and element-wise multiplication with the gate weight, the formula is F joint =G⊙(A·V)+F UV , where V is the 1×3 convolution map of F_NIR; Multimodal feature concatenation and regularization Cross-modal concatenation of the fluorescence feature F_Flu and the joint representation F_joint: Concatenate F_Flu and F_joint along the feature dimension to form a 768-dimensional fusion feature vector, and use dynamic dimension scaling technology to eliminate dimensional differences; Before splicing, temporal-spectral normalization was performed on F_Flu: Z-score normalization was performed along the excitation wavelength axis, and maximum-minimum normalization was performed along the emission wavelength axis; The regularization coefficient is dynamically adjusted according to the feature importance: when the feature variance is greater than 0.15, λ is increased to 0.005 to suppress overfitting; Cross-modal feature enhancement mechanism Dynamic weight recalibration: Based on feature contribution α=Tanh(W c ·F fusion ) redistribute the modal weights, where W c is a learnable 768×3 matrix; Adversarial training compensation: Introducing the gradient reversal layer GRL, through the domain adversarial loss L adv =E[logD(F fusion )] To enhance cross-device generalization capabilities, the discriminator D consists of a 3-layer MLP.

8. The method according to claim 3, wherein: In step (e), Multi-head bilinear pooling feature interaction module 8-head bilinear pooling is used to achieve cross-modal feature interaction: the 768-dimensional fusion feature is split into 8 groups of 96-dimensional sub-features, and each group generates a bilinear interaction matrix B through outer product operation k =F i T W k F j , where W k is a learnable 96×96 parameter matrix, k=1,...,8; The pooled output is compressed using a low-rank approximation: SVD is used to reduce the dimensionality of the eight interaction matrices, retaining the first 32 principal components. This ultimately results in a 256-dimensional enhanced feature vector, reducing computational complexity by 57%. Dynamic head weight allocation: based on feature contribution α k =Softmax(MLP(B k )) Dynamically adjust the output weight of each head to suppress the influence of noise interference head; The quality prediction network architecture adopts a three-level fully connected network design: First layer: 256→128 dimensions, using GeLU activation function and applying Dropout rate 0.3 regularization Second layer: 128→64 dimensions, introducing residual connections and batch normalization to prevent gradient disappearance Output layer: 64→3D, corresponding to the three indicators of icariin, total microbial count, and heavy metal residue, using linear activation; Loss function design Combined weighted mean square error L = 0.5L 淫羊藿 +0.3L 微生物 +0.2L 重金属 , where the icariin term introduces the second-order derivative constraint to enhance the fitting accuracy of the characteristic peak area; Threshold comparison and quality grading Dynamic threshold adjustment mechanism: The basic threshold is set in accordance with the 2025 edition of the Chinese Pharmacopoeia: icariin ≥ 80 μg / mL, microorganisms ≤ 100 CFU / mL, and heavy metals ≤ 0.3 ppm. Each batch is dynamically adjusted by ± 5% based on the medicinal material traceability data. Three-level quality judgment rules: superior products: all three indicators are more than 20% better than the threshold; qualified products: all three indicators are within the threshold range; unqualified products: any indicator exceeds the threshold; Real-time feedback control: When a defective product is detected, a freeze command is sent to the host computer via the OPC UA protocol, triggering the spectrum acquisition module to enter high-density sampling mode, with the frequency increased to 50Hz; Uncertainty quantification: Monte Carlo Dropout method was used. Dropout was kept activated during prediction and 50 forward propagations were performed to calculate the confidence interval. When the 95% CI width of the predicted icariin content was greater than 5 μg / mL, HPLC offline retesting was triggered. Drift compensation mechanism: An adaptive model update strategy based on the EWMA control chart is established. When the prediction residual MAE of 30 consecutive batches is greater than 0.8, incremental learning is started to update the network weights.

Citation Information

Patent Citations

  • Substance identification method and device, and computer readable storage medium

    CN111222543A

  • Textile fiber component nondestructive cleaning analysis method based on deep regression network

    CN113686804A

  • Multi-source spectrum fused self-adaptive dissolved organic carbon on-line detection method

    CN115270951A

  • Near-infrared fluorescence imaging device and method

    CN116297373A

  • Chinese patent medicine oral liquid quality detection device

    CN118464830A

Cited By

  • Activated carbon pore regulation and control method and monitoring equipment

    CN120846948A

  • Intelligent quality inspection system for medicinal empty capsules

    CN120891163A

  • Optical detection method and system for content of vitamin tablets

    CN120948385A

  • Near-infrared brain function imaging-oriented data classification method based on deep learning

    CN121121277A

  • Data classification method for near-infrared functional imaging based on deep learning

    CN121121277B