Microbial spatial distribution monitoring method and system based on multi-level microscopic scanning images
By combining multi-level microscopic scanning images and differential probability density functions, the problems of poor multi-fold adaptability and insufficient ecological specificity of models in microbial distribution monitoring are solved, and accurate monitoring and dynamic adaptation of microbial communities are achieved.
Patent Information
- Application Number
- CN202512035159.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-03-20
- Estimated Expiration
- 2045-12-31
AI Technical Summary
Existing methods for monitoring microbial distribution suffer from problems such as poor adaptability of multi-fold observation data, lack of ecological specificity in distribution models, insufficient quantification of fitting effects, and inability of parameters to dynamically adapt to community changes.
A multi-level microscopic scanning method is adopted to acquire images and their location information through multi-level grid traversal scanning. Differential probability density functions are designed in combination with microbial ecological types, and the model parameters are dynamically updated by incremental training using a rolling window.
It achieves precise capture and spatial distribution characterization of microorganisms of different sizes, improves model fitting accuracy and stability, and can dynamically adapt to changes in microbial communities.
Smart Images

Figure CN121438310B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of microscopic image processing, and particularly relates to a microorganism spatial distribution monitoring method and system based on multi-level microscopic scanning images. BACKGROUND
[0002] For the monitoring of microorganisms in the environment, the following four methods are commonly used in existing microorganism distribution identification methods:
[0003] 1. Microscopic observation and data collection: Microscopic imaging technology with a fixed magnification (such as 500 times) is used in combination with auxiliary technologies such as microfluidics and surface plasmon resonance (SPR) to achieve image collection and quantity statistics of microorganism samples. However, using fixed magnification observation cannot accurately capture microorganisms of different sizes (such as large bacterial aggregates and small protozoa) at the same time, and a hierarchical coordinate system has not been established, so the spatial position information is not fully utilized, resulting in rough distribution description and lack of multi-magnification adaptability. Some schemes record the sample position through single-level grid division without establishing a hierarchical coordinate system associated with multiple magnifications, which can only adapt to the observation of microorganisms within a single size range.
[0004] 2. Microorganism identification method: Based on the image data output by the image sensing module, traditional image processing or simple deep learning algorithms are used to achieve microorganism counting, focusing on the accuracy of quantity statistics, and not forming three-dimensional associated data of "type - quantity - spatial position".
[0005] 3. Distribution modeling method: A unified mathematical model is used to describe the distribution of microorganisms, such as a biological membrane mass transfer - reaction model based on Monod equation and Fick's law, or a statistical model of a single probability density function (such as Poisson distribution and Gaussian distribution). The modeling process does not distinguish between microorganism ecological types (such as dependent type and free type), but only correlates the distribution law with macroscopic environmental parameters (such as substrate concentration and temperature), ignoring the influence of interspecific interaction on distribution. Without designing a differentiated model structure based on the ecological habits of microorganisms, it is difficult to accurately describe the distribution differences of different types of microorganisms such as bacterial aggregate dependent type and environmental free type, and the fitting accuracy is limited.
[0006] 4. Parameter optimization and dynamic adaptation: Some schemes optimize model parameters through Bayesian inference, particle swarm algorithm, or construct dynamic monitoring models based on time series data, but parameter optimization relies on batch offline data and lacks real-time incremental updating mechanism, making it difficult to respond to the dynamic succession of microorganism communities and unable to adapt to the dynamic changes of microorganism communities in real time.
[0007] In summary, there is an urgent need for a solution to solve the problems of poor multi-magnification microorganism observation data adaptability, lack of ecological relevance of distribution models, insufficient fitting effect quantification, and inability of parameters to dynamically adapt to community changes in the existing technology. SUMMARY
[0008] The present application aims to provide a multi-level microscopic scanning image-based microbial spatial distribution monitoring method and system, which solves the problems of poor adaptability of multi-magnification microbial observation data, lack of ecological pertinence of distribution model, insufficient fitting effect quantification, and inability of parameters to dynamically adapt to community changes in the prior art.
[0009] In one aspect, the present application provides a multi-level microscopic scanning image-based microbial spatial distribution monitoring method, which specifically comprises the following steps:
[0010] S1, obtaining microscopic examination data, performing multi-level grid traversal scanning image acquisition on the observation area of the microscopic examination data, and storing the acquired images and their position information in the corresponding level grid into an image position association data set;
[0011] S2, traversing the images in the image position association data set, identifying and counting the number of each target microorganism in each image and the position information of each target microorganism in the corresponding level grid, and storing them into the corresponding to-be-identified level data set of each target microorganism;
[0012] S3, according to the ecological type of each target microorganism, inputting the corresponding to-be-identified level data set into the corresponding trained multi-organism distribution probability density model to obtain the spatial distribution rule of each type of microorganism in the microscopic examination data.
[0013] In some embodiments, the specific process of step S1 is as follows:
[0014] S11, dividing the multi-magnification microscope into multiple levels according to the size of the microorganism body type;
[0015] S12, constructing a multi-level scanning matrix, dividing the observation area into a corresponding number of grids according to the current scanning level, scanning each grid of the current scanning level and collecting the image of each grid, and recording the unique grid position index of each image under each scanning level;
[0016] S13, respectively storing each image and its grid position index in the corresponding scanning level into the image position association data set.
[0017] In some embodiments, the multiple levels include: low magnification, medium magnification, and high magnification, and the specific process of constructing the multi-level scanning matrix is as follows:
[0018] For the low magnification scanning level, the observation area is divided into a first level grid with Y 2 units, Y 2 units of the first level grid are scanned, and Y 2each image corresponds to a unique first-level grid position index;
[0019] For the medium-magnification scanning level, each cell in the first-level grid is independently taken as a first observation sub-region, each first observation sub-region is subdivided into a second-level sub-grid with M 2 cells, a medium-magnification scanning matrix scans all cells of all second sub-grids, and (M x Y) 2 images are acquired, and the first-level grid position index and the second-level sub-grid position index corresponding to each image are recorded;
[0020] For the high-magnification scanning level, each cell of the second-level sub-grid is taken as a second observation sub-region, each second observation sub-region is subdivided into a third-level sub-grid with P 2 cells, a high-magnification scanning matrix scans all cells of all third sub-grids, and (M x Y x P) 2 images are acquired, and the first-level grid position index, the second-level sub-grid position index, and the third-level sub-grid position index corresponding to each image are recorded.
[0021] In some specific embodiments, the process of traversing the images in the image position association dataset includes hierarchical identification and coordinate recording of each image in the image position association dataset, and the specific process is as follows:
[0022] S21, identifying each target microorganism and its quantity in each image;
[0023] S22, obtaining the scanning level corresponding to each image and the grid position index thereof under the corresponding scanning level, and constructing a coordinate system of the corresponding scanning level according to the scanning level;
[0024] S23, assigning each target microorganism in each image a coordinate label in the corresponding coordinate system according to the scanning level corresponding to each image, and the coordinate value of the coordinate label is consistent with the grid position index corresponding to each image;
[0025] S24, counting the quantity of each target microorganism and its coordinate label under each scanning level, and performing quantity consistency verification on target microorganisms of the same type under different scanning levels.
[0026] In some specific embodiments, the ecological type of the microorganism includes a zoogloea-dependent type, and the multi-biological distribution probability density model includes a zoogloea-dependent biological model for analyzing the spatial distribution rule of the zoogloea-dependent microorganism. The zoogloea-dependent biological model adopts a Gaussian mixture model with superimposed symbiotic terms, and the probability density calculation formula of the zoogloea-dependent biological model is as follows:
[0027]
[0028] in, The output value of the probability density function in the corresponding coordinate system, c , d () represents the coordinate values in the corresponding hierarchical coordinate system constructed based on the hierarchy; α Here, σ is the micelle-dependent strength coefficient, and σ is the distance attenuation scale. w i For the first i The weight of each bacterial colony center c i , d i Let f(i) be the center coordinate value of the i-th fungal floc in the corresponding hierarchical coordinate system. c , d ) for( c , d Floc density at coordinate ) , s ( c , d ) represents the distribution density of symbiotic organisms in the corresponding hierarchical coordinate system. β As a symbiotic factor, ε denoted as the background distribution offset, and n is the number of samples in the corresponding level coordinate system.
[0029] In some specific implementation schemes, the ecological types of microorganisms include environmentally free-living microorganisms. The multi-organism distribution probability density model includes an environmentally free-living biological model used to analyze the spatial distribution patterns of these microorganisms. This environmentally free-living biological model adopts a uniform distribution model dominated by symbiotic relationships. The probability density calculation formula for the environmentally free-living biological model is as follows:
[0030]
[0031] in, α1 represents the output value of the probability density function in the corresponding coordinate system, (e,f) represents the coordinate value in the corresponding hierarchical coordinate system constructed according to the hierarchy; α1 represents the basic density coefficient, s(e,f) represents the distribution density of symbiotic organisms in the corresponding hierarchical coordinate system, β represents the symbiotic factor, and ε1 represents the background distribution offset of the random distribution characteristics of free-type microorganisms adapted to the environment.
[0032] In some specific implementation schemes, step S3 further includes: constructing a multi-biosphere distribution probability density model corresponding to each ecological type of the target microorganism. The training process for the multi-biosphere distribution probability density model for each ecological type of microorganism is as follows:
[0033] S31. Construct a hierarchical dataset corresponding to the microorganisms of the current ecological type as a training dataset;
[0034] S32, set a parameter search space and a corresponding discretization step number for each model parameter of the multi-organism distribution probability density model according to the ecological habit of the current ecological type microorganism;
[0035] S33, generate all model parameter combinations through Cartesian product based on the parameter search space and the discretization step number of each model parameter;
[0036] S34, calculate the corresponding loss value after inputting the training data set into the multi-organism distribution probability density model under each model parameter combination, and select the model parameter combination with the minimum loss value as the optimal parameter;
[0037] S35, store the hierarchical data set to be identified input into the multi-organism distribution probability density model each time in the trained data set, dynamically optimize the optimal parameter of the multi-organism distribution probability density model according to the trained data set, and finally obtain the trained multi-organism distribution probability density model.
[0038] In some specific embodiments, the specific process of dynamic optimization is as follows:
[0039] Set a sliding window, the window size of the sliding window is W, traverse the incremental training data set, and obtain the latest W hierarchical data sets from the trained data set to form the incremental training data set;
[0040] Repeat step S34, and re-calculate the optimal parameter based on the incremental training data set;
[0041] Adjust the historical optimal parameter using the re-calculated optimal parameter with a small learning rate to obtain an updated parameter.
[0042] In some specific embodiments, the update formula for adjusting the historical optimal parameter using a small learning rate is as follows:
[0043]
[0044] wherein η represents a small learning rate, represents a historical optimal parameter, represents a re-calculated optimal parameter, represents an updated parameter.
[0045] In a second aspect, the present application provides a microorganism spatial distribution monitoring system based on multi-level microscopic scanning images, comprising:
[0046] An image scanning and collecting module is configured to perform multi-level grid traversal scanning image collection on the observation region of the acquired microscopic data, and store the collected images and their position information in the corresponding hierarchical grid in an image position association data set;
[0047] An image recognition module is configured to traverse images in the image position association dataset, recognize and count the number of each target microorganism in each image, and store the position information of each target microorganism in the corresponding hierarchical grid into the corresponding to-be-recognized hierarchical dataset of each target microorganism.
[0048] A microorganism spatial distribution calculation module is configured to input the corresponding to-be-recognized hierarchical dataset of each target microorganism into the corresponding trained multi-microorganism distribution probability density model according to the ecological type of each target microorganism, and obtain the spatial distribution rule of each type of microorganism in the microscopic data.
[0049] The inventive concept of the present application is:
[0050] In the prior art, microorganism observation is generally performed at a fixed magnification, however, fixed magnification observation cannot adapt to microorganisms of different sizes, and there is a problem of insufficient utilization of hierarchical spatial information; for the observed microscopic images, the prior art uses a unified model to analyze the microorganism distribution in the microscopic images, the model lacks ecological specificity, and the dynamic optimization capability of the model is weak, and cannot dynamically adapt to changes in the community.
[0051] To solve the above problems, the present application designs an adaptive scheme of three-level magnification and corresponding hierarchical coordinate system, directly relies on the modeling of the “image-position-number” association data of the observation level, can realize the accurate capture and spatial distribution description of multi-scale targets such as large bacteria agglomerates and small protozoa, and solves the pain point of poor adaptability of multi-magnification data.
[0052] To solve the problem of the prior art that the unified model lacks ecological specificity, the present application designs a differential probability density function according to the ecological type of microorganisms (bacteria agglomerate dependent type and environmental free type), introduces a symbiotic term and a Gaussian mixture module, accurately describes the interspecific interaction and distribution rule, significantly improves the model fitting accuracy, and makes up for the deficiency that the traditional unified modeling cannot distinguish the difference in ecological habits.
[0053] To solve the problem of the prior art that the model has weak dynamic optimization capability, the present application proposes to use a rolling window incremental training to realize dynamic updating of the model parameters.
[0054] The present application has the following beneficial effects:
[0055] 1. Multi-level magnification is used for hierarchical scanning, a model is directly constructed relying on the information of the microorganism observation level, the corresponding observation magnification and hierarchical coordinate system are matched for microorganisms of different sizes, and the “image-position-number” association data is synchronously captured.
[0056] 2. Design the differentiated probability density function (PDF) according to the ecological type of microorganisms (granule-dependent type, environmental free type), introduce the biological symbiotic term and the Gaussian mixed module, accurately depict the interspecific interaction and distribution rule of microorganisms, design the differentiated probability density function (PDF) according to the ecological type of microorganisms (granule-dependent type, environmental free type), and combine the Poisson distribution to depict the randomness of distribution and accurately match the ecological habit;
[0057] 3. Based on the multi-dimensional quantitative index and the process threshold value evaluation model effect, the parameter dynamic updating model parameter is realized by adopting the rolling window increment training, so that the long-term adaptation of the model to the dynamic change of the microbial community is ensured, and the fitting precision and stability are outstanding. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 A microbial spatial distribution monitoring method flowchart based on multi-level microscopic scanning images is provided for the embodiments of the present application.
[0059] Figure 2 A multi-level scanning grid division result schematic diagram is provided for the embodiments of the present application.
[0060] Figure 3 A rotifer distribution schematic diagram collected at a medium magnification level by using the method of the present application is provided for the embodiments of the present application.
[0061] Figure 4 A rotifer distribution schematic diagram obtained according to actual sample observation is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0062] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. The description of the at least one exemplary embodiment is actually only illustrative, but not as any limitation on the present application and its application or use. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0063] Unless otherwise specified, the relative arrangement, numerical expression and numerical value of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0064] At the same time, it should be understood that, for the convenience of description, the sizes of the various parts shown in the drawings are not drawn in accordance with the actual proportional relationship.
[0065] Also, for clarity and conciseness, descriptions of well-known structures, functions, and configurations can be omitted. Those of ordinary skill in the art will recognize that various changes and modifications of the examples described herein can be made without departing from the spirit and scope of the disclosure.
[0066] Techniques, methods, and apparatus known to those of ordinary skill in the relevant art can not be discussed in detail herein, but should be considered part of the description of the application.
[0067] In all of the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Thus, other examples of the example embodiments can have different values.
[0068] Embodiment 1
[0069] As shown in the figure, the embodiment provides a method for monitoring spatial distribution of microorganisms based on multi-level microscopic scanning images, specifically comprising the following steps: Figure 1
[0070] S1, obtaining microscopic data, performing multi-level grid traversal scanning image acquisition on the observation area of the microscopic data, and storing the acquired images and their position information in the corresponding level grid into an image position association dataset;
[0071] Specifically, in order to realize accurate capture and spatial distribution description of multi-scale targets such as large bacteria agglomerates and small protozoa, and improve the adaptability of multi-magnification data, the specific process of multi-level grid traversal scanning image acquisition is as follows:
[0072] S11, dividing the multi-magnification microscope into multiple levels according to the size of the microorganism body;
[0073] S12, constructing a multi-level scanning matrix, dividing the observation area into a corresponding number of grids according to the current scanning level, scanning each grid of the current scanning level and acquiring the image of each grid, and recording the unique grid position index of each image under each scanning level;
[0074] S13, respectively storing each image and its grid position index in the corresponding scanning level into the image position association dataset.
[0075] Wherein, the multiple levels can include three scanning levels: low magnification, medium magnification and high magnification, and the specific process of constructing the multi-level scanning matrix is as follows:
[0076] For the low magnification scanning level, the observation area is divided into a first level grid with Y 2 (e.g. Y=20, Y 2 =400) units, and the Y2 a unit, and Y 2 images, each image corresponding to a unique first-level grid position index;
[0077] For the medium-magnification scanning level, each unit in the first-level grid is independently taken as a first observation sub-region, and each first observation sub-region is subdivided into a second-level sub-grid of M 2 (e.g., M = 4, M 2 = 16) units, forming a medium-magnification scanning matrix that scans all units of all second sub-grids, and Y 2 images are collected, and the first-level grid position index and the second-level sub-grid position index corresponding to each image are recorded;
[0078] For the high-magnification scanning level, each unit of the second-level sub-grid is taken as a second observation sub-region, and each second observation sub-region is subdivided into a third-level sub-grid of P 2 (e.g., P = 3, P 2 = 9) units, forming a high-magnification scanning matrix that scans all units of all third sub-grids, and M 2 × Y × P images are collected, and the first-level grid position index, the second-level sub-grid position index, and the third-level sub-grid position index corresponding to each image are recorded.
[0079] S2, traverse the images in the image position association dataset, identify and count the number of each target microorganism in each image and the position information of each target microorganism in the corresponding level grid, and store in the corresponding to-be-identified level dataset of each target microorganism;
[0080] Specifically, the process of traversing the images in the image position association dataset includes hierarchical identification and coordinate recording of each image in the image position association dataset, and the specific process is as follows:
[0081] S21, identify each target microorganism and the number thereof in each image;
[0082] S22, obtain the scanning level corresponding to each image and the grid position index thereof under the corresponding scanning level, and construct a coordinate system of the corresponding scanning level according to the scanning level;
[0083] S23, according to the scanning level corresponding to each image, assign each target microorganism in each image a coordinate label in the corresponding coordinate system, and the coordinate value of the coordinate label is consistent with the grid position index corresponding to each image;
[0084] S24, count the number of each target microorganism and the coordinate label thereof under each scanning level, and perform consistency verification on the number of target microorganisms of the same type under different scanning levels.
[0085] S3. Based on the ecological type of each target microorganism, the corresponding datasets of the levels to be identified are input into the corresponding trained multi-organism distribution probability density models to obtain the spatial distribution patterns of various microorganisms in the microscopic data.
[0086] To improve model fitting accuracy and differentiate the ecological habits of different microbial ecological types, microbial ecological types are divided into floc-dependent and environment-free types based on the dependence relationship between microorganisms and flocs. Differential probability density functions are designed according to microbial ecological types, and symbiotic terms and Gaussian mixture modules are introduced to accurately characterize interspecific interactions and distribution patterns. The multi-organism distribution probability density model includes a floc-dependent biological model for analyzing the spatial distribution patterns of floc-dependent microorganisms and an environment-free biological model for analyzing the spatial distribution patterns of environment-free microorganisms. The floc-dependent biological model uses a Gaussian mixture model with superimposed symbiotic terms, while the environment-free biological model uses a uniform distribution model dominated by symbiotic relationships. Specifically:
[0087] 1. The probability density calculation formula for the floc-dependent biological model is as follows:
[0088] in, The output value of the probability density function in the corresponding coordinate system, c , d () represents the coordinate values in the corresponding hierarchical coordinate system constructed based on the hierarchy; α Here, σ is the micelle-dependent strength coefficient, and σ is the distance attenuation scale. w i For the first i The weight of each bacterial colony center c i , d i Let f(i) be the center coordinate value of the i-th fungal floc in the corresponding hierarchical coordinate system. c , d ) for( c , d Density of bacterial flocs at coordinates s( c , d ) represents the distribution density of symbiotic organisms in the corresponding hierarchical coordinate system, β represents the symbiotic factor, ε represents the background distribution offset, and n represents the number of samples in the corresponding hierarchical coordinate system.
[0089] 2. The probability density calculation formula for the multi-organism distribution probability density model, including the environmental free-living organism model, is as follows:
[0090]
[0091] in, The output value of the probability density function in the corresponding coordinate system is (e, f), which is the coordinate value in the corresponding hierarchical coordinate system constructed according to the hierarchy; a1 is a basic density coefficient, s (e, f) is the distribution density of the symbiont in the corresponding hierarchical coordinate system, β is a symbiotic factor, and ε1 is a background distribution offset that adapts to the random distribution characteristics of the free-living microorganism in the environment.
[0092] In order to ensure that the model is long-term adapted to the dynamic changes of the microbial community, the probability distribution model of each ecological type of microorganism is dynamically trained, and the model is updated and iterated each time the input is input, thereby improving the long-term adaptability of the model. Specifically, for each ecological type of microorganism, the training process of the corresponding multi-biological distribution probability density model includes:
[0093] S31, constructing a hierarchical data set corresponding to the current ecological type of microorganism as a training data set;
[0094] S32, setting a parameter search space and a corresponding discretization step number for each model parameter of the multi-biological distribution probability density model according to the ecological habit of the current ecological type of microorganism;
[0095] S33, generating all model parameter combinations based on the parameter search space and the discretization step number of each model parameter through Cartesian product;
[0096] S34, calculating the loss value corresponding to the input of the training data set into the multi-biological distribution probability density model under each model parameter combination, and selecting the model parameter combination with the smallest loss value as the optimal parameter;
[0097] S35, storing the hierarchical data set to be recognized in the multi-biological distribution probability density model each time into the trained data set, and dynamically optimizing the optimal parameter of the multi-biological distribution probability density model according to the trained data set, to finally obtain the trained multi-biological distribution probability density model.
[0098] The specific process of dynamic optimization is as follows:
[0099] Set a sliding window, and the window size of the sliding window is W. Traverse the incremental training data set, and obtain the latest W hierarchical data sets from the trained data set to form the incremental training data set;
[0100] Repeat step S34 to re-calculate the optimal parameter based on the incremental training data set;
[0101] Use a small learning rate to adjust the historical optimal parameter with the re-calculated optimal parameter to obtain an updated parameter.
[0102] The update formula for adjusting the historical optimal parameter with a small learning rate is:
[0103]
[0104] wherein, η represents a small learning rate, represents a historical optimal parameter, represents a recalculated optimal parameter, represents an updated parameter.
[0105] In order to better understand the scheme proposed in the present application, the following will take a three-level magnification ratio hierarchical scanning as an example to introduce from the hierarchical scanning collection of microscopic images to the analysis output of the model:
[0106] Step 1, hierarchical scanning and image collection of multi-magnification microscope
[0107] Through hierarchical scanning of three magnification ratios, a scanning matrix of three magnification ratios is constructed to realize accurate capture of different types of microorganisms and record the position information of each image in the corresponding level grid to provide a benchmark for subsequent modeling.
[0108] Step 1.1, matching of three magnification ratios and observation objects:
[0109] Low magnification (100 times): suitable for observation of large size targets, including large bacterial aggregates, large metazoans (such as giant nematodes);
[0110] Medium magnification (400 times): suitable for observation of medium size targets, including small bacterial aggregates, small and medium-sized metazoans (such as rotifers, conventional nematodes), large protozoans (such as trichalea);
[0111] High magnification (1000 times): suitable for observation of small size targets, including small protozoans (such as amoebae, paramecia), to capture the morphology and position of tiny microorganisms at high resolution.
[0112] Step 1.2, as shown in Figure 2 , the hierarchical scanning matrix is constructed:
[0113] Low magnification scanning: divide the observation area into a first level grid of 20x20, collect 400 images, each image corresponds to a unique first level grid position index (such as row number a∈[0, 19], column number b∈[0, 19]);
[0114] Medium magnification scanning: each unit of the first level grid is independently taken as an observation sub-region, subdivided into a second level sub-grid of 4x4, forming a medium magnification scanning matrix of 80x80, collecting 6400 images, recording the corresponding first level grid index and second level sub-grid position index (such as row number c∈[0, 79], column number d∈[0, 79]);
[0115] High-magnification scanning: Each cell of the second-level grid is subdivided into a 3x3 third-level sub-grid, forming a 240x240 high-magnification scanning matrix. A total of 57600 images are collected, and their corresponding first and second-level grid indices and third-level sub-grid position indices (e.g., row number e∈[0, 239], column number f∈[0, 239]) are recorded.
[0116] Step 1.3, acquisition control and data storage:
[0117] Collecting microscopic data of sludge from a water treatment plant, the grid traversal acquisition is realized through automatic scanning of the microscope, ensuring that there is no overlap and no omission between adjacent images. The image data and corresponding hierarchical position index are stored synchronously to form the "image - position" association dataset.
[0118] Step 2, microorganism identification and coordinate statistics
[0119] Based on image recognition technology, target identification is performed on each magnification image, target microorganisms are extracted, and the number of different types of microorganisms and their coordinate labels in the corresponding hierarchical coordinate system are recorded. The number statistics and coordinate labeling are completed in the coordinate system of the corresponding observation level, ensuring the accuracy of spatial information.
[0120] Step 2.1, hierarchical identification and coordinate recording:
[0121] Low-magnification images (20x20 coordinate system): 400 images are identified one by one, and the number of large bacterial aggregates and large metazoans is counted. Each target is assigned a coordinate label (a, b) in the first-level coordinate system, and the coordinate value is consistent with the first-level grid position index.
[0122] Medium-magnification images (80x80 coordinate system): 6400 images are identified, and the number of small bacterial aggregates, rotifers, nematodes, and other targets is counted. Each target is assigned a coordinate label (c, d) in the second-level coordinate system, and the coordinate value is consistent with the second-level sub-grid position index.
[0123] High-magnification images (240x240 coordinate system): 57600 images are identified, and the number of small protozoa such as amoebae and paramecia is counted. Each target is assigned a coordinate label (e, f) in the third-level coordinate system, and the coordinate value is consistent with the third-level sub-grid position index.
[0124] Step 2.1, data verification:
[0125] For the same microorganism that can be observed across different magnifications (such as medium-sized nematodes that can be identified at medium and low magnifications), the number consistency verification is performed to eliminate misidentification data, ensuring the reliability of the "number - coordinate" association.
[0126] Step 3: Multi-biodistribution probability density model construction
[0127] For different ecological types of microorganisms, for the ecological habits of microorganisms, and combined with the grid characteristics of the observation level coordinate system, design different probability density functions, and accurately describe the spatial distribution law through Poisson distribution.
[0128] Step 3.1, Microbial ecological type division:
[0129] According to the dependence relationship between microorganisms and zoogloea, it is divided into two core ecological types: zoogloea-dependent type (such as rotifer, nematode, and stoloniform, mainly observed in the 80×80 coordinate system with medium magnification) and environmental free type (such as amoeba and paramecium, mainly observed in the 240×240 coordinate system with high magnification);
[0130] Step 3.2, Design of different probability density functions (PDF):
[0131] ① Zoogloea-dependent biological model (adapted to 80×80 coordinate system): Gaussian mixture model superimposed with symbiotic terms, the core expression is:
[0132]
[0133] Where: α is the zoogloea-dependent intensity coefficient, σ is the distance attenuation scale (unit: 80×80 coordinate grid number), w i The weight of the i-th zoogloea center (based on the zoogloea area density calculation), ( c i , d i ) is the center coordinate of the zoogloea in the 80×80 coordinate system, f (c,d) is the zoogloea density at this coordinate, s (c,d) is the distribution density of the symbiotic organism in the 80×80 coordinate system, β is the symbiotic factor, ε is the background distribution offset, and n is the sample number in the 80×80 coordinate system (i.e. The number of grid units collected);
[0134] ② Environmental free biological model (adapted to 240×240 coordinate system): uniform distribution model dominated by symbiotic relationship, the core expression is:
[0135]
[0136] Where: α1 is the basic density coefficient, s (e,f) is the distribution density of the symbiotic organism in the 240×240 coordinate system, β is the symbiotic factor, ε1 is the background distribution offset, and the model has no Gaussian mixture term, which adapts to the random distribution characteristics of free microorganisms.
[0137] Poisson distribution is used to describe the probability of the number of microorganisms k at a certain coordinate , and the expression is:
[0138]
[0139] where λ is the output value corresponding to the probability density function in the coordinate system, e is a mathematical constant, reflecting the distribution intensity of microorganisms at this position, and also representing the expected number of microorganisms at this position.
[0140] It can be understood that the above-mentioned Poisson distribution is a random Poisson process, which regards each coordinate point (x, y) in each hierarchical coordinate system (such as 80x80, 240x240) as a "space microelement" (corresponding to the "fixed scale interval" of the random Poisson process), and the number k of microorganisms appearing in the space microelement (k = 0, 1, 2,..., i.e. "number of event occurrences") obeys Poisson distribution, and its probability The formula is: .
[0141] Step 4, model training
[0142] This step is based on the hierarchical data set corresponding to each microorganism, and the optimal parameter for fitting effect is screened out by grid search traversing the parameter space.
[0143] Step 4.1, training data set construction:
[0144] The data set is divided according to the type of microorganism, and the data under the 80x80 coordinate system with medium magnification is used for bacteria-dependent microorganisms, and the data under the 240x240 coordinate system with high magnification is used for environmental free microorganisms.
[0145] Step 4.2, parameter search space definition:
[0146] According to the ecological characteristics of microorganisms, reasonable parameter boundaries are set to ensure that the search range covers the actual possible parameter values (which can be adjusted according to the actual data situation here):
[0147] ① Bacteria-dependent model: α∈[0.1, 10.0], σ∈[5.0, 20.0], β∈[0.0, 1.0], ε∈[-1.0, 1.0];
[0148] ② Environmental free model: α∈[0.1, 10.0], β∈[0.0, 1.0], ε∈[-1.0, 1.0];
[0149] Step 4.3, parameter discretization and grid generation:
[0150] Set the number of discrete steps for each model parameter (model parameters include α, σ, β, ε) (e.g. α, σ, β are set to 5 steps, and ε is set to 10 steps), and generate a grid of all parameter combinations through Cartesian product;
[0151] Step 4.4, loss function and optimization objective:
[0152] The average mean square error (MSE) of the predicted distribution and the true distribution is used as the loss function Loss , the expression is:
[0153]
[0154] where N is the number of coordinate points in the data set, is the expected distribution of the model prediction, i.e. λ, is the true observed number of microorganisms;
[0155] Step 4.4, grid search execution:
[0156] Traverse all parameter combinations, calculate the loss value of each combination, and select the parameter combination with the smallest loss as the initial optimal parameter.
[0157] Step 5, dynamic parameter optimization and model effect evaluation
[0158] Based on the true distribution and the predicted distribution, evaluate the model fitting degree, and evaluate the model effect under the corresponding hierarchical coordinate system. Incremental training is used to realize dynamic updating of parameters, and the long-term adaptability of the model is improved.
[0159] Dynamic parameter optimization mechanism:
[0160] ① Rolling window data set construction: Set the window size W batch (e.g. W=5), and each time 1 batch (1 batch of data is assumed to be 1000) of the same level observation data is added, the last W batch of data is retained to form an incremental training data set;
[0161] ② Incremental parameter calculation: Based on the incremental training data set, the optimal parameters (new parameters) are recalculated through grid search to ensure that the parameters adapt to the latest microbial community characteristics;
[0162] ③ Smoothing update strategy: Use a small learning rate η (e.g. η=0.1) to adjust the historical parameters to avoid parameter mutation leading to model instability, and the update formula is:
[0163]
[0164] where θ is the model parameter (α, σ, β, ε, etc.), is the historical optimal parameter, is the new parameter corresponding to the incremental data set, representing the updated parameters;
[0165] ④ Model iteration application: every time the parameter is updated, the microbial prediction distribution under the corresponding coordinate system is output, the model performance is judged combined with the evaluation index, if the MSE exceeds the threshold (such as 0.05), the parameter search space is adjusted to re-optimize.
[0166] Model effect evaluation:
[0167] In the corresponding coordinate system, the prediction distribution output by the model is compared with the real observation data point by point, and the mean square error MSE, the coefficient of determination R 2 , the mean absolute error MAE and other indicators are calculated, and the fitting effect of the first 10 batches of data of the model is shown in Table 1, such as Figure 3 shows the rotifer distribution in the medium magnification image predicted by the method of the present application on sample 1, such as Figure 4 shows the visualization of the rotifer distribution actually observed on sample 1, and the effect can be compared according to Figure 3 and Figure 4 .
[0168] Table 1 Model effect evaluation table
[0169] Note: The evaluation standard is: according to the actual requirements of M Water Plant, MSE: ≤0.05 is qualified, and ≤0.03 is excellent
[0170]
[0171] It can be seen that the method of the present embodiment has the following advantages:
[0172] 1. The three-level magnification and corresponding hierarchical coordinate system adaptive modeling method designs a three-level magnification and corresponding hierarchical coordinate system adaptive scheme, directly relies on the “image - position - quantity” correlation data modeling of the observation level, and can realize the accurate capture and spatial distribution description of multi-scale targets such as large bacteria aggregates and small protozoa.
[0173] 2. The differentiated probability distribution model according to the ecological type of microorganisms (bacteria aggregate dependent type, environmental free type) includes a bacteria aggregate dependent biological model (adapted to an 80x80 coordinate system): a Gaussian mixture model superimposed with a symbiotic term, and an environmental free biological model (adapted to a 240x240 coordinate system): a uniform distribution model dominated by symbiotic relationship;
[0174] 3. The parameter optimization combination scheme of “grid search + rolling window incremental training + small learning rate smoothing update” is adopted, especially the dynamic adaptation mechanism of the combination of rolling window and small learning rate.
[0175] 4, The application can be widely used in various microbial distribution analysis scenarios, the model has very high availability, and potential other application scenarios include:
[0176] Sewage treatment system: sludge microbial community monitoring, process optimization and system health status evaluation;
[0177] Environmental monitoring field: spatial distribution analysis of microbial community in water (surface water, groundwater), soil;
[0178] Water quality safety evaluation: microbial pollution tracing and risk warning of drinking water and industrial wastewater;
[0179] Microbial ecology research: analysis of microbial interspecific relationship and community dynamic evolution in scientific research scenarios;
[0180] Industrial biological process: functional microbial distribution regulation and process optimization in biological fermentation and biopharmaceutical processes;
[0181] Agricultural ecological monitoring: soil microbial community distribution and crop growth adaptability evaluation.
[0182] Embodiment 2
[0183] In order to realize the method in embodiment 1, the embodiment provides a microbial spatial distribution monitoring system based on multi-level microscopic scanning images, comprising:
[0184] An image scanning and collecting module is configured to perform multi-level grid traversal scanning image collection on the observation area of the acquired microscopic data, and store the collected images and their position information in the corresponding level grid in the image position association dataset;
[0185] An image recognition module is configured to traverse the images in the image position association dataset, identify and count the number of each target microorganism in each image and the position information of each target microorganism in the corresponding level grid, and store them in the corresponding to-be-identified level dataset of each target microorganism;
[0186] A microbial spatial distribution calculation module is configured to input the corresponding to-be-identified level dataset into the corresponding trained multi-biological distribution probability density model according to the ecological type of each target microorganism, and obtain the spatial distribution rule of each type of microorganism in the microscopic data.
[0187] The above is only a preferred embodiment of the present application, and does not limit the present application in any form. According to the technical essence of the present application, any simple modification, equivalent replacement and improvement of the above embodiment within the spirit and principles of the present application are still within the protection scope of the present application.
Claims
1. A method for monitoring the spatial distribution of microorganisms based on multi-level microscopic scanning images, characterized in that, Specifically, the following steps are included: S1. Acquire microscopic data, perform multi-level grid traversal scanning of the observation area of the microscopic data to acquire images, and store the acquired images and their position information in the corresponding grid level into the image position association dataset. S2. Traverse the images in the image location association dataset, identify and count the number of each target microorganism in each image and the location information of each target microorganism in the corresponding layer grid, and store it in the target microorganism's corresponding layer dataset. S3. Based on the ecological type of each target microorganism, the corresponding datasets of the level to be identified are input into the corresponding trained multi-organism distribution probability density model to obtain the spatial distribution pattern of various microorganisms in the microscopic data. Microbial ecological types include floc-dependent types. Multi-organism distribution probability density models include floc-dependent biological models used to analyze the spatial distribution patterns of floc-dependent microorganisms. The floc-dependent biological model employs a Gaussian mixture model with superimposed symbiotic terms. The probability density calculation formula for the floc-dependent biological model is as follows: in, The output value of the probability density function in the corresponding coordinate system, c , d () represents the coordinate values in the corresponding hierarchical coordinate system constructed based on the hierarchy; α Here, σ is the micelle-dependent strength coefficient, and σ is the distance attenuation scale. w i For the first i The weight of each bacterial colony center c i , d i Let f(i) be the center coordinate value of the i-th fungal floc in the corresponding hierarchical coordinate system. c , d ) for( c , d Floc density at coordinate ) , s ( c , d ) represents the distribution density of symbiotic organisms in the corresponding hierarchical coordinate system. β As a symbiotic factor, ε denoted as the background distribution offset, and n is the number of samples in the corresponding level coordinate system; The ecological types of microorganisms include environmentally free-living microorganisms. Multi-organism distribution probability density models include environmentally free-living biological models used to analyze the spatial distribution patterns of these microorganisms. These models employ a uniform distribution model dominated by symbiotic relationships. The probability density calculation formula for the environmentally free-living biological model is as follows: in, The output value of the probability density function in the corresponding coordinate system, e , f () represents the coordinate values in the corresponding hierarchical coordinate system constructed based on the hierarchy; α 1 is the basic density coefficient, s ( e , f ) represents the distribution density of symbiotic organisms in the corresponding hierarchical coordinate system. β As a symbiotic factor, ε 1 represents the background distribution offset to adapt to the random distribution characteristics of free-living microorganisms in the environment.
2. The method for monitoring the spatial distribution of microorganisms based on multi-level microscopic scanning images according to claim 1, characterized in that, The specific process of step S1 is as follows: S11. Based on the size of microorganisms, multi-magnification microscopes are divided into multiple levels; S12. Construct a multi-level scanning matrix, divide the observation area into several corresponding grids according to the current scanning level, scan each grid of the current scanning level and collect the image of each grid, and record the unique grid position index corresponding to each image under each scanning level. S13. Store each image and its grid position index at the corresponding scanning level into the image position association dataset.
3. The method for monitoring the spatial distribution of microorganisms based on multi-level microscopic scanning images according to claim 2, characterized in that, Multiple levels are included: low magnification, medium magnification, and high magnification. The specific process of constructing a multi-level scanning matrix is as follows: For low-magnification scanning levels, the observation area is divided into sections with Y... 2 The first-level grid of each unit is scanned, and the Y-axis of the first-level grid is scanned. 2 Each unit collects Y. 2 Each image corresponds to a unique first-level grid position index; For medium-magnification scanning levels, each cell in the first-level grid is independently designated as a first observation sub-region, and each first observation sub-region is further subdivided into M... 2 The second-level subgrid of each unit is used to form a medium-magnification scanning matrix to scan all units of the second-level subgrid, acquiring (M×Y) data. 2 For each image, record the first-level grid position index and the second-level subgrid position index. For high-magnification scanning levels, each cell of the second-level subgrid is taken as a second observation sub-region, and each second observation sub-region is further subdivided into units with P. 2 The third-level subgrid of each unit is used to form a high-magnification scanning matrix to scan all units of all third-level subgrids, acquiring (M×Y×P). 2 For each image, record the first-level grid position index, the second-level subgrid position index, and the third-level subgrid position index.
4. The method for monitoring the spatial distribution of microorganisms based on multi-level microscopic scanning images according to claim 1, characterized in that, The process of traversing the images in the image location association dataset includes hierarchical recognition and coordinate recording for each image in the dataset. The specific process is as follows: S21. Identify each target microorganism and its quantity in each image; S22. Obtain the scanning level corresponding to each image and its grid position index under the corresponding scanning level, and construct the coordinate system of the corresponding scanning level according to the scanning level; S23. Based on the scanning level corresponding to each image, assign a coordinate label to each target microorganism in each image in the corresponding coordinate system. The coordinate values of the coordinate labels are consistent with the grid position index corresponding to each image. S24. Count the number of each type of target microorganism and its coordinate label under each scanning level, and perform quantity consistency verification for the same type of target microorganism under different scanning levels.
5. The method for monitoring the spatial distribution of microorganisms based on multi-level microscopic scanning images according to claim 1, characterized in that, Step S3 also includes: constructing a multi-biota distribution probability density model corresponding to each ecological type of the target microorganism. The training process for the multi-biota distribution probability density model for each ecological type of microorganism is as follows: S31. Construct a hierarchical dataset corresponding to the microorganisms of the current ecological type as a training dataset; S32. Based on the ecological habits of microorganisms of the current ecological type, set the parameter search space and the corresponding number of discretization steps for each model parameter of the multi-organism distribution probability density model; S33. Based on the parameter search space and discretization steps of each model parameter, generate all model parameter combinations through Cartesian product; S34. Calculate the loss value corresponding to the input of the training dataset into the multi-biological distribution probability density model under each combination of model parameters, and select the model parameter combination with the smallest loss value as the optimal parameters. S35. Each time, the dataset of the level to be identified in the multi-organism distribution probability density model is stored in the trained dataset. The optimal parameters of the multi-organism distribution probability density model are dynamically optimized based on the trained dataset, and finally the trained multi-organism distribution probability density model is obtained.
6. The method for monitoring the spatial distribution of microorganisms based on multi-level microscopic scanning images according to claim 5, characterized in that, The specific process of dynamic optimization is as follows: Set a sliding window with a window size of W, traverse the incremental training dataset, and obtain the W nearest level datasets from the trained dataset to form the incremental training dataset. Repeat step S34 to recalculate the optimal parameters based on the incremental training dataset; By using a small learning rate, the historical optimal parameters are adjusted using the recalculated optimal parameters to obtain updated parameters.
7. The method for monitoring the spatial distribution of microorganisms based on multi-level microscopic scanning images according to claim 6, characterized in that, The update formula for adjusting the historically optimal parameters using a small learning rate is: Where η represents the small learning rate, Represents the historical optimal parameters. This represents the recalculated optimal parameters. This indicates that the parameters are being updated.
8. A microbial spatial distribution monitoring system based on multi-level microscopic scanning images, used to implement the microbial spatial distribution monitoring method based on multi-level microscopic scanning images as described in claim 1, characterized in that, include: The image scanning and acquisition module is used to perform multi-level grid traversal scanning of the observation area of the acquired microscopic data to acquire images, and to store the acquired images and their position information in the corresponding grid level into the image position association dataset. The image recognition module is used to traverse the images in the image location association dataset, identify and count the number of each target microorganism in each image and the location information of each target microorganism in the corresponding layer grid, and store it into the target microorganism's corresponding layer dataset. The microbial spatial distribution calculation module is used to input the corresponding hierarchical datasets to be identified into the corresponding trained multi-organism distribution probability density models according to the ecological type of each target microorganism, so as to obtain the spatial distribution patterns of various microorganisms in the microscopic data.
Citation Information
Patent Citations
Microscopic image organism identification method based on cooperative detection
CN116740706A
Sewage activated sludge microscopic examination system and method based on visual identification
CN118015616A