A handheld near infrared spectrum detection method and device

Through the fiber exposure design and multi-stage release strategy of handheld near-infrared spectral detection method, the problems of complex detector structure and non-contact detection in the prior art are solved, and portable and accurate detection of raw and auxiliary materials of drug products are realized.

CN115128036BActive Publication Date: 2025-02-07SHANDONG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210842698.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-18
Publication Date
2025-02-07
Estimated Expiration
2042-07-18

AI Technical Summary

Technical Problem

The existing handheld near-infrared spectral detectors have problems such as complex equipment structure, large space occupied, inconvenient handling, and incomplete spectral information and high operation difficulty caused by contactless detection.

Method used

The handheld near-infrared spectral detection method is adopted to realize direct contact detection through fiber exposure design, combining multi-stage release strategy and automated modeling to improve the accuracy and portability of the detection.

Benefits of technology

It realizes portable and accurate detection of raw and auxiliary materials for pharmaceuticals, reduces operation difficulty, improves the accuracy of spectral information and the degree of automation of modeling, and avoids the risk of errors in judgment of a single method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115128036B_ABST
    Figure CN115128036B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of rapid detection and release of pharmaceutical raw materials and auxiliary materials, and provides a handheld near-infrared spectrum detection method and device, comprising: obtaining sample infrared spectrum data and performing preprocessing; performing band selection based on the preprocessed sample infrared spectrum data to obtain infrared spectrum data of the sample to be detected; automatically establishing a near-infrared qualitative inspection model based on the infrared spectrum data of the sample to be detected; using a multi-level release strategy to judge the near-infrared qualitative inspection model to determine whether the near-infrared qualitative inspection model is correct; if correct, performing inspection according to the near-infrared qualitative inspection model, and storing the inspection result in a material database; if wrong, not storing the sample in the material database, and performing chemical inspection on the sample; the present invention adopts an automatic multi-level release strategy to avoid the risk of misjudgment of release by a single method, and solves the problem that a traditional modeling method requires a large amount of manpower to collect spectra of multiple samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of rapid detection and release of pharmaceutical raw and auxiliary materials, and particularly relates to a handheld near-infrared spectrum detection method and device. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] In the pharmaceutical industry, near-infrared spectroscopy has been used for raw material incoming inspection and identification analysis before raw materials are put into use. Its advantage is that it can directly analyze raw materials through glass or polymer packaging. Traditional near-infrared spectroscopy detectors have problems such as complex equipment structure, large space occupation and inconvenient transportation, which are not conducive to the application and promotion in the detection of pharmaceutical raw materials and excipients. Compared with special instruments, portable near-infrared spectrometers are smaller in size and lighter in weight, and have a wider range of application for ambient temperature, humidity and earthquake resistance. Cloud computing can speed up the perception, transmission and analysis of real-time data information. Existing portable instruments are mainly handheld, and the main types are cylindrical and pistol types. Most of the existing types of detectors are designed for non-contact detection, resulting in incomplete spectral information collected and high requirements for personnel operation. The present invention realizes the design of exposed optical fiber, which can directly contact the test sample, avoiding problems such as contaminated samples or incomplete reception of test information due to improper control of the detection distance. The anti-slip design of the detector shell can better protect the instrument, and the material is selected from ABS material with light density and relatively ideal comprehensive performance, achieving the purpose of portable and accurate detection.

[0004] To achieve non-destructive inspection, the near-infrared spectrometer can detect the sample to be tested through the outer packaging material. The packaging materials of some pharmaceutical raw materials are transparent materials and can be directly detected, but the outer packaging of some pharmaceutical raw materials is non-transparent packaging such as tin foil and aluminum foil, and detection can only be achieved by spacing a certain distance or directly contacting the material. The existing pharmaceutical factory raw material first-line detection instruments are mainly non-contact detection. The detection process must ensure that the probe and the detection sample are separated by a certain distance, and cannot contact the sample to prevent the fiber optic probe from being contaminated, and the operation difficulty coefficient is high. This makes data collection difficult, the collection success rate is relatively low, and the fiber optic probe is difficult to clean after being detected. In order to make the established model have better accuracy and minimize the interference of errors, the fiber optic probe is inserted into the sample for direct measurement when the model is established. The present invention avoids the above problems by configuring a disposable probe cover for the optical fiber probe, and the disposable probe cover is low in cost and easy to use, which is very suitable for the detection of large quantities of raw materials in pharmaceutical factories.

[0005] For the current identification of raw and auxiliary materials, most handheld near-infrared instruments on the market use a single correlation coefficient method to determine the identity of the samples to be tested. However, the near-infrared spectrum has no obvious characteristic peaks, and the spectra of different materials of the same category are very similar. The single release method has certain risks. Summary of the invention

[0006] In order to solve the above problems, the present invention proposes a handheld near-infrared spectroscopy detection method and device. The automatic multi-level release strategy of the present invention avoids the risk of misjudgment of release by a single method, which is conducive to the application and promotion of drug raw and auxiliary material detection.

[0007] According to some embodiments, a first solution of the present invention provides a handheld near-infrared spectrum detection method, which adopts the following technical solution:

[0008] A handheld near-infrared spectrum detection method, comprising:

[0009] Obtain sample infrared spectrum data and perform preprocessing;

[0010] Based on the preprocessed infrared spectrum data of the sample, band selection is performed to obtain infrared spectrum data of the sample to be tested;

[0011] Automatically establish a near-infrared qualitative inspection model based on the infrared spectrum data of the sample to be tested;

[0012] Adopting a multi-level release strategy to judge the near infrared qualitative inspection model, and judging whether the near infrared qualitative inspection model is correct;

[0013] If correct, perform inspection according to the near infrared qualitative inspection model, and store the inspection result in the material database;

[0014] If it is wrong, the sample is not stored in the material database and chemical testing is performed on the sample.

[0015] Furthermore, the obtaining of sample spectral data and preprocessing includes:

[0016] Acquire sample spectrum data;

[0017] The convolution smoothing method is used to smooth and reduce noise of sample spectral data;

[0018] The multivariate scattering correction method is used to eliminate the influence of surface property differences and particle size scale of the sample spectral data after smoothing and noise reduction;

[0019] Get the sample spectral data after preprocessing.

[0020] Furthermore, the band selection is performed based on the preprocessed sample spectral data to obtain the sample spectral data to be detected, including:

[0021] The absorbance vector I corresponding to each wavelength in the calibration set spectrum array is correlated with the concentration vector of the component to be measured in the concentration array;

[0022] The wavelength with a larger absolute value of the corresponding correlation coefficient has more information, and the wavelength with a large correlation coefficient is selected as the wavelength to be measured.

[0023] Furthermore, the multi-level release strategy is used to determine whether the near infrared qualitative inspection model is correct, including:

[0024] The first-level release strategy is to calculate the correlation between the near-infrared qualitative inspection model and the model in the spectral model library. If the correlation coefficient with the model of the same type of material is above the first threshold and the correlation coefficient with the model of different types of materials is below the second threshold, the judgment is correct; otherwise, the second-level release strategy is activated;

[0025] The secondary release strategy is to establish a SIMCA model based on the infrared spectrum data of the sample to be tested, and analyze the SIMCA model with the model in the spectrum model library through the similarity coefficient. If the correlation coefficient with similar materials is above the second threshold, the judgment is correct; otherwise, the tertiary release strategy is activated;

[0026] The three-level release strategy is to establish a support vector machine model based on the infrared spectrum data of the sample to be tested, and analyze the support vector machine model and the model in the spectral model library through the similarity coefficient. If the correlation coefficient with similar materials is above the second threshold, the judgment is correct; otherwise, the sample is automatically judged as a high-risk material.

[0027] According to some embodiments, a second solution of the present invention provides a handheld near-infrared spectrum detection device, which adopts the following technical solution:

[0028] A handheld near-infrared spectrum detection device comprises a handheld terminal and a PC terminal, wherein the handheld terminal is connected to the PC terminal via a Bluetooth module;

[0029] Wherein, the handheld terminal comprises a housing, a miniature near-infrared spectrometer integrated in the housing, a controller and a Bluetooth module;

[0030] The controller is connected to the PC terminal via a Bluetooth module to send the sample spectrum data collected by the micro near-infrared spectrometer to the PC terminal;

[0031] The PC terminal analyzes the sample spectrum data.

[0032] Furthermore, the shell is divided into a head and a handheld part; the head is divided into two compartments, a fiber optic probe is fixed in the first compartment; a miniature near-infrared spectrometer is fixed in the second compartment; the handheld part is divided into three compartments, a controller is fixed in the third compartment, the controller is connected to the miniature near-infrared spectrometer; a Bluetooth module is fixed in the fourth compartment, the Bluetooth module is connected to the controller; a power module is fixed in the fifth compartment;

[0033] The head is provided with a spiral switch, and the bottom of the head is a snap-on switch; the handheld part is provided with a power control button and an anti-slip ring.

[0034] Furthermore, a bottom cover is provided at the handheld portion, and a threaded cover is provided at the front end of the head portion for connecting an optical fiber probe, thereby facilitating the maintenance of the near-infrared instrument.

[0035] Furthermore, the threaded cover is provided with two layers of slots for connecting the disposable probe cover and the metal protective cover respectively.

[0036] Furthermore, a disposable probe cover is sleeved on the optical fiber probe.

[0037] Furthermore, a sealing ring matching the front end threaded cover is also provided at the connection between the front end threaded cover and the head shell.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] The present invention uses a multi-level modeling method to perform model determination of samples. The correlation coefficient method is first used to determine the correlation coefficient of the sample. If it is within the specified range, the sample can be released and meets the model standard. If it is no longer within the specified range, the next level of model determination will be entered until the third level determination is completed. If the model standard is still not met, the material will be automatically classified as high risk. The software refuses to store the material and recommends further confirmation by traditional chemical methods, avoiding the risk of misjudgment of a single method release, which is conducive to the application and promotion of drug raw and auxiliary material detection.

[0040] The handheld terminal of the present invention has a simplified structure and a reduced size, making it lighter to carry. The exposed design of the optical fiber probe realizes the accessibility of detection and improves the accuracy of spectral information. The modeling automation is high, and the modeling accuracy can be greatly improved and the anti-interference ability of the model can be made stronger, which can increase the sampling and modeling speed, reduce human errors, and facilitate intelligent data management. The disposable probe cover prevents the contamination of raw and auxiliary materials during the collection process. The shockproof setting of the shell can increase the stability and service life of the instrument. Bluetooth communication makes the spectral detection more free. The multi-level release judgment strategy realizes the rigorous and reasonable judgment of unknown samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0042] Figure 1 It is a flow chart of automatic optimization of prediction model and prediction spectrum modeling of multi-stage release system according to an embodiment of the present invention;

[0043] Figure 2 It is a main structural diagram of the handheld near-infrared spectrum detection and automatic modeling system according to an embodiment of the present invention;

[0044] Figure 3 Functional principle block diagram of the handheld near-infrared spectroscopy detection and automatic modeling system according to an embodiment of the present invention;

[0045] Figure 4 This is an instrument parameter configuration page for the handheld near-infrared spectroscopy detection and automatic modeling system according to an embodiment of the present invention;

[0046] In the figure: 1-fiber optic probe; 2-cover; 3-mini near-infrared spectrometer; 4-shockproof device; 5-controller; 6-indicator light; 7-power button; 8-Bluetooth module; 9-battery; 10-bottom cover; 11-anti-slip rubber sleeve; 12-protective cover; 13-housing. DETAILED DESCRIPTION

[0047] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0048] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0049] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0050] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0051] Embodiment 1

[0052] like Figure 1-Figure 4 As shown, this embodiment provides a handheld near-infrared spectrum detection method. In this embodiment, the method includes the following steps:

[0053] A handheld near-infrared spectrum detection method, comprising:

[0054] Obtain sample infrared spectrum data and perform preprocessing;

[0055] Based on the preprocessed infrared spectrum data of the sample, band selection is performed to obtain infrared spectrum data of the sample to be tested;

[0056] Automatically establish a near-infrared qualitative inspection model based on the infrared spectrum data of the sample to be tested;

[0057] Adopting a multi-level release strategy to judge the near infrared qualitative inspection model, and judging whether the near infrared qualitative inspection model is correct;

[0058] If correct, perform inspection according to the near infrared qualitative inspection model, and store the inspection result in the material database;

[0059] If it is wrong, the sample is not stored in the material database and chemical testing is performed on the sample.

[0060] Specifically, the obtaining of sample spectral data and preprocessing includes:

[0061] Acquire sample spectrum data;

[0062] The convolution smoothing method is used to smooth and reduce noise of sample spectral data;

[0063] The multivariate scattering correction method is used to eliminate the influence of surface property differences and particle size scale of the sample spectral data after smoothing and noise reduction;

[0064] Get the sample spectral data after preprocessing.

[0065] Specifically, the band selection is performed based on the preprocessed sample spectral data to obtain the sample spectral data to be detected, including:

[0066] The absorbance vector I corresponding to each wavelength in the calibration set spectrum array is correlated with the concentration vector of the component to be measured in the concentration array;

[0067] The wavelength with a larger absolute value of the corresponding correlation coefficient has more information, and the wavelength with a large correlation coefficient is selected as the wavelength to be measured.

[0068] Specifically, the multi-level release strategy is used to determine whether the near infrared qualitative inspection model is correct, including:

[0069] The first-level release strategy is to calculate the correlation between the near-infrared qualitative inspection model and the model in the spectral model library. If the correlation coefficient with the model of the same type of material is above the first threshold and the correlation coefficient with the model of different types of materials is below the second threshold, the judgment is correct; otherwise, the second-level release strategy is activated;

[0070] The secondary release strategy is to establish a SIMCA model based on the infrared spectrum data of the sample to be tested, and analyze the SIMCA model with the model in the spectrum model library through the similarity coefficient. If the correlation coefficient with similar materials is above the second threshold, the judgment is correct; otherwise, the tertiary release strategy is activated;

[0071] The three-level release strategy is to establish a support vector machine model based on the infrared spectrum data of the sample to be tested, and analyze the support vector machine model and the model in the spectral model library through the similarity coefficient. If the correlation coefficient with similar materials is above the second threshold, the judgment is correct; otherwise, the sample is automatically judged as a high-risk material.

[0072] The present invention also discloses a prediction model automatic optimization and multi-level release processing system. The software subsystem design includes the upper computer software subsystem design and the lower computer software subsystem design. The upper computer software is Windows 10 system software, and the controller and the PC are connected through a Bluetooth module. The controller adopts an STM32 single-chip microcomputer, and the lower computer is developed using the uKeil5 development environment. After the compilation is completed, it can be directly downloaded into the STM32 single-chip microcomputer for use.

[0073] In this example, the software is mainly divided into five layers. The bottom layer is the communication layer for receiving data and sending instructions. The middle layer includes the infrastructure layer that provides processors and memory for the system. The spectral algorithm layer includes two modules. One is the bottom processing module, which is the storage of preprocessing methods, qualitative analysis algorithms and optimization algorithms; the other is the top control module that realizes the processing and calling of algorithms. The spectral model layer is used to search for existing spectral models, store new spectral models, and convert spectral models. The top human-computer interaction layer is used for interface display. The software system structure framework diagram is shown in the figure below. Figure 1 shown.

[0074] In this example, data is transmitted between the PC and the device via the Bluetooth module, making sample data detection convenient and flexible. The Bluetooth module communication method is as follows:

[0075] Bluetooth module connection: The program is operated in the order of opening the Bluetooth module, initializing the Bluetooth module, querying nearby Bluetooth modules, establishing a connection, sending data / files, disconnecting, and closing the Bluetooth module, which is triggered by the buttons in the operation area. After the Bluetooth module is initialized, the local Bluetooth module address will be displayed in the information area. After the query is completed, the queried remote Bluetooth module address will be displayed in the information area, and then the connection can be initiated. With the local PC-side Bluetooth module as the main device, first actively initiate a query. After querying the device Bluetooth module device, actively initiate a connection. After the connection is established, data can be transmitted between the PC-side Bluetooth module and the device Bluetooth module.

[0076] Data transmission: After the Bluetooth module connection between the MCU and PC is established, data can be transmitted between the two. The PC sends a command, and after the MCU receives the data, it controls the near infrared to collect the spectrum. When the MCU is a slave device, if it is set to automatically return, it can also return the received data to the PC. The process of file transfer between the MCU and PC is the process of interaction between the two devices. The MCU needs an external memory to temporarily store the data to be transmitted, so the MMC card is used as an external memory and a simple FAT16 file system is programmed on the MCU so that the MCU receives the file from the PC through the Bluetooth module wireless interface and stores the file in the FAT16 format that matches the PC. The ultimate goal is that after the MMC card is taken out from the MCU, it can be connected to the PC through a card reader to identify the received file. The files transmitted from the PC are all in a certain format, and the most common ones are FAT16 and FAT32 format files. The files received from the PC must be stored in a format that matches them to be considered a successful file transfer. The process is as follows:

[0077] 1. The MCU first sends a "file sending request" message to the PC. After receiving the request, the PC returns an "allow file sending" message to the MCU.

[0078] 2. After receiving the transmission permission information, the MCU opens the file to be sent in the MMC, obtains the file information and file data, and sends the file information to the PC. After receiving the file information, the PC creates a new empty file based on it and returns the "file creation completed" information to the MCU after completion.

[0079] 3. After the MCU learns that the PC file has been created, it can send the file data. The file data is sent in segments.

[0080] 4. After the MCU completes sending the data, it sends a "file sending completed" message to the PC, and the PC closes the current file.

[0081] In this example, the host computer software is Windows 10 system software, and the analyzer is connected via a Bluetooth module. The software requirements are as follows:

[0082] (1) Serial port setting function: It can automatically scan the serial port and display the available serial ports on the software. It can set the baud rate of the serial port and has connect and disconnect buttons.

[0083] (2) System switch: Set the system switch function. When the system is turned off, other functions cannot be used. Only when the system is turned on, other functions can be used.

[0084] (3) NIR spectrum modeling optimization function: pre-process the received data, call the pattern recognition algorithm, the first-level modeling method is fixed as the correlation coefficient method, and the second level and above are selected according to the properties of the sample.

[0085] (4) NIR spectral qualitative model storage function: The established spectral model is stored in a specified path and can be called up and viewed at any time.

[0086] (5) Tungsten lamp control function: you can set the switch of tungsten lamp

[0087] (6)PID parameter setting function: You can set PID parameters, such as KP, KI, and KD.

[0088] (7) NIR spectrum display function: real-time display of the collected spectrum, with the horizontal axis representing time and the vertical axis representing the corresponding current value.

[0089] The software is written in Python 3.7 and developed in Pycharm. The host computer control software is written according to the software requirements and the software system structure diagram, and the software is divided into four functional modules: user interaction module, instrument parameter configuration module, spectrum acquisition module, spectrum modeling module, and model storage module.

[0090] The user interaction module is the interface module for users to use the software, making human-computer interaction more friendly. This module is developed using PyQt5. In this module, two tabs are set to support the configuration of instrument parameters and the acquisition of spectra respectively. All the functions of buttons, tabs and graphic displays are also completed in this module.

[0091] The instrument parameter configuration module mainly uses the Pyserial module to complete the underlying communication function. The Pyserial module encapsulates access to the serial port (serialport). It provides a Python backend running on Windows, OSX, Linux, BSD, and IronPython. The module name "serial" will automatically select the appropriate backend. The main functions of the software are completed in this instrument parameter configuration module, such as traversing all ports of the host computer and determining the model of the connected detector, establishing a long connection between the host computer and the detector NIRONE1.7, sending user instructions, and receiving data from NIRONE1.7.

[0092] After the spectrum acquisition module establishes the connection between the host computer and NironeSensor in Pyserial and configures the detection parameters, the "dark current" button can be used to collect the dark current spectrum, the "reference spectrum" button is responsible for collecting the reference spectrum, and the "measure" button is responsible for collecting the sample spectrum. After completing the collection of the dark current and reference spectrum, when collecting the sample spectrum, the sample spectrum display image will be automatically converted into an absorbance spectrum according to the formula. The conversion formula is as follows:

[0093] ;

[0094] Spectral modeling module: There are two modes, one is the automatic modeling mode, which is the method of automatic modeling by the machine pushing the optimal algorithm, and the other is the manual modeling mode, which is the operator can manually select the required modeling algorithm stored in the machine according to the properties of the measured sample, and achieve one-click modeling by prohibiting the call of the optimization algorithm recommendation. This module is mainly completed by NumPy, SciPy (ScientificPython) and Matplotlib modules.

[0095] The model storage module is mainly responsible for saving data during data collection. When the user collects data, the software will automatically save the data. Since the xlsxwriter module can store data multiple times, this module is used to complete the development of the automatic save function. However, this module supports writing up to 256 columns and cannot meet the data saving requirements when the resolution is 1. In order to solve this problem, the resolution will be judged before reading and writing data. If the number of data columns exceeds 256 rows, it will be automatically divided into two tables for storage. In addition to the system automatically saving data, the system supports users to save manually. The manual save function is developed and implemented by the xlwt module.

[0096] In this example, after opening the main interface of the system, six menus will appear: parameter configuration, file saving, spectrum measurement, modeling and verification, sample determination, and viewing. After running the system, you can start working from the configuration menu. The modeling process is as follows:

[0097] (1) Enter the spectral parameter configuration interface. Enter the instrument parameter configuration page, such as Figure 4 The instrument configuration interface is shown. Select the port on this page, that is, select the model and quantity of the near-infrared instrument to be used. Select the appropriate instrument detection parameters, wavelength average is wavelengthaverage, scan average is scanaverage, wavelength average and scan average are parameters that determine the number of spectral scans; resolution is a parameter for setting the number of wavelength points. When the resolution is 1, an energy value is collected every 1nm; the scan interval is the time interval for spectrum collection in the automatic scanning mode. If it is set to 5s, the instrument automatically collects a spectrum every 5 seconds. If you do not want to set the basic parameters, you can click the "Default" button, and the software will automatically fill in the conventional basic parameters. In the default state, the wavelength average is 100, the scan average is 1, the resolution is 1, and the scan interval is 5s.

[0098] (2) Select New File Path from the File menu and set the file name. To select the path to save the collected spectral data, you can directly enter the path and file name to be saved in the label bar under "Modify Project Name"; if you want to select the path location, you can click the "Save Location" button, and a pop-up window will pop up to select the save location and the file name to be saved.

[0099] (3) Receive spectral data and display the original spectrum of the sample in real time. Click the Start Configuration button and send the detection transmission required by the instrument to NironeSensor via the Bluetooth module. The software command feedback bar will display "Configuration completed!". At this time, you can switch to the spectrum measurement interface to collect the spectrum and display the spectrum collection interface in real time.

[0100] (4) Selection between automatic spectral modeling and manual modeling. Click the Modeling and Verification button, and there will be two options: automatic modeling and manual modeling. If you choose the automatic modeling option, the system will automatically perform modeling, and the model calibration and verification results will be displayed after the modeling is completed. If you are satisfied with the model verification results, you can then enter the model name, sample name, sample type and other information in the dialog box, and then click the "Save to Model Library" button to save. If you choose the manual modeling button, the manual modeling algorithm selection interface will pop up, including the selection of preprocessing, pattern recognition methods and other methods. Select from the algorithms saved in the spectral algorithm layer of the software, press the "Modeling" button, and the system will call the corresponding algorithm in the software according to the method selected by the user to process the spectral data. After the processing is completed, the corresponding results will be displayed. The saving process is the same as automatic modeling. This function realizes the efficiency and speed of automatic modeling, and also meets the accuracy and scientificity of manual modeling.

[0101] (5) The system uses the sample determination menu to complete the qualitative discrimination of unknown samples based on the model library. First, click the sample determination menu to open the sample determination dialog box. Click the Read Sample File button and select the sample optical latent data to be initially determined from the dialog box that opens. This system can measure a single sample or multiple samples at the same time, as long as the samples to be tested use the same prediction model. Finally, select the prediction model to be used from the existing model list, and click the Determination button to perform the determination.

[0102] The method for automatic modeling of raw and auxiliary materials and automatic multi-level release of unknown samples in this example is as follows:

[0103] Select the spectral file to be modeled, and divide the sample spectra into calibration set samples and validation set samples. The calibration set samples are used for spectral modeling, and the validation set samples are used to verify the performance of the model later. The samples in the calibration set should contain all chemical components that may exist in the samples to be tested in the future; their concentration (or property) range should exceed the conditions that may be encountered in the samples to be tested in the future.

[0104] Preprocess the sample spectral data. Modern measuring instruments are relatively precise, especially in the raw spectra collected by near-infrared spectroscopy. In addition to the sample composition information, there are also a lot of noises that affect the performance of the built model. In order to eliminate the influence of noise or other external factors on the spectrum, we need to preprocess the model to improve the accuracy of model prediction. The Savitsky-Golay convolution smoothing method and multiplicative scatter correction (MSC) are embedded in the software. The former is used for noise removal and smoothing. Since most raw and auxiliary material samples are solid particles, the latter is selected to eliminate the influence of sample surface property differences and particle size.

[0105] (1) Savitsky-Golay convolution smoothing method assumes that the noise contained in the spectrum is zero-mean random white noise. Through multiple measurements, the data is weighted averaged to reduce the noise and improve the signal-to-noise ratio. The average value after smoothing at wavelength k is:

[0106] ;

[0107] In the formula, h i is the smoothing coefficient, H is the normalization factor, H = h i , each measurement value is multiplied by the smoothing coefficient h i The purpose is to minimize the impact of smoothing on useful information. i It can be obtained by polynomial fitting based on the least squares principle.

[0108] (2) Multiplicative scatter correction (MSC) For a spectrum x (1 × m), the specific algorithm of MSC is as follows:

[0109] A. Calculate the average spectrum of the calibration set samples (i.e., the “ideal spectrum”);

[0110] B. Compare x with Perform linear regression, , use the least squares method to find b0 and b;

[0111] C. ;

[0112] The spectrum after denoising and smoothing is band selected. When modeling near-infrared correction, the use of full spectrum calculation will greatly increase the amount of calculation, and the presence of spectral information in certain bands will affect the correlation between key spectral information and index properties. Therefore, it is necessary to select the spectrum band to find the band with strong correlation to the measured properties. The present invention adopts the common method of band selection, the correlation coefficient method. The absorbance value corresponding to each wavelength in the correction set spectrum array is calculated for correlation with the concentration value to be measured. The larger the correlation coefficient, the more information the wavelength contains.

[0113] The correlation coefficient method is to calculate the correlation between the absorbance vector I corresponding to each wavelength in the calibration set spectrum array and the concentration vector y of the component to be measured in the concentration array. The wavelength with a larger absolute value of the corresponding correlation coefficient (or determination coefficient) should have more information. The correlation coefficient R is calculated by the following formula:

[0114] ;

[0115] in, , n is the number of samples for calibration.

[0116] The spectrum after pretreatment and band selection is automatically optimized and modeled using the first-order derivative, SG smoothing, and SNV methods. Qualitative modeling methods include qualitative discriminant modeling, cluster modeling, etc. The present invention uses a cluster analysis method to model the spectrum. The important components of cluster analysis are the distance between samples, the distance between classes, the way of class merging, and the number of clusters. An automatic multi-level release strategy is used to model the calibration set and verification set of the sample spectrum in turn using the first-level discriminant method correlation coefficient method, the second-level discriminant method SMICA method, and the third-level discriminant method SVM method, and the model is stored in the spectral model library. The verification set verifies the model in four situations:

[0117] The primary discrimination method is the similarity coefficient method. After discrimination, the correlation coefficient between the validation set spectrum and the calibration set spectrum of the same material must be above 0.97, and the correlation coefficient with the spectrum of different materials must be below 0.85. Materials that meet the conditions of the correlation coefficient method are successfully discriminated and are the primary release strategy;

[0118] When the correlation coefficient between the validation set spectrum and the calibration set spectrum is below 0.97 and above 0.85, there may be differences in the physical properties or batches of the same material. The system automatically starts the secondary release strategy, that is, establishing a SIMCA (soft independent modeling of class analogy) model to further attribute the material.

[0119] When the correlation coefficient between the validation set spectrum and the calibration set spectrum is below 0.85, the system automatically activates the secondary and tertiary release strategies, that is, further assigning material types through the support vector machine (SVM) model;

[0120] When the three-level release strategies are unable to correctly identify the material, the material is automatically classified as high-risk, the software refuses to allow the material into the warehouse, and recommends traditional chemical methods for further confirmation.

[0121] The similarity coefficient method regards each sample as a point in an m-dimensional space (m variables), and defines the degree of closeness between samples in this m-dimensional space. The similarity coefficient is often expressed as a correlation coefficient:

[0122] ;

[0123] in are the means of all characteristic variables of the i-th and j-th samples respectively. The closer the two samples are, the closer the similarity coefficient between them is to 1 (or -1).

[0124] In the method, the first-level release method is the correlation coefficient method, and the second-level and third-level release methods can be selected as different qualitative discrimination methods according to the properties of the sample, such as the artificial neural network method (ANN), the K nearest neighbor method (KNM), etc.

[0125] The above-mentioned prediction model automatic establishment and optimization processing system automatically establishes and optimizes the prediction model for the sample to be tested through five functional modules, namely, user interaction module, instrument parameter configuration module, spectrum acquisition module, spectrum modeling module, and model storage module. It solves the problem that the traditional modeling method requires a lot of manpower and material resources to collect spectra of various samples during the sample collection process, which is time-consuming and labor-intensive, and has operational errors introduced by personnel, which is bound to cause loss of model accuracy. Spectral automatic modeling does not require excessive human intervention, does not require professional personnel to model, and does not require professional personnel to determine the qualification status of parameters. It can improve the modeling speed, reduce human errors, and facilitate intelligent data management.

[0126] Embodiment 2

[0127] like Figure 2 As shown, this embodiment provides a handheld near-infrared spectrum detection device, including a handheld terminal and a PC terminal, wherein the handheld terminal is connected to the PC terminal via a Bluetooth module;

[0128] Wherein, the handheld terminal comprises a housing, a miniature near-infrared spectrometer integrated in the housing, a controller and a Bluetooth module;

[0129] The controller is connected to the PC terminal via a Bluetooth module to send the sample spectrum data collected by the micro near-infrared spectrometer to the PC terminal;

[0130] The PC terminal analyzes the sample spectrum data.

[0131] The housing is divided into a head and a handheld part; the head is divided into two compartments, a fiber optic probe is fixed in the first compartment; a miniature near-infrared spectrometer is fixed in the second compartment; the handheld part is divided into three compartments, a controller is fixed in the third compartment, the controller is connected to the miniature near-infrared spectrometer; a Bluetooth module is fixed in the fourth compartment, the Bluetooth module is connected to the controller; a power module is fixed in the fifth compartment;

[0132] The head is provided with a spiral switch, and the bottom of the head is a snap-on switch; the handheld part is provided with a power control button and an anti-slip ring.

[0133] The bottom of the handheld part is provided with a cover, and the front end of the head is provided with a threaded cover for connecting the optical fiber probe, so as to facilitate the maintenance of the near-infrared instrument.

[0134] The threaded cover is provided with two layers of slots for connecting the disposable probe cover and the metal protective cover respectively.

[0135] The optical fiber probe is also sleeved with a disposable probe cover.

[0136] The connection between the front end threaded cover and the head shell is also provided with a sealing ring matching the front end threaded cover.

[0137] This implementation provides a handheld near-infrared spectroscopy detection and automatic modeling system, which uses a halogen tungsten lamp as a light source. After collimation, it is irradiated into the sample in direct contact. After transmission, it is collimated again to ensure that the light path is parallel and received by the optical fiber. At this time, the light is a spectrum containing a large amount of sample information, and the optical fiber transmits the spectrum to the spectrometer. The spectrum enters the spectrometer and is split by a MEMS-based Fabro-Perot interferometer to filter out a large amount of stray light. Finally, the indium gallium arsenide photodetector converts the split spectrum into an electrical signal and stores it in the controller. The controller transmits the sample spectrum information to the PC via a Bluetooth module. After receiving the spectral data, the PC converts the format of the spectral data and automatically saves it to the set save path, and forms a spectral image through the human-computer interaction module.

[0138] After the sample data collection is completed, the software system selects the collected data for processing, selects the preprocessing method, eliminates the influence of various factors on the spectral data, and selects the appropriate band for analysis and processing; the preprocessed spectral data selects the appropriate pattern recognition method, that is, the qualitative modeling method, and the sample is modeled by multiple methods and multiple levels. The first-level modeling method is the correlation coefficient method, and the modeling above the second-level modeling can be selected according to the nature of the sample. Different qualitative discrimination methods, such as artificial neural network method (ANN), K nearest neighbor method (KNM), etc.; finally, the multi-level release method is used to discriminate unknown samples. The determination of the pattern recognition method is determined by the type of sample to be tested, and the spectral distance is calculated to filter out-of-bounds sample data; after the automatic modeling process is completed, the system displays the results of each step on the PC through the human-computer interaction module, and the operator judges whether to save or not based on the results. If the results are saved, the corresponding sample information and model are stored together in the storage module on the PC, which is convenient for subsequent calls and viewing. Unknown sample detection can retrieve the established model according to the sample attributes, and bring the spectral data into the model to make qualitative judgments on unknown samples. For the modeling of samples with special needs, this system provides a manual modeling mode, manually selecting the algorithm required for modeling to achieve personalized modeling. It achieves fast and efficient modeling and is suitable for front-line work in modeling a large number of products. Each step is completed with a data bar display. If an error occurs midway, the system will pop up a warning window.

[0139] In this example, the main components selected include: halogen tungsten lamp as light source (model: 997418-21), micro NIR spectrometer (NIRONE1.7), controller (STM32), Bluetooth module (4.0BLE)

[0140] The present invention discloses a handheld near-infrared spectrum detection and automatic modeling system subsystem. The handheld near-infrared spectrum detection hardware system has the overall requirements of compact structure, small size, high portability and shock resistance. In this example, the functional structure of the hardware subsystem includes: (1) collecting spectrometer data and transmitting the data to a computer host through a serial communication interface; (2) receiving computer instructions and executing light source switching.

[0141] The handheld near-infrared spectrum detection hardware system includes: in this example, a shell; a miniature near-infrared spectrometer, a Bluetooth module, a power module, and a controller integrated in the shell; an optical fiber probe and a protective cover; and a disposable probe cover. The optical fiber probe is connected to the near-infrared spectrometer inside the shell; the controller is electrically connected to the near-infrared spectrometer; the Bluetooth module is electrically connected to the controller; the power module is electrically connected to the controller; and the disposable probe cover is applied to the optical fiber probe during spectrum acquisition. In this example, the hardware subsystem uses the STM32 main control chip as the control center. The main control chip and the computer host communicate through a serial communication port. The serial interface is referred to as a serial port. Its characteristics are simple communication lines, and two-way communication can be achieved as long as the Bluetooth module is used. The main control chip can accept instructions from the computer host, such as spectrometer instructions and light source switch instructions. At the same time, the main control chip can also report the raw data collected by the spectrometer to the computer host.

[0142] In this example, the shell is a handheld structure and is divided into two parts: the head and the handheld part. The shell; the optical fiber probe protective cover, threaded cover, and miniature near-infrared spectrometer with optical fiber probe stored in the head are connected in sequence; the controller, Bluetooth module, power supply and bottom cover stored in the handheld part. The shell is provided with a switch button placed on the handheld part; the key switch is used to start and shut down the power supply of the hardware device. There are openable covers at both ends of the shell. The screw cover on the head is used for disassembly of the optical fiber probe and is also convenient for the maintenance of internal instruments; two layers of card slots are set on the edge of the cover, the front layer of the card slot is used for the installation of the disposable probe cover, and the second layer of the card slot is used for the installation of the protective cover; the bottom cover is used for the removal of the battery, and the snap-on cover is used. It is set at the USB connection port for charging the battery. The handheld part of the shell is covered with an anti-slip ring to prevent the instrument from falling during operation; the shell is equipped with an airbag shockproof setting to stabilize the near-infrared spectrometer, including a buffer airbag and a protective pad for double-layer protection, which fits the near-infrared spectrometer tightly. The internal components of portable near-infrared devices are mostly precision instruments. Slight vibrations have a certain impact on the test results. The placement and removal of the instrument during operation can also cause problems with the connection of the internal components. This airbag shockproof setting can well protect the instrument from external influences. Each internal component is divided by a corresponding partition, which divides the interior into five small compartments, namely the near-infrared spectrometer, optical path board, controller, Bluetooth module, and battery.

[0143] In this embodiment, the housing includes: a cover, a front spiral cover, a main body, a bottom cover, and an indicator light on the side, which are connected in sequence. The bottom cover is connected to the handheld part by snapping, and the front threaded cover is connected to the main part by screwing. The head of the device is used to accommodate and fix the installation structure of the micro near-infrared spectrometer and the circuit board. The main body is handheld and can be split into two partitions in the axial direction. The two arc-shaped plates are combined to form a cavity for accommodating a controller, a Bluetooth module, and a battery. The bottom cover is used to seal the bottom of the handheld body. For another example, one end of the housing is provided with a sealing ring that matches the spiral cover. The sealing ring is used to improve the sealing of the cover when it is closed, protect the probe of the micro near-infrared spectrometer, and avoid interference of ambient light on the spectrum acquisition. For another example, the housing is provided with a power button electrically connected to the power control module. The operator starts to power each electronic component and start the device by pressing the power button.

[0144] In this example, the probe end of the near infrared spectrometer is arranged toward the spiral capping.Preferred near infrared spectrometer is a high performance, compact and reliable near infrared spectroscopy sensor.For example, in the present embodiment, the near infrared spectrometer is a spectrometer NIRONE1.7 micro NIR spectrometer, and the NIR spectrometer sensor can be controlled by the user-friendly SensorControl software with the PC end.The replacement of the spectrometer does not cause the linkage of other parts, that is, by transforming the spectrometer, 4 wires (power positive, power negative, serial port receiving end, serial port transmitting end) are drawn out of the existing spectrometer and connected to the XH2.54 female head, and the XH2.54 male head drawn out from the controller is docked, so as to realize the replacement of the spectrometer.

[0145] In this example, the Bluetooth module is electrically connected to the controller. As a relatively common short-range wireless communication module, the Bluetooth communication module can easily achieve wireless connection with the PC terminal. Figure 2 As shown, in this embodiment, the preferred Bluetooth module 4.0BLE is taken as an example, which can be connected to the thousand controllers and realize data transmission with the PC terminal through the Bluetooth module transmission method.

[0146] In this example, the power source includes: a battery as a built-in energy storage component, and a rechargeable battery is selected as the power source of the device. In order to achieve green, environmentally friendly and convenient, the power supply element of the hardware subsystem, that is, the power module, uses a recyclable rechargeable battery, which can obtain electrical energy from the power interface by connecting to an external power source. For example, the power source is a rechargeable battery contained in a housing, and the battery can also be charged through the power interface. A lithium-ion electrochemical battery cell is preferably selected, which has a graphite anode material or a lithium titanate anode material, and a lithium iron phosphate cathode material suitable for rapid recharging of the rechargeable battery, and a battery box for fixing the battery is also provided.

[0147] In this example, the disposable probe cover is used for different samples when the fiber optic probe is used for testing. Figure 2 As shown, the shape and size are made according to the relevant information of the optical fiber probe. When testing, the protective cover of the probe is removed, and the disposable probe cover is installed on the optical fiber probe so that the two fit tightly and are spliced ​​with the first card slot at the front end of the shell to complete the test. As in this embodiment, the disposable probe cover is preferably made of PMMA plastic, which has high optical transmittance and avoids affecting the test results.

[0148] In this example, the controller is electrically connected to the micro near-infrared spectrometer. The controller serves as the driving circuit of the micro near-infrared spectrometer and is used as a control module. In this embodiment, the NanoPi-Neo circuit board can be used to build a driving circuit board. The controller serves as the control center of the hardware subsystem; the controller STM32 and the host computer communicate through the serial communication port, and two-way communication can be achieved as long as the Bluetooth module is used. The controller can accept instructions from the host computer, such as spectrometer instructions and light source switch instructions. At the same time, the controller can also report the raw data collected by the spectrometer to the host computer.

[0149] The STM32 main control chip is used as the main control chip, the specific model is STM32F103C8T6.

[0150] The above-mentioned handheld near-infrared spectrum detection hardware system, as a handheld terminal for sample detection, plays the function of data collection for near-infrared spectrum detection. Among them, the micro near-infrared spectrometer is a small-volume spectrometer, which can compress the occupied space of the entire device, which is conducive to the miniaturization and improvement of the device.

[0151] The miniature near-infrared spectrometer is housed in the housing, and the spectrum collection of the miniature near-infrared spectrometer is controlled by a collection button on the handheld portion of the housing.

[0152] The controller is used to drive the operation of the micro near-infrared spectrometer, and the wireless communication module is used to exchange data with an external PC terminal, thereby setting the acquisition parameters of the micro near-infrared spectrometer and using the PC terminal for data analysis and processing. The rechargeable battery is used as a power supply unit to achieve green, environmentally friendly and efficient energy utilization.

[0153] In addition, each electronic component can be fixed in the housing, which can ensure the working stability and safety of each electronic component.

[0154] Through the above design, a miniature near-infrared spectrometer is used for spectral detection, and a wireless communication module is used to separate the detection parameter acquisition setting and data analysis and processing process from the handheld terminal to an external PC terminal, thereby simplifying the structure of the handheld terminal, reducing its size, and making it lighter to carry, which is conducive to its application and promotion in the detection of pharmaceutical raw materials and auxiliary materials.

[0155] like Figure 2 As shown, the near-infrared spectrum detection system includes a handheld near-infrared spectrum detection device according to any one of the above embodiments, and also includes a PC terminal connected to the handheld near-infrared spectrum detection device.

[0156] In summary, the embodiment of the present invention, based on the micro near-infrared spectrometer NIRONE, provides a special analyzer for spectral detection of pharmaceutical raw materials and auxiliary materials from the two aspects of hardware subsystem and software subsystem. The instrument is connected to an external 220V power supply, and the voltage is converted to the voltage required for the main control chip and other components to work through a switching power supply. The instrument has a compact structure, a small size, and is portable. The software system develops the upper computer and the lower computer software, wherein the upper computer software system designs various functional interfaces, embeds various optimized chemometric methods into the software system, and realizes the automatic establishment and optimization of the predictive spectral detection model.

[0157] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. A handheld near-infrared spectroscopy detection method, characterized in that: include: A handheld near-infrared spectrum detection device is used, including a handheld terminal and a PC terminal, wherein the handheld terminal is connected to the PC terminal via a Bluetooth module; Wherein, the handheld terminal includes a housing, a miniature near-infrared spectrometer integrated in the housing, a controller and a Bluetooth module; The controller is connected to the PC terminal via a Bluetooth module to send the sample spectrum data collected by the micro near-infrared spectrometer to the PC terminal; The PC terminal analyzes the sample spectral data; The methods for automatic modeling of raw materials and auxiliary materials and automatic multi-level release of unknown samples are as follows: Select the spectrum file to be modeled, and divide the sample spectra into calibration set spectra and validation set spectra; the calibration set spectra are used for spectrum modeling, and the validation set spectra are used to verify the performance of the model later; The automatic multi-level release strategy is adopted to model the calibration set spectrum and the verification set spectrum of the sample spectrum in turn through the first-level discrimination method correlation coefficient method, the second-level discrimination method SMICA method and the third-level discrimination method SVM method, and the model is stored in the spectral model library. The verification set spectrum verifies the model in four cases: The primary discrimination method is the correlation coefficient method. After discrimination, the correlation coefficient between the validation set spectrum and the calibration set spectrum of the same material must be above 0.97, and the correlation coefficient with the spectrum of different materials must be below 0.

85. Materials that meet the conditions of the correlation coefficient method are successfully discriminated and are the primary release strategy; When the correlation coefficient between the validation set spectrum and the calibration set spectrum of the same material is below 0.97 and above 0.85, there are physical properties or batch differences of the same material. The system automatically starts the secondary release strategy, that is, establishes a SIMCA model to further attribute the material. When the correlation coefficient between the validation set spectrum and the calibration set spectrum of the same material is below 0.85, the system automatically starts the third-level release strategy, that is, further assigning the material type through SVM; The model judgment of the sample is carried out through a multi-level modeling method. The correlation coefficient method is first used to determine the correlation coefficient of the sample. If it is within the specified range, the sample can be released and meets the model standard. If it is not within the specified range, it will enter the next level of model judgment until the third level judgment is completed. If the model standard is still not met, the material will be automatically classified as high-risk. The software will refuse to allow the material to enter the warehouse and recommend traditional chemical methods for further confirmation.

2. A handheld near-infrared spectroscopy detection method as claimed in claim 1, characterized in that: The shell is divided into a head and a handheld part; the head is divided into two compartments, a fiber optic probe is fixed in the first compartment; a miniature near-infrared spectrometer is fixed in the second compartment; the handheld part is divided into three compartments, a controller is fixed in the third compartment, and the controller is connected to the miniature near-infrared spectrometer; a Bluetooth module is fixed in the fourth compartment, and the Bluetooth module is connected to the controller; a power module is fixed in the fifth compartment; The head is provided with a spiral switch, and the bottom of the head is a snap-on switch; the handheld part is provided with a power control button and an anti-slip ring.

3. A handheld near-infrared spectroscopy detection method as claimed in claim 2, characterized in that: The bottom of the handheld part is provided with a cover, and the front end of the head is provided with a threaded cover for connecting the optical fiber probe, so as to facilitate the maintenance of the near-infrared instrument.

4. A handheld near-infrared spectroscopy detection method as claimed in claim 3, characterized in that: The threaded cover is provided with two layers of slots for connecting the disposable probe cover and the metal protective cover respectively.

5. A handheld near-infrared spectroscopy detection method as claimed in claim 4, characterized in that: The optical fiber probe is also sleeved with a disposable probe cover.

Citation Information

Patent Citations

  • Handheld near infrared spectrum detection system and detection method for quality of fruits and vegetables

    CN106323909A