A method for quality detection of pharmaceutical excipients by near infrared spectroscopy
By combining the derivative sign consistency matrix and the spectral collinearity intensity index, a spectral interference risk assessment mechanism was constructed, which solved the problem of identifying unknown impurities in near-infrared spectroscopy detection of pharmaceutical excipients and improved the robustness and safety of detection.
Patent Information
- Application Number
- CN202511063468.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-07-31
AI Technical Summary
In the existing technology, the near-infrared spectroscopy detection method of pharmaceutical excipients has difficulty in identifying unknown impurities or low-concentration harmful pollutants, resulting in false negative quality judgments and potential safety hazards.
By introducing the derivative sign consistency matrix and the spectral collinearity intensity index, a spectral interference risk assessment mechanism is constructed in combination with the energy coverage ratio, and a weighted modeling strategy is adopted to dynamically downweight the highly overlapping spectral bands to improve the robustness and sensitivity of the model.
It effectively reduces the risk of misjudging impurity signals as main components, improves the sensitivity of quality testing of pharmaceutical excipients and the safety early warning capability, and ensures the quality consistency of the drug production process and the safety of clinical use.
Smart Images

Figure CN120558904B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of drug detection, and in particular to a near-infrared spectroscopy quality detection method for pharmaceutical excipients. Background Art
[0002] Near-infrared spectroscopy quality testing of pharmaceutical excipients utilizes near-infrared spectroscopy (NIR) technology to rapidly, non-destructively, and non-contactly analyze the physicochemical properties of excipients used in pharmaceutical formulations. This technology captures the excipient's absorption characteristics for specific wavelengths of light in the near-infrared region (generally ranging from 780nm to 2500nm) and establishes mathematical models linking these characteristics with key quality indicators such as ingredient concentration, moisture content, particle size distribution, and mixing uniformity. This enables quality control objectives such as excipient identification, authenticity verification, content determination, and adulteration analysis. Compared to traditional chemical analysis, this method is faster and requires no sample pretreatment, making it suitable for online monitoring or batch consistency assessment. It is a key process analytical technology (PAT) tool in modern pharmaceutical quality control systems.
[0003] The existing technology has the following deficiencies:
[0004] Prior art uses near-infrared spectroscopy to assess the quality of pharmaceutical excipients, generally relying on the characteristic absorption peaks of the excipient's primary components in the near-infrared region for modeling and identification. However, in practice, the presence of unknown impurities or low-concentration hazardous contaminants (such as residual organic solvents and trace denaturing components) in pharmaceutical excipients can create a significant overlap between their absorption characteristics and those of the primary components in the near-infrared region, creating a "blind spot" in spectral identification. These interfering substances, lacking distinct, independent near-infrared absorption characteristics, are difficult to identify using conventional modeling methods and can easily be misidentified as normal components in test results, resulting in false-negative quality assessments. Long-term reliance on this detection method can lead to the omission of potential safety hazards in pharmaceutical excipients. If these impurities exhibit toxic cumulative effects or are allergenic, their continued use could trigger chronic toxic reactions or allergic reactions during clinical use, posing a direct threat to patient safety in severe cases.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention
[0006] The purpose of the present invention is to provide a near-infrared spectral quality detection method for pharmaceutical excipients. By introducing a derivative sign consistency matrix and a spectral segment collinearity intensity index, the overlap relationship between the main component and the impurity in the spectral trend is accurately extracted, and the quantitative expression of the intensity dimension is achieved by combining the energy coverage ratio, and then a unified spectral interference risk assessment mechanism is constructed through the overlap index. On this basis, a weighted modeling strategy is adopted to dynamically reduce the weight of highly overlapping spectral segments, so as to realize the adaptive suppression of risk spectral segments by the model, which not only effectively reduces the risk of misjudging the impurity signal as the main component and improves the robustness and reliability of the modeling, but also enhances the sensitivity of the quality detection of pharmaceutical excipients and the safety warning capability, so as to solve the problems in the above-mentioned background technology.
[0007] In order to achieve the above object, the present invention provides the following technical solution: a method for detecting the quality of pharmaceutical excipients by near-infrared spectroscopy, comprising the following steps:
[0008] Collect high-resolution near-infrared reflectance spectrum data of pharmaceutical excipient samples within a uniform wavelength range, and obtain the near-infrared reflectance spectrum curves of the main component sample and the near-infrared reflectance spectrum curves of the impurity sample respectively;
[0009] The near-infrared reflectance spectrum curves of the main component sample and the near-infrared reflectance spectrum curves of the impurity sample are normalized to eliminate the systematic deviation caused by the overall light intensity difference;
[0010] First-order derivative transformations were performed on the normalized near-infrared reflectance spectra of the principal component sample and the near-infrared reflectance spectra of the impurity sample. The direction of the derivative value at each wavelength was extracted, and a derivative sign consistency matrix was constructed based on this. This matrix is used to describe the trend consistency characteristics of the local absorption behavior of the two types of spectral curves.
[0011] Based on the derivative sign consistency matrix, wavelength segments with continuous derivative sign consistency are extracted and defined as spectral collinearity regions. Within each spectral collinearity region, the average slope similarity between the first-order derivative spectral curve of the principal component sample and the first-order derivative spectral curve of the impurity sample is calculated to construct a spectral collinearity intensity index set.
[0012] Perform an integration operation on the original reflectivity curve in the collinear region of each spectral segment to obtain the corresponding energy density integral value, and calculate the energy coverage ratio of the integrated energy of the impurity sample in the collinear region of the spectral segment relative to the integrated energy of the main component sample to generate a spectral segment energy coverage ratio matrix;
[0013] The average slope similarity of the collinear region of each spectral segment is weightedly fused with the corresponding spectral segment energy coverage ratio. The overlapping contribution value of each spectral segment is calculated using a preset scoring function. The overlapping contribution values of all spectral segments are summed up to construct an overlap index under a unified dimension. The overlap index value ranges from 0 to 1 and is used to quantify the degree of spectral absorption overlap between the main component sample and the impurity sample in the near-infrared band.
[0014] According to the preset overlap risk threshold, it is judged whether the current pharmaceutical excipient sample forms a spectral interference risk area. If the overlap index exceeds the overlap risk threshold, the current pharmaceutical excipient sample is identified as a spectral interference risk area. For the spectral interference risk area, the spectral segment is assigned a corresponding weight in the subsequent modeling process according to the overlap index of the collinear area of each spectral segment, so as to realize the modeling difference sensitivity control based on the degree of absorption overlap.
[0015] Preferably, the step of obtaining the near-infrared reflectance spectrum curve of the main component sample and the near-infrared reflectance spectrum curve of the impurity-containing sample includes:
[0016] The sampling wavelength range of the spectrometer is selected to be 780 nm to 2500 nm, and high-resolution sampling parameters are set with a fixed wavelength interval of no more than 5 nm to ensure sufficient capture capability for subtle absorption differences that may exist in pharmaceutical excipients. During the spectral data acquisition process, the consistency of the measurement conditions of the pharmaceutical excipient samples is controlled, including constant temperature, humidity control, and fixed reflection angle, to avoid the impact of environmental interference on the consistency of the spectral data and ensure that the main component sample and the impurity-containing sample obtain the reflection spectrum curve under the same physical conditions. Each set of near-infrared reflection spectrum data collected is measured three times, and the average value is calculated as the final near-infrared reflection spectrum curve to reduce the random errors caused by instrument noise and transient disturbances, and improve the reliability of subsequent feature extraction and recognition.
[0017] Preferably, the step of normalizing the near-infrared reflectance spectrum curve of the main component sample and the near-infrared reflectance spectrum curve of the impurity-containing sample further includes: for each near-infrared reflectance spectrum curve, extracting its maximum reflectance value and minimum reflectance value in the entire wavelength range, and performing linear transformation based on the extreme difference between the maximum reflectance value and the minimum reflectance value, mapping all reflectance values to a standardized interval between 0 and 1; performing mean shift processing on the standardized spectral curve, that is, adjusting the average reflectance of each curve to a unified reference value, so as to further eliminate the overall spectral offset caused by differences in surface reflection characteristics of different samples; performing standard deviation scaling processing on the spectral curve after the above processing, proportionally adjusting the reflectance value of each wavelength point in the curve according to its standard deviation, so as to balance the differences in fluctuation strength in different near-infrared reflectance spectrum curves, thereby ensuring that in subsequent spectral comparison analysis, each curve is uniformly evaluated at the same light intensity scale, thereby improving the stability and robustness of the entire spectral analysis system.
[0018] Preferably, the step of constructing a derivative sign consistency matrix further includes: calculating the first-order derivative value of each normalized near-infrared reflectance spectrum curve according to the reflectivity difference between adjacent wavelength points, and recording the direction information of the derivative value at each wavelength point, and the derivative direction is three-state encoded using positive, negative or zero values, respectively indicating that the current absorption trend is rising, falling or stable; comparing the derivative direction of each wavelength point of the main component sample with the derivative direction of the corresponding impurity-containing sample point by point, if the derivative directions of the two samples at the wavelength point are consistent, that is, both are positive or both are negative, then it is marked as 1; if the directions are opposite or either derivative direction is zero, then it is marked as 0; arranging the above comparison results in wavelength order, and constructing a derivative sign consistency matrix covering the entire wavelength range, which is used to quantify whether the local absorption behavior trends of the main component sample and the impurity-containing sample at each wavelength point are consistent, thereby providing structured trend consistency feature information for subsequent spectral collinear region identification and spectral interference risk judgment.
[0019] Preferably, the step of constructing the spectrum segment co-linearity intensity index set further comprises: performing continuity scanning on the wavelength points with value 1 in the derivative sign consistency matrix in wavelength order, extracting adjacent continuous regions with length greater than a set length threshold, defined as spectrum segment co-linearity regions, to ensure that the extracted regions have stable consistency in spectral trend; in each spectrum segment co-linearity region, extracting the slope value sequences of the corresponding wavelength points in the first derivative spectral curve of the principal component sample and the first derivative spectral curve of the impurity-containing sample, and performing normalization processing on the two groups of sequences to exclude the influence of the absolute slope amplitude difference between different curves; performing vector angle cosine similarity calculation on the normalized slope value sequences to obtain the consistency degree of the slope change direction of the principal component sample and the impurity-containing sample in the spectrum segment co-linearity region, and taking the similarity value as the average slope similarity of the spectrum segment; collecting the average slope similarities corresponding to all spectrum segment co-linearity regions in wavelength order to construct the spectrum segment co-linearity intensity index set, which is used to represent the relative intensity of different spectrum segments in local absorption trend consistency and provide quantitative trend feature support for subsequent spectral overlap risk assessment.
[0020] Preferably, the step of generating the spectrum segment energy coverage ratio matrix further comprises: in each spectrum segment co-linearity region, extracting the original reflectivity curves of the principal component sample and the impurity-containing sample respectively, and performing discrete integral operation on all wavelength points in the spectrum segment co-linearity region; using numerical integral methods such as trapezoidal method or Simpson method to calculate the total energy density integral value in the waveband as a quantitative representation of the absorption energy; performing ratio calculation on the obtained energy density integral value of the principal component sample and the energy density integral value of the impurity-containing sample to obtain the proportion of the energy of the impurity sample in the energy of the principal component in the spectrum segment co-linearity region, representing the proportion of the impurity signal in the overall absorption energy; standardizing the proportion of the impurity signal in the overall absorption energy with fixed numerical precision to limit the result within the closed interval of 0 to 1, ensuring that the energy coverage ratios of all spectrum segment co-linearity regions can be compared and integrated on a unified scale; arranging the energy coverage ratio values corresponding to each spectrum segment co-linearity region in wavelength order to form a spectrum segment energy coverage ratio matrix, which is used to quantitatively systemize the coverage degree of the impurity absorption signal to the principal component absorption signal in each co-linearity region, and is a key basic data structure for identifying potential spectral shielding phenomenon and interference intensity.
[0021] Preferably, the step of constructing an overlap index under a unified dimension further includes: setting a slope similarity weight coefficient and an energy coverage ratio weight coefficient for each collinear region of a spectral segment, and setting the ratio of the two according to specific application requirements to ensure that the overlap contribution value can reflect both trend consistency and the degree of masking of the absorption intensity; multiplying the average slope similarity and energy coverage ratio in the collinear region of the spectral segment by their corresponding weight coefficients, and inputting the weighted results into a preset nonlinear scoring function to generate the overlap contribution value of the spectral segment. The scoring function can use a logical function, a Sigmoid function or other adjustable functions to enhance the sensitivity to intermediate values and the boundary distinction; the overlap contribution values of the collinear regions of all spectral segments are accumulated in order of wavelength, and normalized in combination with the total number of spectral segments, and the accumulated values are standardized to the results under a unified scale to construct an overlap index with a unified dimension to achieve comparability and indicator stability across samples. The overlap index takes a value range in a closed interval between 0 and 1, which serves as an overall overlap index of the spectral absorption behavior of the main component sample and the impurity-containing sample in the near-infrared band.
[0022] Preferably, for the spectral interference risk area, the spectral segment is assigned a corresponding weight in the subsequent modeling process according to the overlap index of the collinear region of each spectral segment. The specific steps include: setting a weight adjustment function according to the overlap index corresponding to the collinear region of each spectral segment, and the weight adjustment function is a monotonically decreasing function, which is used to map the overlap index to a modeling weight factor, thereby ensuring that the spectral segment with a higher overlap index is assigned a lower feature weight in the subsequent modeling to weaken its dominant role in the model training results; applying the weight adjustment function to the original spectral modeling features corresponding to the collinear region of each spectral segment to complete the weighted processing of the feature matrix, thereby realizing dynamic compression of the spectral segment weights before inputting the model, so that the contribution ratio of the spectral segment with a high overlap risk to the fitting result is significantly reduced, and the potential misjudgment risk introduced by it is effectively suppressed; in the modeling training process, a model input structure is constructed based on the spectral segment feature matrix after the above weighted processing, so that the spectral segment weight of each spectral segment modeling is inversely proportional to its overlap index, thereby improving the model's responsiveness and recognition accuracy to the true principal component features, while enhancing the model's robustness and adaptability to low-concentration impurity interference.
[0023] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0024] The present application extracts the coincidence relationship of the main component and impurities on the spectral trend by introducing the derivative symbol consistency matrix and the spectral segment co-line intensity index, and realizes the quantitative expression of the intensity dimension by combining the energy coverage ratio, and further constructs a unified spectral interference risk assessment mechanism through the overlap index. On this basis, the weighted modeling strategy is adopted to dynamically weight the high overlap spectrum, realize the adaptive inhibition of the model to the risk spectrum, not only effectively reduce the risk of misjudgment of impurity signal as main component, improve the robustness and reliability of modeling, but also improve the sensitivity and safety warning ability of drug excipient quality detection, which has significant practical value and technical progress significance for guaranteeing the quality consistency of drug production process and the safety of clinical use. BRIEF DESCRIPTION OF DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments will be briefly introduced. Obviously, the drawings in the following description only represent some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art according to these drawings.
[0026] Figure 1 The method flow chart of the present application is a method for near-infrared spectroscopy quality detection of pharmaceutical excipients. DETAILED DESCRIPTION
[0027] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these example implementations are provided so that this disclosure will be thorough and complete, and will fully convey the gist of each example to those skilled in the art.
[0028] The present application provides a method for near-infrared spectroscopy quality detection of pharmaceutical excipients as shown in Figure 1 The method flow chart of the present application is a method for near-infrared spectroscopy quality detection of pharmaceutical excipients.
[0029] Collecting high-resolution near-infrared reflectance spectrum data of pharmaceutical excipient samples in a unified wavelength range, respectively obtaining near-infrared reflectance spectrum curves of main component samples and near-infrared reflectance spectrum curves of samples containing impurities;
[0030] The step of obtaining the near-infrared reflectance spectrum curve of the main component sample and the near-infrared reflectance spectrum curve of the sample containing impurities comprises:
[0031] The sampling wavelength range of the spectrometer is selected to be 780 nm to 2500 nm, and high-resolution sampling parameters are set with a fixed wavelength interval of no more than 5 nm to ensure sufficient capture capability for subtle absorption differences that may exist in pharmaceutical excipients. During the spectral data acquisition process, the consistency of the measurement conditions of the pharmaceutical excipient samples is controlled, including constant temperature, humidity control, and fixed reflection angle, to avoid the impact of environmental interference on the consistency of the spectral data and ensure that the main component sample and the impurity-containing sample obtain the reflection spectrum curve under the same physical conditions. Each set of near-infrared reflection spectrum data collected is measured three times, and the average value is calculated as the final near-infrared reflection spectrum curve to reduce the random errors caused by instrument noise and transient disturbances, and improve the reliability of subsequent feature extraction and recognition.
[0032] This step provides fundamental data support for subsequent spectral analysis and identification of impurity interferences, and is a core prerequisite for the entire near-infrared spectroscopy quality testing method for pharmaceutical excipients. By collecting high-resolution near-infrared reflectance spectral data of pharmaceutical excipient samples within a uniform wavelength range, it is possible to fully capture the spectral absorption characteristics of the samples within a specific near-infrared range (e.g., 780 nm to 2500 nm). This wavelength range covers the absorption region of functional groups such as CH, OH, and NH, which are common in most organic compounds, and is an important basis for characterizing the molecular structure, functional group composition, and physical state changes of pharmaceutical excipients.
[0033] Specifically, collecting near-infrared reflectance spectra of the principal component sample and the impurity sample separately not only helps establish a standard spectral model for the principal component but also allows for comparative analysis to reveal potential interference from impurity signals on the overall spectrum. High-resolution spectral sampling ensures that detailed features in areas with dense or overlapping absorption peaks are fully preserved, providing sufficient data granularity and structural foundation for subsequent key steps such as derivative processing, collinear region extraction, and overlap calculation.
[0034] Furthermore, the unified wavelength range ensures that all samples are analyzed and compared on the same spectral scale, avoiding systematic errors caused by differences in instrument wavelengths or inconsistent sampling settings. This step in the entire testing process not only ensures the accuracy and repeatability of model analysis but also determines the ability to effectively identify false negatives caused by collinear absorption patterns, making it a fundamental requirement for high-precision quality monitoring.
[0035] The near-infrared reflectance spectrum curves of the main component sample and the near-infrared reflectance spectrum curves of the impurity sample are normalized to eliminate the systematic deviation caused by the overall light intensity difference;
[0036] The step of normalizing the near-infrared reflectance spectrum curve of the main component sample and the near-infrared reflectance spectrum curve of the sample containing impurities further comprises: for each near-infrared reflectance spectrum curve, extracting the maximum reflectance value and the minimum reflectance value in the entire wavelength range, and performing linear transformation based on the maximum reflectance value and the minimum reflectance value range, mapping all reflectance values to a standardized interval of 0 to 1; performing mean shift processing on the normalized spectrum curve, that is, adjusting the average reflectance of each curve to a unified reference value, to further eliminate the overall spectral shift caused by the difference in surface reflectance characteristics of different samples; performing standard deviation scaling processing on the spectrum curve after the above processing, adjusting the reflectance values of each wavelength point in the curve according to the standard deviation, to balance the difference in fluctuation strength in different near-infrared reflectance spectrum curves, thereby ensuring that each curve is uniformly evaluated under the same light intensity scale in subsequent spectral comparison and analysis, improving the stability and robustness of the entire spectral analysis system.
[0037] After the normalization (standardization) processing of the spectrum curve is completed, the overall position of each spectrum curve also needs to be corrected to eliminate the system offset caused by the difference in average reflectance intensity between different samples. This process is called "mean shift processing", which calculates the average reflectance value of each standardized spectrum curve in the entire wavelength range, and then adjusts the average reflectance value to a unified set reference value (such as 0.5 or other specified values). Specifically, the reflectance values of all points on the entire spectrum curve are simultaneously added or subtracted by an offset, so that the average value is accurately aligned to the target reference value. The purpose of this processing is to exclude the interference of the overall reflectance level caused by factors such as sample surface optical characteristics, measurement environment differences, instrument drift, etc., to ensure that all sample spectra have consistency in the mean scale, thereby improving the accuracy and comparability of subsequent feature extraction and curve comparison. In short, it is a standardization correction step that "raises or lowers the overall spectrum" to unify the center position.
[0038] The purpose of this step is to unify the light intensity scales of the main component samples and the impurity samples in the near-infrared reflectance spectrum data, eliminate systematic deviations caused by external factors or equipment status differences, and thus improve the accuracy and reliability of subsequent analysis. In the actual acquisition process, even if the same near-infrared spectrometer is used, the surface roughness, moisture content, placement angle or light source intensity fluctuations between different samples may cause the overall reflected light intensity to be too high or too low. If normalization is not performed and the spectral data of different samples are directly compared, it is easy to make misjudgments due to differences in light intensity rather than actual composition differences, which in turn affects key links such as derivative operations, collinear region identification and overlap calculation. Through normalization, each spectral curve is mapped to a unified numerical interval or scale, which can make the spectral characteristics between different samples more comparable, thereby more accurately reflecting the differences in the absorption behavior of the samples themselves. This is the key foundation for achieving reliable spectral modeling and impurity interference identification.
[0039] First-order derivative transformations were performed on the normalized near-infrared reflectance spectra of the principal component sample and the near-infrared reflectance spectra of the impurity sample. The direction of the derivative value at each wavelength was extracted, and a derivative sign consistency matrix was constructed based on this. This matrix is used to describe the trend consistency characteristics of the local absorption behavior of the two types of spectral curves.
[0040] The step of constructing a derivative sign consistency matrix further includes: calculating the first-order derivative value of each normalized near-infrared reflectance spectrum curve according to the reflectivity difference between adjacent wavelength points, and recording the direction information of the derivative value at each wavelength point, and the derivative direction is three-state encoded using positive, negative or zero values, respectively indicating that the current absorption trend is rising, falling or stable; comparing the derivative direction of each wavelength point of the main component sample with the derivative direction of the corresponding impurity-containing sample point by point, if the derivative directions of the two samples at this wavelength point are consistent, that is, both are positive or both are negative, then it is marked as 1; if the directions are opposite or either derivative direction is zero, then it is marked as 0; arranging the above comparison results in wavelength order, and constructing a derivative sign consistency matrix covering the entire wavelength range, which is used to quantify whether the local absorption behavior trends of the main component sample and the impurity-containing sample at each wavelength point are consistent, thereby providing structured trend consistency feature information for subsequent spectral collinear region identification and spectral interference risk judgment.
[0041] The step extracts the absorption change trend information in the near-infrared reflectance spectrum curve from the original reflectance signal, and quantifies whether the local spectral behavior of the principal component sample and the sample containing impurities is consistent at each wavelength point by constructing a derivative sign consistency matrix, thereby providing a structured and comparable basis for subsequent identification of spectral overlap regions and spectral interference risks. In actual near-infrared spectral analysis, the reflectance value itself is affected by multiple factors, and direct comparison of curve shapes is easily disturbed by amplitude differences or baseline drift. By first derivative transformation, the change direction of the spectrum at each wavelength can be highlighted, that is, rising, falling or remaining stable, thereby shifting the focus of comparison from "absolute reflectance value" to "trend" itself, enhancing the anti-interference ability and detail sensitivity. Further, by three-state coding (positive, negative or zero) of the derivative direction at each wavelength point, and then comparing the derivative direction of the principal component and the sample containing impurities at the same wavelength point one by one, it is judged whether they are consistent, a derivative sign consistency matrix covering the whole wavelength range can be constructed. The matrix represents the matching degree of the absorption trend of the two types of samples at each wavelength point in binary form, laying a data foundation for subsequent identification of spectral collinear regions (i.e. continuous regions with highly consistent change direction). This processing enables the system to sensitively capture impurity signals that have similar reflectance amplitudes but different trend behaviors, thereby improving the overall detection ability to distinguish low-concentration interfering substances, and effectively supplementing the recognition ability of traditional spectral modeling in the "blind area" of absorption overlap region.
[0042] Based on the derivative sign consistency matrix, extract the wavelength section with continuous derivative sign consistency, defined as the spectral collinear region; in each spectral collinear region, calculate the average slope similarity between the first derivative spectrum curve of the principal component sample and the first derivative spectrum curve of the sample containing impurities, and construct a spectral collinear intensity index set;
[0043] The step of constructing the spectrum segment collinear intensity index set further includes: performing continuity scanning on the wavelength points with a value of 1 in the derivative sign consistency matrix in the order of wavelength, extracting a section adjacent and continuous and longer than a set length threshold, defined as a spectrum segment collinear section, to ensure that the extracted region has stable consistency in the spectral trend; in each spectrum segment collinear section, extracting the slope value sequence of the corresponding wavelength points in the first derivative spectrum curve of the principal component sample and the first derivative spectrum curve of the impurity-containing sample, and performing normalization processing on the two groups of sequences to eliminate the influence of the difference in absolute slope amplitude between different curves; performing vector angle cosine similarity calculation on the normalized slope value sequence to obtain the consistency degree of the slope change direction of the principal component sample and the impurity-containing sample in the spectrum segment collinear section, and taking the similarity value as the average slope similarity of the spectrum segment; and collecting the average slope similarity corresponding to all spectrum segment collinear sections in the order of wavelength to construct the spectrum segment collinear intensity index set, which is used to represent the relative intensity of different spectrum segments in the local absorption trend consistency and provide quantitative trend feature support for subsequent spectral overlap risk assessment.
[0044] This step is based on the previously constructed derivative sign consistency matrix, further identifies the continuous wavelength sections in which the principal component sample and the impurity-containing sample have consistent local absorption trends in the near-infrared reflectance spectrum, and quantitatively analyzes the derivative behavior in these wavelength sections, thereby constructing the spectrum segment collinear intensity index set to provide trend intensity dimension support for subsequent identification of spectral overlap risk. In near-infrared spectral analysis, different components may exhibit similar absorption trends at the same wavelength, especially when the impurity concentration is low or the absorption intensity is weak, and the characteristic signal is easily masked by the principal component spectrum, forming an identification blind area. By extracting the wavelength section in which the derivative direction is continuous and consistent (i.e., the spectrum segment collinear section), the region in which the principal component and the impurity significantly overlap in the change trend can be located in the overall spectral structure, and these regions are most likely to have spectral absorption overlap.
[0045] After the spectrum segment collinear section is determined, the average slope similarity of the first derivative curves of the principal component sample and the impurity-containing sample in the section is calculated to further evaluate whether the change rates of the two samples in the region are consistent. If the average slope similarity is high, it means that the derivative behavior of the impurity is very close to that of the principal component, which enhances the indication of the spectrum segment to spectral overlap. By constructing the spectrum segment collinear intensity index set, the trend overlap intensity of each collinear section can be quantitatively analyzed, which provides a basis for subsequent determination of the overlap degree index and development of a weighted modeling strategy. In short, this step not only realizes deep analysis from “trend direction” to “trend intensity”, but also enhances the perceptibility and quantitative expression ability of potential spectral overlap interference, which is a key link in identifying complex interference relationships in the entire detection method.
[0046] Perform an integration operation on the original reflectivity curve in the collinear region of each spectral segment to obtain the corresponding energy density integral value, and calculate the energy coverage ratio of the integrated energy of the impurity sample in the collinear region of the spectral segment relative to the integrated energy of the main component sample to generate a spectral segment energy coverage ratio matrix;
[0047] The step of generating a spectrum energy coverage ratio matrix further includes: extracting the original reflectivity curves of the main component sample and the impurity sample in the collinear region of each spectrum segment, performing discrete integration operations on all wavelength points in the collinear region of the spectrum segment, and using a numerical integration method (such as the trapezoidal method or the Simpson method) to calculate the total energy density integral value in the band as a quantitative representation of the absorbed energy; performing a ratio calculation on the obtained energy density integral value of the main component sample and the energy density integral value of the impurity sample to obtain the proportion of the impurity sample energy in the collinear region of the spectrum segment to the main component energy, which represents the impurity signal. The proportion of the impurity signal in the overall absorption energy is normalized with a fixed numerical precision, and the result is limited to a closed interval of 0 to 1, ensuring that the energy coverage ratios of the collinear regions of all spectral segments can be compared and integrated on a unified scale; the energy coverage ratio values corresponding to the collinear regions of each spectral segment are organized into a spectral segment energy coverage ratio matrix in the order of wavelengths. This matrix is used to systematically quantify the coverage degree of the impurity absorption signal on the main component absorption signal in each collinear region, and is a key basic data structure for identifying potential spectral masking phenomena and interference intensity.
[0048] The method of normalizing the proportion of impurity signals in the overall absorbed energy and limiting the result to a closed interval between 0 and 1 is as follows: the energy density integral value of the principal component sample in the collinear region of each spectral segment is determined as the reference energy value, and this is used as the denominator for normalization; then, the energy density integral value of the impurity sample in the corresponding spectral segment is used as the numerator, and the ratio is calculated with the reference energy value to form the impurity energy proportion. In order to avoid abnormal situations such as excessively large values or zero denominators during the calculation process, a minimum non-zero threshold can be set, and the result can be truncated to ensure that the calculation result is strictly in the closed interval between 0 and 1. This standardization method can not only eliminate the influence of the differences in absolute energy levels between different spectral segments, but also reflect the relative coverage of the impurity signal to the principal component energy under a unified scale, thereby improving the comparability and stability of the spectral segment energy coverage ratio matrix in subsequent comprehensive analysis.
[0049] This step extracts the spectral energy distribution characteristics within the collinear region of each spectral segment by performing an integral operation on the original reflectivity curve within the collinear region of the spectral segment, and quantifies the energy difference between the impurity sample and the main component sample in the same wavelength range. It further establishes a spectral segment energy coverage ratio matrix, thereby achieving a structured and quantitative evaluation of the degree of shielding of the main component signal by the impurity spectral signal. In near-infrared spectral detection, some impurities are often difficult to directly identify using traditional methods due to their weak absorption characteristics or high overlap between the signal and the main component. Even if the derivative trends are consistent, it is impossible to confirm whether their energy contribution has a substantial impact on the modeling. Therefore, relying solely on the derivative direction or slope information is not enough to reveal the potential interference intensity of impurities.
[0050] By integrating the original reflectivity curve within the collinear region of the spectrum, the total energy density within this continuous wavelength segment can be extracted, reflecting the overall absorption capacity of the sample in the collinear region of the spectrum. Next, by calculating the ratio of the integrated energy of the impurity sample to the integrated energy of the main component sample, it can be determined whether the impurity component has significantly covered or obscured the absorption characteristics of the main component in the collinear region of the spectrum. This energy ratio not only reflects the "intensity" of impurity absorption, but also indirectly reflects its "hiddenness". If the impurity energy ratio is close to or exceeds that of the main component, it means that the impurity is likely to be misjudged as a main component feature during modeling of this spectrum segment, increasing the risk of error.
[0051] The average slope similarity of the collinear region of each spectral segment is weightedly fused with the corresponding spectral segment energy coverage ratio. The overlapping contribution value of each spectral segment is calculated using a preset scoring function. The overlapping contribution values of all spectral segments are summed up to construct an overlap index under a unified dimension. The overlap index value ranges from 0 to 1 and is used to quantify the degree of spectral absorption overlap between the main component sample and the impurity sample in the near-infrared band.
[0052] The step of constructing the overlap index in a unified dimension further comprises: setting a slope similarity weight coefficient and an energy coverage ratio weight coefficient for each spectral segment collinear region, proportionally setting the two according to specific application requirements, and ensuring that the overlap contribution value can reflect both the trend consistency and the shielding degree of the absorption intensity; multiplying the average slope similarity and the energy coverage ratio in the spectral segment collinear region by their corresponding weight coefficients respectively, and inputting the weighted results into a preset nonlinear scoring function to generate the overlap contribution value of the spectral segment, and the scoring function can adopt a logic function, a Sigmoid function or other adjustable functions to enhance the sensitivity of intermediate values and the degree of boundary differentiation; accumulating the overlap contribution values of all spectral segment collinear regions in the order of wavelength, and performing normalization operation in combination with the total number of spectral segments to standardize the accumulated value into a result in a unified scale, and constructing an overlap index with a unified dimension to realize the comparability and stability of the index between samples, and the overlap index has a value range in the closed interval of 0 to 1, and serves as the overall overlap degree index of the spectral absorption behavior of the main component sample and the impurity-containing sample in the near-infrared band.
[0053] The slope similarity weight coefficient and the energy coverage ratio weight coefficient are set for each spectral segment collinear region, which is illustrated as follows:
[0054] When setting the slope similarity weight coefficient and the energy coverage ratio weight coefficient, the importance of the spectral trend consistency and the energy shielding degree in actual application should be proportionally allocated. For example, if the application scenario emphasizes the identification of low-concentration impurities and hopes to improve the detection sensitivity of weak shielding signals, the weight of the energy coverage ratio should be appropriately increased, such as setting the slope similarity weight to 0.4 and the energy coverage ratio weight to 0.6. On the contrary, if the main concern is the morphological similarity of the absorption trend of the impurity and the main component to avoid mistakenly considering the trend-consistent but essentially different impurity absorption as the main component signal in modeling, the slope similarity weight can be set to 0.7 and the energy coverage ratio weight can be set to 0.3. In addition, a dynamic weight strategy can also be introduced in actual operation to adaptively adjust the proportion according to the range of the overlap contribution intensity of a certain spectral segment, thereby enhancing the comprehensive perception ability of the model to different types of interference. Through such flexible setting, the scoring function can be more consistent with the detection target in a specific scene, and the adaptability and accuracy of the overall analysis method can be improved.
[0055] According to the preset overlap risk threshold, it is judged whether the current pharmaceutical material sample forms a spectral interference risk area, and if the overlap index exceeds the overlap risk threshold, the current pharmaceutical material sample is identified as a spectral interference risk area; for the spectral interference risk area, a corresponding weight is given to each spectral segment collinear region in the subsequent modeling process according to the overlap index of the spectral segment collinear region, so as to realize the modeling difference sensitivity regulation based on the absorption overlap degree.
[0056] For spectral interference risk areas, a corresponding weight is assigned to each spectral segment in the subsequent modeling process based on the overlap index of the collinear region of each spectral segment. The specific steps include: setting a weight adjustment function based on the overlap index corresponding to the collinear region of each spectral segment. The weight adjustment function is a monotonically decreasing function used to map the overlap index to a modeling weight factor, thereby ensuring that spectral segments with higher overlap indexes are assigned lower feature weights in subsequent modeling, thereby weakening their dominant role in the model training results; applying the weight adjustment function to the original spectral modeling features corresponding to the collinear region of each spectral segment to complete the weighted processing of the feature matrix, thereby achieving dynamic compression of the spectral segment weights before input into the model, significantly reducing the contribution of spectral segments with high overlap risk to the fitting results, and effectively suppressing the potential misjudgment risk introduced by them; during the modeling training process, a model input structure is constructed based on the spectral segment feature matrix after the weighted processing, so that the spectral segment weight of each spectral segment modeling is inversely proportional to its overlap index, thereby improving the model's responsiveness and recognition accuracy to the true principal component features, while enhancing the model's robustness and adaptability to low-concentration impurity interference.
[0057] The following are examples:
[0058] Suppose that in near-infrared spectral analysis, three collinear regions are identified, with overlap indices of 0.15, 0.48, and 0.83, respectively. To mitigate the interference of high overlap regions on model training, a nonlinear weight adjustment function is set: spectral weight = exp(−α × overlap index), where α is the adjustment coefficient, which is set to 3. The modeling weights calculated using this function are: exp(−3 × 0.15) ≈ 0.64, exp(−3 × 0.48) ≈ 0.23, and exp(−3 × 0.83) ≈ 0.07. As can be seen, higher overlap indices correspond to lower weights, exhibiting an exponential decay relationship. These weight coefficients are applied to the spectral data of the corresponding spectral segments in the modeling input features. This weighting is then applied to the reflectance values at each wavelength within the collinear regions. This ensures that, during model training, spectral segments with low overlap risk retain a stronger modeling influence, while segments with high overlap risk are automatically suppressed. Through this nonlinear weight adjustment method, the spectral interference area can be dynamically downgraded, thereby improving the responsiveness of the modeling system to the true principal component and the anti-interference robustness.
[0059] By the above pharmaceutical excipient near-infrared spectrum quality detection method, the recognition ability of the system to the absorption behavior of low-concentration impurities or unknown pollutants in the near-infrared band can be significantly enhanced, and the recognition "blind area" formed by the spectral overlap of the traditional method is broken through. The method introduces the derivative symbol consistency matrix and the spectral segment collinearity intensity index, accurately extracts the coincidence relationship of the principal component and the impurity in the spectral trend, and realizes the quantitative expression of the intensity dimension combined with the energy coverage ratio, and then builds a unified spectral interference risk evaluation mechanism through the overlap degree index. On this basis, a weighted modeling strategy is used to dynamically weight the high overlap spectrum, realizing the adaptive inhibition of the model to the risk spectrum. This scheme not only effectively reduces the risk of misjudging the impurity signal as the principal component, improves the robustness and reliability of modeling, but also improves the sensitivity and safety warning ability of pharmaceutical excipient quality detection, which has significant practical value and technical progress significance for ensuring the quality consistency of the production process of drugs and the safety of clinical use.
[0060] The above only describes certain exemplary embodiments of the present application by way of illustration, and it is needless to say that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present application. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present application.
Claims
1. A method for detecting the quality of pharmaceutical excipients by near infrared spectroscopy, characterized in that: The following steps are involved: Obtaining a near-infrared reflection spectrum curve of the main component sample and a near-infrared reflection spectrum curve of the sample containing impurities, and performing normalization processing on the near-infrared reflection spectrum curve of the main component sample and the near-infrared reflection spectrum curve of the sample containing impurities; A first-order derivative transformation is performed on the normalized near-infrared reflectance spectrum curve to extract the direction of the derivative value at each wavelength point, and a derivative sign consistency matrix is constructed. The derivative sign consistency refers to whether the derivative directions at the wavelength points are all positive or all negative. Based on the derivative sign consistency matrix, wavelength segments with continuous derivative sign consistency are extracted and defined as spectral collinearity regions. Within each spectral collinearity region, the average slope similarity between the first-order derivative spectral curve of the principal component sample and the first-order derivative spectral curve of the impurity sample is calculated to construct a spectral collinearity intensity index set. Perform an integration operation on the original reflectivity curve in the collinear region of each spectral segment to obtain the corresponding energy density integral value, and calculate the energy coverage ratio of the integrated energy of the impurity sample in the collinear region of the spectral segment relative to the integrated energy of the main component sample to generate a spectral segment energy coverage ratio matrix; The average slope similarity of the collinear region of each spectral segment is weightedly fused with the corresponding spectral segment energy coverage ratio, and the overlap contribution value of each spectral segment is calculated using a preset scoring function. The overlap contribution values of all spectral segments are summed up to construct an overlap index with a unified dimension. Identify whether the current pharmaceutical excipient sample forms a spectral interference risk zone based on the preset overlap risk threshold. If so, assign a corresponding weight to the spectral segment in the subsequent modeling process based on the overlap index of the collinear region of each spectral segment; The step of constructing the derivative sign consistency matrix further includes: For each normalized near-infrared reflectance spectrum curve, the first-order derivative value is calculated according to the reflectivity difference between adjacent wavelength points, and the direction information of the derivative value is recorded at each wavelength point. The derivative direction is encoded in three states: positive, negative, or zero, indicating whether the current absorption trend is rising, falling, or stable. Compare the derivative direction of each wavelength point of the principal component sample with the derivative direction of the corresponding impurity sample point by point. If the derivative directions of the two samples at this wavelength point are consistent, that is, both are positive or both are negative, then mark it as 1; if the directions are opposite or either derivative direction is zero, then mark it as 0; Arrange the comparison results in order of wavelength and construct a derivative sign consistency matrix covering the entire wavelength range; The steps of constructing a spectrum segment collinearity intensity index set include: The wavelength points with a value of 1 in the derivative sign consistency matrix are continuously scanned in order of wavelength, and adjacent continuous segments with a length greater than a set length threshold are extracted, which are defined as spectral collinear regions to ensure that the extracted regions have stable consistency in spectral trends. In each collinear region of the spectrum, the slope value sequence of the first-order derivative spectrum curve of the main component sample and the first-order derivative spectrum curve of the impurity sample at the corresponding wavelength point is extracted, and the two sets of sequences are normalized; Perform vector angle cosine similarity calculation on the normalized slope value sequence, and use the similarity value as the average slope similarity of the spectrum segment; The average slope similarities corresponding to the collinear regions of all spectral segments are summarized in order of wavelength to construct a set of spectral segment collinearity intensity indicators.
2. A pharmaceutical excipient near infrared spectroscopy quality detection method according to claim 1, characterized in that: The steps of obtaining a near-infrared reflectance spectrum curve of a main component sample and a near-infrared reflectance spectrum curve of a sample containing impurities include: The sampling wavelength range of the spectrometer is selected to be 780 nm to 2500 nm, and high-resolution sampling parameters are set with a fixed wavelength interval of no more than 5 nm; During spectral data collection, control the consistency of measurement conditions for pharmaceutical excipient samples, including constant temperature, humidity control, and fixed reflection angle; Each set of collected near-infrared reflectance spectrum data was measured three times, and the average value was calculated as the final near-infrared reflectance spectrum curve.
3. The method for detecting the quality of pharmaceutical excipients by near infrared spectroscopy according to claim 1, wherein: The steps of normalizing the near-infrared reflectance spectrum curve of the main component sample and the near-infrared reflectance spectrum curve of the impurity-containing sample include: For each near-infrared reflectance spectrum curve, extract its maximum and minimum reflectance values within the entire wavelength range, and perform a linear transformation based on the extreme difference between the maximum and minimum reflectance values, mapping all reflectance values to a standardized range between 0 and 1. Perform mean shift processing on the standardized spectral curve, that is, adjust the average reflectance of each curve to a unified reference value; The processed spectral curve is subjected to standard deviation scaling processing, and the reflectance value of each wavelength point in the curve is proportionally adjusted according to its standard deviation.
4. The method for detecting the quality of pharmaceutical excipients by near infrared spectroscopy according to claim 1, wherein: The steps of generating a spectrum energy coverage ratio matrix include: In each collinear region of the spectrum, the original reflectivity curves of the main component sample and the impurity sample are extracted respectively, and discrete integration operations are performed on all wavelength points in the collinear region of the spectrum. The total energy density integral value in the band is calculated using the numerical integration method, and then the energy density integral value of the main component sample and the energy density integral value of the impurity sample are obtained; Calculate the ratio of the energy density integral value of the main component sample to the energy density integral value of the impurity sample to obtain the proportion of the impurity sample energy in the collinear region of the spectrum segment to the main component energy; The proportion of the impurity signal in the overall absorbed energy is normalized using a fixed numerical precision, and the result is limited to a closed interval between 0 and 1; The energy coverage ratio values corresponding to the collinear region of each spectrum segment are arranged in the order of wavelength to form a spectrum segment energy coverage ratio matrix.
5. The method for detecting the quality of pharmaceutical excipients by near infrared spectroscopy according to claim 1, wherein: The steps to construct an overlap index under a unified dimension include: Set the slope similarity weight coefficient and energy coverage ratio weight coefficient for each spectral collinear region; The average slope similarity and energy coverage ratio in the collinear region of the spectrum segment are multiplied by their corresponding weight coefficients, and the weighted results are input into the preset nonlinear scoring function to generate the overlap contribution value of the spectrum segment; The overlapping contribution values of the collinear regions of all spectral segments are accumulated in order of wavelength, and normalized based on the total number of spectral segments. The accumulated values are standardized to the results under a unified scale, and an overlapping index with a unified dimension is constructed.
6. The method for detecting the quality of pharmaceutical excipients by near infrared spectroscopy according to claim 1, wherein: For the spectral interference risk area, the corresponding weight is assigned to each spectral segment in the subsequent modeling process according to the overlap index of the collinear region of each spectral segment. The specific steps include: A weight adjustment function is set according to the overlap index corresponding to the collinear region of each spectral segment. The weight adjustment function is a monotonically decreasing function used to map the overlap index to a modeling weight factor. The weight adjustment function is applied to the original spectral modeling features corresponding to the collinear region of each spectral segment to complete the weighting processing of the feature matrix and realize the dynamic compression of the spectral segment weights before inputting the model. During the modeling training process, the model input structure is constructed based on the weighted spectral segment feature matrix, so that the spectral segment weight of each spectral segment modeling is inversely proportional to its overlap index.
Citation Information
Patent Citations
Method for identifying dendrobium officinale medicinal material based on near infrared spectroscopy
CN106092950A
Agricultural product quality detection method and system
CN119804377A
