Sterile water safety monitoring method and system based on hyperspectral imaging and medium
By using hyperspectral imaging technology to achieve specific identification and real-time monitoring of live microorganisms on microfluidic chips, the problem of long detection cycles and inability to monitor in real time in sterile water systems has been solved, improving detection sensitivity and reducing false alarm rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SICHUAN HONGYE XINCHUANG TECHNOLOGY CO LTD
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-19
Smart Images

Figure CN122238243A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sterile water safety monitoring technology, and more specifically, to a method, system, and medium for sterile water safety monitoring based on hyperspectral imaging. Background Technology
[0002] In the field of microbial safety monitoring of sterile water preparation and distribution systems in biopharmaceuticals, current industry standards still primarily rely on offline culture methods. This requires sterile water samples to be filtered through a membrane or cultured in a specific medium for 7 to 14 days, with the degree of contamination determined by manually counting colony-forming units. This traditional method suffers from fundamental flaws, including excessively long detection cycles and the inability to provide real-time warnings. As a result, microbial contamination events during production are often only detected several days later, easily leading to serious quality incidents such as the scrapping of entire batches of drugs, production line shutdowns, and even product recalls. While existing improved technologies, such as adenosine triphosphate (ATP) fluorescence detection, can shorten the detection time to 24 hours, they cannot distinguish between live and dead bacteria and are easily affected by chemical matrices. Online total organic carbon analyzers, although capable of continuous monitoring, only reflect the overall organic matter content and lack the ability to identify specific microorganisms. Turbidity and impedance methods have a detection sensitivity of only 10 for low concentrations of microorganisms. 3 The concentration is in the CFU / mL range, far from reaching the 10⁻ level of sterile water. 6 Quality control requirements for CFU / mL. These techniques all employ indirect inference strategies and lack the ability to directly target and identify the metabolic activity of live microorganisms. Summary of the Invention
[0003] The purpose of this invention is to provide a method, system, and medium for monitoring the safety of sterile water based on hyperspectral imaging, in order to improve the aforementioned problems. To achieve the above objective, the technical solution adopted by this invention is as follows: In a first aspect, this application provides a method for monitoring the safety of sterile water based on hyperspectral imaging, comprising: Acquire multi-dimensional monitoring data streams of a microfluidic chip-based sterile water system. These multi-dimensional monitoring data streams include continuous hyperspectral image sequences, time-series data of microenvironment chemical parameters, and fluid dynamic parameters. The hyperspectral image sequences cover the 400-1000 nm wavelength band. Based on hyperspectral image sequences and fluid dynamic parameters, the microfluidic channel structure partitioning module is invoked to divide the background region, edge region, and central enrichment region formed by hydrodynamic focusing effect according to the flow velocity field distribution. Non-negative matrix decomposition spectral unmixing is performed on the central enrichment region to extract the endmember spectral features of pure substances. At the same time, local binary mode spatial texture encoding is performed on the endmembers. The unmixed spectral vector and texture encoding features are fused by outer product to generate the spectral-spatial joint feature matrix of the microbial enrichment region. By integrating the spectral-spatial joint feature matrix with time-series data of microenvironment chemical parameters, the sliding time window storage module is called to accumulate historical normal operating condition features, a historical feature buffer is constructed, and Mahalanobis distance iterative clustering analysis is performed on the buffer data to establish a normal distribution probability density model. The model parameters are dynamically updated by exponential weighted moving average, thereby constructing an adaptive baseline spectral feature library. Load the adaptive baseline spectral feature library and the real-time spectral-spatial joint feature matrix, call the multi-scale Gaussian kernel function to calculate the feature deviation distribution, extract the multi-scale feature deviation statistics, and input the statistics into the softmax probability evaluation network to perform classification operation, and output the microbial contamination discrimination index vector; The microbial contamination discrimination index vector is coupled with fluid dynamic parameters, the flow velocity-contamination weight mapping relationship is imported by calling the graded judgment module, and three-level warning thresholds are set. Fuzzy logic reasoning is then performed to finally generate real-time safety status information of the sterile water system.
[0004] Preferably, based on hyperspectral image sequences and fluid dynamic parameters, the microfluidic channel structure partitioning module is invoked to divide the region into a background region, an edge region, and a central enrichment region formed by hydrodynamic focusing effect according to the velocity field distribution. Non-negative matrix factorization spectral unmixing is performed on the central enrichment region to extract pure substance endmember spectral features. Simultaneously, local binary mode spatial texture encoding is performed on the endmembers. The unmixed spectral vector and the texture-encoded features are then fused by an outer product to generate a spectral-spatial joint feature matrix of the microbial enrichment region, including: The Reynolds number is calculated based on the flow velocity and channel hydraulic diameter in the fluid dynamics parameters. When the Reynolds number is less than 2000, it is determined to be a laminar flow state. Then, based on the laminar flow hydrodynamic focusing theory, the channel is divided into: a background zone of 0-20 micrometers near the wall, an edge zone of 20-80 micrometers, and a central enrichment zone of 80-120 micrometers. The central enrichment zone is the key area for microbial concentration and accumulation. A nonnegative matrix factorization algorithm is applied to the hyperspectral subcube of the central enrichment region to decompose the subcube into an endmember matrix and an abundance matrix. Each column of the endmember matrix represents the spectrum of a pure substance, including at least three endmembers: microbial cell scattering spectrum, fluorescein diacetate fluorescent indicator spectrum, and background water Raman spectrum. Each row of the abundance matrix corresponds to the spatial distribution of each endmember. The number of iterations is set to 500, and the process terminates when the reconstruction error is less than 0.001. Through this decomposition, interpretable material composition spectra and spatial distributions are obtained. Local binary mode texture encoding was performed on the spatial distribution map corresponding to microbial endmembers in the abundance matrix. The neighborhood radius was set to 3 pixels and the number of sampling points was 8. An 8-bit binary texture feature vector was generated. The outer product operation was performed on the spectral vector of the microbial endmembers in the endmember matrix and the texture feature vector. The calculation formula is as follows: In the formula, M is a spectral-spatial joint feature matrix with dimensions of 256×8. This represents the spectral vector of microbial endmembers. This is a local binary pattern texture feature vector.
[0005] Preferably, the fused spectral-spatial joint feature matrix and microenvironment chemical parameter time-series data are used to accumulate historical normal operating condition features by calling a sliding time window storage module, constructing a historical feature buffer, and performing Mahalanobis distance iterative clustering analysis on the buffer data to establish a normal distribution probability density model. The model parameters are then dynamically updated using exponential weighted moving averages, thereby constructing an adaptive baseline spectral feature library, which includes: The sliding time window length is set to 7 days and the step size is 1 day. The spectral-spatial joint feature matrix sequence and the corresponding chemical parameter mean under normal operating conditions within the time window are stored in the circular buffer to form a historical feature buffer. This buffer retains the normal data of the most recent 30 days for baseline learning. The mean matrix and covariance matrix are calculated for all feature matrices in the historical feature buffer. For each new feature matrix, the Mahalanobis distance from the baseline is calculated. After removing outliers whose Mahalanobis distance is greater than 3 times the standard deviation, the new mean matrix and covariance matrix are calculated iteratively. After 10 iterations and convergence, a normal distribution probability density model is established. The baseline parameters are dynamically updated using an exponentially weighted moving average mechanism.
[0006] Preferably, the process involves loading the adaptive baseline spectral feature library and the real-time spectral-spatial joint feature matrix, calling a multi-scale Gaussian kernel function to calculate the feature bias distribution, extracting multi-scale feature bias statistics, and inputting the statistics into a softmax probability evaluation network to perform classification operations, outputting a microbial contamination discrimination index vector, including: Load the current mean matrix and covariance matrix from the adaptive baseline spectral feature library, call the Gaussian kernel function on the real-time spectral-spatial joint feature matrix, set the three scale parameters to 0.5, 1.0 and 2.0 respectively, calculate the feature deviation distributions with three different smoothing degrees, and generate multi-scale deviation feature vectors; Perform a chi-square statistical test on the bias feature at each scale, and calculate the chi-square statistic, which is equal to the square of the bias feature. The chi-square statistic approximately follows a chi-square distribution with degrees of freedom as the feature dimension. Calculate the contamination probability by subtracting the value of the chi-square cumulative distribution function at the chi-square statistic and degrees of freedom from 1. The chi-square cumulative distribution function is the integral of the chi-square probability density function, with degrees of freedom as the feature dimension. Input the contamination probability vectors of the three scales into the softmax probability evaluation network.
[0007] Secondly, this application also provides a sterile water safety monitoring system based on hyperspectral imaging, comprising: Acquisition module: used to acquire multi-dimensional monitoring data streams of the microfluidic chip sterile water system, including continuous hyperspectral image sequences, time-series data of microenvironment chemical parameters, and fluid dynamic parameters. The hyperspectral image sequences cover the 400-1000nm wavelength band. Extraction and Fusion Module: Based on hyperspectral image sequences and fluid dynamic parameters, it calls the microfluidic channel structure partitioning module to divide the background area, edge area, and central enrichment area formed by hydrodynamic focusing effect according to the flow velocity field distribution. Non-negative matrix decomposition spectral unmixing is performed on the central enrichment area to extract the endmember spectral features of pure substances. At the same time, local binary mode spatial texture encoding is performed on the endmembers. The unmixed spectral vector and texture encoding features are fused by outer product to generate the spectral-spatial joint feature matrix of the microbial enrichment region. The construction module is used to fuse the spectral-spatial joint feature matrix with the time series data of microenvironment chemical parameters, call the sliding time window storage module to accumulate historical normal operating condition features, build a historical feature buffer, perform Mahalanobis distance iterative clustering analysis on the buffer data, establish a normal distribution probability density model, and perform exponential weighted moving average dynamic update on the model parameters, thereby building an adaptive baseline spectral feature library. The output module is called to load the adaptive baseline spectral feature library and the real-time spectral-spatial joint feature matrix, call the multi-scale Gaussian kernel function to calculate the feature bias distribution, extract the multi-scale feature bias statistics, input the statistics into the softmax probability evaluation network to perform classification operations, and output the microbial contamination discrimination index vector. The coupling setting module is used to couple the microbial contamination discrimination index vector with the fluid dynamics parameters, call the graded judgment module to import the flow velocity-contamination weight mapping relationship, set three-level warning thresholds, perform fuzzy logic reasoning, and finally generate real-time safety status information of the sterile water system.
[0008] Thirdly, this application also provides a sterile water safety monitoring device based on hyperspectral imaging, comprising: Memory, used to store computer programs; A processor is used to implement the steps of the hyperspectral imaging-based sterile water safety monitoring method when executing the computer program.
[0009] Fourthly, this application also provides a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for monitoring the safety of sterile water based on hyperspectral imaging.
[0010] The beneficial effects of this invention are as follows: This invention achieves multi-dimensional synchronous acquisition of microenvironmental chemical parameters such as flow rate, pressure, temperature, dissolved oxygen, redox potential, and pH by using a microfluidic chip wall-mounted microsensor array and an electrochemical microelectrode array. It also employs hyperspectral push-broom imaging to acquire microbial metabolic fingerprints in the 400-1000nm band, overcoming the shortcomings of traditional offline culture methods, such as long cycles and limited information. Furthermore, it determines the laminar flow state based on Reynolds number and delineates the hydrodynamic focusing center enrichment zone, enabling efficient enrichment of microorganisms in the central flow layer, significantly improving detection sensitivity, and solving the problem of insufficient detection limits in existing online methods.
[0011] This invention also employs nonnegative matrix decomposition to extract the spectral endmembers of fluorescein diacetate fluorescent indicator, combines local binary pattern texture encoding to capture the spatial aggregation morphology of live bacteria, and constructs a spectral-spatial joint feature matrix through outer product fusion, thereby achieving specific identification of the metabolic activity of live microorganisms and effectively distinguishing dead bacteria from inorganic particle interference. A sliding time window historical feature buffer is established, outlier contaminant samples are eliminated through Mahalanobis distance iterative clustering, and baseline parameters are dynamically updated using exponential weighted moving average. The forgetting factor adaptively tracks system drift, eliminating the influence of reagent batch differences and temperature fluctuations, and maintaining long-term operational stability.
[0012] This invention introduces a multi-scale Gaussian kernel function and a chi-square test to calculate feature bias, inputs it into a softmax network, and outputs a normalized discriminant index to improve classification accuracy. Finally, it dynamically suppresses false positives of high flow velocity through a flow velocity-pollution weight mapping function, and generates four levels of safety status information by combining three-level warning thresholds and fuzzy logic reasoning to achieve real-time response and effectively reduce the false alarm rate.
[0013] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing embodiments of the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a schematic diagram of the process of the sterile water safety monitoring method based on hyperspectral imaging as described in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of the aseptic water safety monitoring system based on hyperspectral imaging as described in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of the sterile water safety monitoring device based on hyperspectral imaging as described in an embodiment of the present invention.
[0016] In the diagram: 701, Acquisition module; 702, Extraction and fusion module; 703, Construction module; 704, Call output module; 705, Coupling setting module; 800, Aseptic water safety monitoring device based on hyperspectral imaging; 801, Processor; 802, Memory; 803, Multimedia component; 804, I / O interface; 805, Communication component. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0018] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance. Example 1:
[0019] This embodiment provides a method for monitoring the safety of sterile water based on hyperspectral imaging.
[0020] See Figure 1 The figure shows that the method includes steps S100, S200, S300, S400 and S500.
[0021] S100: Acquire multi-dimensional monitoring data streams of the microfluidic chip sterile water system, including continuous hyperspectral image sequences, time-series data of microenvironment chemical parameters, and fluid dynamic parameters, wherein the hyperspectral image sequences cover the 400-1000nm band.
[0022] It is understood that step S100 includes S101, S102, and S103, wherein: S101. Through a micro-sensor array integrated into the channel wall of the microfluidic chip, the flow rate, pressure and temperature of sterile water at three cross sections at the channel inlet, central enrichment section and outlet are collected simultaneously. The flow rate is measured by a thermal flow meter at a frequency of 100 Hz and the pressure is measured by a piezoresistive micro pressure sensor at a frequency of 50 Hz. S102. A push-broom hyperspectral imager is used to continuously scan the central enrichment segment of the microfluidic chip to acquire a hyperspectral image cube with a wavelength range of 400-1000 nm, 256 bands, and a spatial resolution of 5 μm. The sampling frequency is set to acquire 1 frame every 10 seconds. S103. The time-series data of three chemical parameters—dissolved oxygen, redox potential, and pH value—acquired by the electrochemical microelectrode array integrated at the bottom of the microfluidic chip are synchronized with the hyperspectral image cube through a timestamp alignment mechanism to construct a multi-dimensional monitoring data stream, which serves as the input source for subsequent steps.
[0023] S200: Based on hyperspectral image sequences and fluid dynamic parameters, the microfluidic channel structure partitioning module is called to divide the background region, edge region, and central enrichment region formed by hydrodynamic focusing effect according to the flow velocity field distribution. Non-negative matrix decomposition spectral unmixing is performed on the central enrichment region to extract the endmember spectral features of pure substances. At the same time, local binary mode spatial texture encoding is performed on the endmembers. The unmixed spectral vector and texture encoding features are fused by outer product to generate the spectral-spatial joint feature matrix of the microbial enrichment region.
[0024] It is understood that step S200 includes S201, S202, and S203, wherein: S201. Calculate the Reynolds number based on the flow velocity and channel hydraulic diameter in the fluid dynamics parameters. When the Reynolds number is less than 2000, it is determined to be a laminar flow state. Then, based on the laminar flow hydrodynamic focusing theory, the channel is divided into: a background zone of 0-20 micrometers near the wall, an edge zone of 20-80 micrometers, and a central enrichment zone of 80-120 micrometers. The central enrichment zone is the key area for microbial concentration and accumulation. It should be noted that the laminar flow state is accurately determined by calculating the Reynolds number, and the active enrichment of microorganisms is achieved by utilizing the hydrodynamic focusing effect at the microscale. When the fluid is in laminar flow, the shear force is stable and controllable. The injected microbial particles migrate to the central axis region of the channel under the balance of inertial and viscous forces, forming a high-concentration aggregation zone. This physical enrichment method does not require chemical trapping agents, avoids the introduction of external interference, and significantly improves the signal-to-noise ratio of subsequent spectral detection. Dividing the channel into a background region, an edge region, and a central enrichment region can effectively isolate near-wall light scattering interference and shear layer signal fluctuations, making the detection target area clearer and significantly reducing computational complexity.
[0025] S202. Apply a nonnegative matrix factorization algorithm to the hyperspectral subcube of the central enrichment region to decompose the subcube into an endmember matrix and an abundance matrix. Each column of the endmember matrix represents the spectrum of a pure substance, including at least three endmembers: microbial cell scattering spectrum, fluorescein diacetate fluorescent indicator spectrum, and background water Raman spectrum. Each row of the abundance matrix corresponds to the spatial distribution of each endmember. The number of iterations is set to 500, and the process terminates when the reconstruction error is less than 0.001. Through this decomposition, interpretable material composition spectra and spatial distributions are obtained. Understandably, selecting microbial cell scattering spectra, fluorescein diacetate fluorescent indicator spectra, and background water Raman spectra as pure substance endmembers can specifically identify the metabolic activity of live bacteria. The FDA fluorescent endmember directly correlates with the expression level of esterases in live bacteria, distinguishing them from dead bacteria and inorganic particles; the microbial scattering endmember reflects cell morphology characteristics; and the water Raman endmember is used to correct baseline drift. Compared to traditional full-spectrum analysis, this demixing strategy decouples mixed signals into independent sources, significantly improving the specificity and anti-interference ability for identifying low concentrations of live bacteria.
[0026] S203. Perform local binary pattern texture encoding on the spatial distribution map corresponding to microbial endmembers in the abundance matrix, setting the neighborhood radius to 3 pixels and the sampling points to 8, and generating an 8-bit binary texture feature vector. Perform an outer product operation on the spectral vector of microbial endmembers in the endmember matrix and the texture feature vector. The calculation formula is as follows: M=S_m⊗T In the formula, M is a spectral-spatial joint feature matrix with dimensions of 256×8, S_m is the microbial endmember spectral vector, and T is the local binary pattern texture feature vector.
[0027] It should be noted that this step performs local binary mode encoding on the microbial spatial distribution map parsed from the abundance matrix. Multiple points are sampled within a defined radius neighborhood centered on each pixel, and grayscale differences are compared to generate binary codes, which are then converted into decimal texture values. This encoding is robust to illumination changes and computationally concise. The microbial endmember spectral vector and texture feature vector are outer-producted to generate a spectral-spatial joint feature matrix, where each element represents the weight of co-occurrence of a specific spectral band intensity and a specific texture pattern. Compared to vector concatenation, outer-product fusion achieves second-order feature interaction, enhancing the expressive power of colony cluster structures. This tensor structure retains complete physical interpretability and is compatible with deep learning architectures such as convolutional neural networks, enabling rapid implementation on edge computing devices.
[0028] The S300 integrates the spectral-spatial joint feature matrix with the time series data of microenvironment chemical parameters, calls the sliding time window storage module to accumulate historical normal operating condition features, constructs a historical feature buffer, performs Mahalanobis distance iterative clustering analysis on the buffer data, establishes a normal distribution probability density model, and performs exponential weighted moving average dynamic updates on the model parameters, thereby constructing an adaptive baseline spectral feature library.
[0029] It is understood that step S300 includes S301, S302, and S303, wherein: S301. Set the sliding time window length to 7 days and the step size to 1 day. Store the spectral-spatial joint feature matrix sequence and the corresponding chemical parameter mean under normal operating conditions within the time window into a circular buffer to form a historical feature buffer. This buffer retains the normal data of the most recent 30 days for baseline learning. It should be noted that the time window length is set based on the natural decay cycle of microorganisms in sterile water, covering the complete process from active proliferation to stable death, ensuring the representativeness of the baseline data. The step size design enables daily rolling updates, allowing the baseline to capture long-term slow drift. The circular buffer structure retains the most recent period data through an overwrite mechanism, preventing unlimited memory growth.
[0030] S302. Calculate the mean matrix and covariance matrix for all feature matrices in the historical feature buffer. Calculate the Mahalanobis distance between each new feature matrix and the baseline. Remove outliers with a Mahalanobis distance greater than 3 standard deviations. Iteratively calculate the new mean matrix and covariance matrix. After 10 iterations and convergence, establish a normal distribution probability density model. It should be noted that this step calculates the mean and covariance matrices of all feature matrices within the historical buffer. The covariance matrix contains correlation information between dimensions and better characterizes the true geometric structure of the feature space than Euclidean distance. For each new sample, the Mahalanobis distance is calculated; this distance measures the statistical distance from the sample to the baseline distribution center. Samples with excessively large distances are considered outliers and removed. The iterative process repeatedly calculates the mean and covariance, progressively purifying the dataset. In actual operation, outliers may originate from transient air bubbles, particulate impurities, or occasional missed bacteria; iterative removal ensures baseline purity. The normal distribution model established after convergence describes the probability distribution of normal operating conditions, providing a statistical basis for subsequent anomaly detection.
[0031] S303. The baseline parameters are dynamically updated using an exponentially weighted moving average mechanism, and the update calculation formula is as follows: In the formula, Let be the mean matrix at time t. Let be the covariance matrix at time t. Let be the spectral-spatial joint characteristic matrix at time t. The mean forgetting factor, This is the covariance forgetting factor.
[0032] It should be noted that this step uses an exponentially weighted moving average to dynamically track baseline parameters. New samples are incorporated into the baseline with a certain weight, while the weight of historical data decays exponentially. This mechanism enables the baseline to respond to long-term drift factors such as slow decay of light source intensity, minor changes in the surface properties of the microfluidic chip, and batch differences in reagents, preventing baseline rigidity and failure. The forgetting factor controls the balance between response speed and stability; its value requires a trade-off between the need for rapid drift tracking and the need to suppress short-term noise.
[0033] S400: Load the adaptive baseline spectral feature library and the real-time spectral-spatial joint feature matrix, call the multi-scale Gaussian kernel function to calculate the feature deviation distribution, extract the multi-scale feature deviation statistics, and input the statistics into the softmax probability evaluation network to perform classification operations, and output the microbial contamination discrimination index vector.
[0034] It is understood that in this step, S400 includes S401, S402, and S403, wherein: S401. Load the current mean matrix and covariance matrix from the adaptive baseline spectral feature library, and call the Gaussian kernel function on the real-time spectral-spatial joint feature matrix. Set the three scale parameters to 0.5, 1.0 and 2.0 respectively, calculate the feature deviation distributions with three different smoothing degrees, and generate multi-scale deviation feature vectors. It's important to note that the core consideration for setting three different scale parameters is as follows: the smaller scale corresponds to a narrower kernel bandwidth, making it sensitive to small local spectral shifts and capable of capturing early, subtle metabolic changes; the medium scale achieves a balance, responding significantly to moderate bacterial aggregation; and the larger scale corresponds to a wider kernel bandwidth, being robust to macroscopic spectral drift and suppressing transient noise interference. In actual operation, microfluidic chips experience slight spectral baseline drift due to pressure pump pulsation and temperature fluctuations. Multi-scale processing can extract deviation information at different sensitivity levels, avoiding missed detections or false alarms caused by a single scale. The process of generating multi-scale deviation feature vectors essentially maps the three-dimensional spectral-spatial tensor to three kernel spaces with different smoothness levels. Each scale outputs the deviation statistics for the corresponding dimension, forming a hierarchical feature representation, providing multi-perspective discrimination criteria for subsequent testing.
[0035] S402. Perform a chi-square statistical test on the deviation characteristics at each scale, and calculate the chi-square statistic, which is equal to the square of the deviation characteristic. The chi-square statistic approximately follows a chi-square distribution with the degrees of freedom as the feature dimension. Calculate the contamination probability, which is equal to 1 minus the value of the chi-square cumulative distribution function at the chi-square statistic and the degrees of freedom. The chi-square cumulative distribution function is the integral of the chi-square probability density function, with the degrees of freedom as the feature dimension. It should be noted that, since the spectral-spatial joint feature matrix has undergone mean removal and covariance whitening, each dimension is approximately independent and identically distributed, and its sum of squared deviations conforms to the chi-square distribution assumption. The setting of degrees of freedom equal to the feature dimensions stems from the constraint of the matrix rank, ensuring the validity of the probabilistic interpretation of the statistics. In practical applications, the chi-square test, compared to simple threshold determination, has probabilistic semantics and can directly output the contamination confidence level. The contamination probability is calculated using the cumulative distribution function to calculate the tail probability, i.e., calculating the extreme degree of the current deviation statistic among all possible normal fluctuations; the smaller the probability value, the further it deviates from normal.
[0036] S403. Input the three-scale pollution probability vectors into the softmax probability evaluation network, where the network output is calculated using the following formula: In the formula, Let i be the discriminant index for the i-th class. Let be the input probability of the i-th class. Let be the input probability of class j.
[0037] It should be noted that the network structure is designed as a three-layer architecture. The input layer receives three-dimensional probabilistic features, the hidden layer mines the interaction relationships between scales through nonlinear activation, and the output layer corresponds to three categories: safe, warning, and dangerous. The Softmax activation function ensures that the sum of the output exponents is 1, forming a probability distribution, which can be directly interpreted as the posterior probability of a sample belonging to each category. Compared with hard classification thresholds, the probability output provides information on gradual risk changes, allowing operators to judge the severity of pollution based on the exponent magnitude and take early intervention measures. In actual operation, the network parameters are trained offline using historical pollution event samples to learn the joint distribution law of multi-scale probabilities under different pollution modes. For example, in the process of slow biofilm formation, the small-scale bias increases first, followed by the medium and large-scale biases; in acute pollution shocks, all three scales increase simultaneously. The hidden layers of the network can capture such temporal pattern differences, outputting more robust classification results.
[0038] The S500 algorithm couples the microbial contamination discrimination index vector with fluid dynamic parameters, calls the grading judgment module to import the flow velocity-contamination weight mapping relationship, sets three-level warning thresholds, executes fuzzy logic reasoning, and finally generates real-time safety status information of the sterile water system.
[0039] It is understood that in this step, S500 includes S501, S502, and S503, wherein: S501. Extract the current flow velocity from the fluid dynamics parameters, call the flow velocity-contamination weight mapping function. The function is equal to 1 divided by 1 plus the negative sensitivity coefficient in the exponential function multiplied by the difference between the flow velocity and the critical flow velocity. The sensitivity coefficient is 0.5 and the critical flow velocity is 0.1 m / s. Calculate the dynamic weight of the flow velocity on the contamination judgment. The faster the flow velocity, the greater the weight to suppress false positives. S502. Set three warning thresholds of 0.3, 0.6 and 0.9 respectively. Compare the maximum value of the discriminant index vector (equal to the dynamic weight multiplied by the discriminant index) with the threshold. If the weighted discriminant index is less than 0.3, it is considered safe. If 0.3 is less than or equal to the weighted discriminant index and less than 0.6, it is considered a warning. If the weighted discriminant index is greater than or equal to 0.6, it is considered dangerous. 0.9 is the severe pollution threshold that triggers an emergency shutdown. S503. Define fuzzy logic rules: if the weighted discriminant index is low, the safety state is safe; if the weighted discriminant index is medium, the safety state is in a warning state; if the weighted discriminant index is high, the safety state is dangerous. Defuzzification is performed using the centroid method, and the defuzzification formula is as follows: In the formula, S represents the final safety state level. Let be the activation strength of the k-th fuzzy rule. S is the center value of the security level corresponding to the k-th rule. k=1,2,3,4 correspond to the four levels of security, warning, danger and emergency, respectively. S takes integers from 1 to 4 as the real-time security status information output by the system. Example 2:
[0040] like Figure 2 As shown, this embodiment provides a sterile water safety monitoring system based on hyperspectral imaging. See [link to documentation]. Figure 2 The system includes: Acquisition module 701: used to acquire multi-dimensional monitoring data streams of the microfluidic chip sterile water system, including continuous hyperspectral image sequences, time-series data of microenvironment chemical parameters and fluid dynamic parameters, wherein the hyperspectral image sequences cover the 400-1000nm band; Extraction and fusion module 702: Based on hyperspectral image sequences and fluid dynamic parameters, it calls the microfluidic channel structure partitioning module to divide the background area, edge area and central enrichment area formed by hydrodynamic focusing effect according to the flow velocity field distribution. Non-negative matrix decomposition spectral unmixing is performed on the central enrichment area to extract the pure material endmember spectral features. At the same time, local binary mode spatial texture encoding is performed on the endmembers. The unmixed spectral vector and texture encoding features are fused by outer product to generate the spectral-spatial joint feature matrix of the microbial enrichment area. Module 703: This module is used to fuse the spectral-spatial joint feature matrix with time-series data of microenvironment chemical parameters, call the sliding time window storage module to accumulate historical normal operating condition features, build a historical feature buffer, perform Mahalanobis distance iterative clustering analysis on the buffer data, establish a normal distribution probability density model, and perform exponential weighted moving average dynamic updates on the model parameters to build an adaptive baseline spectral feature library. Call output module 704: Used to load the adaptive baseline spectral feature library and the real-time spectral-spatial joint feature matrix, call the multi-scale Gaussian kernel function to calculate the feature deviation distribution, extract the multi-scale feature deviation statistics, input the statistics into the softmax probability evaluation network to perform classification operation, and output the microbial contamination discrimination index vector. Coupling setting module 705: used to couple the microbial contamination discrimination index vector with fluid dynamic parameters, call the graded judgment module to import the flow velocity-contamination weight mapping relationship, set three-level warning thresholds, perform fuzzy logic reasoning, and finally generate real-time safety status information of the sterile water system.
[0041] Specifically, the extraction and fusion module 702 includes: The first calculation unit is used to calculate the Reynolds number based on the flow velocity and channel hydraulic diameter in the fluid dynamics parameters. When the Reynolds number is less than 2000, it is determined to be a laminar flow state. Then, based on the laminar flow hydrodynamic focusing theory, the channel is divided into: a background zone of 0-20 micrometers near the wall, an edge zone of 20-80 micrometers, and a central enrichment zone of 80-120 micrometers. The central enrichment zone is the key area for microbial concentration and accumulation. The second computational unit is used to apply a nonnegative matrix factorization algorithm to the hyperspectral sub-cube of the central enrichment region, decomposing the sub-cube into an endmember matrix and an abundance matrix. Each column of the endmember matrix represents the spectrum of a pure substance, including at least three endmembers: microbial cell scattering spectrum, fluorescein diacetate fluorescent indicator spectrum, and background water Raman spectrum. Each row of the abundance matrix corresponds to the spatial distribution of each endmember. The number of iterations is set to 500, and the process terminates when the reconstruction error is less than 0.001. Through this decomposition, interpretable material composition spectra and spatial distributions are obtained. The third computational unit performs local binary pattern texture encoding on the spatial distribution map corresponding to microbial endmembers in the abundance matrix. It sets the neighborhood radius to 3 pixels, the sampling points to 8, and generates an 8-bit binary texture feature vector. It performs an outer product operation between the spectral vectors of microbial endmembers in the endmember matrix and the texture feature vector. The calculation formula is as follows: M=S_m⊗T In the formula, M is a spectral-spatial joint feature matrix with dimensions of 256×8, S_m is the microbial endmember spectral vector, and T is the local binary pattern texture feature vector.
[0042] Specifically, the construction module 703 includes: Setting unit: Used to set the sliding time window length to 7 days and the step size to 1 day, and store the spectral-spatial joint feature matrix sequence and the corresponding chemical parameter mean under normal operating conditions within the time window into the circular buffer to form a historical feature buffer. This buffer retains the normal data of the most recent 30 days for baseline learning. The fourth calculation unit is used to calculate the mean matrix and covariance matrix of all feature matrices in the historical feature buffer, calculate the Mahalanobis distance of each new feature matrix to the baseline, remove outliers with a Mahalanobis distance greater than 3 times the standard deviation, iteratively calculate the new mean matrix and covariance matrix, and establish a normal distribution probability density model after 10 iterations and convergence. Update Unit: Used to dynamically update baseline parameters using an exponentially weighted moving average mechanism. The update calculation formula is as follows: In the formula, Let be the mean matrix at time t. Let be the covariance matrix at time t. Let be the spectral-spatial joint characteristic matrix at time t. The mean forgetting factor, This is the covariance forgetting factor.
[0043] Specifically, the call output module 704 includes: Calling unit: Used to load the current mean matrix and covariance matrix from the adaptive baseline spectral feature library, and call the Gaussian kernel function on the real-time spectral-spatial joint feature matrix. The three scale parameters are set to 0.5, 1.0 and 2.0 respectively to calculate the feature deviation distributions with three different smoothing degrees and generate multi-scale deviation feature vectors. The fifth calculation unit is used to perform a chi-square statistical test on the deviation characteristics at each scale, calculate the chi-square statistic equal to the square of the deviation characteristic, where the chi-square statistic approximately follows a chi-square distribution with degrees of freedom as the feature dimension, and calculate the contamination probability equal to 1 minus the value of the chi-square cumulative distribution function at the chi-square statistic and degrees of freedom, where the chi-square cumulative distribution function is the integral of the chi-square probability density function and the degrees of freedom are the feature dimension. The sixth computational unit is used to input the three-scale pollution probability vectors into the softmax probability evaluation network, where the network output is calculated using the following formula: In the formula, Let i be the discriminant index for the i-th class. Let be the input probability of the i-th class. Let be the input probability of class j.
[0044] In summary, this invention proposes a sterile water safety monitoring method based on microfluidic hydrodynamic focusing enrichment and hyperspectral imaging spectral-spatial feature fusion. It creatively combines microscale fluid microbial concentration technology, hyperspectral chemical fingerprinting technology, and an adaptive dynamic baseline learning algorithm. By constructing a laminar hydrodynamic focusing field in a microfluidic chip, microorganisms are actively enriched in the central flow layer, significantly improving detection sensitivity. Hyperspectral imaging technology is used to capture the spectral fingerprint of microchemical microenvironmental changes induced by live bacterial metabolism, and a spectral-spatial joint feature matrix is constructed by combining non-negative matrix unmixing and local binary pattern texture encoding. Furthermore, an exponentially weighted moving average mechanism is introduced to establish a dynamic adaptive baseline library, effectively eliminating system drift interference. Finally, a fuzzy logic hierarchical judgment model coupled with flow velocity weights achieves rapid response and a detection sensitivity of up to 10. 0 Online monitoring with CFU / mL and a low false alarm rate fundamentally solves the common technical problem in the industry where traditional methods have too long a cycle and cannot be monitored in real time.
[0045] It should be noted that the specific methods by which each module performs operations in the system described in the above embodiments have been described in detail in the embodiments related to the method, and will not be elaborated here. Example 3:
[0046] Corresponding to the above method embodiments, this embodiment also provides a sterile water safety monitoring device based on hyperspectral imaging. The sterile water safety monitoring device based on hyperspectral imaging described below and the sterile water safety monitoring method based on hyperspectral imaging described above can be referred to each other.
[0047] Figure 3 This is a block diagram illustrating a hyperspectral imaging-based sterile water safety monitoring device 800 according to an exemplary embodiment. Figure 3 As shown, the hyperspectral imaging-based sterile water safety monitoring device 800 includes a processor 801 and a memory 802. The hyperspectral imaging-based sterile water safety monitoring device 800 also includes one or more of a multimedia component 803, an I / O interface 804, and a communication component 805.
[0048] The processor 801 controls the overall operation of the hyperspectral imaging-based sterile water safety monitoring device 800 to complete all or part of the steps in the hyperspectral imaging-based sterile water safety monitoring method described above. The memory 802 stores various types of data to support the operation of the hyperspectral imaging-based sterile water safety monitoring device 800. This data may include, for example, instructions for any application or method operating on the hyperspectral imaging-based sterile water safety monitoring device 800, as well as application-related data such as contact data, sent and received messages, images, audio, video, etc. The memory 802 can be implemented using any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 802 or transmitted via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. I / O interface 804 provides an interface between processor 801 and other interface modules, such as keyboards, mice, or buttons. These buttons can be virtual or physical. Communication component 805 is used for wired or wireless communication between the hyperspectral imaging-based sterile water safety monitoring device 800 and other devices. Wireless communication includes, for example, Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof. Therefore, the corresponding communication component 805 may include a Wi-Fi module, a Bluetooth module, or an NFC module.
[0049] In an exemplary embodiment, the hyperspectral imaging-based sterile water safety monitoring device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the hyperspectral imaging-based sterile water safety monitoring method described above.
[0050] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the hyperspectral imaging-based sterile water safety monitoring method described above. For example, the computer-readable storage medium may be the memory 802 including the program instructions described above, which may be executed by the processor 801 of the hyperspectral imaging-based sterile water safety monitoring device 800 to complete the hyperspectral imaging-based sterile water safety monitoring method described above. Example 4:
[0051] Corresponding to the above method embodiments, this embodiment also provides a readable storage medium. The readable storage medium described below can be referred to in conjunction with the sterile water safety monitoring method based on hyperspectral imaging described above.
[0052] A computer program is stored on a readable storage medium, and when the computer program is executed by a processor, it implements the steps of the sterile water safety monitoring method based on hyperspectral imaging as described in the above method embodiments.
[0053] Specifically, the readable storage medium can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or any other readable storage medium capable of storing program code.
[0054] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A method for monitoring the safety of sterile water based on hyperspectral imaging, characterized in that, include: Acquire multi-dimensional monitoring data streams of a microfluidic chip-based sterile water system. These multi-dimensional monitoring data streams include continuous hyperspectral image sequences, time-series data of microenvironment chemical parameters, and fluid dynamic parameters. The hyperspectral image sequences cover the 400-1000 nm wavelength band. Based on hyperspectral image sequences and fluid dynamic parameters, the microfluidic channel structure partitioning module is invoked to divide the background region, edge region, and central enrichment region formed by hydrodynamic focusing effect according to the flow velocity field distribution. Non-negative matrix decomposition spectral unmixing is performed on the central enrichment region to extract the endmember spectral features of pure substances. At the same time, local binary mode spatial texture encoding is performed on the endmembers. The unmixed spectral vector and texture encoding features are fused by outer product to generate the spectral-spatial joint feature matrix of the microbial enrichment region. By integrating the spectral-spatial joint feature matrix with time-series data of microenvironment chemical parameters, the sliding time window storage module is called to accumulate historical normal operating condition features, a historical feature buffer is constructed, and Mahalanobis distance iterative clustering analysis is performed on the buffer data to establish a normal distribution probability density model. The model parameters are dynamically updated by exponential weighted moving average, thereby constructing an adaptive baseline spectral feature library. Load the adaptive baseline spectral feature library and the real-time spectral-spatial joint feature matrix, call the multi-scale Gaussian kernel function to calculate the feature deviation distribution, extract the multi-scale feature deviation statistics, and input the statistics into the softmax probability evaluation network to perform classification operation, and output the microbial contamination discrimination index vector; The microbial contamination discrimination index vector is coupled with fluid dynamic parameters, the flow velocity-contamination weight mapping relationship is imported by calling the graded judgment module, and three-level warning thresholds are set. Fuzzy logic reasoning is then performed to finally generate real-time safety status information of the sterile water system.
2. The method for monitoring the safety of sterile water based on hyperspectral imaging according to claim 1, characterized in that, The method, based on hyperspectral image sequences and fluid dynamics parameters, invokes a microfluidic channel structure partitioning module to divide the region into a background area, an edge area, and a central enrichment area formed by hydrodynamic focusing effects, according to the flow field distribution. Non-negative matrix factorization spectral unmixing is performed on the central enrichment area to extract pure substance endmember spectral features. Simultaneously, local binary mode spatial texture encoding is performed on the endmembers. The unmixed spectral vector and texture-encoded features are then fused by an outer product to generate a spectral-spatial joint feature matrix of the microbial enrichment region, including: The Reynolds number is calculated based on the flow velocity and channel hydraulic diameter in the fluid dynamics parameters. When the Reynolds number is less than 2000, it is determined to be a laminar flow state. Then, based on the laminar flow hydrodynamic focusing theory, the channel is divided into: a background zone of 0-20 micrometers near the wall, an edge zone of 20-80 micrometers, and a central enrichment zone of 80-120 micrometers. The central enrichment zone is the key area for microbial concentration and accumulation. A nonnegative matrix factorization algorithm is applied to the hyperspectral subcube of the central enrichment region to decompose the subcube into an endmember matrix and an abundance matrix. Each column of the endmember matrix represents the spectrum of a pure substance, including at least three endmembers: microbial cell scattering spectrum, fluorescein diacetate fluorescent indicator spectrum, and background water Raman spectrum. Each row of the abundance matrix corresponds to the spatial distribution of each endmember. The number of iterations is set to 500, and the process terminates when the reconstruction error is less than 0.
001. Through this decomposition, interpretable material composition spectra and spatial distributions are obtained. Local binary mode texture encoding was performed on the spatial distribution map corresponding to microbial endmembers in the abundance matrix. The neighborhood radius was set to 3 pixels and the number of sampling points was 8. An 8-bit binary texture feature vector was generated. The outer product operation was performed on the spectral vector of the microbial endmembers in the endmember matrix and the texture feature vector. The calculation formula is as follows: In the formula, M is a spectral-spatial joint feature matrix with dimensions of 256×8. This represents the spectral vector of microbial endmembers. This is a local binary pattern texture feature vector.
3. The method for monitoring the safety of sterile water based on hyperspectral imaging according to claim 1, characterized in that, The fused spectral-spatial joint feature matrix and microenvironment chemical parameter time-series data are used to accumulate historical normal operating condition features by calling the sliding time window storage module, constructing a historical feature buffer, and performing Mahalanobis distance iterative clustering analysis on the buffer data to establish a normal distribution probability density model. The model parameters are then dynamically updated using exponential weighted moving averages, thereby constructing an adaptive baseline spectral feature library, which includes: The sliding time window length is set to 7 days and the step size is 1 day. The spectral-spatial joint feature matrix sequence and the corresponding chemical parameter mean under normal operating conditions within the time window are stored in the circular buffer to form a historical feature buffer. This buffer retains the normal data of the most recent 30 days for baseline learning. The mean matrix and covariance matrix are calculated for all feature matrices in the historical feature buffer. For each new feature matrix, the Mahalanobis distance from the baseline is calculated. After removing outliers whose Mahalanobis distance is greater than 3 times the standard deviation, the new mean matrix and covariance matrix are calculated iteratively. After 10 iterations and convergence, a normal distribution probability density model is established. The baseline parameters are dynamically updated using an exponentially weighted moving average mechanism, and the update calculation formula is as follows: In the formula, Let be the mean matrix at time t. Let be the covariance matrix at time t. Let be the spectral-spatial joint characteristic matrix at time t. The mean forgetting factor, This is the covariance forgetting factor.
4. The method for monitoring the safety of sterile water based on hyperspectral imaging according to claim 1, characterized in that, The process involves loading the adaptive baseline spectral feature library and the real-time spectral-spatial joint feature matrix, calling the multi-scale Gaussian kernel function to calculate the feature bias distribution, extracting the multi-scale feature bias statistics, and inputting the statistics into the softmax probability evaluation network to perform classification operations. The output is a microbial contamination discrimination index vector, which includes: Load the current mean matrix and covariance matrix from the adaptive baseline spectral feature library, call the Gaussian kernel function on the real-time spectral-spatial joint feature matrix, set the three scale parameters to 0.5, 1.0 and 2.0 respectively, calculate the feature deviation distributions with three different smoothing degrees, and generate multi-scale deviation feature vectors; Perform a chi-square statistical test on the deviation feature at each scale, and calculate the chi-square statistic, which is equal to the square of the deviation feature. The chi-square statistic approximately follows a chi-square distribution with the degrees of freedom as the feature dimension. Calculate the contamination probability, which is equal to 1 minus the value of the chi-square cumulative distribution function at the chi-square statistic and the degrees of freedom. The chi-square cumulative distribution function is the integral of the chi-square probability density function, with the degrees of freedom as the feature dimension. The three-scale pollution probability vectors are input into the softmax probability evaluation network, and the network output is calculated using the following formula: In the formula, Let i be the discriminant index for the i-th class. Let be the input probability of the i-th class. Let be the input probability of class j.
5. A sterile water safety monitoring system based on hyperspectral imaging, based on the sterile water safety monitoring method based on hyperspectral imaging as described in claim 1, characterized in that, include: Acquisition module: used to acquire multi-dimensional monitoring data streams of the microfluidic chip sterile water system, including continuous hyperspectral image sequences, time-series data of microenvironment chemical parameters, and fluid dynamic parameters. The hyperspectral image sequences cover the 400-1000nm wavelength band. Extraction and Fusion Module: Based on hyperspectral image sequences and fluid dynamic parameters, it calls the microfluidic channel structure partitioning module to divide the background area, edge area, and central enrichment area formed by hydrodynamic focusing effect according to the flow velocity field distribution. Non-negative matrix decomposition spectral unmixing is performed on the central enrichment area to extract the endmember spectral features of pure substances. At the same time, local binary mode spatial texture encoding is performed on the endmembers. The unmixed spectral vector and texture encoding features are fused by outer product to generate the spectral-spatial joint feature matrix of the microbial enrichment region. The construction module is used to fuse the spectral-spatial joint feature matrix with the time series data of microenvironment chemical parameters, call the sliding time window storage module to accumulate historical normal operating condition features, build a historical feature buffer, perform Mahalanobis distance iterative clustering analysis on the buffer data, establish a normal distribution probability density model, and perform exponential weighted moving average dynamic update on the model parameters, thereby building an adaptive baseline spectral feature library. The output module is called to load the adaptive baseline spectral feature library and the real-time spectral-spatial joint feature matrix, call the multi-scale Gaussian kernel function to calculate the feature bias distribution, extract the multi-scale feature bias statistics, input the statistics into the softmax probability evaluation network to perform classification operations, and output the microbial contamination discrimination index vector. The coupling setting module is used to couple the microbial contamination discrimination index vector with the fluid dynamics parameters, call the graded judgment module to import the flow velocity-contamination weight mapping relationship, set three-level warning thresholds, perform fuzzy logic reasoning, and finally generate real-time safety status information of the sterile water system.
6. The aseptic water safety monitoring system based on hyperspectral imaging according to claim 5, characterized in that, The extraction and fusion module includes: The first calculation unit is used to calculate the Reynolds number based on the flow velocity and channel hydraulic diameter in the fluid dynamics parameters. When the Reynolds number is less than 2000, it is determined to be a laminar flow state. Then, based on the laminar flow hydrodynamic focusing theory, the channel is divided into: a background zone of 0-20 micrometers near the wall, an edge zone of 20-80 micrometers, and a central enrichment zone of 80-120 micrometers. The central enrichment zone is the key area for microbial concentration and accumulation. The second computational unit is used to apply a nonnegative matrix factorization algorithm to the hyperspectral sub-cube of the central enrichment region, decomposing the sub-cube into an endmember matrix and an abundance matrix. Each column of the endmember matrix represents the spectrum of a pure substance, including at least three endmembers: microbial cell scattering spectrum, fluorescein diacetate fluorescent indicator spectrum, and background water Raman spectrum. Each row of the abundance matrix corresponds to the spatial distribution of each endmember. The number of iterations is set to 500, and the process terminates when the reconstruction error is less than 0.
001. Through this decomposition, interpretable material composition spectra and spatial distributions are obtained. The third computational unit performs local binary pattern texture encoding on the spatial distribution map corresponding to microbial endmembers in the abundance matrix. It sets the neighborhood radius to 3 pixels, the sampling points to 8, and generates an 8-bit binary texture feature vector. It performs an outer product operation between the spectral vectors of microbial endmembers in the endmember matrix and the texture feature vector. The calculation formula is as follows: In the formula, M is a spectral-spatial joint feature matrix with dimensions of 256×8. This represents the spectral vector of microbial endmembers. This is a local binary pattern texture feature vector.
7. The aseptic water safety monitoring system based on hyperspectral imaging according to claim 5, characterized in that, The building module includes: Setting unit: Used to set the sliding time window length to 7 days and the step size to 1 day, and store the spectral-spatial joint feature matrix sequence and the corresponding chemical parameter mean under normal operating conditions within the time window into the circular buffer to form a historical feature buffer. This buffer retains the normal data of the most recent 30 days for baseline learning. The fourth calculation unit is used to calculate the mean matrix and covariance matrix of all feature matrices in the historical feature buffer, calculate the Mahalanobis distance of each new feature matrix to the baseline, remove outliers with a Mahalanobis distance greater than 3 times the standard deviation, iteratively calculate the new mean matrix and covariance matrix, and establish a normal distribution probability density model after 10 iterations and convergence. Update Unit: Used to dynamically update baseline parameters using an exponentially weighted moving average mechanism. The update calculation formula is as follows: In the formula, Let be the mean matrix at time t. Let be the covariance matrix at time t. Let be the spectral-spatial joint characteristic matrix at time t. The mean forgetting factor, This is the covariance forgetting factor.
8. The sterile water safety monitoring system based on hyperspectral imaging according to claim 5, characterized in that, The call output module includes: Calling unit: Used to load the current mean matrix and covariance matrix from the adaptive baseline spectral feature library, and call the Gaussian kernel function on the real-time spectral-spatial joint feature matrix. The three scale parameters are set to 0.5, 1.0 and 2.0 respectively to calculate the feature deviation distributions with three different smoothing degrees and generate multi-scale deviation feature vectors. The fifth calculation unit is used to perform a chi-square statistical test on the deviation characteristics at each scale, calculate the chi-square statistic equal to the square of the deviation characteristic, where the chi-square statistic approximately follows a chi-square distribution with degrees of freedom as the feature dimension, and calculate the contamination probability equal to 1 minus the value of the chi-square cumulative distribution function at the chi-square statistic and degrees of freedom, where the chi-square cumulative distribution function is the integral of the chi-square probability density function and the degrees of freedom are the feature dimension. The sixth computational unit is used to input the three-scale pollution probability vectors into the softmax probability evaluation network, where the network output is calculated using the following formula: In the formula, Let i be the discriminant index for the i-th class. Let be the input probability of the i-th class. Let be the input probability of class j.
9. A sterile water safety monitoring device based on hyperspectral imaging, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the hyperspectral imaging-based sterile water safety monitoring method as described in any one of claims 1 to 4 when executing the computer program.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program that, when executed by a processor, implements the sterile water safety monitoring method based on hyperspectral imaging as described in any one of claims 1 to 4.