Automatic pathogenic bacterium identification system and method based on multispectral microscopic image fusion
By dynamically adjusting spectral channels and introducing pathogen enhancement channel data, combined with a pathogen identification model based on residual networks and transfer learning, the problem of symbiotic interference in multispectral fusion technology was solved, achieving high-precision automatic identification of pathogens.
Patent Information
- Application Number
- CN202511090473.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-11-18
AI Technical Summary
Existing multispectral fusion technologies are unable to effectively distinguish between symbiotic bacteria and pathogenic bacteria, leading to misjudgment and missed detection in scenarios with overlapping spectral features. In particular, spectral interference from symbiotic bacteria can mask the characteristic signals of pathogenic bacteria in the detection of complex samples.
By dynamically adjusting the spectral channels and introducing pathogen enhancement channel data, the interference factor is calculated using weighted projection and judged based on the variance of the interference factor. The spectral channels are dynamically optimized, and the pathogen identification process is optimized by combining a pathogen identification model based on residual networks and transfer learning.
It significantly reduces false positives and false negatives, improving the accuracy and robustness of pathogen identification, especially in scenarios where the spectral characteristics of symbiotic bacteria and pathogens highly overlap, thus enhancing identification precision and reliability.
Smart Images

Figure CN120976919A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of microorganism detection and image processing, in particular to a pathogenic bacteria automatic identification system and method based on multispectral microscopic image fusion. BACKGROUND
[0002] In the field of microorganism detection, multispectral microscopic imaging technology is widely used in pathogenic bacteria identification because it can provide rich spectral information. Multispectral microscopic imaging technology captures the reflection / transmission characteristics of samples at different spectral bands and is widely used in agricultural plant pathology detection to identify and locate pathogenic bacteria.
[0003] However, in the scenario where the spectral characteristics are highly overlapped, the existing multispectral fusion technology has obvious defects. Since the spectral characteristics of symbiotic bacteria and pathogenic bacteria often have similarities, traditional methods cannot effectively distinguish between the two, especially in complex sample detection, the differentiated contributions of different spectral channels to pathogenic bacteria identification cannot be fully tapped, resulting in spectral interference of symbiotic bacteria masking the characteristic signals of pathogenic bacteria, causing a large number of misjudgments and missed detections.
[0004] In view of the above problems, the prior art needs to be improved. SUMMARY
[0005] In view of the deficiencies of the prior art, the present application provides a pathogenic bacteria automatic identification system and method based on multispectral microscopic image fusion.
[0006] To achieve the above purpose, the technical scheme of the present application is as follows:
[0007] In a first aspect, the present application discloses a pathogenic bacteria automatic identification method based on multispectral microscopic image fusion, comprising the following steps:
[0008] Obtaining multispectral microscopic image data of a sample to be detected;
[0009] According to the multispectral microscopic image data and the pre-stored symbiotic bacteria spectral library data, the interference factor of each pixel point is calculated by weighted projection; the interference factor represents the similarity between the current pixel point and the symbiotic bacteria spectrum;
[0010] Judging whether the variance of the interference factors of a continuous preset number of pixel points is greater than a preset convergence threshold, if yes, extracting a symbiotic bacteria sensitive channel set according to the symbiotic bacteria spectral library data, and constructing pathogenic bacteria enhanced channel data according to the symbiotic bacteria sensitive channel set, adding the pathogenic bacteria enhanced channel data to the multispectral microscopic image data and recalculating the interference factor;
[0011] Otherwise, a pathogenic bacteria spectral feature vector is obtained by linear calculation according to the interference factor and the multispectral microscopic image data, the pathogenic bacteria spectral feature vector is input into a pre-trained pathogenic bacteria recognition model, and a pathogenic bacteria confidence is output.
[0012] It is judged whether the pathogenic bacteria confidence of the pixel point meets a preset condition, and if yes, a binary pathogenic bacteria distribution mask is generated.
[0013] In a second aspect, the present application discloses a pathogenic bacteria automatic recognition system based on multispectral microscopic image fusion, comprising: a data acquisition module configured to acquire multispectral microscopic image data of a sample to be detected;
[0014] An interference factor calculation module is configured to calculate an interference factor of each pixel point by weighted projection according to the multispectral microscopic image data and pre-stored symbiotic bacteria spectral library data.
[0015] A channel enhancement module is configured to judge whether the variance of the interference factors of a continuous preset number of pixel points is greater than a preset convergence threshold, and if yes, a symbiotic bacteria sensitive channel set is extracted according to the symbiotic bacteria spectral library data, and pathogenic bacteria enhanced channel data is constructed according to the symbiotic bacteria sensitive channel set, and the pathogenic bacteria enhanced channel data is added to the multispectral microscopic image data and the interference factor is recalculated.
[0016] A feature vector calculation module is configured to obtain a pathogenic bacteria spectral feature vector by linear calculation according to the interference factor and the multispectral microscopic image data.
[0017] A pathogenic bacteria recognition module is configured to input the pathogenic bacteria spectral feature vector into a pre-trained pathogenic bacteria recognition model, and output a pathogenic bacteria confidence, and judge whether the pathogenic bacteria confidence of the pixel point meets a preset condition, and if yes, a binary pathogenic bacteria distribution mask is generated.
[0018] Compared with the prior art, the present application has the following beneficial effects:
[0019] 1. By dynamically adjusting the spectral channel and introducing the pathogenic bacteria enhanced channel data, the present application can effectively suppress the interference of symbiotic bacteria on the pathogenic bacteria recognition process. In the case of overlapping spectral features of symbiotic bacteria and pathogenic bacteria, the interference factor is calculated by weighted projection, and the spectral channel is dynamically optimized based on the variance of the interference factor, the spectral discrimination degree of pathogenic bacteria and symbiotic bacteria is improved, and the misjudgment and missed detection phenomenon is significantly reduced.
[0020] 2. By introducing a pathogenic bacteria recognition model based on a residual network structure, and combining with transfer learning to pre-train and fine-tune the model, the recognition accuracy is improved. The model can extract effective feature information from complex multispectral data, and through neighborhood analysis and confidence threshold optimization, the pathogenic bacteria recognition robustness in the low signal-to-noise ratio area is further improved.
[0021] 3、By putting forward the interference factor variance feedback mechanism, the processing flow can be dynamically adjusted according to the interference in the sample, so as to realize the adaptive adjustment of the spectral characteristics. When the interference factor variance is out of limit, the spectral characteristic vector of the pathogenic bacteria is recalculated through the dynamic screening of the symbiotic bacteria sensitive channel set, the problem of residual interference of the spectral characteristics in the traditional static channel method is effectively solved, and the overall recognition accuracy is improved. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0023] Figure 1 It is the overall block diagram of the method of the embodiment of the present application.
[0024] Figure 2 It is the method flow chart of the embodiment of the present application.
[0025] Figure 3 It is the overall block diagram of the system of the embodiment of the present application. DETAILED DESCRIPTION
[0026] The technical solutions of the present application will be described clearly and completely in combination with the embodiments. Obviously, the described embodiments only constitute some embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0027] Summary of the application: In the traditional existing multispectral microscopic image fusion technology, the spectral characteristics of symbiotic bacteria and pathogenic bacteria are highly overlapped, which leads to the inability to effectively distinguish the spectral response difference between symbiotic bacteria and pathogenic bacteria in the interference factor calculation process. The existing method adopts static spectral channel combination and fixed weight matrix, which cannot dynamically adjust the spectral data according to the real-time interference factor, resulting in continuous accumulation of residual interference of symbiotic bacteria in the extraction process of pathogenic bacteria spectral characteristic vector. This defect directly leads to the systematic deviation of the input data of the pathogenic bacteria recognition model, and finally affects the generation accuracy of the binary pathogenic bacteria distribution mask.
[0028] For example, in a microscopic image analysis system of a medical laboratory, a multispectral imaging device containing five spectral channels is used to scan a biological tissue sample, and the symbiotic bacteria spectral library covers the spectral characteristics of twenty common strains. When Staphylococcus epidermidis and Staphylococcus aureus exist in the sample at the same time, the spectral response difference between the two in the 480-520nm waveband is less than 3%.
[0029] In the face of the above problems, the present application first discovers that the static spectral channel combination and fixed weight matrix in the prior art lead to the core contradiction of residual symbiotic bacteria interference. By analyzing the correlation between interference factor variance fluctuation and spectral feature confusion, the technical direction of establishing a dynamic feedback mechanism is proposed. Specifically, for the calculation cycle problem caused by the interference factor variance exceeding the limit, the possibility of introducing an antagonistic enhanced channel in the spectral space is explored. Among them, the focus is on how to realize interference suppression through dynamic screening of symbiotic bacteria sensitive channels, and a synergistic mechanism of channel enhancement and weight expansion is designed to ensure the convergence of interference factor calculation. By comparing the static channel expansion and dynamic iterative optimization two paths, the scheme of reconstructing the spectral vector under the variance triggering condition is finally selected, which not only avoids global channel redundancy but also realizes local interference suppression.
[0030] Embodiment one:
[0031] As shown in Figures 1-2 The pathogenic bacteria automatic recognition method of multispectral microscopic image fusion includes the following steps: acquiring multispectral microscopic image data of a sample to be detected; calculating the interference factor of each pixel point by weighted projection according to the multispectral microscopic image data and the pre-stored symbiotic bacteria spectral library data; the interference factor represents the similarity between the current pixel point and the symbiotic bacteria spectrum; judging whether the variance of the interference factors of a continuous preset number of pixel points is greater than a preset convergence threshold, if yes, extracting a symbiotic bacteria sensitive channel set according to the symbiotic bacteria spectral library data, and constructing pathogenic bacteria enhanced channel data according to the symbiotic bacteria sensitive channel set, adding the pathogenic bacteria enhanced channel data to the multispectral microscopic image data and recalculating the interference factor; otherwise, linearly calculating the pathogenic bacteria spectral feature vector according to the interference factor and the multispectral microscopic image data, inputting the pathogenic bacteria spectral feature vector into a pre-trained pathogenic bacteria recognition model, and outputting the pathogenic bacteria confidence; judging whether the pathogenic bacteria confidence of the pixel point meets the preset condition, if yes, generating a binary pathogenic bacteria distribution mask.
[0032] The multi-spectral microscopic image data refers to a data set containing pixel-level spectral intensity values of at least five spectral channels, which can be specifically collected by a multi-spectral microscopic imaging device to realize sample images under different wavelengths, and the spectral vector of each pixel is composed of intensity values of all channels, which is used to represent the spectral characteristics of the pixel. The interference factor refers to the minimum distance between the current pixel spectral vector and the standard spectral vector in the symbiotic bacteria spectral library calculated by weighted projection, which can be specifically realized by using weighted Euclidean distance or Mahalanobis distance algorithm, and reflects the similarity between the pixel and the symbiotic bacteria spectrum, which is used to quantify the interference intensity of the symbiotic bacteria on the current pixel. The interference factor variance judgment refers to calculating the variance of the interference factor of a continuous preset number of pixels, and comparing it with a preset convergence threshold, which can be specifically realized by using a sliding window to calculate the variance value, and is used to dynamically evaluate the stability of the interference factor to determine whether to introduce an enhanced channel to optimize the interference suppression effect. The symbiotic bacteria sensitive channel set refers to a set of spectral channels selected from the symbiotic bacteria spectral library, which has a significant response to the symbiotic bacteria spectrum, which can be specifically realized by calculating the standardized distance of the target pixel in each channel and the symbiotic bacteria intensity sequence and setting a sensitivity threshold, and is used to identify the dominant spectral channel of the symbiotic bacteria. The pathogenic bacteria enhanced channel data refers to new channel data generated by suppressing the sensitive channel and strengthening the non-sensitive channel, which can be specifically realized by using weighted summation and adjusting the contribution ratio of the non-sensitive channel and the sensitive channel through the antagonistic coefficient, and is used to enhance the spectral difference between the pathogenic bacteria and the symbiotic bacteria. The pathogenic bacteria spectral feature vector refers to the spectral vector after eliminating the interference of the symbiotic bacteria through linear calculation, which can be specifically realized by subtracting the product of the interference factor and the minimum distance standard spectral vector from the original spectral vector, and is used to extract the independent spectral features of the pathogenic bacteria. The pathogenic bacteria recognition model refers to a classification model based on a residual network structure, which can be specifically realized by pre-training model parameters through transfer learning, and is used to output confidence according to the pathogenic bacteria spectral feature vector to support pixel-level pathogenic bacteria identification. The binary pathogenic bacteria distribution mask refers to a segmented image generated according to the pixels whose confidence meets the preset conditions, which can be specifically realized by setting the confidence threshold and the number of neighboring pixels, and is used to visually display the spatial distribution of the pathogenic bacteria.
[0033] Through the above scheme, the automatic recognition of pathogenic bacteria in multi-spectral microscopic images is realized. By dynamically adjusting the spectral channel and recalculating the interference factor, the spectral interference of the symbiotic bacteria is effectively suppressed. At the same time, the confidence judgment strategy based on neighborhood analysis is adopted to improve the accuracy of the pathogenic bacteria distribution mask. This method can maintain high recognition accuracy in the scene where the spectral characteristics of the symbiotic bacteria and the pathogenic bacteria are highly overlapped, and improves the reliability of automatic recognition of microscopic images.
[0034] The present application further proposes that the multi-spectral microscopic image data includes pixel-level spectral intensity values of at least five spectral channels, and the spectral vector of the target pixel is composed of pixel-level spectral intensity values of all spectral channels.
[0035] The number of spectral channels is set to five or more to ensure that the spectral information of different wavelengths can cover the spectral difference area of symbiotic bacteria and pathogenic bacteria. The pixel-level spectral intensity value of each channel is combined in vector form to form a point in a multi-dimensional space, and the spectral feature difference is quantified by vector operation. The dimension of the spectral vector is consistent with the number of channels, and each dimension corresponds to the intensity value of a specific spectral channel, so that different weights can be assigned to different channels during weighted projection calculation.
[0036] Specifically, the spectral vector of the target pixel is constructed by integrating the intensity values of at least five channels, for example, selecting channels of 450nm, 550nm, 650nm in the visible light range and 750nm, 850nm in the near-infrared region. The intensity value of each channel is collected by a photosensor and combined into a vector in a linear arrangement. When calculating the interference factor, the weighted matrix adjusts the projection distance of different channels, for example, assigning higher weights to channels with significant pathogenic bacteria characteristics. Through distance calculation in a multi-dimensional vector space, the spectral differences between symbiotic bacteria and pathogenic bacteria can be more accurately distinguished, avoiding the problem of spectral feature overlap caused by insufficient number of channels. The construction method of the spectral vector provides a structured data basis for subsequent interference factor calculation, so that the weighted projection operation can effectively extract the difference information of the key channels.
[0037] As a preferred embodiment, the scheme of the present application is implemented as follows:
[0038] The multi-spectral microscopic image data includes pixel-level spectral intensity values of five spectral channels. The five spectral channels correspond to spectral information in different wavelength ranges, for example, five bands of blue light, green light, red light, near-infrared and mid-infrared can be selected. For each pixel, the pixel-level spectral intensity values of the five spectral channels form a five-dimensional spectral vector. This five-dimensional spectral vector contains the spectral response information of the pixel in different wavelength ranges and can be used for subsequent pathogenic bacteria identification analysis.
[0039] Through the above technical scheme, the present application can obtain more rich and comprehensive spectral information, improve the accuracy and reliability of pathogenic bacteria identification. The combination of multiple spectral channels can capture the spectral characteristics of pathogenic bacteria in different wavelength ranges, which helps to distinguish pathogenic bacteria from other symbiotic bacteria or background substances. Therefore, the present scheme overcomes the limitation of insufficient information of a single spectral channel and provides a more reliable data basis for subsequent pathogenic bacteria identification.
[0040] The present application further proposes a calculation process of the interference factor, which includes: obtaining a standard spectral vector of a pre-stored symbiotic bacteria spectral library, calculating the minimum distance between the current pixel's spectral vector and each standard spectral vector as the interference factor by weighted projection, and the calculation formula is:
[0041]
[0042] wherein, is a pre-stored symbiotic bacteria spectrum library, is a standard spectrum vector, is a spectrum vector of a target pixel, is a weighting matrix.
[0043] The weighting matrix is a diagonal matrix, and the diagonal elements correspond to the preset weights of different spectral channels, used to adjust the contribution proportion of each channel in distance calculation. The standard spectrum vector is obtained by the pre-stored symbiotic bacteria spectrum library, covering the spectral characteristics of known symbiotic bacteria. The selection of the minimum distance is obtained by traversing all standard spectrum vectors in the symbiotic bacteria spectrum library, and screening out the result with the smallest difference from the spectrum vector of the target pixel.
[0044] Specifically, the weighted projection calculation obtains the weighted Euclidean distance by performing matrix multiplication operation on the difference between the spectrum vector of the target pixel and each standard spectrum vector. For example, if the spectral channel contains five dimensions, the diagonal elements of the weighting matrix can be set to [0.3, 0.2, 0.1, 0.2, 0.2] to enhance the discriminant ability of a specific channel. Through the selection of the minimum distance, the interference factor α directly reflects the minimum deviation degree of the target pixel from the symbiotic bacteria spectrum, so as to accurately identify the symbiotic bacteria interference area. The calculation process suppresses the influence of the channel highly related to the symbiotic bacteria by dynamically adjusting the channel weight, improves the sensitivity of the interference factor to the spectral difference, and provides a reliable basis for subsequent variance judgment.
[0045] In specific implementation, first, a spectrum library containing standard spectra of multiple symbiotic bacteria is established. The standard spectrum vector of each symbiotic bacteria is composed of reflectance or absorbance of multiple wave bands. For each target pixel in the sample to be detected, the multispectral data thereof is obtained to form a spectrum vector. Then, a weighting matrix is constructed, which is a diagonal matrix, and the diagonal elements are weight coefficients of each spectral wave band. The weighted least squares method is used to calculate the weighted Euclidean distance between the spectrum vector of the target pixel and each standard spectrum vector in the spectrum library. The minimum value among all the calculated distances is selected as the interference factor of the pixel point. The above steps are repeated to calculate each pixel in the sample, and the interference factor distribution of the entire image is obtained.
[0046] Through the above technical solution, the present application can accurately quantify the similarity degree of each pixel point to the symbiotic bacteria spectrum, and provide a reliable interference evaluation basis for subsequent pathogenic bacteria identification. Through the weighted projection method, the spectral wave bands more critical for pathogenic bacteria identification are highlighted, and the pertinence and effectiveness of the interference factor calculation are improved. At the same time, using the minimum distance as the interference factor can effectively capture the spectral difference between the target pixel and the most similar symbiotic bacteria, and provide accurate basis for subsequent interference suppression and pathogenic bacteria feature extraction.
[0047] The application further proposes a symbiotic bacteria sensitive channel set extraction process, which includes: extracting the spectral intensity values of all bacterial species in the spectral channel i from the symbiotic bacteria spectral library to form a symbiotic bacteria intensity sequence in the spectral channel i; calculating the standardized distance between the spectral intensity value of the target pixel in the spectral channel i and the symbiotic bacteria intensity sequence; when the standardized distance is less than 1, the sensitivity of the spectral channel i = 1- standardized distance; when the standardized distance is not less than 1, the sensitivity of the spectral channel i = 0; and adding the spectral channel i with a sensitivity greater than a preset sensitivity threshold to the symbiotic bacteria sensitive channel set.
[0048] The symbiotic bacteria intensity sequence is formed by statistically analyzing the spectral intensity values of all symbiotic bacteria in a specific spectral channel, and is used to represent the spectral distribution characteristics of the symbiotic bacteria in the channel. The standardized distance is calculated using statistical methods, such as normal distribution standardization based on mean and standard deviation, to measure the deviation of the spectral intensity of the target pixel from the symbiotic bacteria population distribution. The sensitivity is calculated by a piecewise function, which is linearly negatively correlated with the distance when the standardized distance is less than 1, and is zero when the distance exceeds 1, indicating that the channel has no significant correlation with the symbiotic bacteria. The preset sensitivity threshold is used to filter sensitive channels, for example, setting the threshold to 0.5, and only keeping channels with a sensitivity higher than the threshold.
[0049] Specifically, in the extraction of the symbiotic bacteria sensitive channel set, first, for each spectral channel i, the spectral intensity values of all bacterial species in the channel are extracted from the symbiotic bacteria spectral library to form an intensity sequence. The standardized distance between the intensity value of the target pixel in the channel i and the sequence is obtained by calculating the difference between the mean and standard deviation of the sequence, for example, using the Z-score standardization method. If the standardized distance is less than 1, it indicates that the intensity value of the target pixel is within the main range of the symbiotic bacteria intensity distribution, and the sensitivity is set to 1 minus the distance value, the smaller the distance, the higher the sensitivity. If the distance exceeds 1, it is considered that the target pixel has no significant correlation with the symbiotic bacteria in the channel, and the sensitivity is set to zero. Finally, by comparing the sensitivity with the preset threshold, the spectral channels sensitive to the symbiotic bacteria are selected to form the symbiotic bacteria sensitive channel set. This process quantifies the sensitivity of the channel, dynamically excludes the spectral information unrelated to the symbiotic bacteria, thereby improving the accuracy of subsequent pathogenic bacteria enhanced channel construction and effectively suppressing the interference of the symbiotic bacteria.
[0050] Through the above technical solutions, the application can effectively identify the spectral channels sensitive to the symbiotic bacteria, thereby specifically suppressing the interference of these channels in subsequent processing. This sensitivity-based channel selection method can dynamically adapt to the spectral characteristics of the symbiotic bacteria in different samples, improving the accuracy and robustness of pathogenic bacteria identification. At the same time, by setting a preset sensitivity threshold, the selection criteria of sensitive channels can be flexibly adjusted to balance the identification accuracy and computational efficiency.
[0051] This application further proposes a process for constructing pathogen enhancement channel data, including: dividing spectral channels into sensitive and non-sensitive channels based on a symbiotic sensitive channel set; generating pathogen enhancement channel data by weighted summation of non-sensitive channels and subtracting a preset ratio from the weighted sum of sensitive channels; and adding the pathogen enhancement channel data as a new channel to the spectral vector of the target pixel; the calculation formula for pathogen enhancement channel data is as follows:
[0052]
[0053] in, For symbiotic bacteria sensitive channel set, This represents the spectral intensity value. Preset weights for spectral channels, This is the preset resistance coefficient.
[0054] The channel classification is based on the membership relationships of the symbiotic bacteria's sensitive channel set. The weighted sum of non-sensitive channels is a linear combination of preset weights and intensity values for each channel. The adversarial calculation of sensitive channels controls their negative contribution through a preset proportional coefficient λ. The adversarial coefficient λ is set to a value between 0.5 and 1.5, with a preferred value of 1.0 in the preferred embodiment. The newly added channel weight elements are set to 1.2 times the original maximum weight in the expanded weight matrix to enhance the distinguishing effect of the enhanced channels.
[0055] Specifically, when calculating the enhanced channel data, the weighted sum of non-sensitive channels represents spectral features unrelated to the symbiotic bacteria, while the weighted sum of sensitive channels reflects the typical spectral patterns of the symbiotic bacteria. The inhibition strength of the sensitive channels is adjusted by a preset antagonism coefficient λ, achieving complete and equal cancellation when λ=1. (Added...) By adding channel data as an independent spectral dimension to the original vector, subsequent interference factor calculations can amplify pathogen features through the intensity differences of the newly added channels. For example, in implementation, the original five-channel spectral vector is expanded to six channels using this method. The intensity values of the newly added channels are calculated by the difference between the weighted sum of the insensitive channels and the weighted sum of the sensitive channels. The larger this difference, the more significant the difference between the current pixel and the spectral pattern of the symbiotic bacteria. The enhanced channels constructed in this way can effectively reduce the interference factor values of pixels similar to symbiotic bacteria when recalculating interference factors, while improving the discrimination of interference factors for real pathogen pixels.
[0056] By the technical solution, the application can effectively inhibit the interference of symbiotic bacteria on pathogenic bacteria identification. Since the pathogenic bacteria enhanced channel data is constructed, the spectral characteristics of the pathogenic bacteria are enhanced, and the spectral characteristics of the symbiotic bacteria are inhibited, thereby improving the spectral distinguishability of the pathogenic bacteria and the symbiotic bacteria. Further, by adding the pathogenic bacteria enhanced channel data to the multispectral microscopic image data, the spectral dimension is expanded, and more effective information is provided for subsequent pathogenic bacteria identification. Thus, the application can dynamically inhibit the interference of symbiotic bacteria in the scene with highly overlapped spectral characteristics, and improve the identification accuracy of pathogenic bacteria.
[0057] The application further proposes that, in the process of recalculating the interference factor, the same number of zero-value elements as the number of newly added channels is added to each standard spectrum in the symbiotic bacteria spectral library to form an extended symbiotic bacteria standard spectrum; and the weight elements of the newly added channels are added to the original weight matrix to form a diagonal matrix.
[0058] In the process of extending the symbiotic bacteria standard spectrum, the number of zero-value elements is strictly consistent with the number of newly added channels, so as to ensure that the dimension of the standard spectrum vector is aligned with that of the target pixel spectrum vector; and the weight matrix is extended to a diagonal matrix, so that the weight elements of the newly added channels are independently set, thereby avoiding the weight coupling between different channels. For example, if one pathogenic bacteria enhanced channel is newly added, a zero value is added to the end of each standard spectrum, and an independent weight value is newly added to the diagonal line of the weight matrix.
[0059] Specifically, after the pathogenic bacteria enhanced channel data is constructed, the dimension of the spectrum vector of the target pixel is increased. By adding zero-value elements to the standard spectrum, the dimension of the standard spectrum is aligned with that of the target pixel spectrum vector, so as to avoid the distance measurement failure caused by the dimension difference in the projection calculation. At the same time, the weight matrix is extended to a diagonal matrix, the preset weight of the original channel is retained, and an independent weight is allocated to the newly added channel, so as to ensure that the weight of each channel is independently controllable in the weighted projection calculation. Thus, the recalculation of the interference factor can accurately reflect the influence of the newly added channel on the spectral similarity of the symbiotic bacteria, and improve the dynamic adaptability of the interference inhibition.
[0060] As a preferred embodiment, the scheme of the application is implemented as follows:
[0061] The process of recalculating the interference factor includes the following steps:
[0062] First, the same number of zero-value elements as the number of newly added channels is added to each standard spectrum in the symbiotic bacteria spectral library. For example, the original standard spectrum vector is [0.2, 0.3, 0.4, 0.5, 0.6], and after one channel is newly added, the extended standard spectrum vector becomes [0.2, 0.3, 0.4, 0.5, 0.6, 0]. In this way, the extended symbiotic bacteria standard spectrum is formed.
[0063] Secondly, a new channel weight element is added to the original weight matrix to form a diagonal matrix. For example, the original weight matrix is a 5x5 diagonal matrix with diagonal elements [1, 1, 1, 1, 1], and after adding a new channel, the expanded weight matrix becomes a 6x6 diagonal matrix with diagonal elements [1, 1, 1, 1, 1, 0.5], where 0.5 is the weight of the new channel.
[0064] Finally, the interference factor is recalculated using the expanded standard spectrum and the expanded weight matrix. The calculation formula remains unchanged, but the input data dimension increases.
[0065] Through the above technical solutions, the application realizes the dynamic updating of the interference factor after adding a new channel. Thus, the accuracy of the interference factor calculation is ensured, and the precision of the pathogen identification is improved. Specifically, by adding zero-value elements to the symbiotic bacteria spectrum library, the integrity of the original spectrum information is maintained; by expanding the weight matrix, flexible control of the new channel is achieved. This method enables the system to adapt to the dynamic changes of multi-spectral data, improving the robustness and universality of the algorithm.
[0066] The application further proposes a calculation process of the pathogen spectrum feature vector, which includes:
[0067]
[0068] wherein, is the spectrum vector of the target pixel, is the interference factor, is the standard spectrum vector in the symbiotic bacteria spectrum database that minimizes the interference factor.
[0069] Specifically, after the variance of the interference factor converges, the standard spectrum vector in the symbiotic bacteria spectrum library that is closest to the spectrum vector of the target pixel is selected , and multiplied by the interference factor to obtain the estimated component of the symbiotic bacteria spectrum. Through linear subtraction operation, the component is removed from the original spectrum vector to generate a spectrum vector that only retains the pathogen features.
[0070] For example, for a target pixel containing 10 spectral channels, its spectrum vector is [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1].
[0071] The calculated interference factor is 0.8, and the corresponding standard spectrum vector is [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0].
[0072] After linear calculation, the pathogenic bacteria spectral feature vector is obtained is [0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.24, 0.26, 0.28, 0.30].
[0073] Through the above technical solutions, the present application can effectively separate the spectral features of pathogenic bacteria and symbiotic bacteria. Thus, the spectral features of pathogenic bacteria are enhanced, and the interference of symbiotic bacteria is inhibited. Further, the method improves the accuracy and reliability of pathogenic bacteria recognition, especially in the scenario where the spectral features of pathogenic bacteria and symbiotic bacteria are highly overlapped. Specifically, the pathogenic bacteria spectral feature vector obtained by linear calculation can better reflect the characteristics of pathogenic bacteria, providing more reliable input data for the subsequent pathogenic bacteria recognition model.
[0074] The present application further proposes a classification model based on a residual network structure, which is obtained by pre-training through transfer learning. The preset conditions include that the pathogenic bacteria confidence of the current pixel point is greater than a preset confidence threshold, and there are at least a preset number of pixel points in its neighborhood whose pathogenic bacteria confidence is greater than the threshold.
[0075] Among them, the residual network structure alleviates the gradient vanishing problem in the training process of deep network through jump connection, and improves the ability of the model to capture subtle differences in spectral features; transfer learning uses the model parameters pre-trained on a large multispectral dataset as the initial weights, and adapts to the current pathogenic bacteria recognition task through fine-tuning, reducing the overfitting risk caused by insufficient training data; the confidence threshold is set to 0.8, which is used to filter noise points with low confidence; the neighborhood condition is defined as at least 3 pixel points in the 3x3 region centered on the target pixel meet the confidence threshold, avoiding isolated pixels being incorrectly labeled as pathogenic bacteria.
[0076] Specifically, the residual network contains multiple residual blocks, each of which is composed of two convolutional layers and batch normalization layers. The input is transmitted to the next layer after being added to the output of the residual block through jump connection. In the transfer learning process, the convolutional layer weights of the pre-trained model are frozen, and only the parameters of the fully connected layer are adjusted to adapt to the new task. In the model inference stage, when the pathogenic bacteria confidence of the target pixel exceeds 0.8, it is further detected whether there are at least 3 pixel points in its 8-neighborhood whose confidence exceeds the threshold. If both conditions are met, the pixel is determined to belong to the pathogenic bacteria region and is marked as 1 in the mask; otherwise, it is marked as 0. Through the extraction ability of deep features of the residual network and the spatial consistency constraint of the neighborhood condition, the probability of misjudgment caused by spectral overlap is effectively reduced, and the generation accuracy of the pathogenic bacteria distribution mask is improved.
[0077] As a preferred embodiment, the scheme of the application is implemented as follows: the pathogenic bacteria recognition model uses ResNet50 residual network as the basic architecture, which contains 49 convolutional layers and 1 fully connected layer, and is pre-trained on the ImageNet dataset for transfer learning. In the transfer learning process, the original classification layer is removed and connected to the feature extraction layer composed of 256 neurons, and the Softmax classification layer is constructed at the end. After pre-training, a dataset containing 200,000 multispectral microscopic images is used for fine-tuning training, each group of data containing labeled pathogenic bacteria spectral feature vectors and corresponding binary labels. The preset condition is set as follows: the confidence threshold is set to 0.85, the neighborhood range is defined as a 3x3 region centered on the target pixel, and at least 5 pixels in the region are required to have a confidence value greater than 0.82.
[0078] Through the above technical scheme, the application effectively solves the problem of recognition accuracy decline caused by symbiotic bacteria interference in the spectral feature overlap scene. The residual network structure enhances the expression ability of deep spectral features through cross-layer connection mechanism, and the transfer learning strategy improves the training efficiency of small sample data by using the feature extraction ability of the pre-trained model. The joint determination mechanism of neighborhood confidence eliminates the misjudgment interference of isolated noise points, and through the spatial continuity constraint, the recognition result of the pathogenic bacteria region forms a continuous closed mask shape, thereby significantly improving the accuracy and robustness of pathogenic bacteria distribution detection in microscopic images.
[0079] The application further proposes that when judging whether the pathogenic bacteria confidence of a pixel point meets the preset condition, not only the pathogenic bacteria confidence of the current pixel point is required to be greater than the preset confidence threshold, but also there are at least a preset number of pixel points in the neighborhood of the current pixel point whose pathogenic bacteria confidence is greater than the confidence threshold.
[0080] Among them, the neighborhood range can be set to a 3x3 or 5x5 square region centered on the target pixel, and the preset number can be set to 30% to 50% of the total number of pixels in the neighborhood according to the actual sample characteristics. The residual network structure uses convolutional layer stacking with skip connection, and the transfer learning process uses a public microscopic image dataset for pre-training, and then fine-tunes with a small number of labeled pathogenic bacteria samples. The confidence threshold is determined according to the ROC curve of the validation set classification result, and is usually set to an interval value of 0.85 to 0.95.
[0081] Specifically, when the confidence output value of the target pixel exceeds the set threshold, the system will scan all the pixels within the range of its 8-neighborhood or 24-neighborhood. If the number of pixels in the neighborhood that meet the threshold reaches the preset lower limit, it is determined that the region has pathogen aggregation characteristics, and a mask label is generated; otherwise, it is considered as isolated noise and excluded. The residual network alleviates the gradient vanishing problem through a skip connection, enabling the model to effectively extract high-order nonlinear combinations of multispectral features. The transfer learning strategy utilizes the underlying feature extraction capabilities trained on large-scale natural images, combined with the unique spectral and spatial features of microscopic images for parameter fine-tuning, achieving high-precision classification under limited labeled data. This dual decision mechanism incorporates local spatial consistency into the decision-making process, effectively suppressing false positives caused by spectral noise or residual features of symbiotic bacteria.
[0082] As a preferred embodiment, the scheme of the application is implemented as follows: when the pathogen confidence of the target pixel does not meet the preset condition, a 5x5 neighborhood range is selected centered on the pixel, and the spectral vectors of all pixels in the neighborhood are extracted. For each spectral channel, the intensity values of the channel in the neighborhood are arranged in ascending order, and the 13th value is taken as the median. The intensity medians corresponding to each channel are combined in the original spectral channel order to form a new spectral vector. Based on this new spectral vector, a weighted projection algorithm is used to recalculate the minimum distance interference factor with the symbiotic bacteria spectral library. The updated interference factor and the new spectral vector are used to obtain a corrected pathogen spectral feature vector through linear calculation, which is input into a pre-trained residual network model for secondary identification. If the confidence meets the neighborhood density condition, a mask label is generated.
[0083] Through the above technical scheme, the application effectively solves the problem of insufficient symbiotic bacteria interference suppression in the spectral feature overlap scenario. By calculating the neighborhood spectral median, the influence of local abnormal noise on single-pixel judgment is eliminated, and the spatial continuity feature is used to enhance the dynamic suppression ability of symbiotic bacteria spectra, significantly improving the robustness of pathogen recognition in low signal-to-noise ratio areas.
[0084] Embodiment Two:
[0085] As shown in Figure 3 , the multispectral microscopic image fusion automatic pathogen recognition system comprises:
[0086] A data acquisition module for acquiring multispectral microscopic image data of a sample to be detected;
[0087] An interference factor calculation module for calculating the interference factor of each pixel point based on the multispectral microscopic image data and the pre-stored symbiotic bacteria spectral library data using a weighted projection algorithm;
[0088] The channel enhancement module is configured to determine whether the variance of the interference factor of the continuous preset number of pixel points is greater than a preset convergence threshold value, and if yes, extract a symbiotic bacteria sensitive channel set according to the symbiotic bacteria spectrum library data, construct pathogenic bacteria enhanced channel data according to the symbiotic bacteria sensitive channel set, add the pathogenic bacteria enhanced channel data to the multispectral microscopic image data, and recalculate the interference factor;
[0089] The feature vector calculation module is configured to perform linear calculation to obtain a pathogenic bacteria spectrum feature vector according to the interference factor and the multispectral microscopic image data.
[0090] The pathogenic bacteria recognition module is configured to input the pathogenic bacteria spectrum feature vector into a pre-trained pathogenic bacteria recognition model, output a pathogenic bacteria confidence, and determine whether the pathogenic bacteria confidence of the pixel point meets a preset condition, and if yes, generate a binary pathogenic bacteria distribution mask.
[0091] The above content is merely an example and description of the structure of the present application, and those skilled in the art can make various modifications or supplements or use similar ways to replace the described specific embodiments, as long as they do not deviate from the structure of the application or exceed the scope defined by the claims.
[0092] In the description of the present application, the description of the terms "one embodiment", "example", "specific example" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present application, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0093] The preferred embodiments of the application disclosed above are only used to help explain the application. The preferred embodiments do not describe all the details and do not limit the application to the specific embodiments. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can well understand and utilize the present application. The present application is limited only by the claims and their entire scope and equivalents.
Claims
1. A method for automatic identification of pathogens based on multispectral microscopic image fusion, characterized in that, Includes the following steps: Acquire multispectral microscopic image data of the sample to be tested; Based on the multispectral microscopic image data and the pre-stored symbiotic bacterial spectral library data, the interference factor of each pixel is calculated by weighted projection; the interference factor represents the degree of similarity between the current pixel and the symbiotic bacterial spectrum. If the variance of the interference factor of a consecutive preset number of pixels is greater than a preset convergence threshold, then extract the symbiotic sensitive channel set based on the symbiotic spectral library data, construct pathogen enhancement channel data based on the symbiotic sensitive channel set, add the pathogen enhancement channel data to the multispectral microscopic image data, and recalculate the interference factor. Otherwise, the pathogen spectral feature vector is obtained by linear calculation based on the interference factor and the multispectral microscopic image data. The pathogen spectral feature vector is then input into the pre-trained pathogen identification model, and the pathogen confidence score is output. Determine whether the pathogen confidence level of the pixel meets the preset conditions; if so, generate a binary pathogen distribution mask.
2. The method for automatic identification of pathogens based on multispectral microscopic image fusion according to claim 1, characterized in that: The multispectral microscopic image data includes pixel-level spectral intensity values of at least five spectral channels, and the pixel-level spectral intensity values of all spectral channels constitute the spectral vector of the target pixel.
3. The method for automatic identification of pathogens based on multispectral microscopic image fusion according to claim 2, characterized in that: The calculation process of the interference factor includes: Obtain the standard spectral vectors from the pre-stored symbiotic bacterial spectral library. Calculate the minimum distance between the current pixel's spectral vector and each standard spectral vector using weighted projection, and use this distance as the interference factor. The calculation formula is as follows: in, For a pre-stored spectral library of symbiotic bacteria, For standard spectral vectors, The spectral vector of the target pixel. It is a weighted matrix.
4. The method for automatic identification of pathogens based on multispectral microscopic image fusion according to claim 3, characterized in that: The extraction process of the symbiotic bacteria sensitive channel set includes: The spectral intensity values of all bacterial species in spectral channel i are extracted from the symbiotic bacterial spectral library to form the symbiotic bacterial intensity sequence of spectral channel i; Calculate the normalized distance between the spectral intensity value of the target pixel in spectral channel i and the intensity sequence of the symbiotic bacteria; When the normalized distance is less than 1, the sensitivity of spectral channel i = 1 - normalized distance; when the normalized distance is not less than 1, the sensitivity of spectral channel i = 0; spectral channel i with a sensitivity greater than the preset sensitivity threshold is added to the symbiotic sensitive channel set.
5. The method for automatic identification of pathogens based on multispectral microscopic image fusion according to claim 4, characterized in that: The process of constructing pathogen enhancement channel data includes: The spectral channels are divided into sensitive channels and non-sensitive channels according to the symbiotic sensitive channel set. The non-sensitive channels are weighted and summed, and the weighted sum of the sensitive channels is subtracted by a preset ratio to generate pathogen enhancement channel data. The pathogen enhancement channel data is then added as a new channel to the spectral vector of the target pixel. The formula for calculating pathogen enhancement channel data is as follows: in, For symbiotic bacteria sensitive channel set, This represents the spectral intensity value. Preset weights for spectral channels, This is the preset resistance coefficient.
6. The method for automatic identification of pathogens based on multispectral microscopic image fusion according to claim 5, characterized in that: The calculation process of the pathogen's spectral feature vector includes: in, The spectral vector of the target pixel. As an interference factor, This is the standard spectral vector that minimizes interference factors in the symbiotic bacterial spectral database.
7. The method for automatic identification of pathogens based on multispectral microscopic image fusion according to claim 6, characterized in that: The pathogen identification model is a classification model based on a residual network structure, which is obtained through transfer learning pre-training.
8. The method for automatic identification of pathogens based on multispectral microscopic image fusion according to claim 7, characterized in that: The preset conditions include: The pathogen confidence level of the current pixel is greater than a preset confidence threshold, and there are at least a preset number of pixels in the neighborhood of the current pixel whose pathogen confidence level is greater than the confidence threshold.
9. The method for automatic identification of pathogens based on multispectral microscopic image fusion according to claim 8, characterized in that: Also includes: If the pathogen confidence of the target pixel does not meet the preset conditions, the spectral vectors of all pixels in the neighborhood of the target pixel are further obtained. For each spectral channel of the target pixel, calculate the median intensity of that channel in the neighborhood; A new spectral vector is formed by the median intensity of all channels. The interference factor is recalculated based on the new spectral vector, and the pathogen is identified.
10. An automatic pathogen identification system based on multispectral microscopic image fusion, characterized in that: The method for automatic identification of pathogens using multispectral microscopic image fusion as described in any one of claims 1-9 includes: The data acquisition module is used to acquire multispectral microscopic image data of the sample to be tested; The interference factor calculation module is used to calculate the interference factor of each pixel by weighted projection based on the multispectral microscopic image data and the pre-stored symbiotic bacterial spectral library data. The channel enhancement module is used to determine whether the variance of the interference factor of a consecutive preset number of pixels is greater than a preset convergence threshold. If so, it extracts the symbiotic sensitive channel set based on the symbiotic spectral library data, constructs pathogen enhancement channel data based on the symbiotic sensitive channel set, adds the pathogen enhancement channel data to the multispectral microscopic image data, and recalculates the interference factor. The feature vector calculation module is used to perform linear calculations based on the interference factor and the multispectral microscopic image data to obtain the spectral feature vector of the pathogen. The pathogen identification module is used to input the spectral feature vector of the pathogen into a pre-trained pathogen identification model and output the pathogen confidence score; determine whether the pathogen confidence score of the pixel meets the preset conditions, and if so, generate a binary pathogen distribution mask.