An online quality detection method for shenbushen liquid based on multispectral detection technology

By using an online detection device with multispectral detection technology and combined with multispectral data processing methods, the problems of timeliness, synchronicity, and adaptability in the traditional detection of An Shen Bu Nao Liquid have been solved. This has enabled efficient and accurate simultaneous detection of multidimensional quality indicators, adapting to batch differences in medicinal materials and reducing detection errors and misjudgment rates.

CN120446023BActive Publication Date: 2026-04-21JIANGSU JURONG PHARM GRP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU JURONG PHARM GRP CO LTD
Filing Date
2025-04-01
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Traditional quality testing technologies for calming and brain-nourishing liquids suffer from poor offline testing timeliness, weak multi-indicator simultaneous testing capability, and insufficient dynamic adaptability. In particular, they are easily affected by factors such as liquid turbidity and temperature drift on high-speed production lines, leading to fluctuations in testing accuracy and a high rate of false negatives.

Method used

An online detection device based on multispectral detection technology is adopted, which combines ultraviolet-visible spectroscopy, near-infrared spectroscopy and fluorescence spectroscopy. It achieves spectral feature extraction and cross-modal attention fusion through adaptive moving average method, multi-scale residual convolutional network, depthwise separable convolution and spectral attention mechanism. Dynamic time warping algorithm is used for time-frequency domain alignment. Finally, key quality indicators are output through multi-head bilinear pooling and quality prediction network.

Benefits of technology

It achieves simultaneous detection of multiple quality indicators within 15 seconds, improves detection accuracy, reduces error by 40%, shortens the response time for intercepting abnormal products to 200ms, reduces the false judgment rate to below 0.8%, adapts to batch differences in medicinal materials, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120446023B_ABST
    Figure CN120446023B_ABST
Patent Text Reader

Abstract

This invention proposes an online quality detection method for An Shen Bu Nao Liquid based on multispectral fusion. Addressing the bottlenecks of traditional detection techniques, such as long offline processing time, weak multi-index detection capabilities, and poor dynamic adaptability, this method achieves intelligent quality control throughout the entire production process. The device integrates ultraviolet-visible spectroscopy, near-infrared spectroscopy, and fluorescence spectroscopy modules. It constructs a multi-scale residual convolutional network to extract ultraviolet-visible spectral features, uses a two-way LSTM to analyze the fluorescence excitation-emission matrix, and employs dynamic baseline correction of the ultraviolet spectrum. This improves the detection accuracy of icariin content by 40% compared to traditional HPLC methods, and achieves a heavy metal residue detection limit of 0.05 ppm, providing an innovative solution for the intelligent production of traditional Chinese medicine preparations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traditional Chinese medicine analysis and testing, specifically to an online method for quality detection of Anshen Bunao Liquid based on multispectral detection technology. Background Technology

[0002] Traditional quality testing technologies for calming and brain-nourishing liquids suffer from three major bottlenecks: First, poor timeliness of offline testing. Current mainstream methods rely on high-performance liquid chromatography (HPLC) to determine icariin content, requiring 5-8 hours to complete a single batch test, which is severely incompatible with the 10-ton / day production capacity of modern extraction workshops. Second, weak capability for simultaneous multi-indicator detection. Existing quality control systems only perform quantitative analysis on single components (such as vitamin B1 or icariin), failing to simultaneously obtain key safety indicators such as total microbial count and heavy metal residues. Third, insufficient dynamic adaptability. Although traditional near-infrared online monitoring systems can monitor some parameters, they are limited by low spectral resolution (typically >6nm) and insufficient signal-to-noise ratio (<30000:1), making them susceptible to interference from factors such as turbidity and temperature drift in complex operating conditions, resulting in detection accuracy fluctuations exceeding 15%.

[0003] The current technical system has the following specific defects: (1) The ultraviolet spectroscopy detection adopts fixed window baseline correction, which cannot dynamically adapt to the absorbance fluctuation caused by batch differences of medicinal materials during the production of An Shen Bu Nao Liquid; (2) Near-infrared feature extraction relies on manually designed band selection, which makes it difficult to capture the weak spectral features of the effective components of medicinal materials; (3) Fluorescence spectral timing alignment adopts static interpolation algorithm, which is prone to timing misalignment of more than 0.5 seconds in high-speed production line scenarios (single bottle detection < 15 seconds). In addition, existing quality control devices mostly adopt a single spectral mode, and lack an effective cross-modal attention mechanism for the fusion decision of multi-dimensional quality indicators, resulting in a false negative rate of up to 12% for sudden abnormal detection such as microbial contamination. Summary of the Invention

[0004] To address the aforementioned problems, this invention provides an online quality detection device for An Shen Bu Nao Liquid based on multispectral detection technology.

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

[0006] The host computer connects to the conveying device, the spectral acquisition module, the data processing module, and the quality assessment module. The conveying device includes a feeding device, a turntable device, and a discharging device. The turntable device is used to transfer the bottles containing the calming and brain-nourishing liquid to different testing stations. The spectral acquisition module includes an ultraviolet-visible spectral module, a near-infrared spectral module, and a fluorescence spectral module. The spectral acquisition module acquires ultraviolet-visible, near-infrared, and fluorescence spectra, and inputs them into the data processing module for spectral 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 host computer includes a control panel and a cabinet; the feeding device includes a feeding conveyor belt; the turntable device includes a circular turntable; and the unloading device includes an unloading conveyor belt.

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

[0010] Furthermore, this invention also provides an online method for detecting the quality of An Shen Bu Nao Liquid based on multispectral detection technology, comprising the following steps:

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

[0012] The spectral acquisition module acquires ultraviolet-visible, near-infrared, and fluorescence spectra during the production process of An Shen Bu Nao Ye (a traditional Chinese medicine for calming the mind and nourishing the brain).

[0013] (b) Dynamic Spectral Preprocessing

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

[0015] (c) Extraction of key quality indicators

[0016] Multi-scale residual convolutional networks are used to extract spectral features from ultraviolet-visible spectra, depthwise separable convolution and spectral attention mechanisms are used to extract features from infrared spectra, and time-spectral bidirectional LSTM is used to extract features from fluorescence spectral data.

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

[0018] The spectral alignment unit is set up to achieve time / frequency domain alignment of different spectra based on the dynamic time warping algorithm; the features of ultraviolet-visible spectrum and infrared spectrum are used to generate joint characterization through gated attention, and then spliced ​​with fluorescence features. The final fused feature dimension is 768, and L2 regularization is performed before inputting into the fully connected layer.

[0019] (e) Multimodal quality fusion decision

[0020] After the fusion features are processed by multi-head bilinear pooling, they are input into the quality prediction network, which outputs three core quality indicators: icariin content, total microbial count, and heavy metal residue. The prediction results are compared with preset thresholds in real time, and the quality grade of An Shen Bu Nao Liquid is calculated from the three core quality indicators.

[0021] In step (a), the UV-Vis spectral 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 of 900-2500 nm, corresponding wavenumber range It employs an InGaAs array detector with a spectral resolution ≤6nm, a signal-to-noise ratio ≥30000:1, a dynamic adjustment range of integration time 10μs-10s, and a 12-scan averaging mode to improve the signal-to-noise ratio.

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

[0024] In step (b), baseline drift compensation and turbidity interference elimination in the UV-Vis spectrum are performed using a sliding window adaptive moving average method for baseline correction: the dynamic window length is set to 30-50 spectral data points, and the window width is dynamically adjusted by calculating the local root mean square error of the spectral data within the window. When the root mean square error is >0.05AU, the window shrinks to 20 points, and when the root mean square error is <0.01AU, the window expands to 60 points. Turbidity interference elimination employs a dual-weighting factor correction strategy: based on the absorbance change rate at the 278nm characteristic wavelength, the turbidity compensation coefficient is calculated in real time. It is then convolved with the moving average baseline of the adjacent band (260-300nm); after baseline drift compensation, Savitzky-Golay smoothing is performed: window width 11 points, 3rd order polynomial fitting, to eliminate high-frequency noise interference.

[0025] Near-infrared spectral wavelet denoising and baseline correction wavelet decomposition uses Symlets8 wavelet basis functions for 5-level decomposition, and the high-frequency coefficients are decomposed using an improved SURE thresholding rule: threshold ,in Here, j represents the noise standard deviation, j is the number of decomposition layers, and N is the signal length. Baseline correction employs 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 for each band is calculated, and non-uniform scattering interference is eliminated through orthogonal projection. The reconstructed spectrum undergoes first-order derivative processing: a first-order Savitzky-Golay derivative with a 17-point window width is used to enhance spectral feature resolution.

[0026] Dynamic time warping and intensity normalization of fluorescence spectra are performed. Excitation-emission timing alignment adopts the dynamic time warping (DTW) algorithm: the warping window width is set to ±15% of the excitation wavelength switching interval, and the optimal path matching is achieved by 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 temporal resolution error of the excitation-emission matrix (EEM). Intensity normalization adopts a combination of max-min normalization and PARAFAC decomposition: first, the original fluorescence intensity is mapped to the [0,1] interval, and then the Raman scattering interference is eliminated by the trilinear decomposition model to retain the intensity of characteristic fluorescence components.

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

[0028] A multi-scale dilated residual block (ACRB) is employed, comprising three parallel dilated convolutional layers with dilation rates r=1 / 3 / 5, each extracting local spectral features under different receptive fields. The output of each ACRB is added to the input via skip connections to alleviate the gradient vanishing problem. The convolutional kernels are 1×7 in size to accommodate the banded feature distribution of the near-infrared spectrum. A global residual connection is introduced in the fourth layer of the network, adding the original input spectrum to the deep features element-wise, preserving low-frequency information while enhancing the discriminative power of high-frequency features. The fused features are then compressed using 3×1 max pooling to reduce noise interference. The convolutional kernel weights are dynamically adjusted based on the spectral signal-to-noise ratio (SNR): when SNR < 45dB, small-scale convolutions (r=1) are activated as the main branch; when SNR ≥ 45dB, large-scale convolutions (r=5) are switched to enhance contextual association.

[0029] Infrared spectral depth-separable convolution and spectral attention mechanism:

[0030] The depthwise separable convolutional architecture employs a dual-branch structure:

[0031] Depthwise convolution branch: Uses 3×3 depthwise convolution to extract spatial features, with each channel computed independently, reducing the number of parameters to 1 / 8 of the standard convolution;

[0032] Pointwise convolution branch: 1×1 convolution performs inter-channel information exchange, generating a 128-dimensional feature map.

[0033] The two branch outputs are spliced ​​and merged through channels to preserve details and improve computational efficiency;

[0034] Spectral attention mechanism:

[0035] Channel attention: Channel weights are obtained through global average pooling, and attention coefficients of 0-1 are generated using the Sigmoid function to enhance effective bands;

[0036] Spatial attention: Asymmetric convolution (combination of 1×3 and 3×1) is introduced to capture spectral lateral fluctuation features. Spatial weights are assigned through Softmax, and finally the attention weights are multiplied with the convolution features to achieve adaptive feature enhancement.

[0037] Fluorescence spectroscopy time-spectral bidirectional LSTM modeling

[0038] Bidirectional LSTM structure:

[0039] Two LSTM layers are configured to process the timing data in the forward and reverse directions, respectively.

[0040] Time-series LSTM: Input is the excitation wavelength switching sequence, time step... The hidden layer has a dimension of 64, capturing the excitation-emission delay dynamics;

[0041] Spectral Dimension LSTM: Processes spectral intensity sequences along the emission wavelength axis from 280-700nm, with a step size of 2nm and a hidden layer dimension of 32, to extract local peak and valley features;

[0042] Gating mechanism optimization: The forget gate adopts a dynamic decay factor.

[0043] ;

[0044] in This is the time decay coefficient, which increases with the excitation period to suppress early noise interference.

[0045] Multi-scale feature stitching:

[0046] The bidirectional LSTM output is stitched together with the original fluorescence matrix in three dimensions, and the time sequence × wavelength × intensity is compressed to a 256-dimensional fusion feature through 1×1×1 convolution, preserving the spatiotemporal correlation.

[0047] In step (d), the multispectral time-frequency domain alignment module achieves time alignment between the ultraviolet-visible spectrum and the near-infrared spectrum based on the dynamic time warping algorithm:

[0048] An improved windowing strategy is used when constructing the cumulative distance matrix, setting the maximum path offset to 15% of the time series length to avoid excessive stretching that could lead to feature distortion.

[0049] The distance metric function is defined as follows: ,in It represents the first derivative characteristic, enhancing the matching accuracy of spectral variation trends;

[0050] The optimal alignment path is generated by backtracking through the reverse path, and cubic spline interpolation is used to compensate for spectral data of non-integer multiple sampling points, with the temporal alignment error controlled within ±0.3s;

[0051] Gated attention joint representation generation

[0052] Ultraviolet-visible spectral features (F_UV) and near-infrared spectral features (F_NIR) interact through a dual-gated attention unit (Dual-GAU):

[0053] Query (Q) and Key (K) Generation: F_UV is convolved with a 1×5 matrix to generate the Q matrix, and F_NIR is convolved with a depthwise separable matrix to generate the K matrix, both with dimensions of 256×64.

[0054] Gating weight calculation: A modified Sigmoid gating function is used. ,in For a trainable parameter matrix, Indicates channel splicing operation

[0055] Joint representation output: via attention score matrix Weighted fusion, and element-wise multiplication with the gate weights, the formula is as follows: , where V is a 1×3 convolution mapping of F_NIR;

[0056] Multimodal feature concatenation and regularization

[0057] Cross-modal splicing of fluorescence features (F_Flu) and joint characterization (F_joint):

[0058] F_Flu (192 dimensions) and F_joint (576 dimensions) are concatenated along the feature dimension to form a 768-dimensional fused feature vector. Dynamic dimension scaling technology is used to eliminate the difference in dimensions.

[0059] Before splicing, perform timing-spectral normalization on F_Flu: perform Z-score normalization along the excitation wavelength axis and maximum-min normalization along the emission wavelength axis;

[0060] L2 regularization strategy:

[0061] An adaptive regularization constraint is applied before the input to the fully connected layer, with the objective function being:

[0062] ,

[0063] in ;

[0064] The regularization coefficient is dynamically adjusted based on feature importance: when the variance of the ultraviolet feature is >0.15, λ is increased to 0.005 to suppress overfitting;

[0065] Cross-modal feature enhancement mechanism

[0066] Dynamic weight recalibration: based on feature contribution Reassign modal weights, where It is a learnable 768×3 matrix;

[0067] Adversarial training compensation: Introducing a gradient inversion layer (GRL) and using domain adversarial loss. To enhance cross-device generalization capabilities, the discriminator D consists of a 3-layer MLP.

[0068] In step (e),

[0069] Multi-head bilinear pooling feature interaction module

[0070] Cross-modal feature interaction is achieved using 8-head bilinear pooling: the 768-dimensional fused feature is split into 8 groups of 96-dimensional sub-features, and each group generates a bilinear interaction matrix through outer product operation. ,in It is a learnable 96×96 parameter matrix, k=1,...,8;

[0071] Pooling output is compressed using a low-rank approximation: Singular value decomposition (SVD) is used to reduce the dimensionality of the 8 interaction matrices, retaining the first 32 principal components, and finally forming a 256-dimensional enhanced feature vector, reducing computational complexity by 57%.

[0072] Dynamic head weight allocation: based on feature contribution Dynamically adjust the output weights of each head to suppress the influence of noise interference heads;

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

[0074] First layer: 256 to 128 dimensions, using the GeLU activation function, with a dropout rate of 0.3 applied for regularization.

[0075] The second layer: from 128 to 64 dimensions, introduces residual connections and batch normalization (BN) to prevent gradient vanishing.

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

[0077] Loss function design

[0078] Combined weighted mean square error The second derivative constraint is introduced into the icariin term to enhance the fitting accuracy of the characteristic peak region.

[0079] Threshold comparison and quality grading

[0080] Dynamic threshold adjustment mechanism: The basic thresholds are set with reference to the 2025 edition of the Chinese Pharmacopoeia: icariin ≥80μg / mL, microorganisms ≤100CFU / mL, heavy metals ≤0.3ppm, and each batch is dynamically corrected by ±5% based on the traceability data of medicinal materials;

[0081] Level 3 Quality Judgment Rules:

[0082] Superior grade: All three indicators are more than 20% better than the threshold; Qualified grade: All three indicators are within the threshold range; Unqualified grade: Any one indicator exceeds the threshold.

[0083] Real-time feedback control: When a non-conforming product is detected, a freeze command is sent to the host computer via the OPC UA protocol, and the spectral acquisition module is triggered to enter the high-density sampling mode, with the frequency increased to 50Hz;

[0084] Uncertainty quantification: The Monte Carlo Dropout method was used, with Dropout active during prediction. Confidence intervals were calculated by performing 50 forward propagations. When the 95% CI width of the predicted icariin content was >5 μg / mL, offline HPLC re-examination was triggered.

[0085] Drift compensation mechanism: An adaptive model update strategy based on EWMA control chart is established. When the prediction residual MAE > 0.8 for 30 consecutive batches, incremental learning is initiated to update the network weights.

[0086] The beneficial effects of this invention are as follows:

[0087] To address the differences in characteristics between ultraviolet-visible spectroscopy, near-infrared spectroscopy, and fluorescence spectroscopy, a customized feature extraction method is employed to significantly improve detection accuracy and dynamic adaptability.

[0088] A sliding window adaptive moving average method (window length dynamically adjusted from 30 to 50 points) combined with a dual-weighting factor correction strategy (compensation coefficient calculated in real time based on the absorbance change rate at 278 nm) effectively eliminates turbidity interference. Savitzky-Golay smoothing (11-point window + 3rd-order polynomial fitting) controls the baseline drift error to ±0.01 AU. Compared to the traditional fixed window method, the turbidity interference compensation response time is shortened to 50 ms, adapting to absorbance fluctuations caused by batch variations in medicinal materials.

[0089] Parallel dilated convolutional layers with a dilation rate r=1 / 3 / 5 are employed, combined with global residual connections, to achieve multi-level spectral feature fusion. Through an SNR dynamic convolutional kernel weight adjustment mechanism, 95% feature extraction effectiveness is maintained even under low signal-to-noise ratio conditions.

[0090] A dual-branch structure is introduced, combining depthwise separable convolution (3×3 spatial convolution + 1×1 channel interaction) and asymmetric convolution (a combination of 1×3 and 3×1), along with Sigmoid channel attention and Softmax spatial weight allocation, to achieve... The band feature discrimination is improved by 60%. This technology successfully solves the 15% prediction bias problem caused by instrument differences in traditional near-infrared models.

[0091] A bidirectional LSTM network was constructed along the excitation wavelength axis (10 nm step size) and the emission wavelength axis (2 nm step size), with hidden layer dimensions set to 64 and 32, respectively. A forgetting gate with a dynamic decay factor was used. Early noise interference is suppressed, reducing the timing alignment error of the excitation-emission matrix from 0.5 seconds to ±0.3 seconds.

[0092] An improved DTW algorithm (normalized window ± 15% excitation wavelength interval) was used, combined with cubic spline interpolation to reconstruct non-integer multiple sampling point data. Experiments showed that this method achieved a Raman scattering suppression ratio > 60 dB after normalization of fluorescence intensity, and the accuracy of characteristic fluorescent component identification reached 98.79%.

[0093] This method achieves simultaneous detection of icariin, total microbial count, and heavy metal residues by fusing three-dimensional data from ultraviolet-visible spectroscopy, near-infrared spectroscopy, and fluorescence spectroscopy, covering the full spectral range of 200-2500 nm. Compared to traditional single near-infrared detection (correlation coefficient only 0.95-0.98), this method employs a cross-modal attention mechanism and multi-head bilinear pooling technology, reducing the prediction error of core indicators by more than 40% (icariin RMSEP ≤ 0.03 μg / mL, heavy metal detection limit reaches 0.05 ppm).

[0094] The timing alignment algorithm based on Dynamic Time Warping (DTW) can complete the timing compensation of the excitation-emission matrix within 15 seconds, solving the timing misalignment problem of more than 0.5 seconds in high-speed production lines (single bottle inspection < 15 seconds) caused by traditional static interpolation methods. The sliding window adaptive moving average method combined with a dual-weighting factor correction strategy reduces the turbidity interference compensation response time to 50ms and improves the baseline drift correction accuracy to ±0.01AU.

[0095] Compared to traditional offline HPLC detection (requiring 5-8 hours per batch), this system achieves high-density online sampling at 10Hz, coupled with real-time feedback control using the OPC UA protocol, resulting in an abnormal sample interception response time of <200ms. Confidence intervals are calculated through 50 forward propagations using the Monte Carlo Dropout method, and automatic retesting is triggered when the 95% CI width of icariin is >5μg / mL, improving efficiency by 300% compared to manual sampling.

[0096] The three-tiered quality grading system (superior / qualified / unqualified) achieves dynamic threshold adaptation to the 2025 edition of the Chinese Pharmacopoeia. Through L2 regularization and feature importance weight calibration, the misjudgment rate of key indicators is reduced to below 0.8% (compared to approximately 5-8% for traditional methods). The establishment of a three-dimensional spectral database provides data support for production process optimization. Correlation analysis between near-infrared characteristic bands (1200-2500 cm⁻¹) and fluorescence excitation wavelengths (250-550 nm) can trace the impact of batch-to-batch differences in medicinal materials on the effective components. Attached Figure Description

[0097] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

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

[0099] Appendix Figure 2 This is a model framework diagram of the present invention;

[0100] Appendix Figure 3 This is a front view of the detection device of the present invention;

[0101] Appendix Figure 4 This is a top view of the device of the present invention;

[0102] Appendix Figure 5 This is a front view of the device of the present invention.

[0103] in:

[0104] 1. Cabinet; 2. Control panel; 3. Feeding conveyor belt; 4. Unloading conveyor belt; 5. Ultraviolet-visible spectral sensor; 6. Near-infrared spectral sensor; 7. Fluorescence spectral sensor; 8. Circular turntable. Detailed Implementation

[0105] Example 1:

[0106] See Figures 1 to 5 This invention provides an online detection device for the quality of An Shen Bu Nao Liquid based on multispectral detection technology.

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

[0108] The host computer connects to the conveying device, the spectral acquisition module, the data processing module, and the quality assessment module. The conveying device includes a feeding device, a turntable device, and a discharging device. The turntable device is used to transfer the bottles containing the calming and brain-nourishing liquid to different testing stations. The spectral acquisition module includes an ultraviolet-visible spectral module, a near-infrared spectral module, and a fluorescence spectral module. The spectral acquisition module acquires ultraviolet-visible, near-infrared, and fluorescence spectra, and inputs them into the data processing module for spectral preprocessing, and then inputs them into the quality assessment module for quality assessment.

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

[0110] The host computer includes a control panel and a cabinet; the feeding device includes a feeding conveyor belt; the turntable device includes a circular turntable; and the unloading device includes an unloading conveyor belt.

[0111] It also includes ultraviolet-visible spectroscopy sensors, near-infrared spectroscopy sensors, and fluorescence spectroscopy sensors.

[0112] Example 2:

[0113] See Figures 1 to 2 An online detection method for the quality of An Shen Bu Nao Liquid based on multispectral detection technology includes the following steps:

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

[0115] The spectral acquisition module acquires ultraviolet-visible, near-infrared, and fluorescence spectra during the production process of An Shen Bu Nao Ye (a traditional Chinese medicine for calming the mind and nourishing the brain).

[0116] (b) Dynamic Spectral Preprocessing

[0117] The data processing module performs baseline drift compensation on ultraviolet spectral data, eliminates turbidity interference using an adaptive moving average method, performs wavelet denoising and baseline correction on near-infrared spectral data, and performs dynamic time warping to align the excitation-emission sequence on fluorescence spectral data and completes intensity normalization.

[0118] (c) Extraction of key quality indicators

[0119] Multi-scale residual convolutional networks are used to extract spectral features from ultraviolet-visible spectra, depthwise separable convolution and spectral attention mechanisms are used to extract features from infrared spectra, and time-spectral bidirectional LSTM is used to extract features from fluorescence spectral data.

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

[0121] The spectral alignment unit is set up to achieve time / frequency domain alignment of different spectra based on the dynamic time warping algorithm; the features of ultraviolet-visible spectrum and infrared spectrum are used to generate joint characterization through gated attention, and then spliced ​​with fluorescence features. The final fused feature dimension is 768, and L2 regularization is performed before inputting into the fully connected layer.

[0122] (e) Multimodal quality fusion decision

[0123] After the fusion features are processed by multi-head bilinear pooling, they are input into the quality prediction network, which outputs three core quality indicators: icariin content, total microbial count, and heavy metal residue. The prediction results are compared with preset thresholds in real time, and the quality grade of An Shen Bu Nao Liquid is calculated from the three core quality indicators.

[0124] In step (a), the UV-Vis spectral parameters are: detection wavelength range 200-800 nm, sampling frequency 10 Hz, and absorbance dynamic range 0.2-1.5 AU.

[0125] Near-infrared spectral parameters: spectral frequency range of 900-2500 nm, corresponding wavenumber range It employs an InGaAs array detector with a spectral resolution ≤6nm, a signal-to-noise ratio ≥30000:1, a dynamic adjustment range of integration time 10μs-10s, and a 12-scan averaging mode to improve the signal-to-noise ratio.

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

[0127] In step (b), baseline drift compensation and turbidity interference elimination in the UV-Vis spectrum are performed using a sliding window adaptive moving average method for baseline correction: the dynamic window length is set to 30-50 spectral data points, and the window width is dynamically adjusted by calculating the local root mean square error of the spectral data within the window. When the root mean square error is >0.05AU, the window shrinks to 20 points, and when the root mean square error is <0.01AU, the window expands to 60 points. Turbidity interference elimination employs a dual-weighting factor correction strategy: based on the absorbance change rate at the 278nm characteristic wavelength, the turbidity compensation coefficient is calculated in real time. It is then convolved with the moving average baseline of the adjacent band (260-300nm); after baseline drift compensation, Savitzky-Golay smoothing is performed: window width 11 points, 3rd order polynomial fitting, to eliminate high-frequency noise interference.

[0128] Near-infrared spectral wavelet denoising and baseline correction wavelet decomposition uses Symlets8 wavelet basis functions for 5-level decomposition, and the high-frequency coefficients are decomposed using an improved SURE thresholding rule: threshold ,in Here, j represents the noise standard deviation, j is the number of decomposition layers, and N is the signal length. Baseline correction employs 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 for each band is calculated, and non-uniform scattering interference is eliminated through orthogonal projection. The reconstructed spectrum undergoes first-order derivative processing: a first-order Savitzky-Golay derivative with a 17-point window width is used to enhance spectral feature resolution.

[0129] Dynamic time warping and intensity normalization of fluorescence spectra are performed. Excitation-emission timing alignment adopts the dynamic time warping (DTW) algorithm: the warping window width is set to ±15% of the excitation wavelength switching interval, and the optimal path matching is achieved by 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 temporal resolution error of the excitation-emission matrix (EEM). Intensity normalization adopts a combination of max-min normalization and PARAFAC decomposition: first, the original fluorescence intensity is mapped to the [0,1] interval, and then the Raman scattering interference is eliminated by the trilinear decomposition model to retain the intensity of characteristic fluorescence components.

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

[0131] A multi-scale dilated residual block (ACRB) is employed, comprising three parallel dilated convolutional layers with dilation rates r=1 / 3 / 5, each extracting local spectral features under different receptive fields. The output of each ACRB is added to the input via skip connections to alleviate the gradient vanishing problem. The convolutional kernels are 1×7 in size to accommodate the banded feature distribution of the near-infrared spectrum. A global residual connection is introduced in the fourth layer of the network, adding the original input spectrum to the deep features element-wise, preserving low-frequency information while enhancing the discriminative power of high-frequency features. The fused features are then compressed using 3×1 max pooling to reduce noise interference. The convolutional kernel weights are dynamically adjusted based on the spectral signal-to-noise ratio (SNR): when SNR < 45dB, small-scale convolutions (r=1) are activated as the main branch; when SNR ≥ 45dB, large-scale convolutions (r=5) are switched to enhance contextual association.

[0132] Infrared spectral depth-separable convolution and spectral attention mechanism:

[0133] The depthwise separable convolutional architecture employs a dual-branch structure:

[0134] Depthwise convolution branch: Uses 3×3 depthwise convolution to extract spatial features, with each channel computed independently, reducing the number of parameters to 1 / 8 of the standard convolution;

[0135] Pointwise convolution branch: 1×1 convolution performs inter-channel information exchange, generating a 128-dimensional feature map.

[0136] The two branch outputs are spliced ​​and merged through channels to preserve details and improve computational efficiency;

[0137] Spectral attention mechanism:

[0138] Channel attention: Channel weights are obtained through global average pooling, and attention coefficients of 0-1 are generated using the Sigmoid function to enhance effective bands;

[0139] Spatial attention: Asymmetric convolution (combination of 1×3 and 3×1) is introduced to capture spectral lateral fluctuation features. Spatial weights are assigned through Softmax, and finally the attention weights are multiplied with the convolution features to achieve adaptive feature enhancement.

[0140] Fluorescence spectroscopy time-spectral bidirectional LSTM modeling

[0141] Bidirectional LSTM structure:

[0142] Two LSTM layers are configured to process the timing data in the forward and reverse directions, respectively.

[0143] Time-series LSTM: Input is the excitation wavelength switching sequence, time step... The hidden layer has a dimension of 64, capturing the excitation-emission delay dynamics;

[0144] Spectral Dimension LSTM: Processes spectral intensity sequences along the emission wavelength axis from 280-700nm, with a step size of 2nm and a hidden layer dimension of 32, to extract local peak and valley features;

[0145] Gating mechanism optimization: The forget gate adopts a dynamic decay factor.

[0146] ;

[0147] in This is the time decay coefficient, which increases with the excitation period to suppress early noise interference.

[0148] Multi-scale feature stitching:

[0149] The bidirectional LSTM output is stitched together with the original fluorescence matrix in three dimensions, and the time sequence × wavelength × intensity is compressed to a 256-dimensional fusion feature through 1×1×1 convolution, preserving the spatiotemporal correlation.

[0150] In step (d), the multispectral time-frequency domain alignment module achieves time alignment between the ultraviolet-visible spectrum and the near-infrared spectrum based on the dynamic time warping algorithm:

[0151] An improved windowing strategy is used when constructing the cumulative distance matrix, setting the maximum path offset to 15% of the time series length to avoid excessive stretching that could lead to feature distortion.

[0152] The distance metric function is defined as follows: ,in It represents the first derivative characteristic, enhancing the matching accuracy of spectral variation trends;

[0153] The optimal alignment path is generated by backtracking through the reverse path, and cubic spline interpolation is used to compensate for spectral data of non-integer multiple sampling points, with the temporal alignment error controlled within ±0.3s;

[0154] Gated attention joint representation generation

[0155] Ultraviolet-visible spectral features (F_UV) and near-infrared spectral features (F_NIR) interact through a dual-gated attention unit (Dual-GAU):

[0156] Query (Q) and Key (K) Generation: F_UV is convolved with a 1×5 matrix to generate the Q matrix, and F_NIR is convolved with a depthwise separable matrix to generate the K matrix, both with dimensions of 256×64.

[0157] Gating weight calculation: A modified Sigmoid gating function is used. ,in For a trainable parameter matrix, Indicates channel splicing operation

[0158] Joint representation output: via attention score matrix Weighted fusion, and element-wise multiplication with the gate weights, the formula is as follows: , where V is a 1×3 convolution mapping of F_NIR;

[0159] Multimodal feature concatenation and regularization

[0160] Cross-modal splicing of fluorescence features (F_Flu) and joint characterization (F_joint):

[0161] F_Flu (192 dimensions) and F_joint (576 dimensions) are concatenated along the feature dimension to form a 768-dimensional fused feature vector. Dynamic dimension scaling technology is used to eliminate the difference in dimensions.

[0162] Before splicing, perform timing-spectral normalization on F_Flu: perform Z-score normalization along the excitation wavelength axis and maximum-min normalization along the emission wavelength axis;

[0163] L2 regularization strategy:

[0164] An adaptive regularization constraint is applied before the input to the fully connected layer, with the objective function being:

[0165] ,

[0166] in ;

[0167] The regularization coefficient is dynamically adjusted based on feature importance: when the variance of the ultraviolet feature > 0.15, Increased to 0.005 to suppress overfitting;

[0168] Cross-modal feature enhancement mechanism

[0169] Dynamic weight recalibration: based on feature contribution Reassign modal weights, where Wc is a learnable 768×3 matrix;

[0170] Adversarial training compensation: Introducing a gradient inversion layer (GRL) and using domain adversarial loss. To enhance cross-device generalization capabilities, the discriminator D consists of a 3-layer MLP.

[0171] In step (e),

[0172] Multi-head bilinear pooling feature interaction module

[0173] Cross-modal feature interaction is achieved using 8-head bilinear pooling: the 768-dimensional fused feature is split into 8 groups of 96-dimensional sub-features, and each group generates a bilinear interaction matrix through outer product operation. ,in It is a learnable 96×96 parameter matrix, k=1,...,8;

[0174] Pooling output is compressed using a low-rank approximation: Singular value decomposition (SVD) is used to reduce the dimensionality of the 8 interaction matrices, retaining the first 32 principal components, and finally forming a 256-dimensional enhanced feature vector, reducing computational complexity by 57%.

[0175] Dynamic head weight allocation: based on feature contribution Dynamically adjust the output weights of each head to suppress the influence of noise interference heads;

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

[0177] First layer: 256 to 128 dimensions, using the GeLU activation function, with a dropout rate of 0.3 applied for regularization.

[0178] The second layer: from 128 to 64 dimensions, introduces residual connections and batch normalization (BN) to prevent gradient vanishing.

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

[0180] Loss function design

[0181] Combined weighted mean square error The second derivative constraint is introduced into the icariin term to enhance the fitting accuracy of the characteristic peak region.

[0182] Threshold comparison and quality grading

[0183] Dynamic threshold adjustment mechanism: The basic thresholds are set with reference to the 2025 edition of the Chinese Pharmacopoeia: icariin ≥80μg / mL, microorganisms ≤100CFU / mL, heavy metals ≤0.3ppm, and each batch is dynamically corrected by ±5% based on the traceability data of medicinal materials;

[0184] Level 3 Quality Judgment Rules:

[0185] Superior grade: All three indicators are more than 20% better than the threshold; Qualified grade: All three indicators are within the threshold range; Unqualified grade: Any one indicator exceeds the threshold.

[0186] Real-time feedback control: When a non-conforming product is detected, a freeze command is sent to the host computer via the OPC UA protocol, and the spectral acquisition module is triggered to enter the high-density sampling mode, with the frequency increased to 50Hz;

[0187] Uncertainty quantification: The Monte Carlo Dropout method was used, with Dropout active during prediction. Confidence intervals were calculated by performing 50 forward propagations. When the 95% CI width of the predicted icariin content was >5 μg / mL, offline HPLC re-examination was triggered.

[0188] Drift compensation mechanism: An adaptive model update strategy based on EWMA control chart is established. When the prediction residual MAE > 0.8 for 30 consecutive batches, incremental learning is initiated to update the network weights.

[0189] Thus far, the description of the above embodiments has been provided for illustrative and descriptive purposes. This is not intended to be exhaustive or limiting of the present disclosure. Individual elements or features of particular embodiments are generally not limited to those particular embodiments, but may be interchanged and used in selected embodiments where applicable, even if not specifically shown or described. In many respects, the same elements or features may also be varied. Such variations are not considered a departure from this disclosure, and all such modifications are intended to be included within the scope of this disclosure.

[0190] Example embodiments are provided so that this disclosure will become thorough and will fully convey the scope to those skilled in the art. Numerous details, such as examples of specific parts, apparatus, and methods, are set forth to provide a thorough understanding of embodiments of this disclosure. It will be apparent to those skilled in the art that the specific details are not required, and the example embodiments may be implemented in many different forms, neither of which should be construed as limiting the scope of this disclosure. In some example embodiments, well-known processes, well-known apparatus structures, and well-known techniques are not described in detail.

[0191] Technical terms are used herein for the purpose of describing specific exemplary embodiments only and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a” and “the” as used herein may also refer to the plural forms. The terms “comprising” and “having” are inclusive and therefore specify the presence of the stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or additional having of one or more other features, integrals, steps, operations, elements, components, and / or combinations thereof. Unless expressly indicated in order of execution, the method steps, processes, and operations described herein are not to be construed as necessarily requiring performance in the specific order discussed and shown. It should also be understood that additional or optional steps may be employed.

Claims

1. An online detection method for the quality of An Shen Bu Nao Liquid based on multispectral detection technology, using an online detection device for the quality of An Shen Bu Nao Liquid based on multispectral detection technology; The device includes a host computer, a conveying device, a spectrum acquisition module, a data processing module, and a quality assessment module; The host computer connects to the conveying device, the spectral acquisition module, the data processing module, and the quality assessment module. The conveying device includes a feeding device, a turntable device, and a discharging device. The turntable device is used to transfer the medicine bottles containing the calming and brain-nourishing liquid to different testing stations. The spectral acquisition module includes an ultraviolet-visible spectral module, a near-infrared spectral module, and a fluorescence spectral module. The spectral acquisition module acquires ultraviolet-visible, near-infrared, and fluorescence spectra, and inputs them into the data processing module for spectral 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. Its features The detection method includes the following steps: (a) Real-time acquisition of multispectral data The spectral acquisition module acquires ultraviolet-visible, near-infrared, and fluorescence spectra during the production process of An Shen Bu Nao Ye (a traditional Chinese medicine for calming the mind and nourishing the brain). (b) Dynamic Spectral Preprocessing The data processing module performs baseline drift compensation on the ultraviolet-visible spectral data, eliminates turbidity interference using the adaptive moving average method, performs wavelet denoising and baseline correction on the near-infrared spectral data, and performs dynamic time warping to align the excitation-emission sequence on the fluorescence spectral data and completes intensity normalization. (c) Extraction of key quality indicators Multi-scale residual convolutional networks are used to extract spectral features from ultraviolet-visible spectra, depthwise separable convolution and spectral attention mechanisms are used to extract features from near-infrared spectra, and time-spectral bidirectional LSTM is used to extract features from fluorescence spectral data. (d) Cross-modal dynamic attention fusion The spectral alignment unit is set up to achieve time / frequency domain alignment of different spectra based on the dynamic time warping algorithm; The features of ultraviolet-visible spectroscopy and near-infrared spectroscopy are used to generate a joint characterization through gated attention, which is then spliced ​​with fluorescence features. The final fused feature dimension is 768, and L2 regularization is performed before inputting into the fully connected layer. (e) Multimodal quality fusion decision After the fusion features are processed by multi-head bilinear pooling, they are input into the quality prediction network, which outputs three core quality indicators: icariin content, total microbial count, and heavy metal residue. The prediction results are compared with preset thresholds in real time, and the quality grade of An Shen Bu Nao Liquid is calculated from the three core quality indicators.

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

3. The method according to claim 1, characterized in that: In step (a), the UV-Vis spectral 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 of 900-2500 nm, corresponding wavenumber range It employs an InGaAs array detector with a spectral resolution ≤6nm, a signal-to-noise ratio ≥30000:1, a dynamic adjustment range of integration time 10μs-10s, and a 12-scan averaging mode to improve the signal-to-noise ratio; Fluorescence spectral parameters: excitation wavelength range 250-550nm, emission wavelength range 280-700nm, scanning in excitation-emission matrix mode, excitation wavelength switching step size 10nm, emission spectrum acquisition at 2nm interval, response time <5ns, Rayleigh scattering suppression ratio >60dB, single full spectrum scan time ≤15 seconds.

4. The method according to claim 3, characterized in that: In step (b), UV-Vis spectral baseline drift compensation and turbidity interference elimination Baseline correction was performed using a sliding window adaptive moving average method: the dynamic window length was set to 30-50 spectral data points, and the window width was dynamically adjusted by calculating the local root mean square error of the spectral data within the window. When the root mean square error was >0.05AU, the window was shrunk to 20 points, and when the root mean square error was <0.01AU, the window was expanded to 60 points. Turbidity interference elimination employs a dual-weighting factor correction strategy: based on the absorbance change rate at characteristic wavelengths, the turbidity compensation coefficient is calculated in real time and convolved with the moving average baseline of adjacent bands; after baseline drift compensation, Savitzky-Golay smoothing is performed to eliminate high-frequency noise interference. Near-infrared spectral wavelet denoising and baseline correction Wavelet decomposition uses Symlets8 wavelet basis functions for 5-level decomposition, and high-frequency coefficients adopt an improved SURE threshold rule; baseline correction adopts piecewise multivariate scattering correction: the spectrum is divided into three bands, the light scattering path length correction factor of each band is calculated, and non-uniform scattering interference is eliminated by orthogonal projection. The reconstructed spectrum is processed using the first derivative to enhance the resolution of spectral features. Dynamic time warping and intensity normalization of fluorescence spectra, and excitation-emission timing alignment are performed using a dynamic time warping algorithm; After time alignment, cubic spline interpolation compensation is performed to ensure the temporal resolution error of the excitation-emission matrix. Intensity normalization adopts a combination of max-min normalization and PARAFAC decomposition to retain the intensity of characteristic fluorescent components.

5. The method according to claim 1, characterized in that: In step (c), Feature extraction using multi-scale residual convolutional networks: A multi-scale dilated residual block (ACRB) is employed, comprising three parallel dilated convolutional layers with dilation rates r=1 / 3 / 5, each extracting local spectral features under different receptive fields. The output of each ACRB is added to the input via a skip connection to alleviate the gradient vanishing problem. A global residual connection is introduced in the fourth layer of the network, adding the original input spectrum to the deep features element-wise, preserving low-frequency information while enhancing the discriminative power of high-frequency features. The fused features are then compressed using 3×1 max pooling to reduce noise interference. The convolutional kernel weights are dynamically adjusted based on the spectral signal-to-noise ratio (SNR): when SNR < 45dB, small-scale convolution (r=1) is activated as the main branch; when SNR ≥ 45dB, large-scale convolution (r=5) is switched to enhance contextual association. Near-infrared spectral depth-separable convolution and spectral attention mechanism: The depthwise separable convolutional architecture employs a dual-branch structure: Depthwise convolution branch: Use 3×3 depthwise convolution to extract spatial features. Each channel is computed independently, reducing the number of parameters to 1 / 8 of the standard convolution. Pointwise convolution branch: 1×1 convolution performs inter-channel information exchange, generating a 128-dimensional feature map. The two branch outputs are spliced ​​and merged through channels to preserve details and improve computational efficiency; Spectral attention mechanism: Channel attention: Channel weights are obtained through global average pooling, and attention coefficients of 0-1 are generated using the Sigmoid function to enhance effective bands; Spatial attention: Asymmetric convolution is introduced to capture lateral spectral fluctuations. Spatial weights are assigned through Softmax, and finally, the attention weights are multiplied with the convolutional features to achieve adaptive feature enhancement. Fluorescence spectroscopy time-spectral bidirectional LSTM modeling Bidirectional LSTM structure: Two LSTM layers are configured to process the timing data in the forward and reverse directions, respectively. Time-series LSTM: Input is the excitation wavelength switching sequence, time step... The hidden layer has a dimension of 64, capturing the excitation-emission delay dynamics; Spectral Dimension LSTM: Processes spectral intensity sequences along the emission wavelength axis, with a hidden layer dimension of 32, to extract local peak and valley features; In the optimization of the gating mechanism, the forget gate adopts a dynamic decay factor; Multi-scale feature stitching: The bidirectional LSTM output is stitched together with the original fluorescence matrix in three dimensions, and the time sequence × wavelength × intensity is compressed to a 256-dimensional fusion feature through 1×1×1 convolution, preserving the spatiotemporal correlation.

6. The method according to claim 1, characterized in that: In step (d), the multispectral time-frequency domain alignment module achieves time alignment between the ultraviolet-visible spectrum and the near-infrared spectrum based on the dynamic time warping algorithm: An improved windowing strategy is used when constructing the cumulative distance matrix, setting the maximum path offset to 15% of the time series length to avoid excessive stretching that could lead to feature distortion. The distance metric function is defined as follows: ,in It represents the first derivative characteristic, enhancing the matching accuracy of spectral variation trends; The optimal alignment path is generated by backtracking through the reverse path, and cubic spline interpolation is used to compensate for spectral data of non-integer multiple sampling points, with the temporal alignment error controlled within ±0.3s; Gated attention joint representation generation Ultraviolet-visible spectral characteristics Near-infrared spectral characteristics Interacting via dual-channel gated attention units: Query and key generation: The Q matrix is ​​generated by 1×5 convolution. The K matrix is ​​generated by depthwise separable convolution, with dimensions of 256×64. Gating weight calculation: A modified Sigmoid gating function is used. ,in For a trainable parameter matrix, Indicates channel splicing operation Joint representation output: via attention score matrix Weighted fusion, and element-wise multiplication with the gate weights, the formula is as follows: , where V is 1×3 convolution mapping; Multimodal feature concatenation and regularization Fluorescence characteristics With joint characterization Cross-modal splicing: Along the feature dimension and The vectors are spliced ​​together to form a 768-dimensional fusion feature vector, and dynamic dimension scaling technology is used to eliminate the difference in dimensions. Before splicing Perform timing-spectral normalization: Z-score normalization is performed along the excitation wavelength axis, and maximum-min normalization is performed along the emission wavelength axis; The regularization coefficient is dynamically adjusted based on feature importance: when the feature variance > 0.15, λ is increased to 0.005 to suppress overfitting; Cross-modal feature enhancement mechanism Dynamic weight recalibration: based on feature contribution Reassign modal weights, where It is a learnable 768×3 matrix; Adversarial training compensation: Introducing a gradient inversion layer (GRL) and using domain adversarial loss. To enhance cross-device generalization capabilities, the discriminator D consists of a 3-layer MLP.

7. The method according to claim 1, characterized in that: In step (e), Multi-head bilinear pooling feature interaction module Cross-modal feature interaction is achieved using 8-head bilinear pooling: the 768-dimensional fused feature is split into 8 groups of 96-dimensional sub-features, and each group generates a bilinear interaction matrix through outer product operation. ,in It is a learnable 96×96 parameter matrix, k=1,...,8; The pooling output is compressed by a low-rank approximation: the dimensionality of the 8 sets of interaction matrices is reduced by using singular value decomposition (SVD) to retain the first 32 principal components, and finally a 256-dimensional enhanced feature vector is formed, which reduces the computational complexity by 57%. Dynamic head weight allocation: based on feature contribution Dynamically adjust the output weights of each head to suppress the influence of noise interference heads; The quality prediction network architecture adopts a three-level fully connected network design: First layer: 256 to 128 dimensions, using the GeLU activation function, with a dropout rate of 0.3 applied for regularization. The second layer: from 128 to 64 dimensions, introduces residual connections and batch normalization to prevent gradient vanishing. Output layer: 64→3-dimensional, corresponding to three indicators: icariin, total microbial count, and heavy metal residue, using linear activation; Loss function design Combined weighted mean square error The second derivative constraint is introduced into the icariin term to enhance the fitting accuracy of the characteristic peak region. Threshold comparison and quality grading Dynamic threshold adjustment mechanism: The basic thresholds are set with reference to the 2025 edition of the Chinese Pharmacopoeia, iridoid ≥80μg / mL, microorganisms ≤100CFU / mL, heavy metals ≤0.3ppm, and each batch is dynamically corrected by ±5% based on the traceability data of medicinal materials; Three-level quality judgment rules: Superior grade: all three indicators are more than 20% better than the threshold; Qualified grade: all three indicators are within the threshold range; Unqualified grade: any one indicator exceeds the threshold. Real-time feedback control: When a non-conforming product is detected, a freeze command is sent to the host computer via the OPC UA protocol, and the spectral acquisition module is triggered to enter the high-density sampling mode, with the frequency increased to 50Hz; Uncertainty quantification: The Monte Carlo Dropout method was used, with Dropout active during prediction. Confidence intervals were calculated by performing 50 forward propagations. When the 95% CI width of the predicted icariin content was >5 μg / mL, offline HPLC re-examination was triggered. Drift compensation mechanism: An adaptive model update strategy based on EWMA control chart is established. When the prediction residual MAE > 0.8 for 30 consecutive batches, incremental learning is initiated to update the network weights.

Citation Information

Patent Citations

  • Chinese patent medicine oral liquid quality detection device

    CN118464830A

Cited By

  • A crude oil moisture content near-infrared spectrum detection device

    CN122409572A