Animal pathogenic microorganism target image detection model construction system
By constructing an ideal reference light field image matrix and a dual-track difference mechanism, training data is automatically generated, solving the problems of imbalanced training data for microbial samples and the difficulty of manual annotation, thus realizing a highly robust animal pathogen detection model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LIAONING ECOLOGICAL ENG VOCATIONAL UNIV
- Filing Date
- 2026-01-19
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies struggle to cope with biological variations and optical interference in microbial samples in complex environments, leading to imbalanced training data, high costs for manual annotation, and difficulty in effectively distinguishing biological features from background noise.
By constructing an ideal reference light field image matrix, generating a theoretical simulation state image matrix using interference factors, and automatically generating training data through a dual-track difference and coupled decision mechanism, self-supervised learning and closed-loop optimization are achieved.
It effectively solves the problem of imbalanced training data, reduces the cost of manual annotation, improves the model's robustness against interference and generalization ability, and enhances the signal-to-noise ratio and iteration efficiency of the detection model.
Smart Images

Figure CN121937428A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and intelligent medical testing technology, specifically to a system for constructing a target image detection model for animal pathogenic microorganisms. Background Technology
[0002] With the continuous development of smart veterinary medicine and precision testing technologies, microscopic image analysis of animal pathogens has become a key link in disease diagnosis and control; this technology is of great significance for quickly identifying pathogens at the microscopic level and blocking the spread of epidemics.
[0003] Currently, detection models are typically built by acquiring real pathological microscopic images and combining them with deep learning algorithms. Technicians need to obtain a matrix of original microscopic images containing the target microorganisms and perform extensive manual annotation of the biological features for model training. However, traditional model building and monitoring methods rely on idealized or easily accessible sample data, which is difficult to cope with complex biological variations and optical interference in real-world environments. Specifically, real-world microbial samples often exhibit long-tail distributions, making it extremely difficult to obtain rare samples at specific growth stages, such as division or aggregation, or affected by slide preparation processes, such as excessive decolorization or staining precipitation, resulting in severely imbalanced training data. Furthermore, existing image processing techniques often ignore the physical optical diffraction effects of the microscopic imaging system and struggle to fundamentally distinguish biological features from random background noise such as slide scratches and dust, leading to high manual annotation costs and insufficient anti-interference capabilities of the model in complex environments. Therefore, how to solve the problems of imbalanced training sample data and the difficulty of manual annotation, and effectively eliminate the interference of optical and environmental noise to build a highly robust detection model, has become an urgent problem to be solved in this field. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a system for constructing an image detection model for animal pathogenic microorganisms. Specifically, the technical solution of this invention includes:
[0005] A digital microscopy imaging device, a memory, and a processor, wherein the memory stores computer-executable instructions that are executed by the processor, the instructions being configured to implement the following modules:
[0006] The sample acquisition module is used to control the digital microscopic imaging device to acquire a matrix of raw microscopic images containing the target microorganisms;
[0007] The ideal benchmark construction module is used to construct an ideal benchmark light field image matrix based on a preset three-dimensional microbial voxel model and optical point spread function convolution.
[0008] The knowledge parameterization injection module is used to transform the ideal reference light field image matrix based on the interference factor to generate a theoretical simulation state image matrix. The interference factor includes a biological factor tensor that controls geometric deformation and a film-making factor tensor that controls pixel intensity attenuation.
[0009] The dual-track difference module is used to calculate the differences between the original microscopic image matrix, the theoretical simulation state image matrix and the ideal reference light field image matrix, respectively, so as to generate the real light field residual matrix and the theoretical simulation residual matrix.
[0010] The coupled decision and model building module is used to calculate the Euclidean distance between the eigenvectors of the two residual matrices; if the distance is less than a threshold, the theoretical simulation state image matrix is used as a positive sample to train the model; otherwise, the adjustment instruction is sent to the knowledge parameterization injection module based on the differential gradient feedback to trigger regeneration.
[0011] Optionally, the specific execution logic of the ideal reference construction module is as follows: a topology definition unit is used to generate a binary voxel mesh of the target microorganism in a three-dimensional Cartesian coordinate system, wherein the geometric boundary of the voxel mesh is defined by the mathematical equation of a sphere or a cylinder; a light field projection unit is used to retrieve a preset optical system point spread function convolution kernel, perform a three-dimensional convolution operation on the binary voxel mesh, and project the convolution result along the Z-axis onto a two-dimensional plane to generate the ideal reference light field image matrix with pixel values normalized, wherein the pixel values in the matrix are determined only by the geometric projection of the target microorganism and do not contain background noise components.
[0012] Optionally, the parameterized interference factor in the knowledge parameterization injection module is specifically defined as follows: the biological factor tensor is a coordinate transformation matrix, including: a binary splitting numerical parameter, used to define the pixel stretching ratio along the long axis of the microorganism; a capsule thickness numerical parameter, used to define the Gaussian blur kernel radius of the microorganism edge pixels; a cell aggregation numerical parameter, used to define the overlapping coordinate offset of multiple microbial voxel models in three-dimensional space; the slide preparation factor tensor is a pixel intensity superposition matrix, including: a staining agent precipitation numerical parameter, used to define the density distribution of high-frequency salt-and-pepper noise; a decolorization overdose numerical parameter, used to define the linear attenuation coefficient of global pixel brightness; and a slide scratch numerical parameter, used to define the linear low grayscale pixel stripes superimposed on the image.
[0013] Optionally, the specific execution logic of the knowledge parameterization injection module is as follows: the active deduction unit is used to perform the following matrix operations: apply the biological factor tensor to perform an affine transformation on the ideal reference light field image matrix to generate a deformation reference matrix; perform a Hadamard product operation or matrix addition operation on the deformation reference matrix and the slide preparation factor tensor to generate the theoretical simulation state image matrix containing specific pathological features and environmental noise.
[0014] Optionally, the specific execution logic of the dual-track difference module is as follows: a real path extraction unit is used to subtract the pixel value of the corresponding coordinate of the ideal reference light field image matrix from each pixel value of the original microscopic image matrix and take the absolute value to generate the real light field residual matrix, which quantifies the non-ideal imaging features in the real environment; a theoretical path extraction unit is used to subtract the pixel value of the corresponding coordinate of the ideal reference light field image matrix from each pixel value of the theoretical simulation state image matrix and take the absolute value to generate the theoretical simulation residual matrix, which quantifies the simulated interference features under the current parameter settings.
[0015] Optionally, the coupling decision and model building module includes: a spatial mapping unit, used to input the real light field residual matrix and the theoretical simulation residual matrix into a pre-trained convolutional neural network feature extractor, and output a first feature vector and a second feature vector with fixed dimensions; and a logical decision unit, used to calculate the Euclidean distance between the first feature vector and the second feature vector; if the Euclidean distance is less than a preset convergence threshold... If the Euclidean distance is greater than or equal to the convergence threshold, then a matching success signal is output; If the match fails, a matching failure signal will be output.
[0016] Optionally, the coupled decision and model building module further includes: a sample generation unit, used to extract the current theoretical simulation state image matrix and its corresponding biological factor tensor labels in response to the matching success signal, and construct labeled synthetic training data; and a model training unit, used to perform backpropagation training on the deep convolutional neural network using the synthetic training data, and update the network weights to construct the target detection model.
[0017] Optionally, the coupling decision and model building module further includes: a closed-loop optimization unit, used to calculate the difference vector between the first feature vector and the second feature vector in response to the matching failure signal; the knowledge parameterization injection module is used to receive the difference vector, and adjust the value of the parameterized interference factor by step size according to a preset gradient descent algorithm or random walk algorithm to generate an updated parameterized interference factor, and re-execute the generation step of the theoretical simulation state image matrix using the updated parameterized interference factor.
[0018] Compared with the prior art, the present invention has the following beneficial effects:
[0019] 1. This invention decouples complex biological morphological variations and defects in slide preparation process into independent and controllable numerical variables through a knowledge parameterization injection module; the system can actively generate long-tail samples that are extremely difficult to collect in reality, such as microorganisms in a specific division stage and accompanied by abnormal staining, thereby effectively filling the gaps in training data, solving the problem of severe imbalance in sample distribution, and greatly improving the model's ability to generalize to rare pathological features.
[0020] 2. This invention establishes a verification mechanism based on digital twins. When the feature distance between the theoretical simulation image and the real observation image converges, the system directly extracts the parameters determined when generating the simulation image as accurate ground truth labels. This self-supervised learning closed loop completely replaces manual annotation, eliminates high labor costs and subjective annotation errors, and realizes the automated production of massive, pure training data with perfect physical annotations.
[0021] 3. This invention innovatively constructs an ideal reference light field based on the first principles of physics and uses a dual-track differential mechanism to transform the recognition problem into a residual matching problem. This method can not only accurately eliminate the inherent optical blur of the microscopic imaging system, but also naturally filter out non-biological random impurities that cannot be simulated by biological parameters, such as dust and fibers, which significantly improves the signal-to-noise ratio and anti-interference robustness of the detection model in complex backgrounds.
[0022] 4. This invention introduces a finite difference gradient estimation strategy through a closed-loop optimization unit, successfully solving the mathematical problem of non-differentiability in the light field rendering process. This enables the system to use feature differences to drive parameter adjustment in reverse, actively searching for the optimal solution in the parameter space instead of blindly trying random approaches. This achieves rapid and accurate inversion from real-world observations to theoretical parameters, significantly improving the efficiency of model construction and iteration. Attached Figure Description
[0023] The present invention will be further explained below with reference to the accompanying drawings and embodiments:
[0024] Figure 1 This is a structural diagram of the system of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0026] Example 1:
[0027] Please see Figure 1 A system for constructing an image detection model for animal pathogenic microorganisms includes a digital microscopic imaging device, a memory, and a processor. The memory stores computer-executable instructions that are executed by the processor, and the instructions are configured to implement the following modules:
[0028] The sample acquisition module is used to control the digital microscopic imaging equipment to acquire a matrix of raw microscopic images containing the target microorganisms;
[0029] The ideal benchmark construction module is used to construct an ideal benchmark light field image matrix based on a preset three-dimensional microbial voxel model and optical point spread function convolution.
[0030] The knowledge parameterization injection module is used to transform the ideal reference light field image matrix based on the interference factor to generate the theoretical simulation state image matrix. The interference factor includes the biological factor tensor that controls geometric deformation and the film-making factor tensor that controls pixel intensity attenuation.
[0031] The dual-track difference module is used to calculate the differences between the original microscopic image matrix, the theoretical simulation state image matrix, and the ideal reference light field image matrix, respectively, in order to generate the real light field residual matrix and the theoretical simulation residual matrix.
[0032] The coupled decision and model building module is used to calculate the Euclidean distance between the eigenvectors of the two residual matrices. If the distance is less than a threshold, the theoretical simulation state image matrix is used as a positive sample to train the model. Otherwise, the adjustment instruction is sent to the knowledge parameterization injection module based on the differential gradient feedback to trigger regeneration.
[0033] This embodiment provides a system for constructing an image detection model for animal pathogenic microorganisms based on optical field residual coupling. The core logic of this system is the introduction of a digital twin verification mechanism, which achieves high-confidence identification and model training of microbial targets with zero or few samples by comparing the deviations of real observations with the deviations of theoretical deductions.
[0034] Implementation of the sample acquisition module: This module controls the digital microscopy imaging equipment to acquire a raw microscopic image matrix containing the target microorganism; in this embodiment, the system controls the automatic stage to perform a full-slide scan, acquiring a resolution of [resolution missing]. The image data is denoted as the original microscopic image matrix. The matrix contains the biological characteristics of the target microorganism, background impurities, optical noise, and staining artifacts.
[0035] The implementation of the ideal benchmark construction module aims to establish an interference-free reference system. Unlike existing technologies that use Gaussian smoothing or background mean as the benchmark, this embodiment constructs an ideal benchmark light field image matrix. Ideal reference light field image matrix: refers to a theoretically calculated virtual image that represents the pixel distribution of a specific type of microorganism, such as Staphylococcus aureus, under perfect optical system conditions, without staining defects, background noise, or overlapping occlusion; its construction process is achieved through convolution operations.
[0036] Implementation of the knowledge parameterization injection module: This module is used to simulate complex interference in reality; this module receives a set of parameterized interference factors. Based on this, a theoretical simulation state image matrix is generated. ;Parameterized interference factor: refers to a set of tensors that transform uncontrollable biological variations and environmental noise into computable values; it is clearly divided into two categories:
[0037] Biological factor tensor Controlling geometric deformation, such as bacterial division, stretching, and aggregation;
[0038] Production factor tensor : Controls pixel luminosity, such as staining depth and slide dirt;
[0039] Implementation of the dual-track difference module: This module is one of the core innovations of this system. Its purpose is to eliminate common background features and extract differential features. This module executes the following two parallel computation paths:
[0040] The actual path of the first difference operation: calculation and The difference generates the real light field residual matrix. This matrix retains only information from real-world images that deviates from a perfect state: real lesion features + real environmental noise.
[0041] The theoretical path of the second difference operation: calculation and The difference is used to generate the theoretical simulation residual matrix. This matrix only retains the deviation information under the current parameters, namely: simulated lesion characteristics + simulated environmental noise;
[0042] Implementation of the Coupled Decision and Model Building Module: This module is used to verify whether the current theoretical deductions conform to real-world observations; this module will... and Mapping to a high-dimensional feature space yields feature vectors. and And calculate the Euclidean distance between them. :
[0043]
[0044] The vector representation of the real light field residual matrix in the feature space, output by the feature extraction network;
[0045] Theoretical simulation residual matrix vector representation in feature space, dimension and same;
[0046] L2 norm operations;
[0047] The system's decision logic is as follows: When When the convergence threshold is preset: the judgment features are consistent; this means that the current parameterized interference factor The actual observation results were successfully reproduced; due to It was generated from known parameters, and the system automatically obtained the precise annotation of the image. Marked as positive samples and stored in the training database; when When the characteristics are inconsistent, the system calculates the difference gradient and feeds it back to the knowledge parameterization injection module, triggering parameter adjustment.
[0048] This embodiment cleverly transforms the identification problem into a residual matching problem by constructing an ideal benchmark and performing dual-track difference; random impurities in the background, such as dust, although present... However, because the system cannot adjust biological parameters, such as bacterial length, to generate the shape of dust, therefore... It will never be able to fit the characteristics of dust, thus resulting in distance. It cannot converge; this mechanism naturally filters out false positives from non-biological features, significantly improving the purity of the model training data and the anti-interference ability of the final detection model.
[0049] Example 2:
[0050] The specific execution logic of the ideal benchmark construction module is as follows: the topology definition unit is used to generate a binary voxel mesh of the target microorganism in a three-dimensional Cartesian coordinate system. The geometric boundary of the voxel mesh is defined by the mathematical equation of a sphere or a cylinder. The light field projection unit is used to retrieve the preset optical system point spread function (PSF) convolution kernel, perform a three-dimensional convolution operation on the binary voxel mesh, and project the convolution result along the Z-axis onto a two-dimensional plane to generate an ideal benchmark light field image matrix with pixel values normalized. The pixel values in the matrix are determined only by the geometric projection of the target microorganism and do not contain background noise components.
[0051] This embodiment is a further specification of the ideal reference construction module in Embodiment 1, and elaborates in detail how to construct an optical field reference from the first principles of physics;
[0052] The execution logic of the topology definition unit: This unit is used to generate the geometric prototype of the target microorganism; Binary voxel mesh: refers to a three-dimensional pixel array defined in three-dimensional space. ,in Represents microbial entities, The representative medium; in this embodiment, strict analytical geometric equations are used to define the boundaries for different microbial species:
[0053] For cocci, the spheric equation is applied:
[0054]
[0055] in, The coordinates of the center of the target microorganism in the voxel grid are: The geometric radius of the target microorganism;
[0056] For bacilli, applying capsule-like geometric constraints, let the length of the cylindrical segment be... , radius is Central axis along axis:
[0057] Column body, left end cap, right end cap:
[0058]
[0059] in, The coordinates of the center point of the bacillus;
[0060] This step does not rely on any real images, but is based on the morphological standard definition of microbiology, which ensures the absolute purity of the benchmark;
[0061] The execution logic of the light field projection unit: This unit simulates the imaging physical process of a microscope; the system is preset with respect to the numerical aperture (NA) and wavelength of the current microscope equipment. Matched optical point spread function (PSF) convolution kernel Ideal reference light field image matrix The generation process follows the following imaging physics model:
[0062]
[0063] The above-generated three-dimensional binary voxel mesh;
[0064] : Three-dimensional point spread function convolution kernel, derived from the physical calibration of the microscopic optical system or the calculation of the Abbe diffraction limit formula;
[0065] : 3D convolution operator;
[0066] The projection operator along the Z-axis is used in this embodiment to preserve the luminous flux characteristics. Its mathematical expression is as follows:
[0067]
[0068] in, The maximum physical depth of the 3D voxel mesh in the Z-axis direction or the preset scan depth boundary ensures that the integral covers the entire microbial voxel.
[0069] The output matrix is then subjected to Min-Max normalization to map pixel values to... interval;
[0070] The technical advantages of this embodiment: Compared to the background subtraction method used in traditional image processing, this embodiment generates images through physical optics simulation. It includes theoretical image blur caused by microscope diffraction effects; this means that subsequent difference operations can accurately eliminate the inherent optical blur of the imaging system and retain only the features caused by the variation of the sample itself, which greatly improves the signal-to-noise ratio of small target detection.
[0071] Example 3:
[0072] The parameterized interference factors in the knowledge parameterization injection module are specifically defined as follows: The biological factor tensor is a coordinate transformation matrix, including: a binary splitting numerical parameter, used to define the pixel stretching ratio along the long axis of the microorganism; a capsule thickness numerical parameter, used to define the Gaussian blur kernel radius of the microorganism edge pixels; a cell aggregation numerical parameter, used to define the overlapping coordinate offset of multiple microbial voxel models in three-dimensional space; the slide preparation factor tensor is a pixel intensity superposition matrix, including: a staining agent precipitation numerical parameter, used to define the density distribution of high-frequency salt-and-pepper noise; a decolorization overdose numerical parameter, used to define the linear attenuation coefficient of global pixel brightness; and a slide scratch numerical parameter, used to define the linear low grayscale pixel stripes superimposed on the image.
[0073] This embodiment is a concretization of the data in the knowledge parameterization injection module in Embodiment 1, defining the core variables that drive the simulation;
[0074] Definition of biological factor tensor: biological factor tensor It is a vector space describing the morphological variation of microorganisms, specifically containing:
[0075] Numerical parameters of binary splitting : Used to define the pixel stretching ratio along the long axis of the microorganism; when When it is a single entity, The two bodies were about to separate.
[0076] Capsule thickness numerical parameters The Gaussian blur kernel radius is used to define the edge pixels of microorganisms to simulate the scattering effect of light by the bacterial capsule; numerical parameters for the shrinkage of splitting grooves. Used to define the degree of cell wall invagination during the mid-to-late stages of bacterial division; groove width numerical parameter , used to define the standard deviation of the Gaussian distribution of the split trench, in pixels, i.e., the range of influence of the physical width of the trench;
[0077] Numerical parameters of bacterial cell aggregation Define the overlapping coordinate offsets of multiple microbial voxel models in three-dimensional space to generate aggregated samples;
[0078] Definition of Production Factor Tensor: Production Factor Tensor It is a matrix describing defects in the film manufacturing process, specifically including:
[0079] staining agent precipitation numerical parameters : Define the density distribution of high-frequency salt-and-pepper noise superimposed on the image to simulate unwashed crystal violet or safranin dye particles;
[0080] Over-bleaching numerical parameters Defines the linear decay coefficient for global pixel brightness; The result is an increase in bacterial cell transparency due to excessive decolorization, which is close to 1.
[0081] Numerical parameters of glass slide scratches Defines linear low-grayscale pixel stripes superimposed on an image to simulate physical scratches;
[0082] This embodiment decouples complex biological phenomena and operational errors into independent parameters. Furthermore, this system can traverse various rare combinations, such as an over-bleached and dividing bacterium; this parameterized definition enables the system to generate long-tailed distribution samples that are difficult to collect in reality, thus solving the data imbalance problem.
[0083] Example 4:
[0084] The specific execution logic of the knowledge parameterization injection module is as follows: the active deduction unit is used to perform the following matrix operations: apply the biological factor tensor to perform an affine transformation on the ideal reference light field image matrix to generate a deformation reference matrix; perform a Hadamard product operation or matrix addition operation on the deformation reference matrix and the slide factor tensor to generate a theoretical simulation state image matrix containing specific pathological features and environmental noise.
[0085] This embodiment is an implementation of the algorithm in embodiment 3, detailing how to generate simulated images using tensors;
[0086] The specific execution logic of the active deduction unit: This unit performs the following strictly ordered matrix operation steps:
[0087] Step 1: Multi-target spatial overlay, based on numerical parameters of bacterial cell aggregation Constructing a composite reference optical field:
[0088]
[0089] in: This refers to the total number of monomeric microorganisms contained in the pre-defined microaggregates. For pixel coordinates, This is the offset of the planar projection. The preset light absorption coefficient of the culture medium, in units of: , The preset system spatial resolution coefficient, in units of This is used to convert pixel coordinate offsets into physical distances to ensure dimensional consistency of the exponential decay term; it is used to apply the exponential decay formula. Simulates energy loss during light transmission through a medium; it should be noted that this step assumes a preset overlap coordinate offset. Within the depth of focus of the microscope system, the defocusing blurring effect caused by axial displacement is ignored in the calculation process, and only the absorption and attenuation characteristics of light in the medium are simulated.
[0090] Step 2: Constructing a deformation baseline and applying biological factor tensors binary splitting parameters Constructing the affine transformation matrix For ideal benchmark Perform resampling to generate the deformation reference matrix. The computational model is as follows:
[0091]
[0092]
[0093] like In the later stages of splitting, a contraction field of the splitting grooves needs to be superimposed:
[0094]
[0095] in, The coordinates of the geometric center of the current microbial voxel model along its major axis are given by the topologically defined unit. Export;
[0096] This formula uses an inverse Gaussian function to simulate the invagination feature of the cell wall in the middle segment of bacteria;
[0097] Image space transformation function based on bilinear interpolation; Gaussian blur kernel, its kernel size is ;
[0098] Step 3: Overlaying environmental features With production factor tensor The fusion process is performed; among which, the brightness attenuation mask... It is not a simple scalar multiplication, but rather based on the decolorization parameter. Constructed spatial non-uniform field:
[0099]
[0100]
[0101] in The function is used to limit the final calculation result to the range [0,1] to prevent pixel overflow;
[0102] Generates a uniformly distributed random matrix with the same size as the image to simulate uneven staining; The generation density distribution is The salt and pepper noise matrix; The sparse matrix generated by the Bresenham line algorithm has a pixel value of -0.3 on its trajectory, representing the light flux reduction component, and 0 at other positions. This is used to simulate the light flux occlusion effect of the scratch in the [0,1] normalized space, which is about 30% of the light flux.
[0103] Example 5:
[0104] The specific execution logic of the dual-track differential module is as follows: The real path extraction unit is used to subtract the pixel value of the corresponding coordinate of the ideal reference light field image matrix from each pixel value of the original microscopic image matrix and take the absolute value to generate the real light field residual matrix. This matrix quantifies the non-ideal imaging features in the real environment. The theoretical path extraction unit is used to subtract the pixel value of the corresponding coordinate of the ideal reference light field image matrix from each pixel value of the theoretical simulation state image matrix and take the absolute value to generate the theoretical simulation residual matrix. This matrix quantifies the simulated interference features under the current parameter settings.
[0105] This embodiment details the specific operators of the dual-track difference module, which is a key step in achieving background removal and feature retention;
[0106] The logic of the real path extraction unit is as follows: this unit performs the following operations to generate the real light field residual matrix. :
[0107]
[0108] This represents the original image that was actually captured;
[0109] This represents an ideal noise-free image; the [absolute value] function is to eliminate brightness polarity differences and focus on the change itself; this matrix quantifies all non-ideal imaging features in the real environment, including target signals and background noise;
[0110] The logic of the theoretical path extraction unit is as follows: this unit performs the following operations to generate the theoretical simulation residual matrix. :
[0111]
[0112] : A simulation image generated based on the current parameters; this matrix contains only feature changes caused by specific combinations of parameters;
[0113] This embodiment subtracts the same The two paths are placed on the same reference plane; if the original image contains a real bacterium, Includes bacterial features + background; at this point, The bacterial residual plus the background residual are preserved; if the simulation parameters are correct, Equivalent to simulating bacterial characteristics, This is equivalent to simulating bacterial residuals; the subsequent coupling steps actually compare whether the simulated bacterial residuals are included in the real residuals, thus cleverly ignoring the interference of background residuals.
[0114] Example 6:
[0115] The coupling decision and model building module includes: a spatial mapping unit, used to input the real light field residual matrix and the theoretical simulation residual matrix into a pre-trained convolutional neural network feature extractor, and output a first feature vector and a second feature vector with fixed dimensions; and a logical decision unit, used to calculate the Euclidean distance between the first feature vector and the second feature vector; if the Euclidean distance is less than a preset convergence threshold... If the Euclidean distance is greater than or equal to the convergence threshold, then a matching success signal will be output; If the match fails, a matching failure signal will be output.
[0116] This embodiment details the verification logic in the coupled decision and model building module;
[0117] Implementation of the spatial mapping unit: This unit utilizes a deep neural network to convert the residuals in the image space into semantic features; in this embodiment, an intermediate layer of a VGG-16 or ResNet-50 network pre-trained on a large-scale ImageNet dataset is used as the feature extractor. ;
[0118] Generate the first feature vector: ;
[0119] Generate the second feature vector: These two sets of vectors are of fixed dimensions, such as 1x1024, and they encode texture, edge, and topological information in the residual image, rather than simple pixel values.
[0120] Implementation of the logic decision unit: This unit calculates the Euclidean distance. And based on a preset convergence threshold Make a binary classification decision;
[0121] The value of is derived from statistical analysis of small-scale gold standard datasets, and is usually set to 1.5 times the intra-class average distance;
[0122] Match success signal: Indicates that the current simulation parameters correctly interpret the observed phenomena;
[0123] Match failure signal: Indicates that the current simulation parameters fail to explain the observed phenomenon. This may be due to parameter errors or because the observed impurity is not the target.
[0124] This embodiment performs the comparison in the feature space rather than the pixel space, making the system insensitive to minute positional shifts and rotations, thus greatly improving robustness; even and Even if perfect pixel alignment is not achieved, the system can still determine a successful match as long as their topological features are similar.
[0125] Example 7:
[0126] The coupled decision and model building module also includes: a sample generation unit, which extracts the current theoretical simulation state image matrix and its corresponding biological factor tensor labels in response to the matching success signal, and constructs labeled synthetic training data; and a model training unit, which uses the synthetic training data to perform backpropagation training on the deep convolutional neural network and updates the network weights to build an object detection model.
[0127] This embodiment describes the positive gain process after the system guesses the match correctly;
[0128] Implementation of the sample generation unit: In response to the successful match signal, the sample generation unit does not directly use the original image, but performs controlled synthesis: extracting the theoretical simulation state image matrix that led to the successful match. As image data Extract the corresponding biological factor tensors Key parameters such as category, location, and size are used as tag data. Build data pairs Stored in the training library; this actually uses digital twins to generate clean data with perfect physical annotations;
[0129] Implementation of the model training unit: This unit periodically extracts batches of data from the training library and performs backpropagation training on lightweight detection networks such as YOLO or MobileNet;
[0130]
[0131] Weights of the object detection model;
[0132] Learning rate;
[0133] Loss functions such as CIoULoss;
[0134] This embodiment achieves a self-supervised learning closed loop; the system does not require manual annotation, but automatically generates massive amounts of high-quality labeled data through physical simulation verification; this enables the model to quickly adapt to new experimental environments or new pathogen variants, solving the problem of high cost and inaccuracy of manual annotation.
[0135] Example 8:
[0136] The coupled decision and model building module also includes: a closed-loop optimization unit, used to calculate the difference vector between the first feature vector and the second feature vector in response to the matching failure signal; and a knowledge parameterization injection module, used to receive the difference vector and adjust the value of the parameterized interference factor by step size according to the preset gradient descent algorithm or random walk algorithm, generate the updated parameterized interference factor, and re-execute the generation step of the theoretical simulation state image matrix using the updated parameterized interference factor.
[0137] This embodiment describes the closed-loop optimization process after the system guesses incorrectly and fails to match;
[0138] The execution logic of the closed-loop optimization unit: When a decision match fails, it indicates the current parameters. Incorrect; the system calculates the difference vector of eigenvectors. Since the image generation process includes rendering and discretization operations, the objective function It is not differentiable; this system uses the finite difference method to approximate the gradient and then performs parameter updates.
[0139] For parameter set Each parameter in Calculate its partial derivative approximation: to ensure the objective function To ensure stability during numerical differentiation calculations, the system employs a random seed locking strategy: during the calculation of the gradient vector... Within the same iteration cycle, all random functions involved in the knowledge parameterization injection module, including and The seed generation is forced to be fixed to the original microscopic image matrix. The hash value or a fixed constant index; this means that for small perturbations The changes in the image only come from the parameters. The change is due to the resampling of random noise:
[0140]
[0141] in For a preset small perturbation amount, such as ;
[0142] Obtain the gradient vector Then, the parameters are updated using the momentum gradient descent formula:
[0143]
[0144]
[0145] Optimize step size and learning rate; The momentum coefficient for gradient descent, which differs from the contraction parameter in Example 4, is recommended to be 0.9. : Velocity vector, initialized to 0;
[0146] This embodiment solves the problem of non-differentiability in the light field rendering process by introducing finite difference gradient estimation, enabling the system to actively search in the parameter space using optimization algorithms instead of blindly trying random approaches, which significantly improves the convergence speed of digital twin parameter inversion.
[0147] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A system for constructing an image detection model for animal pathogenic microorganisms, characterized in that: It includes a digital microscopy imaging device, a memory, and a processor. The memory stores computer-executable instructions that are executed by the processor, and the instructions are configured to implement the following modules: The sample acquisition module is used to control the digital microscopic imaging device to acquire a matrix of raw microscopic images containing the target microorganisms; The ideal benchmark construction module is used to construct an ideal benchmark light field image matrix based on a preset three-dimensional microbial voxel model and optical point spread function convolution. The knowledge parameterization injection module is used to transform the ideal reference light field image matrix based on the interference factor to generate a theoretical simulation state image matrix. The interference factor includes a biological factor tensor that controls geometric deformation and a film-making factor tensor that controls pixel intensity attenuation. The dual-track difference module is used to calculate the differences between the original microscopic image matrix, the theoretical simulation state image matrix and the ideal reference light field image matrix, respectively, so as to generate the real light field residual matrix and the theoretical simulation residual matrix. The coupled decision and model building module is used to calculate the Euclidean distance between the eigenvectors of two residual matrices; If the distance is less than the threshold, the theoretical simulation state image matrix is used as a positive sample to train the model; otherwise, the differential gradient feedback adjustment instruction is sent to the knowledge parameterization injection module to trigger regeneration.
2. The system for constructing an animal pathogenic microorganism target image detection model according to claim 1, characterized in that: The specific execution logic of the ideal reference construction module is as follows: a topology definition unit is used to generate a binary voxel mesh of the target microorganism in a three-dimensional Cartesian coordinate system, wherein the geometric boundary of the voxel mesh is defined by the mathematical equation of a sphere or a cylinder; a light field projection unit is used to retrieve a preset optical system point spread function convolution kernel, perform a three-dimensional convolution operation on the binary voxel mesh, and project the convolution result along the Z-axis onto a two-dimensional plane to generate the ideal reference light field image matrix with pixel values normalized, wherein the pixel values in the matrix are determined only by the geometric projection of the target microorganism and do not contain background noise components.
3. The system for constructing an animal pathogenic microorganism target image detection model according to claim 1, characterized in that: The parameterized interference factor in the knowledge parameterization injection module is specifically defined as follows: The biological factor tensor is a coordinate transformation matrix, including: a binary splitting numerical parameter, used to define the pixel stretching ratio along the long axis of the microorganism; a capsule thickness numerical parameter, used to define the Gaussian blur kernel radius of the microorganism edge pixels; a cell aggregation numerical parameter, used to define the overlapping coordinate offset of multiple microbial voxel models in three-dimensional space; The slide preparation factor tensor is a pixel intensity superposition matrix, including: a staining agent precipitation numerical parameter, used to define the density distribution of high-frequency salt-and-pepper noise; a decolorization overdose numerical parameter, used to define the linear attenuation coefficient of global pixel brightness; and a slide scratch numerical parameter, used to define the linear low grayscale pixel stripes superimposed on the image.
4. The system for constructing an animal pathogenic microorganism target image detection model according to claim 3, characterized in that: The specific execution logic of the knowledge parameterization injection module is as follows: the active deduction unit is used to perform the following matrix operations: apply the biological factor tensor to perform an affine transformation on the ideal reference light field image matrix to generate a deformation reference matrix; perform a Hadamard product operation or matrix addition operation on the deformation reference matrix and the slide preparation factor tensor to generate the theoretical simulation state image matrix containing specific pathological features and environmental noise.
5. The system for constructing an animal pathogenic microorganism target image detection model according to claim 1, characterized in that: The specific execution logic of the dual-track difference module is as follows: the real path extraction unit is used to subtract the pixel value of the corresponding coordinate of the ideal reference light field image matrix from each pixel value of the original microscopic image matrix and take the absolute value to generate the real light field residual matrix, which quantifies the non-ideal imaging features in the real environment. The theoretical path extraction unit is used to subtract the pixel value of the corresponding coordinate of the ideal reference light field image matrix from each pixel value of the theoretical simulation state image matrix and take the absolute value to generate the theoretical simulation residual matrix. This matrix quantifies the simulated interference characteristics under the current parameter settings.
6. The system for constructing an animal pathogenic microorganism target image detection model according to claim 1, characterized in that: The coupling decision and model construction module includes: a spatial mapping unit, used to input the real light field residual matrix and the theoretical simulation residual matrix into a pre-trained convolutional neural network feature extractor, and output a first feature vector and a second feature vector with fixed dimensions; and a logical decision unit, used to calculate the Euclidean distance between the first feature vector and the second feature vector; if the Euclidean distance is less than a preset convergence threshold... If the Euclidean distance is greater than or equal to the convergence threshold, then a matching success signal is output; If the match fails, a matching failure signal will be output.
7. The animal pathogenic microorganism target image detection model construction system according to claim 6, characterized in that: The coupled decision and model building module further includes: a sample generation unit, used to extract the current theoretical simulation state image matrix and its corresponding biological factor tensor labels in response to the matching success signal, and construct labeled synthetic training data; and a model training unit, used to perform backpropagation training on the deep convolutional neural network using the synthetic training data, and update the network weights to construct the target detection model.
8. The system for constructing an animal pathogenic microorganism target image detection model according to claim 6, characterized in that: The coupled decision and model building module further includes: a closed-loop optimization unit, used to calculate the difference vector between the first feature vector and the second feature vector in response to the matching failure signal; the knowledge parameterization injection module is used to receive the difference vector, and adjust the value of the parameterized interference factor by step size according to a preset gradient descent algorithm or random walk algorithm to generate an updated parameterized interference factor, and re-execute the generation step of the theoretical simulation state image matrix using the updated parameterized interference factor.