A quality control method for traditional Chinese medicine capsules
By using micro-area scanning and differential calculation with a near-infrared spectral probe, the background signal of the capsule shell is filtered out while the scattering signal of the contents particles is retained. Combined with the cosine value of the spectral angle and the transmission flux attenuation characteristics, the quality control problem caused by the change of the physical properties of the capsule shell on the production line of traditional Chinese medicine capsules is solved, and efficient and real-time chemical component detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHAANXI JIANMIN PHARM CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-04-24
AI Technical Summary
In the production of traditional Chinese medicine capsules, changes in the physical properties of the capsule shell lead to non-constant linear bias in the modulation of the optical signal, making it difficult to achieve precise quality control on high-speed production lines. In particular, when there are batch changes in the shell, fluctuations in moisture content, or microscopic defects on the surface, the robustness of model predictions decreases.
Micro-area scanning is performed using a near-infrared spectral probe. Differential operations are used to filter out the background signal of the capsule shell while retaining the scattering signal of the contents particles. The signal is decoupled by combining the cosine value of the spectral angle and the transmission flux attenuation characteristics. Fluctuation fingerprint features are constructed and compared with qualified benchmarks to eliminate physical interference and achieve real-time detection of chemical composition heterogeneity.
Under complex industrial conditions, it enables efficient and real-time detection of the chemical components in the contents of traditional Chinese medicine capsules, reduces the data processing computing power requirements, and improves the anti-interference capability of the detection system and the real-time responsiveness of the production line.
Smart Images

Figure CN121563329B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a quality control method for traditional Chinese medicine capsules, belonging to the field of spectroscopic detection technology. Background Technology
[0002] In the current Chinese medicine preparation production system, non-destructive full inspection of capsule contents using near-infrared spectroscopy is a key step in ensuring drug quality consistency. Existing technologies are usually based on the linear superposition assumption of Lambert-Beer's law, treating the spectral signal collected by the detector as a simple mathematical summation of the absorption spectrum of the contents and the background absorption spectrum of the capsule shell. A standard empty shell spectral correction model is established or a multivariate scattering correction chemometric algorithm is applied to mathematically subtract background interference from the mixed signal to extract drug characteristics. Under high-speed continuous industrial production conditions, the spectral subtraction technology approach faces constraints due to the physical properties of the material. As a polymer film material, the capsule shell is not an ideal optical homogeneous body. The uneven distribution of micro-thickness, random changes in surface curvature, and light scattering effect at the shell-powder contact interface lead to a non-constant linear bias in the modulation of the light signal by the shell, exhibiting complex nonlinear fluctuation characteristics. The physical uncertainty makes it difficult for the preset static background model to accurately match the dynamic changes in the actual production conditions, requiring frequent shutdowns for calibration or the introduction of highly complex compensation algorithms to maintain detection accuracy.
[0003] Relying on conventional mathematical modeling strategies cannot fundamentally eliminate interference from the physical morphology and structure of the capsule shell. For example, Chinese invention patent CN105963382A discloses a method for online detection of jujube seed sedative capsules and their effective components using near-infrared spectroscopy. Although it constructs a quantitative correction model for the drug solution and filling process using partial least squares (PLS) to achieve component monitoring at specific process points, the core logic is still based on the ideal assumption of statistical stability of the background signal. When faced with batch changes of capsule shells, fluctuations in water content, or dynamic physical changes of surface micro-defects on high-speed production lines, the overall regression model trained based on static sample sets lacks the ability to analyze local micro-physical heterogeneity. It cannot distinguish in real time whether the light intensity attenuation is due to the actual change in drug concentration or random disturbances in the physical state of the shell, resulting in a decrease in the robustness of the model prediction under complex working conditions.
[0004] Therefore, how to overcome the limitations of traditional spectral subtraction models and achieve real-time physical-level decoupling of capsule shell interference signals by utilizing the differences in physical properties of the microscopic spatial structure of matter without relying on static reference benchmarks and high-computational-power models has become the technical problem to be solved by this invention. Summary of the Invention
[0005] To address the problems mentioned in the background art, the technical solution of the present invention is as follows: A quality control method for traditional Chinese medicine capsules, comprising the following steps:
[0006] Step S1: During the axial transport of the capsule, a near-infrared spectral probe with an effective detection spot diameter less than one-tenth of the capsule's axial length is used to perform continuous micro-area scanning of the transmitted light intensity distribution of a single capsule, obtaining data containing... A spatial spectral response sequence of spatially sampled points discretely distributed along the capsule axis;
[0007] Step S2: Perform adjacent micro-region difference operation on the spatial spectral response sequence to generate a difference spectral sequence. The difference operation is based on the continuous homogeneous film-forming structure of the capsule shell at the micro-scale and the discrete stacking structure of the contents of the Chinese medicine powder at the micro-scale. The background signal of the capsule shell, which changes continuously and gently with spatial position, is converted into a DC component that approaches zero and is filtered out. At the same time, the scattering signal of the contents particles, which changes randomly with spatial position at a high frequency, is retained and amplified. Thus, background decoupling is achieved without establishing a standard reference model for the capsule shell.
[0008] Step S3: Calculate the statistical dispersion index of the differential spectral sequence within the preset characteristic bands, and construct a fluctuation fingerprint feature that characterizes the uniformity of the chemical properties of the contents particles in the spatial distribution. The statistical dispersion index is the variance or standard deviation of the absorbance value at each wavelength point in the differential spectral sequence.
[0009] Step S4: Compare the fluctuation fingerprint feature with the preset acceptable range, and when the fluctuation fingerprint feature exceeds the acceptable range, generate a control command indicating abnormal quality of the capsule contents.
[0010] Preferably, before calculating the statistical dispersion index in step S3, the method further includes performing physical defect artifact removal processing based on the directionality of spectral vectors on the differential spectral sequence. This processing specifically includes: extracting the differential spectral vector corresponding to each differential sampling point in the differential spectral sequence; calculating the spectral angle cosine value between the differential spectral vector and the pre-constructed standard drug particle characteristic spectral vector; using the spectral angle cosine value as a weighting coefficient to screen the differential spectral sequence and remove differential spectral vectors with spectral angle cosine values lower than a preset correlation threshold; and screening to identify and remove non-chemically specific full-band light intensity jump signals caused by physical scratches or bubbles on the capsule shell surface, retaining only effective fluctuation signals with drug chemical absorption fingerprint characteristics to participate in the calculation of the statistical dispersion index.
[0011] Preferably, before calculating the statistical dispersion index in step S3, the differential spectral sequence is further subjected to optical path adaptive compensation processing based on the transmission flux attenuation characteristics. This processing specifically includes: calculating the average light intensity value of all sampling points in the spatial spectral response sequence, using the average light intensity value to characterize the overall optical density of the material accumulation inside the capsule to be tested; and determining the dynamic gain compensation coefficient corresponding to the average light intensity value based on the pre-calibrated nonlinear response relationship between light intensity and signal fluctuation amplitude. ; Utilizing dynamic gain compensation coefficient The amplitudes of the differential spectral sequence are normalized and corrected according to the following relationship: ,in, The corrected differential spectral amplitude, The original differential spectral amplitude, This is the average light intensity value. The preset standard reference light intensity value, An empirical attenuation index characterizing the scattering properties of materials; a correction used to eliminate the nonlinear attenuation effect of optical path changes caused by variations in the compactness of the material inside the capsule on the amplitude of the fluctuating fingerprint feature.
[0012] Preferably, in step S1, the effective detection spot diameter of the near-infrared spectral probe is limited to 0.2 mm to 0.5 mm, and the number of spatial sampling points... The number of sampling points is set to 20 to 50, and the center-to-center distance between adjacent spatial sampling points is equal to the effective detection spot diameter, to ensure that the differential operation can cover the entire length of the capsule and resolve the spatial distribution characteristics of micron-sized particle aggregates.
[0013] Preferably, the preset characteristic band is a wavelength range pre-selected based on the near-infrared characteristic absorption peaks of the effective chemical components in the contents of traditional Chinese medicine; the differential spectral sequence generated in step S2 only contains spectral data within the preset characteristic band, so as to reduce the data processing dimension and enhance the detection sensitivity to the uneven distribution of specific chemical components.
[0014] Preferably, the characteristic spectral vector of the standard drug particle is a unit vector obtained by collecting the diffuse reflectance spectrum of a pure Chinese herbal medicine powder sample and processing it with the first derivative; the calculation of the cosine value of the spectral angle is based on the cosine value of the angle between two vectors in the multidimensional spectral space, which is used to characterize the consistency of the chemical properties between the material composition represented by the differential spectral vector and the standard drug particle.
[0015] Preferably, the continuous micro-area scanning in step S1 is performed while the capsule is moving at a constant speed, and the trigger frequency of spectral acquisition is kept synchronized with the speed of the capsule to ensure that each spatial sampling point in the spatial spectral response sequence corresponds to a fixed physical position on the capsule, thereby eliminating spatial frequency distortion caused by transmission speed jitter.
[0016] Preferably, the fluctuation fingerprint feature is a multidimensional feature vector composed of the variance values of the differential spectral sequence at multiple discrete feature wavelength points; the comparison in step S4 is to calculate the Mahalanobis distance or Euclidean distance between the multidimensional feature vector and the center of the standard qualified product feature vector set.
[0017] Preferably, in step S2, before performing the difference operation, the spatial spectral response sequence is first subjected to Savitzky-Golay smoothing to suppress the interference of detector electronic noise on the high-frequency differential signal; the window width of the smoothing process is smaller than the number of spatial sampling points. One-fifth of the content particles are used to avoid smoothing out the high-frequency spatial distribution characteristics of the particles.
[0018] Preferred empirical decay index The value ranges from 0.5 to 2.0, and its specific value is determined by fitting the transmission light intensity attenuation curve of standard samples with different filling density gradients in the characteristic band; the dynamic gain compensation coefficient increases monotonically with the decrease of the average light intensity value to compensate for the nonlinear compression of the effective signal amplitude under high-density filling state.
[0019] Compared with the prior art, the beneficial effects of the present invention are:
[0020] 1. In the quality control of traditional Chinese medicine capsules, the physical property differences between the low-frequency spatial characteristics of the microscopic continuous homogeneous film of the capsule shell and the discrete high-frequency spatial characteristics of the Chinese medicine powder particles are utilized. A spatial frequency domain characteristic signal separation mechanism is constructed by continuous scanning of micro-spots and adjacent differential operations. The differential operation is used to suppress the spatial continuous signal, filter out the background interference of the capsule shell at the signal acquisition source, and retain the enhanced chemical fingerprint fluctuations caused by the uneven accumulation of powder particles. The detection does not require the establishment of a standard spectral model of the capsule shell, and eliminates the reference error caused by the drift of physical properties such as batch, thickness or water content of the shell. This enables direct measurement of the heterogeneity of chemical components in the contents of traditional Chinese medicine capsules.
[0021] 2. By introducing differential spectral vector spectral similarity verification, a secondary identification barrier for high-frequency signal source attributes is established. Utilizing the lack of wavelength selectivity in optical scattering caused by physical defects on the capsule shell surface and the specific fingerprint-like spectral differences in the chemical absorption of drug particles, non-specific light intensity jumps caused by physical scratches or bubbles are identified and eliminated. Under harsh industrial transmission conditions, the system distinguishes between physical appearance interference and internal chemical quality fluctuations, ensuring that only particle signals with specific chemical attributes participate in quality evaluation, thereby improving the online detection system's anti-interference capability in complex physical environments.
[0022] 3. A dynamic gain compensation mechanism based on the attenuation characteristics of transmitted light flux is established to overcome the optical path change and signal amplitude nonlinear distortion caused by random fluctuations in material filling compactness. The average light intensity information in the scanning sequence is reused to characterize the internal optical density of the capsule. The detection threshold is corrected in real time by normalizing based on the response relationship between light intensity and signal fluctuation amplitude. This enables the detection system to adapt to fluctuations in production process parameters, ensuring that the system's evaluation standard for the chemical homogeneity of the contents is consistent under different filling densities, and avoiding quality misjudgments caused by differences in physical state. Complex background subtraction and signal decoupling are transformed into microscale spatial difference operations, reducing the data processing computing power requirements and time delay. The simplified signal processing path avoids the computational load caused by high-dimensional matrix operations in traditional chemometrics methods. Millisecond-level high-throughput real-time online detection is achieved on low-cost embedded hardware, meeting the requirements of full inspection speed and real-time system responsiveness in modern Chinese medicine preparation production lines. Attached Figure Description
[0023] Figure 1 This is a flowchart of the quality control method for spatial differential scanning of the present invention;
[0024] Figure 2 This is a schematic diagram illustrating the decoupling of the spatial spectral response sequence and the differential signal in this invention.
[0025] Figure 3 This is a diagram illustrating the system architecture of the precision quality control technology for traditional Chinese medicine capsules according to the present invention. Detailed Implementation
[0026] The following embodiments are intended to further illustrate the present invention, but not to limit it. The present invention provides a quality control method for traditional Chinese medicine capsules. A micro-spot probe is used to continuously scan the capsule to obtain a spatial spectral response sequence. Adjacent micro-region differential operations are performed on this sequence. Through differential operations, the low-frequency background signal of the capsule shell is filtered out, while the high-frequency, randomly fluctuating scattering signal of the contents particles is retained. A statistical dispersion index is calculated based on the differential spectral sequence to construct a fluctuation fingerprint feature, which is then compared with a qualified benchmark range to determine the quality of the capsule contents. During the axial movement of the capsule, a near-infrared spectral probe is used to continuously scan the transmitted light intensity distribution of a single capsule in micro-regions. The effective detection spot diameter of the near-infrared spectral probe is less than one-tenth of the axial length of the capsule, preferably 0.2 mm to 0.5 mm. The trigger frequency of spectral acquisition is synchronized with the speed of the capsule's movement to obtain the content of the capsule. The spatial spectral response sequence of spatially sampled points discretely distributed along the capsule axis, wherein... The number of sampling points is set to 20 to 50, with the center-to-center distance between adjacent spatial sampling points equal to the effective detection spot diameter, to cover the entire length of the capsule and analyze the spatial distribution characteristics of micron-sized particle aggregates. Adjacent micro-region difference operations are performed on the spatial spectral response sequence to generate a difference spectral sequence, which is denoted as... , of which The spectral vector of each spatial sampling point is For the second to the third in the sequence For each sampling point, calculate the spectral difference vector between it and the previous adjacent sampling point. This differential operation utilizes the gradual variation characteristics of the continuous homogeneous film structure of the capsule shell at the microscopic spatial scale to convert the shell background signal into a near-zero DC component and filter it out. Simultaneously, it retains the scattering signal of the contents particles, which exhibits high-frequency random jumps with spatial location. Before performing the differential operation, the spatial spectral response sequence is preferably smoothed using Savitzky-Golay, with the smoothing window width smaller than the number of spatial sampling points. One-fifth.
[0027] Before calculating the statistical dispersion index, a physical defect artifact removal process based on the spectral vector directionality is performed on the differential spectral sequence to extract the differential spectral vector corresponding to each differential sampling point in the differential spectral sequence. And calculate the vector and compare it with the pre-constructed standard drug particle characteristic spectral vector. The spectral angle cosine value between To collect the diffuse reflectance spectrum of pure Chinese herbal medicine powder samples and obtain unit vectors after first-order derivative processing, differential spectral vectors with spectral angle cosine values lower than a preset correlation threshold are identified as physical defect artifacts and discarded. Only fluctuation signals with drug chemical absorption fingerprint characteristics are retained. The correlation threshold is preferably set to 0.8. Optical path adaptive compensation processing based on transmission flux attenuation characteristics is performed on the differential spectral sequence, and the average light intensity value of all sampling points in the spatial spectral response sequence is calculated. This is used to characterize the overall optical density of the material buildup inside the capsule under test. Based on the pre-calibrated nonlinear response relationship between light intensity and signal fluctuation amplitude, it determines the... Corresponding dynamic gain compensation coefficient ,use The amplitude of the differential spectral sequence is normalized and corrected using the following formula: ,in, The corrected differential spectral amplitude, The original differential spectral amplitude, The preset standard reference light intensity value, An empirical attenuation index, used to characterize the scattering properties of materials, is used, ranging from 0.5 to 2.0. This correction eliminates the nonlinear attenuation effect of optical path changes caused by variations in the compactness of the material filling inside the capsule on the amplitude of the fluctuation fingerprint feature. The statistical dispersion index of the differential spectral sequence within a preset characteristic band is calculated to construct the fluctuation fingerprint feature. The preset characteristic band is pre-selected based on the near-infrared characteristic absorption peaks of the effective chemical components in the Chinese medicine contents. The statistical dispersion index is the variance or standard deviation of the absorbance values at each wavelength point in the differential spectral sequence. The fluctuation fingerprint feature is compared with a preset acceptable benchmark range, and the Mahalanobis distance or Euclidean distance between the two is calculated. When the distance exceeds the acceptable benchmark range, a control command indicating abnormal quality of the capsule contents is generated.
[0028] Example 1: In large-scale traditional Chinese medicine (TCM) preparation production lines, the filling state of TCM capsules and the physical condition of the capsule surface exhibit highly complex random fluctuations. In this scenario, due to instantaneous pressure fluctuations in the upstream filling process, the compactness of the powder inside the capsule frequently switches between a low-density loose state and a high-density compacted state, resulting in severe oscillations in transmitted light flux, reaching up to 50%. Simultaneously, due to mechanical friction of the capsule shell on the high-speed transport track, some shell surfaces develop micron-sized scratches and microcracks. This dual superposition of internal optical path nonlinear drift and external physical scattering artifacts causes traditional detection systems based on fixed thresholds or single absorbance models to experience a sharp increase in misjudgment rate when facing such complex conditions. They cannot accurately distinguish between powder loss and optical path attenuation, nor can they differentiate between fluctuations in effective ingredients and interference from shell scratches. Faced with the above conditions, the quality control method provided by this invention is triggered and executed. The system utilizes a micro-spot probe with an effective detection spot diameter less than one-tenth of the capsule's axial length to perform continuous micro-area scanning on single capsules being transported at high speed. During this process, the micro-spot probe collects data at a frequency synchronized with the capsule's movement speed. The system then performs adjacent micro-region difference operations on the spatial spectral response sequence. This step serves as the first physical filter, utilizing the low-frequency spatial characteristics of the homogeneous and continuous film formation of the capsule shell to convert the shell background signal, which changes gradually with spatial position, into a DC component and filter it out. At the same time, it retains and amplifies the high-frequency scattering signal caused by the discrete accumulation of drug powder particles.
[0029] In addition, to address high-frequency artifacts caused by scratches on the shell surface, the system initiates a verification mechanism based on spectral vector directionality. For each retained differential spectral vector, the system calculates its correlation with the characteristic spectral vector of standard drug particles. When a micro-spot scans across a physical scratch on the shell surface, although a strong light intensity jump occurs, this jump lacks the chemical absorption fingerprint specific to the drug, and the spectral angle cosine value is below a preset correlation threshold, such as 0.8. Based on this, the system identifies the signal as a physical artifact and removes it from the valid fluctuation sequence, thus pinpointing the true chemical fluctuation originating from the internal drug particles. Simultaneously, to address the optical path drift caused by changes in drug powder compactness, the system performs adaptive compensation based on transmission flux attenuation characteristics in parallel. The system utilizes the average light intensity value from the original sequence... The system senses changes in optical density inside the capsule in real time and dynamically generates gain compensation coefficients based on a pre-calibrated nonlinear response relationship. When high-density compaction leads to a decrease in light flux, this coefficient automatically increases to normalize and correct the amplitude of the compressed fluctuations. Ultimately, through the above-mentioned multi-signal decoupling and correction, the system successfully eliminates the interference of shell scratches and calibrates the influence of density fluctuations. It accurately calculates the statistical dispersion index reflecting the chemical homogeneity of the contents and compares it with the qualified benchmark range. This drives the rejection mechanism to remove capsules that are truly underfilled or have foreign matter mixed in from the production line. This process is completed in milliseconds, ensuring that the quality of each capsule can be determined based on its internal chemical properties rather than its external physical appearance, even at high-speed production.
[0030] Example 2: This example constructs a test environment containing real physical disturbances and process deviations to quantitatively verify the effectiveness and stability of the technical solution of the present invention in solving the problems of background nonlinear drift and physical artifact interference in the online detection of traditional Chinese medicine capsules. The test platform is built on the transmission track simulating a real industrial production line and is equipped with core hardware components including an adjustable speed conveyor belt, linearly arranged tungsten halogen micro lamps, and a high-speed linear array InGaAs detector. This platform can not only simulate the high-speed transmission state of capsules, but also actively inject micron-level displacement deviations caused by mechanical vibration and random light intensity disturbances caused by light source flicker by introducing a controllable vibration source and an illumination fluctuation device, thereby reproducing the complex and variable actual working conditions. The data used in the experiment are all from the real-time acquisition of the physical platform in the above environment. The spectral response range of the InGaAs detector covers 900nm to 1700nm, and the sampling frequency is set to 2000Hz to ensure high-frequency scanning capability of the microscopic area of the capsule.
[0031] The core of this experimental design lies in the scientific calibration and performance verification of key parameters, namely the differential step size and the correlation threshold. Setting the differential step size involves a technical trade-off between background filtering efficiency and effective signal retention: too small a step size may lead to the false deletion of effective particle signals as low-frequency background, while too large a step size cannot effectively track and eliminate rapidly changing background drift. Therefore, the experiment follows the decision logic of signal frequency response matching. By analyzing the power spectral density of the capsule shell background signal, it was determined that its main energy is concentrated in the low-frequency band, while the drug powder particle signal exhibits high-frequency broadband characteristics. Based on this, the experiment sets the differential step size to a sampling point interval of one to maximize the suppression ratio of low-frequency background while retaining high-frequency details. The correlation threshold is designed to balance the artifact rejection rate and the false positive rate of qualified products: too high a threshold may lead to the misjudgment of some weak but real drug fluctuations as artifacts, while too low a threshold cannot effectively intercept interference caused by physical scratches. The experiment constructs a mixed sample set containing known scratch-defective empty shells and standard filled capsules, plots the receiver operating characteristic (ROC) curve, and selects 0.8, corresponding to the maximum Youden index, as the optimal correlation threshold.
[0032] The experiment was divided into three stages: benchmark establishment, interference injection, and scheme verification. Under ideal conditions without interference, spectral data of standard qualified capsules were collected as a benchmark. A vibration source and a light fluctuation device were activated, and micron-level scratches were artificially created on some capsule shell surfaces to construct a dirty data environment containing noise and artifacts. Finally, the collected data was processed using the method of this invention. During the processing, the system performed adjacent micro-region differential operations on the original spectral sequence. The observed data showed that in the unprocessed original spectrum, the background absorption of the capsule shell accounted for more than 80% of the signal amplitude and exhibited low-frequency drift with the shell thickness. After the differential operation, this low-frequency background component was suppressed to a level close to zero, and the high-frequency scattering signal of the previously submerged powder particles became prominent, improving the signal-to-noise ratio by about 15 dB. Subsequently, the system performed artifact removal based on the spectral vector directionality on the differential signal. Table 1 shows the changes in key intermediate data in this step.
[0033] Table 1: Example of key data in the artifact removal process
[0034]
[0035] As shown in Table 1, although shell scratches and bubble defects also exhibit high-frequency jumps in the spatial frequency domain, and their original differential signal amplitudes are even higher than those of normal drug powder signals, their spectral characteristics mismatch with the drug standard fingerprint results in spectral angle cosine values far below the set threshold of 0.8. Based on this, the method of this invention accurately identifies and zeros these high-amplitude artifact signals, eliminating their interference with subsequent quality judgment. In contrast, the normal drug powder signal is completely preserved due to its highly consistent spectral directionality. This process vividly demonstrates how this solution utilizes orthogonal information in the spectral dimension to achieve accurate separation of heterogeneous signals with the same frequency that are indistinguishable in the spatial dimension; for further... To verify the effectiveness of the optical path adaptive compensation mechanism, a filling density gradient control system was introduced in the experiment. Three groups of capsule samples were constructed with the same amount of internal powder filling, but the density was adjusted to three levels: loose, standard, and compact. Without compensation, as the filling density increased, the transmitted light intensity decreased, resulting in a non-linear decreasing trend in the extracted fluctuation variance index. The variance value of the compact group was even lower than 50% of that of the loose group, which could easily lead to misjudgment of insufficient filling. However, after applying the optical path compensation algorithm of this invention, the variance index dynamically corrected by the average light intensity value restored a high degree of consistency among the three groups of samples, and the relative deviation was reduced to within 5%.
[0036] Example 3: This example combines Figures 1 to 3 A description of a quality control method for traditional Chinese medicine capsules, such as... Figure 1 As shown, the quality control method is initiated when the capsule is in motion along the axial direction. It uses continuous scanning of micro-spots to obtain a spatial spectral response sequence, performs adjacent micro-region difference operation on the sequence to filter out the shell background and retain the particle scattering signal, and then sequentially performs physical defect artifact removal processing based on the cosine value of the spectral angle, and optical path adaptive compensation processing to eliminate the nonlinear effect of filling compactness. On this basis, a fluctuation fingerprint feature is constructed and a statistical dispersion index is calculated. Finally, the index is compared with the qualified benchmark. If the index is within the range, the quality is judged to be qualified. If it exceeds the range, a control command is generated to remove abnormal capsules.
[0037] like Figure 2 As shown, this quality control method is initiated during the axial transport of the capsule. It utilizes continuous scanning of micro-spots to acquire a spatial spectral response sequence, performs adjacent micro-region difference operations on this sequence to filter out the shell background and retain particle scattering signals. Subsequently, it sequentially performs physical defect artifact removal processing based on spectral angle cosine values, and optical path adaptive compensation processing to eliminate the nonlinear effects of filling compactness. Based on this, a fluctuation fingerprint feature is constructed and a statistical dispersion index is calculated. Finally, this index is compared with a pass / fail benchmark. If the index is within the range, the quality is deemed acceptable; if it exceeds the range, a control command is generated to remove the abnormal capsule. Figure 3As shown, the technical system for quality control of traditional Chinese medicine capsules includes five core branches: the signal acquisition and scanning branch uses a micro-spot probe with a spot diameter less than L / 10 to perform continuous micro-area scanning and maintain synchronous locking of the trigger frequency; the signal decoupling operation branch uses Savitzky-Golay smoothing and differential operation between adjacent micro-areas to filter out the background DC of the shell; the elimination branch uses spectral vector directionality and spectral angle cosine value verification to eliminate physical scratches or bubble interference; the optical path adaptive compensation branch performs amplitude normalization correction based on the transmission flux attenuation characteristics and dynamic gain compensation coefficient K; and the judgment and feature construction branch is responsible for calculating statistical dispersion indexes to construct fluctuation fingerprint features and complete the comparison with qualified benchmarks.
[0038] Example 4: This example provides a transparent explanation of the key parameter settings and function construction mechanism in the optical path adaptive compensation process, and completes the adaptive logic under specific process boundary conditions. In the aforementioned specific implementation, optical path compensation is described as a normalization correction of the differential spectral amplitude based on the transmission flux attenuation characteristics, and its core relies on the empirical attenuation index. The values of and average light intensity With dynamic gain compensation coefficient The response relationship between them is discussed. However, in practical engineering applications, the filling state of capsule contents is not ideally homogeneous, and batch-to-batch fluctuations in the particle size distribution, moisture content, and other physicochemical properties of the powder particles can lead to complex nonlinear changes in the light scattering path in the medium. This procedure establishes a standard reference sample set containing different filling density gradients. Empty capsules and traditional Chinese medicine powder from the same batch are selected, and a set of reference samples covering at least five gradient levels from underfilled (density of 80% of the standard value) to overfilled (density of 120% of the standard value) is prepared by controlling the pressure parameters of the filling equipment. Using the spectral detection system of this invention, the spatial spectral response sequences of each gradient sample are collected in an ideal environment without physical defect interference, and the corresponding average light intensity value is calculated. The variance of the differential spectral amplitude before and after compensation Since all samples have the same chemical composition, theoretically, the true variance reflecting their chemical properties should be constant. Therefore, any observed variance... Follow The changes can all be attributed to nonlinear modulation caused by changes in optical path length. Based on the collected data, a light intensity-variance response curve is constructed, using the average light intensity value... The x-axis represents the uncompensated variance. Plotting the data on the ordinate and observing the data shows that as the fill density increases... Decrease It exhibits a monotonically decreasing trend, and the attenuation rate accelerates in low light intensity regions. To quantify this pattern and determine the optimal attenuation index... The least squares method was used to fit the data, and the objective function of the fitting was set to make the variance of each gradient sample after compensation equal to the variance of the gradient sample. Minimize the dispersion between them, i.e., find Values that make all samples By approaching the same constant through this iterative optimization process, a uniquely determined optimal decay index can be calculated for specific pharmaceutical powder material characteristics. For example, for a certain fine-particle-size traditional Chinese medicine powder, the optimal [powder] obtained through standardization The value could be 1.2.
[0039] In determining After the calibration method for the value, an adaptive update mechanism is further introduced to address the drift of material properties during the production process. In actual production, if the moisture content or particle size of the powder changes, the original attenuation characteristics may become ineffective. Therefore, the system incorporates online monitoring and dynamic fine-tuning logic. The system statistically analyzes the average light intensity distribution and variance distribution of capsules judged as qualified products in the current production batch in real time. If it detects that the average light intensity of qualified products shifts across 1000 capsules within a certain period, and this shift causes a systematic deviation (i.e., non-random fluctuation) in the variance mean from the preset benchmark, then an adaptive calibration procedure is triggered. Utilizing the statistical characteristics of the current batch data, the system recalibrates the capsules within the preset safety range, as originally intended. Value Fine-tune the decay index until the mean variance returns to the baseline level.
[0040] Example 5: On a large-scale traditional Chinese medicine preparation production line, to ensure the stability and compliance of the online detection system when introducing a new batch of capsule shell raw materials, a standardized on-site pre-calibration procedure is implemented. In offline mode, samples of the new batch of empty capsule shells are selected, and their full-band transmission spectrum data are collected using a micro-spot probe. Based on the collected data, the system automatically analyzes the characteristic absorption peak shift and baseline drift amplitude of the shell material in the characteristic band, and generates an initial background calibration parameter set for the batch of raw materials. During the no-load operation phase before the production line starts, the system loads this calibration parameter set and performs real-time differential spectral monitoring on empty capsules continuously passing through the detection area. If the average residual value of the monitored differential spectrum is consistently lower than the preset system noise threshold within 1000 consecutive samples, the initial calibration is considered successful, and the system automatically switches to the formal detection mode; otherwise, the system will trigger an alarm and prompt the user to re-execute the offline calibration process.
[0041] In complex production processes requiring the mixing of different specifications of traditional Chinese medicine capsules, a dynamic engineering debugging procedure is implemented to address the misalignment of microscopic spatial sampling points caused by posture jitter during the transport of capsules of different sizes. During the system initialization phase, the procedure uses a high-speed camera to capture the motion trajectory of the capsules on the conveyor belt and combines it with the real-time speed information fed back by the encoder to construct a jitter model of the capsule's motion state. Based on this model, the system automatically calculates the optimal trigger delay time and sampling frequency compensation value required by the micro-spot probe at different transport speeds to ensure that each spatial sampling point can be accurately aligned with the preset physical micro-area of the capsule. During the formal production process, the system continuously monitors the real-time position deviation of the capsules and uses the aforementioned jitter model to perform microsecond-level dynamic fine-tuning of the sampling timing.
[0042] Example 6: In a system integration application scenario for full life-cycle quality monitoring of high-value-added traditional Chinese medicine preparations, to address the differences in response characteristics of sensor components from different batches and the benchmark drift problem under long-term operation, a standardized system deployment pre-calibration and model building procedure was implemented. In a controlled laboratory environment with constant temperature and humidity, a set of standard reference filters with different transmittances were selected, covering the range of transmitted light intensity from 10% to 90%. Static spectral acquisition was performed on each filter using a micro-spot probe to construct the linearity calibration curve of the probe's photoelectric response. Background spectral data was continuously acquired for 1 hour under no-sample, unloaded conditions. The dark current noise baseline and time drift rate at each wavelength point were calculated to generate an initial background correction matrix, which was then stored in the system's non-volatile memory as the absolute physical benchmark for all subsequent online measurements.
[0043] After completing the offline calibration, an adaptive parameter matrix generation process for online operation was further constructed. Each time the system starts or changes capsule type, it automatically performs a self-learning scan. During this process, the system continuously collects spectral data from the first batch of 100 capsules passing through the detection area and uses an unsupervised clustering algorithm to analyze the statistical distribution characteristics of their spatial spectral response sequence. Based on the clustering results, the system automatically identifies feature vector clusters representing normal shell background, powder particle scattering, and potential noise interference. Accordingly, it dynamically adjusts the step size parameter of the differential operation between adjacent micro-regions and the correlation threshold for artifact removal. Specifically, if the frequency distribution center of the powder particle signal shifts to higher frequencies, the system will automatically reduce the differential step size to improve the capture capability of high-frequency details; if the dispersion of the shell background increases, the system will appropriately increase the artifact removal threshold to reduce the false positive rate.
[0044] Example 7: Characteristic spectral vectors of standard drug particles The physical acquisition process follows the calibration procedure: In offline mode, take intermediate powder from the same batch as the capsule to be tested, and fill it until the optical path length equals the average inner diameter of the capsule. Quartz cuvettes are pressed using a powder press to the standard process-specified center-fill density value, such as... The micro-spot probe should be used on the pressed sample for no less than [number] minutes. After multiple point scans, the arithmetic mean of the spectral data is calculated. The average spectrum is then processed with the same first derivative as in online detection to generate a batch-specific unit vector. The vector is stored in the controller and recalibrated only when the raw material batch changes, eliminating the reference error caused by differences in ambient background light or probe spectral response characteristics.
[0045] The correlation threshold for artifact removal is set as preset. The project was established based on the statistical distribution patterns of actual production line data: no less than [number missing] data points were collected. The number of manually confirmed qualified capsule samples is not less than Typical physically scratched empty shell samples were analyzed, and the difference spectral vectors were calculated respectively. Spectral angle cosine value; construct probability density distribution functions for the cosine values of two sets of samples, and set the correlation threshold to the distribution curve of qualified samples. That is, three times the standard deviation boundary value, or set as the value at the intersection of the distribution of qualified samples and the distribution of scratched samples.
[0046] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0047] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A quality control method for traditional Chinese medicine capsules, characterized in that, Includes the following steps: Step S1: During the axial transport of the capsule, a near-infrared spectral probe with an effective detection spot diameter less than one-tenth of the capsule's axial length is used to perform continuous micro-area scanning of the transmitted light intensity distribution of a single capsule, obtaining data containing... A spatial spectral response sequence of spatially sampled points discretely distributed along the capsule axis; Step S2: Perform adjacent micro-region difference operation on the spatial spectral response sequence to generate a difference spectral sequence. The difference operation is based on the continuous homogeneous film-forming structure of the capsule shell at the micro-scale and the discrete stacking structure of the contents of the Chinese medicine powder at the micro-scale. The background signal of the capsule shell, which changes continuously and gently with spatial position, is converted into a DC component that approaches zero and is filtered out. At the same time, the scattering signal of the contents particles, which changes randomly with spatial position at a high frequency, is retained and amplified. Thus, background decoupling is achieved without establishing a standard reference model for the capsule shell. Step S3: Calculate the statistical dispersion index of the differential spectral sequence within the preset characteristic bands, and construct a fluctuation fingerprint feature that characterizes the uniformity of the chemical properties of the contents particles in the spatial distribution. The statistical dispersion index is the variance or standard deviation of the absorbance value at each wavelength point in the differential spectral sequence. Step S4: Compare the fluctuation fingerprint feature with the preset acceptable benchmark range, and generate a control command indicating abnormal quality of the capsule contents when the fluctuation fingerprint feature exceeds the acceptable benchmark range. Furthermore, before calculating the statistical dispersion index in step S3, the differential spectral sequence is subjected to physical defect artifact removal processing based on the spectral vector directionality. This includes: extracting the differential spectral vector corresponding to each differential sampling point in the differential spectral sequence; calculating the spectral angle cosine value between the differential spectral vector and the pre-constructed standard drug particle characteristic spectral vector; using the spectral angle cosine value as a weighting coefficient to screen the differential spectral sequence, removing differential spectral vectors with spectral angle cosine values lower than a preset correlation threshold; screening to identify and remove non-chemically specific full-band light intensity jump signals caused by physical scratches or bubbles on the capsule shell surface, retaining only effective fluctuation signals with drug chemical absorption fingerprint characteristics to participate in the calculation of the statistical dispersion index. Before calculating the statistical dispersion index in step S3, the differential spectral sequence is subjected to optical path adaptive compensation processing based on transmission flux attenuation characteristics. This processing specifically includes: calculating the average light intensity value of all sampling points in the spatial spectral response sequence, using the average light intensity value to characterize the overall optical density of the material accumulation inside the capsule to be tested; determining the dynamic gain compensation coefficient corresponding to the average light intensity value based on the pre-calibrated nonlinear response relationship between light intensity and signal fluctuation amplitude. ; Utilizing dynamic gain compensation coefficient The amplitudes of the differential spectral sequence are normalized and corrected according to the following relationship: ,in, The corrected differential spectral amplitude, The original differential spectral amplitude, This is the average light intensity value. The preset standard reference light intensity value, An empirical attenuation index, used to characterize the scattering properties of materials, is used to correct the nonlinear attenuation effect of optical path changes caused by variations in the compactness of the material inside the capsule on the amplitude of the fluctuating fingerprint feature.
2. The quality control method for traditional Chinese medicine capsules according to claim 1, characterized in that, In step S1, the effective detection spot diameter of the near-infrared spectral probe is limited to 0.2 mm to 0.5 mm, and the number of spatial sampling points is... The number of sampling points is set to 20 to 50, and the center-to-center distance between adjacent spatial sampling points is equal to the effective detection spot diameter.
3. The quality control method for traditional Chinese medicine capsules according to claim 1, characterized in that, The preset characteristic band is a wavelength range pre-selected based on the near-infrared characteristic absorption peaks of the effective chemical components in the contents of traditional Chinese medicine; the differential spectral sequence generated in step S2 only contains spectral data within the preset characteristic band, reducing the data processing dimension and enhancing the detection sensitivity to uneven distribution of specific chemical components.
4. The quality control method for traditional Chinese medicine capsules according to claim 1, characterized in that, The characteristic spectral vector of the standard drug particle is a unit vector obtained by collecting the diffuse reflectance spectrum of a pure Chinese medicine powder sample and processing it with the first derivative; the calculation of the cosine value of the spectral angle is based on the cosine value of the angle between two vectors in the multidimensional spectral space, which is used to characterize the consistency of the chemical properties between the substance represented by the differential spectral vector and the standard drug particle.
5. The quality control method for traditional Chinese medicine capsules according to claim 1, characterized in that, The continuous micro-area scanning in step S1 is performed while the capsule is moving at a constant speed, and the trigger frequency of spectral acquisition is kept synchronized with the speed of the capsule to ensure that each spatial sampling point in the spatial spectral response sequence corresponds to a fixed physical position on the capsule.
6. The quality control method for traditional Chinese medicine capsules according to claim 1, characterized in that, The fluctuation fingerprint feature is a multidimensional feature vector composed of the variance values of the differential spectral sequence at multiple discrete feature wavelength points; the comparison in step S4 is to calculate the Mahalanobis distance or Euclidean distance between the multidimensional feature vector and the center of the standard qualified product feature vector set.
7. The quality control method for traditional Chinese medicine capsules according to claim 1, characterized in that, In step S2, before performing the differential operation, the spatial spectral response sequence is first smoothed using Savitzky-Golay to suppress the interference of detector electronic noise on the high-frequency differential signal; the window width of the smoothing process is smaller than the number of spatial sampling points. One-fifth.
8. The quality control method for traditional Chinese medicine capsules according to claim 1, characterized in that, Experience decay index The value ranges from 0.5 to 2.0, and its specific value is determined by fitting the transmission light intensity attenuation curve of standard samples with different filling density gradients in the characteristic band; the dynamic gain compensation coefficient increases monotonically with the decrease of the average light intensity value, compensating for the nonlinear compression of the effective signal amplitude under high-density filling state.
Citation Information
Patent Citations
Jujube kernel capsule capable of soothing nerves and near infrared spectrum on-line detection method of effective ingredients of capsule
CN105963382A
Method for carrying out near infrared spectrum non-destructive analysis on amoxicillin capsules
CN102095703A
Intelligent quality inspection system for medicinal empty capsules
CN120891163A