CNN-assisted adaptive WMS medicine bottle residual oxygen detection method and system

Through the CNN-assisted adaptive WMS bottle residual oxygen detection method, the concentration prediction model is constructed using laser transmission spectral signal and Fourier transform technology, which solves the accuracy and speed problems of traditional detection methods and realizes the oxygen concentration in the bottle High precision, rapid detection, and adapt to different environmental conditions.

CN119023625APending Publication Date: 2024-11-26ANHUI UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411121554.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The traditional residual oxygen detection method of medicine bottles has problems such as unsatisfactory accuracy, slow response speed, easy to be affected by factors such as temperature and pressure, and contact sampling detection can easily cause waste of medicine bottles.

Method used

Using CNN-assisted adaptive WMS drug bottle residual oxygen detection method, the Fourier transform and multiple sets of WMS-2f/1f spectral signal data processing were carried out by obtaining the transmitted light intensity signal of the laser transmitted through the drug bottle of different oxygen concentrations. Concentration prediction model and trained using convolutional neural networks to achieve accurate detection of oxygen concentration.

Benefits of technology

It realizes non-invasive monitoring of the oxygen concentration inside the drug bottle, improves detection accuracy and response speed, can automatically correct and adjust system parameters, adapt to different drug and environmental conditions, and reduces the influence of factors such as temperature and pressure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119023625A_ABST
    Figure CN119023625A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of WMS medicine bottle residual oxygen detection, solves the technical problems that in the prior art, the oxygen content detection precision is not ideal enough, the response speed is low, the detection is easily influenced by factors such as temperature and pressure intensity, and contact type sampling detection easily causes medicine bottle waste, and particularly relates to a CNN-assisted self-adaptive WMS medicine bottle residual oxygen detection method and system. The method comprises the following steps: acquiring transmission signals generated when light emitted by a laser transmits medicine sample bottles with different oxygen concentrations, extracting harmonic signals from the transmission signals, and inputting the harmonic signals into a concentration prediction model for learning and optimizing a detection algorithm in real time so as to improve the accuracy and stability of concentration detection. The oxygen concentration in the medicine bottle can be accurately measured without being influenced by factors such as temperature, pressure intensity and light intensity fluctuation, compared with a traditional method, spectral data can be processed and analyzed in real time, the residual oxygen in the medicine bottle can be adaptively detected according to environmental conditions or sample characteristics, and therefore the detection precision is improved, and the response speed is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of residual oxygen detection for WMS medicine bottles, and in particular to a CNN-assisted adaptive WMS medicine bottle residual oxygen detection method and system. Background Art

[0002] In the pharmaceutical industry, the detection of residual oxygen in medicine bottles is crucial. The oxygen content in medicine bottles is a decisive factor affecting the quality of medicines. The global market demand for medicine bottles has been rising year by year, but factors such as loose sealing of medicine bottles, improper storage methods and damaged packaging often cause oxygen to enter the inside of medicine bottles. The oxygen entering the medicine bottle may react chemically with the medicine, accelerate the degradation and deterioration of the medicine, and seriously threaten the effectiveness and safety of the medicine. Therefore, accurate monitoring and control of residual oxygen in medicine bottles has become one of the key steps to ensure the quality of medicines. Traditional sampling and detection methods have problems such as complex operation, long analysis time, and sample destruction, and it is difficult to achieve high-speed online detection of oxygen concentration. Therefore, it is expected to introduce advanced drug residual oxygen detection methods without destroying the sample. Summary of the invention

[0003] In view of the shortcomings of the prior art, the present invention provides a CNN-assisted adaptive WMS medicine bottle residual oxygen detection method and system, which solves the technical problems of the prior art that the oxygen content detection accuracy is not ideal, the response speed is slow, it is easily affected by factors such as temperature and pressure, and the contact sampling detection easily causes waste of medicine bottles.

[0004] In order to solve the above technical problems, the present invention provides the following technical solutions: a CNN-assisted adaptive WMS medicine bottle residual oxygen detection method, the method comprising the following steps:

[0005] S1, obtaining transmission light intensity signals of light emitted by a laser passing through drug sample bottles with different oxygen concentrations, and converting multiple sets of transmission light intensity signals into transmission spectrum signal data of electrical signals;

[0006] S2, expanding the transmission spectrum signal data into multiple harmonic components by Fourier transform, and selecting WMS-2f / 1f spectrum signal data for inverting the residual oxygen concentration in the drug sample bottle from the multiple harmonic components;

[0007] S3, constructing a concentration prediction model for detecting residual oxygen concentration in a medicine bottle;

[0008] S4, using multiple sets of WMS-2f / 1f spectral signal data to train the concentration prediction model;

[0009] S5. The WMS-2f / 1f spectral signal of the drug sample bottle to be tested is collected through the WMS drug bottle residual oxygen detection system as the input of the concentration prediction model, and finally the oxygen concentration in the drug sample bottle to be tested is obtained.

[0010] Furthermore, in step S1, the range of different oxygen concentrations is 1%-26%, and when the laser passes through drug sample bottles with different oxygen concentrations, drug sample bottles with a concentration interval of 5% and uneven pressure distribution are selected in turn to obtain multiple groups of different transmission light intensity signals.

[0011] Further, in step S1, the laser is a continuously tunable laser with a central wavelength of about 760 nm, and the temperature and current of the laser are controlled by a laser driver so that the output central wavelength of the laser is 760.654 nm.

[0012] Furthermore, in step S2, the specific process includes the following steps:

[0013] S21. Determine the transmitted light intensity I of the light emitted by the laser through the drug sample bottles with different oxygen concentrations based on the Lambert-Beer law. t The expression of (t), that is:

[0014] I t (t)=I0exp[-α(ν)cL]=I0exp[-S(T)g(ν)PcL]

[0015] In the above formula, I0 is the intensity of the incident light; I t (t) is the intensity of the transmitted light; α(ν) is the absorption coefficient of the gas; c is the concentration of the gas to be measured; L is the optical path; S(T) is the absorption intensity of the gas; g(ν) is the linear function of the absorption coefficient, and the Lorentz linear function is selected; P is the pressure of the gas;

[0016] S22, based on the transmitted light intensity I t (t) Expand the gas absorption coefficient α(ν) into a Fourier series, that is:

[0017]

[0018] In the above formula, is the center frequency of the laser wavelength; a is the modulation depth; ω is the modulation frequency; t is the time when the laser is simultaneously acted upon by the low-frequency triangle wave scanning signal and the high-frequency sinusoidal modulation signal; H k represents the k-th order Fourier series expansion coefficient of the absorption coefficient;

[0019] S23, using the phase-locked amplification factor to extract the nth harmonic component S from the transmission spectrum signal data nf , the expression is:

[0020] S nf =[I t (t)·exp(jnωt)]*F

[0021] In the above formula, F is the impulse response function of the low-pass filter; * represents convolution; j is the imaginary unit;

[0022] S24, the first harmonic component S in the transmission spectrum signal data 1f and the second harmonic component S 2f Normalization is performed to obtain the WMS-2f / 1f spectral signal data used for inversion of concentration, and the expression is:

[0023] S 2f / 1f =S 2f / S 1f

[0024] In the above formula, S 2f / 1f It is the WMS-2f / 1f spectral signal data.

[0025] Furthermore, in step S3, the concentration prediction model consists of an input layer for inputting the transmission spectrum signal, a feature extraction layer for extracting multidimensional signal features in the WMS-2f / 1f spectrum signal, a Flatten layer for flattening the multidimensional signal features into a one-dimensional signal feature vector, a fully connected layer for mapping the one-dimensional signal feature vector to the output space, and an output layer for outputting the oxygen concentration corresponding to the sample label.

[0026] Furthermore, the feature extraction layer is a convolution block structure consisting of two convolution layers and one pooling layer. The convolution layer is responsible for extracting multidimensional signal features, and the pooling layer is used to reduce dimensionality and maintain multidimensional signal features. The convolution kernel size is 3, and the number of convolution kernels is 16, 16, 64, 64, 128, 128, 64, and 64 in sequence, and the activation functions are all set to ReLU functions.

[0027] Furthermore, in step S4, the specific process includes the following steps:

[0028] S41. Preselect 5000 training samples, where the sample features are one-dimensional WMS-2f / 1f spectral signals measured at different concentrations, pressures and temperatures, each WMS-2f / 1f spectral signal consists of 1000 sampling points, and the sample label is the oxygen concentration value;

[0029] S42, standardize the input WMS-2f / 1f spectral signal and scale all features to the same scale;

[0030] S43. Input the standardized WMS-2f / 1f spectral signal into the concentration prediction model for training.

[0031] Furthermore, in step S42, the WMS-2f / 1f spectral signal is standardized using a z-score standardization method.

[0032] The technical solution also provides a system for implementing the above-mentioned adaptive WMS medicine bottle residual oxygen detection method, the system comprising:

[0033] A light source module, including a laser driver for controlling the laser temperature and adjusting the laser current, and a laser for generating laser light of a certain wavelength range;

[0034] An optical detection module, including a photoelectric detector for detecting a transmission light intensity signal transmitted through the medicine bottle and converting it into an electrical signal, and a data acquisition card for collecting the detected signal and transmitting it to a host computer communication module;

[0035] Signal processing module: including a modulation program written in LabView for loading triangle wave scanning signals and sine wave modulation signals to the laser; an orthogonal demodulation program written in LabView for extracting harmonic signals from transmission signals;

[0036] Concentration prediction module: including a concentration prediction model for feature extraction and concentration inversion of input harmonic signals;

[0037] Drug sample bottles to be tested: including drug sample bottles with oxygen concentration of 1%-26% for testing.

[0038] By means of the above technical solution, the present invention provides a CNN-assisted adaptive WMS medicine bottle residual oxygen detection method and system, which has at least the following beneficial effects:

[0039] 1. The present invention utilizes the calibration-free wavelength modulation spectroscopy technology CF-WMS combined with the convolutional neural network CNN to perform non-invasive monitoring of the oxygen concentration inside the medicine bottle. It can automatically correct and adjust the system parameters through active learning to adapt to the characteristics and environmental conditions of different drugs, thereby improving the accuracy and sensitivity of residual oxygen detection in the medicine bottle.

[0040] 2. The present invention can accurately measure the oxygen concentration inside the medicine bottle and is not affected by factors such as temperature, pressure, and light intensity fluctuations. Compared with traditional methods, it can process and analyze spectral data in real time and adaptively detect residual oxygen in the medicine bottle according to environmental conditions or sample characteristics, thereby improving detection accuracy and response speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0042] Figure 1 This is a flow chart of the adaptive WMS medicine bottle residual oxygen detection method of the present invention;

[0043] Figure 2It is a network structure diagram of the concentration prediction model of the present invention;

[0044] Figure 3 A concentration gradient diagram predicted by the concentration prediction model of the present invention;

[0045] Figure 4 It is a linear fitting result curve diagram of the predicted concentration and the standard concentration of the present invention;

[0046] Figure 5 This is a schematic diagram of the system composition of the adaptive WMS medicine bottle residual oxygen detection system of the present invention.

[0047] In the figure: 1. Laser controller; 2. Laser; 3. Medicine bottle sample to be tested; 4. Photoelectric detector; 5. Signal acquisition card; 6. Host computer; 7. Signal processing module; 8. Concentration prediction model. DETAILED DESCRIPTION

[0048] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods, so that the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.

[0049] Wavelength modulation spectroscopy (WMS) is a highly sensitive gas detection technology that does not require pre-processing and sampling. It has the advantages of fast, real-time, and non-contact measurement. It is widely used in environmental monitoring, industrial production, medical diagnosis and other fields. At present, most of the gas concentration detection using wavelength modulation technology in China still uses calibration methods. However, in the process of residual oxygen detection in medicine bottles, the spectral deformation caused by changes in background and working conditions and the standard instrument effect of the glass bottle wall make the strict linear relationship between concentration and harmonic disappear, and the harmonic curve of the same bottle of medicine at different times changes to a certain extent, so it is impossible to directly use a proportional relationship. Moreover, the temperature and pressure conditions in the medicine bottle are not fixed during the oxygen concentration detection process. We cannot monitor their changes in real time. If calculated according to fixed temperature and pressure, certain errors will occur and accurate measurements cannot be achieved. Therefore, it is necessary to propose a method to solve the problems existing in the traditional calibration method, which can automatically calibrate and adjust system parameters to adapt to the characteristics and environmental conditions of different medicines and improve the accuracy and sensitivity of residual oxygen detection in medicine bottles.

[0050] In order to solve the technical problems of the invasive oxygen content detection method, such as insufficient detection accuracy, slow response speed, susceptibility to temperature, pressure and other factors, and easy waste of medicine bottles, please refer to Figure 1-Figure 5, shows a specific implementation of this embodiment. This embodiment combines the CNN neural network with the wavelength modulation spectrum. Through a large amount of data training and learning, the detection system can not only accurately measure the oxygen concentration inside the medicine bottle, but also automatically correct and adjust the system parameters to adapt to the characteristics of different medicines and environmental conditions.

[0051] Please refer to Figure 1 This embodiment proposes a CNN-assisted adaptive WMS medicine bottle residual oxygen detection method. Compared with the traditional method, this method integrates a convolutional neural network model and can process and analyze spectral data in real time, thereby improving the detection accuracy and response speed. The method includes the following steps:

[0052] S1. Obtain the transmission light intensity signal of the light emitted by the laser passing through the medicine sample bottles with different oxygen concentrations, and convert multiple groups of transmission light intensity signals into transmission spectrum signal data of electrical signals; in step S1, the range of different oxygen concentrations is 1%-26%, and when the laser passes through the medicine sample bottles with different oxygen concentrations, medicine sample bottles with concentration intervals of 5% and uneven pressure distribution are selected in turn to obtain multiple groups of different transmission light intensity signals, the laser is a continuously tunable laser with a central wavelength of about 760nm, and the temperature and current of the laser are controlled by the laser driver so that the output central wavelength of the laser is 760.654nm. In this embodiment, the transmission light intensity signal is converted into transmission spectrum signal data of the electrical signal by a photoelectric detector.

[0053] S2, the transmission spectrum signal data is expanded into multiple harmonic components by Fourier transform, and the WMS-2f / 1f spectrum signal data for inverting the residual oxygen concentration in the drug sample bottle is selected from the multiple harmonic components; in step S2, when the laser is acted on by the low-frequency triangle wave scanning signal and the high-frequency sine modulation signal at the same time, the instantaneous output frequency of the laser can be expressed as:

[0054] ν(t)=ν+acos(ωt)

[0055] In the above formula, is the center frequency of the laser wavelength; a is the modulation depth; ω is the modulation frequency.

[0056] The laser intensity is modulated by the current, and the output light intensity can be expressed as:

[0057]

[0058] In the above formula, is the average intensity of the laser at the modulation center frequency; i m is the normalized linear intensity modulation amplitude; ψ m is the linear intensity modulation phase shift; m is a positive integer. Therefore, the specific process includes the following steps:

[0059] S21. Determine the transmitted light intensity I of the light emitted by the laser through the drug sample bottles with different oxygen concentrations based on the Lambert-Beer law. t (t), since the absorption of light by oxygen in the vial follows the Lambert-Beer law, the transmitted light intensity I t The expression of (t) is:

[0060] I t (t)=I0 exp[-α(ν)cL]=I0exp[-S(T)g(ν)PcL]

[0061] In the above formula, I0 is the intensity of the incident light; I t (t) is the intensity of the transmitted light; α(ν) is the absorption coefficient of the gas; c is the concentration of the gas to be measured; L is the optical path; S(T) is the absorption intensity of the gas; g(ν) is the linear function of the absorption coefficient, and the Lorentz linear function is selected; P is the pressure of the gas;

[0062] S22, based on the transmitted light intensity I t (t) Expand the gas absorption coefficient α(ν) into a Fourier series, that is:

[0063]

[0064] In the above formula, is the center frequency of the laser wavelength; a is the modulation depth; ω is the modulation frequency; t is the time when the laser is simultaneously acted upon by the low-frequency triangle wave scanning signal and the high-frequency sinusoidal modulation signal; H k represents the k-th order Fourier series expansion coefficient of the absorption coefficient;

[0065] S23, using the phase-locked amplification factor to extract the nth harmonic component S from the transmission spectrum signal data nf , the expression is:

[0066] S nf =[I t (t)·exp(jnωt)]*F

[0067] In the above formula, F is the impulse response function of the low-pass filter; * represents convolution; j is the imaginary unit;

[0068] S24, the first harmonic component S in the transmission spectrum signal data 1f and the second harmonic component S 2f Normalization is performed to obtain the WMS-2f / 1f spectral signal data used for inversion of concentration, where the transmitted light intensity I t The first and second harmonic components of (t) can be expressed as S 1f and S 2f , by adding S 2fWith S 1f Normalization can eliminate the influence of the incident light intensity I0 and realize wavelength modulation spectroscopy (WMS) without calibration. The expression is:

[0069] S 2f / 1f =S 2f / S 1f

[0070] In the above formula, S 2f / 1f It is the WMS-2f / 1f spectral signal data.

[0071] When the oxygen in the medicine bottle absorbs the light emitted by the laser, the intensity of the transmitted light I t (t) is received and collected by the photodetector, and the optical signal is converted into an electrical signal. The photodetector is connected to the acquisition card, which transmits the collected transmission spectrum signal to the upper computer signal processing module, and the demodulation program written in LabVIEW demodulates the signal. That is, firstly, the 200 sets of transmission spectrum signals collected are averaged to reduce the influence of random noise, and then two phase differences are used to calculate the average transmission spectrum signal. The reference signal with an amplitude of 1V and a frequency twice that of the modulation signal is multiplied by the averaged transmission spectrum signal to obtain two WMS-2f signals. The noise is then processed through a low-pass filter, and the square sum of the filtered signal is taken. Finally, the signal is taken the square root to obtain the orthogonal WMS-2f signal. Similarly, when the reference signal frequency is the same as the modulation signal, a WMS-1f signal can be obtained. The ratio of the two signals is the WMS-2f / 1f signal used to invert the concentration.

[0072] S3. Construct a concentration prediction model for detecting the residual oxygen concentration in the medicine bottle; the concentration prediction model consists of an input layer for inputting the transmission spectrum signal, a feature extraction layer for extracting multidimensional signal features in the WMS-2f / 1f spectrum signal, a Flatten layer for flattening the multidimensional signal features into a one-dimensional signal feature vector, a fully connected layer for mapping the one-dimensional signal feature vector to the output space, and an output layer for outputting the oxygen concentration corresponding to the sample label; the feature extraction layer consists of a convolution block structure consisting of two convolution layers and one pooling layer. The convolution layer is responsible for extracting multidimensional signal features, and the pooling layer is used for dimensionality reduction and maintaining multidimensional signal features. The convolution kernel size is 3, and the number of convolution kernels is 16, 16, 64, 64, 128, 128, 64, 64 in order, and the activation functions are all set to ReLU functions.

[0073] like Figure 2 As shown in the figure, it is the network structure diagram of the concentration prediction model, which is as follows:

[0074] Input layer: receives the original WMS-2f / 1f spectral signal as the starting point of the entire processing flow.

[0075] Feature extraction layer (Blocks 1-4): Each feature extraction layer consists of two convolutional layers (Conv) and a pooling layer, and each convolutional layer is followed by a ReLU activation function. These convolutional layers are responsible for gradually extracting multidimensional signal features from WMS-2f / 1f spectral signals. Multiple convolutional layers and pooling layers are used to extract multidimensional signal features from WMS-2f / 1f spectral signals, and regression prediction is performed through a fully connected layer. The activation function is a linear function.

[0076] Flatten layer: After all the convolutional block structures, the data is flattened, that is, the multi-dimensional input is converted to one dimension so that it can be input into the fully connected layer (Dense).

[0077] Fully connected layer (Dense): Also known as a densely connected layer, it receives the one-dimensional signal feature vector output by the Flatten layer and maps it to the final output space. This layer is usually used for category prediction in classification tasks or continuous value prediction in regression tasks.

[0078] Output layer: Outputs the oxygen concentration corresponding to the sample label.

[0079] In this embodiment, the concentration prediction model uses mean squared error (MSE) as the loss function. MSE is the most common loss function in regression problems, with simple calculation and good convergence effect. In addition to the loss function, the custom determination coefficient R 2 As an evaluation metric, it helps measure the model's ability to explain the prediction of signal data, especially when dealing with specific signal data.

[0080] S4, using multiple groups of WMS-2f / 1f spectral signal data to train the concentration prediction model; in step S4, the specific process includes the following steps:

[0081] S41. Preselect 5000 training samples. The sample features are one-dimensional WMS-2f / 1f spectral signals measured at different concentrations, pressures and temperatures. Each WMS-2f / 1f spectral signal consists of 1000 sampling points, and the sample label is the oxygen concentration value.

[0082] S42, standardize the input WMS-2f / 1f spectral signal and scale all features to the same scale. This embodiment adopts the z-score standardization method, which can eliminate the influence of dimension, make the weights of different features more balanced, reduce overfitting, and improve the generalization ability of the model;

[0083] S43, input the standardized WMS-2f / 1f spectral signal into the concentration prediction model for training; save the trained model as the concentration prediction model, save the WMS-2f / 1f signals collected at different concentrations, input the signals into the convolutional neural network for training, and use the trained model for residual oxygen concentration detection in the medicine bottle. Finally, the WMS-2f / 1f spectral signal collected in the experiment is subjected to feature extraction, recognition and prediction in the concentration prediction model, and the oxygen concentration in the bottle is output through the concentration prediction model.

[0084] S5. The WMS-2f / 1f spectrum signal of the drug sample bottle to be tested is collected through the WMS drug bottle residual oxygen detection system as the input of the concentration prediction model, and finally the oxygen concentration in the drug sample bottle to be tested is obtained. The predicted concentration gradient diagram is as follows: Figure 3 As shown, it can be seen that the system has high repeatability and stability in the concentration inversion; the linear fitting results of the predicted concentration and the standard concentration are shown in Figure 4 As shown in Figure 2, it describes the dependence between the predicted concentration and the standard concentration. The results show that there is a strong linear response between the two, and the determination coefficient R 2 is 0.9988.

[0085] The present invention can accurately measure the oxygen concentration inside a medicine bottle and is not affected by factors such as temperature, pressure, and light intensity fluctuations. Compared with traditional methods, it can process and analyze spectral data in real time and adaptively detect residual oxygen in the medicine bottle according to environmental conditions or sample characteristics, thereby improving detection accuracy and response speed.

[0086] Corresponding to the adaptive WMS medicine bottle residual oxygen detection method proposed in this embodiment, Figure 5 As shown, this embodiment also proposes a CNN-assisted adaptive WMS medicine bottle residual oxygen detection system, which includes:

[0087] The light source module includes a laser driver 1 for controlling the laser temperature and adjusting the laser current, and a laser 2 for generating lasers in a certain wavelength range. The output center wavelength is 760.654nm. The signal acquisition card 5 and the LabView self-made modulation program work together to output a triangular wave scanning signal and superimpose a sine wave modulation signal to load it into the laser 1.

[0088] The optical detection module includes a photoelectric detector 4 for detecting the transmission light intensity signal passing through the medicine bottle and converting it into an electrical signal, and a data acquisition card 5 for collecting the detected signal and transmitting it to the communication module of the host computer 6; specifically, the drug sample bottle 3 to be tested is placed so that the light emitted by the laser 1 passes through the drug sample bottle 3 to be tested and is received and collected by the photoelectric detector 4, the photoelectric detector 4 is connected to the data acquisition card 5, and the data acquisition card 5 transmits the collected transmission spectrum signal to the signal processing module of the host computer 6. After each collection cycle, the next medicine bottle is replaced.

[0089] Signal processing module: including a modulation program written in LabView for loading a triangle wave scanning signal and a sine wave modulation signal to the laser 1; an orthogonal demodulation program written in LabView for extracting harmonic signals from the transmission signal; in the signal processing module 7, the modulation program written in LabVIEW is used to provide a low-frequency scanning voltage and a high-frequency modulation voltage signal to the laser 1 through the data acquisition card 5 and the laser controller 2; at the same time, the orthogonal demodulation program written in LabVIEW is used for demodulation. The demodulation process requires the original transmission spectrum signal data to be expanded into multiple harmonic components through Fourier transform. The orthogonal demodulation program written in LabView processes the collected signal and can obtain the WMS-2f / 1f spectrum signal for inverting the oxygen concentration in real time. The WMS-2f / 1f spectrum signal is selected as the spectrum signal for CNN neural network training and inversion concentration, which can eliminate the influence of light intensity fluctuation on the prediction results.

[0090] Concentration prediction module: including a concentration prediction model 8 for feature extraction and concentration inversion of input harmonic signals;

[0091] Drug sample bottles to be tested: including drug sample bottles 3 with oxygen concentration of 1%-26% for testing.

[0092] In this embodiment, the laser controller 1 is connected to the laser 2, the output end of the data acquisition card 5 is connected to the laser controller 1 for inputting modulation information, the photodetector 4 is connected to the input end of the digital acquisition card 5, the laser 1 and the photodetector 4 are respectively placed on both sides of the medicine bottle 3 to be tested, the data acquisition card 5 is connected to the host computer 6 and the collected signal is input into the host computer 6, and the collected signal is analyzed by the signal processing module 7 and the concentration prediction model 8.

[0093] Connect the above system, turn on the power of the laser driver, laser, detector, acquisition card, and computer modules, and prepare the sample of the medicine bottle to be tested filled with standard gas with a concentration of 1%-26% (concentration interval is 5%, and pressure distribution is uneven). The temperature and current of the laser 2 are controlled by the laser controller 1 to make the output center wavelength of the laser 1 at 760.654nm, and then the data acquisition card 5 collects the transmission spectrum signal converted by the photodetector 4 and transmits it to the host computer 6, and the signal processing module 7 processes it to obtain a one-dimensional WMS-2f / 1f spectrum signal, and finally the concentration prediction model 8 outputs the oxygen concentration in the medicine bottle 3 to be tested.

[0094] The present invention utilizes the calibration-free wavelength modulation spectroscopy technology CF-WMS combined with the convolutional neural network CNN to perform non-invasive monitoring of the oxygen concentration inside the medicine bottle. It can automatically correct and adjust the system parameters through active learning to adapt to the characteristics and environmental conditions of different drugs, thereby improving the accuracy and sensitivity of residual oxygen detection in the medicine bottle.

[0095] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, so the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0096] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the above embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0097] The above implementation methods have been described in detail. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A CNN-assisted adaptive WMS medicine bottle residual oxygen detection method, characterized in that: The method comprises the following steps: S1, obtaining transmission light intensity signals of light emitted by a laser passing through drug sample bottles with different oxygen concentrations, and converting multiple sets of transmission light intensity signals into transmission spectrum signal data of electrical signals; S2, expanding the transmission spectrum signal data into multiple harmonic components by Fourier transform, and selecting WMS-2f / 1f spectrum signal data for inverting the residual oxygen concentration in the drug sample bottle from the multiple harmonic components; S3, constructing a concentration prediction model for detecting residual oxygen concentration in a medicine bottle; S4, using multiple sets of WMS-2f / 1f spectral signal data to train the concentration prediction model; S5. The WMS-2f / 1f spectral signal of the drug sample bottle to be tested is collected through the WMS drug bottle residual oxygen detection system as the input of the concentration prediction model, and finally the oxygen concentration in the drug sample bottle to be tested is obtained.

2. The adaptive WMS medicine bottle residual oxygen detection method according to claim 1 is characterized in that: In step S1, the range of different oxygen concentrations is 1%-26%, and when the laser passes through drug sample bottles with different oxygen concentrations, drug sample bottles with a concentration interval of 5% and uneven pressure distribution are selected in turn to obtain multiple groups of different transmission light intensity signals.

3. The adaptive WMS medicine bottle residual oxygen detection method according to claim 1 is characterized in that: In step S1, the laser is a continuously tunable laser with a central wavelength of about 760 nm, and the temperature and current of the laser are controlled by a laser driver so that the output central wavelength of the laser is 760.654 nm.

4. The adaptive WMS medicine bottle residual oxygen detection method according to claim 1, characterized in that: In step S2, the specific process includes the following steps: S21. Determine the transmitted light intensity I of the light emitted by the laser through the drug sample bottles with different oxygen concentrations based on the Lambert-Beer law. t The expression of (t), that is: I t (t)=I0exp[-α(ν)cL]=I0exp[-S(T)g(ν)PcL] In the above formula, I0 is the intensity of the incident light; I t (t) is the intensity of the transmitted light; α(ν) is the absorption coefficient of the gas; c is the concentration of the gas to be measured; L is the optical path; S(T) is the absorption intensity of the gas; g(ν) is the linear function of the absorption coefficient; P is the pressure of the gas; S22, based on the transmitted light intensity I t (t) Expand the gas absorption coefficient α(ν) into a Fourier series, that is: In the above formula, is the center frequency of the laser wavelength; a is the modulation depth; ω is the modulation frequency; t is the time when the laser is simultaneously acted upon by the low-frequency triangle wave scanning signal and the high-frequency sinusoidal modulation signal; H k represents the k-order Fourier series expansion coefficient of the absorption coefficient; S23, using the phase-locked amplification factor to extract the nth harmonic component S from the transmission spectrum signal data nf , the expression is: S nf =[I t (t)·exp(jnωt)]*F In the above formula, F is the impulse response function of the low-pass filter; * represents convolution; j is the imaginary unit; S24, the first harmonic component S in the transmission spectrum signal data 1f and the second harmonic component S 2f Normalization is performed to obtain the WMS-2f / 1f spectral signal data used for inversion of concentration, and the expression is: S 2f / 1f =S 2f / S 1f In the above formula, S 2f / 1f It is the WMS-2f / 1f spectral signal data.

5. The adaptive WMS medicine bottle residual oxygen detection method according to claim 1 is characterized in that: In step S3, the concentration prediction model consists of an input layer for inputting the transmission spectrum signal, a feature extraction layer for extracting multidimensional signal features in the WMS-2f / 1f spectrum signal, a Flatten layer for flattening the multidimensional signal features into a one-dimensional signal feature vector, a fully connected layer for mapping the one-dimensional signal feature vector to the output space, and an output layer for outputting the oxygen concentration corresponding to the sample label.

6. The adaptive WMS medicine bottle residual oxygen detection method according to claim 5 is characterized in that: The feature extraction layer consists of a convolution block structure consisting of two convolution layers and one pooling layer. The convolution layer is responsible for extracting multi-dimensional signal features, and the pooling layer is used to reduce dimensionality and maintain multi-dimensional signal features. The convolution kernel size is 3, and the number of convolution kernels is 16, 16, 64, 64, 128, 128, 64, and 64 in sequence, and the activation functions are all set to ReLU functions.

7. The adaptive WMS medicine bottle residual oxygen detection method according to claim 1, characterized in that: In step S4, the specific process includes the following steps: S41. Preselect 5000 training samples, where the sample features are one-dimensional WMS-2f / 1f spectral signals measured at different concentrations, pressures and temperatures, each WMS-2f / 1f spectral signal consists of 1000 sampling points, and the sample label is the oxygen concentration value; S42, standardize the input WMS-2f / 1f spectral signal and scale all features to the same scale; S43. Input the standardized WMS-2f / 1f spectral signal into the concentration prediction model for training.

8. The adaptive WMS medicine bottle residual oxygen detection method according to claim 7 is characterized in that: In step S42, the WMS-2f / 1f spectral signal is standardized using the z-score standardization method.

9. A system for implementing the adaptive WMS medicine bottle residual oxygen detection method according to any one of claims 1 to 8, characterized in that: The system includes: A light source module, including a laser driver for controlling the laser temperature and adjusting the laser current, and a laser for generating laser light of a certain wavelength range; An optical detection module, including a photoelectric detector for detecting a transmission light intensity signal transmitted through the medicine bottle and converting it into an electrical signal, and a data acquisition card for collecting the detected signal and transmitting it to a host computer communication module; Signal processing module: including a modulation program written in LabView for loading triangle wave scanning signals and sine wave modulation signals to the laser; an orthogonal demodulation program written in LabView for extracting harmonic signals from transmission signals; Concentration prediction module: including a concentration prediction model for feature extraction and concentration inversion of input harmonic signals; Drug sample bottles to be tested: including drug sample bottles with oxygen concentration of 1%-26% for testing.

Citation Information

Cited By

  • TDLAS intravenous medication concentration prediction method based on one-dimensional convolutional neural network

    CN119479986A

  • Method and system for controlling sterile filling process for nitrogen filling protection of midazolam oral liquid

    CN120864427A

  • Gas detection device and method, terminal equipment and storage medium

    CN122505813A