A digital image target detection method and system based on medical microbiological inspection
Through multi-spectral and polarization imaging technology combined with principal component analysis and deep learning algorithms, the problems of low microbial image quality and insufficient classification accuracy in the prior art are solved, and high-quality image processing and high-precision microbial classification are achieved.
Patent Information
- Application Number
- CN202510199447.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-02-24
AI Technical Summary
The prior art lacks optimized design for microbial characteristics in the microbial image acquisition and preprocessing stages, resulting in low image quality and loss of detailed information. The feature extraction method is limited to a single type of feature, making it difficult to distinguish diverse microbial species.
Multi-spectral and polarization imaging technology are used to acquire images, multi-spectral and polarization images are fused through principal component analysis (PCA), microbial type characteristics in the multi-dimensional dataset are extracted, and a deep learning algorithm is used to construct a microbial classification model.
The contrast and clarity of microbial features are significantly improved, the image quality is enhanced, the discrimination degree of feature extraction and the accuracy of classification models are improved, and the problems of low image quality and insufficient classification accuracy in the prior art are solved.
Smart Images

Figure CN119693945B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital image processing, and particularly to a digital image target detection method and system based on medical microbiological inspection. Background Art
[0002] In recent years, with the rapid development of the fields of computer vision and machine learning, significant progress has been made in digital image target detection technology. In the medical field, especially in microbiological inspection, accurately identifying and classifying microorganisms is crucial for disease diagnosis, treatment plan selection, and public health monitoring. Traditional microbiological inspection methods rely on microscope observation and culture medium cultivation. These methods not only take a long time but are also easily affected by the experience of operators and environmental conditions, resulting in inconsistent and uncertain results. With the progress of imaging technology and computing power, digital image-based target detection methods have gradually become a research hotspot and provided new ideas and technical means for microbiological inspection.
[0003] Although the existing technologies have achieved certain results in microbial image acquisition and preliminary processing, there are still several deficiencies to be solved. First, traditional methods lack optimized design for microbial characteristics in the image acquisition stage and fail to fully utilize the advantages of multi-spectral and polarization imaging to maximize the display of microbial characteristics. Second, in the image preprocessing process, most methods only rely on simple filters for denoising and contrast adjustment, and do not fully consider the statistical characteristics of local regions, resulting in the loss of detail information. Especially in complex backgrounds, it is difficult to maintain the integrity of edges and other key features. Third, existing feature extraction methods are usually limited to a single type of feature and ignore the correlation between different types of features, which limits the ability of the model to distinguish diverse microbial species. Finally, although the application of deep learning models has improved the classification accuracy, they still face problems such as overfitting and insufficient generalization ability in practical applications, especially when dealing with small sample datasets. Summary of the Invention
[0004] In view of the above existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides a digital image target detection method based on medical microbiological inspection, which solves the problem that traditional methods lack optimized design for microbial characteristics in the image acquisition stage and fail to fully utilize the advantages of multi-spectral and polarization imaging to maximize the display of microbial characteristics.
[0006] To solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a digital image target detection method based on medical microbiological examination, which includes: photographing a microbial sample to obtain multi-spectral images of different wavelengths, and photographing the same microbial sample by adjusting the incident light angle to obtain a polarization image;
[0008] Denosing and artifact removal processing are performed on the obtained multi-spectral images and polarization images, and the image contrast is adjusted;
[0009] The processed multi-spectral images and polarization images are fused using principal component analysis (PCA) to obtain a multi-dimensional data set;
[0010] Image processing algorithms are used to extract the type characteristics of different microorganisms from the multi-dimensional data set;
[0011] A microbial classification model is constructed using a deep learning algorithm. The type characteristics are input into the microbial classification model to distinguish different microbial species, and the microbial species are output;
[0012] The output microbial species are compared with known microbial samples to verify the accuracy of the microbial classification model. According to the verification results, the parameters of the microbial classification model are adjusted.
[0013] As a preferred scheme of the digital image target detection method based on medical microbiological examination according to the present invention, wherein: the step of photographing the microbial sample to obtain multi-spectral images of different wavelengths and photographing the same microbial sample by adjusting the incident light angle to obtain a polarization image is specifically as follows:
[0014] The microbial sample is photographed at different wavelengths using a camera equipped with multiple filter wheels to obtain multi-spectral images;
[0015] Then, under the same conditions, by placing a linear polarization filter in front of the camera lens and rotating the filter to change the incident light angle, the same microbial sample is photographed to obtain a polarization image.
[0016] As a preferred scheme of the digital image target detection method based on medical microbiological examination according to the present invention, wherein: the step of denosing and artifact removal processing are performed on the obtained multi-spectral images and polarization images, and the image contrast is adjusted is specifically as follows:
[0017] The average value of all pixel values within a small neighborhood around each pixel point is calculated using a local mean filter to obtain the average brightness within the local area ;
[0018] An adaptive filtering formula is introduced according to the pixel values of the image to process the noise and artifacts in the multi-spectral images and polarization images and adjust the image contrast.
[0019] As a preferred embodiment of the digital image target detection method based on medical microbiological inspection according to the present invention, wherein: the use of principal component analysis (PCA) to fuse the processed multi-spectral image and polarization image to obtain a multi-dimensional data set, the specific steps are as follows:
[0020] Arrange the preprocessed multi-spectral image and polarization image into a data matrix X according to pixel positions, where each row represents a pixel point and each column represents the eigenvalue at a wavelength;
[0021] Perform centering processing on the data matrix X, subtract the average value of each feature from each feature to obtain the centered data matrix ;
[0022] Calculate the covariance matrix of the centered data matrix ; ;
[0023] The covariance matrix is a symmetric matrix. By solving the covariance matrix , a set of eigenvalues is obtained, where represents the eigenvalue, and represents the dimension of the covariance matrix ;
[0024] For each eigenvalue, solve the linear equation system to obtain the corresponding eigenvector , where represents the identity matrix, represents the index variable of the eigenvalue, represents the th eigenvalue, and represents the eigenvector corresponding to the th eigenvalue;
[0025] Sort the eigenvalues in descending order according to their magnitudes, and select the eigenvectors corresponding to the first largest eigenvalues as the principal components;
[0026] Project the centered data matrix onto the new coordinate system composed of the selected principal components to obtain the reduced-dimensional multi-dimensional data set .
[0027] As a preferred embodiment of the digital image target detection method based on medical microbiological inspection according to the present invention, wherein: the use of image processing algorithms to extract the type characteristics of different microorganisms from the multi-dimensional data set, the specific steps are as follows:
[0028] Apply the Canny edge detection algorithm to the fused dataset for processing to highlight the contours of microorganisms;
[0029] Perform opening and closing operations on the edge detection results to remove noise and fill existing holes;
[0030] Enhance the microbial features and automatically adjust the enhancement intensity according to the changes in the surrounding environment of each pixel point to obtain the enhanced image ;
[0031] According to Segment the enhanced image into different regions, with each region corresponding to a microbial sample;
[0032] Apply the OpenCV library to calculate the shape features, size features, and color distribution features of the microorganisms for each segmented object;
[0033] Integrate all the shape features, size features, and color distribution features to obtain the comprehensive type features of the microorganism 。
[0034] As a preferred solution of the digital image target detection method based on medical microorganism inspection according to the present invention, wherein: the microbial classification model is constructed using a deep learning algorithm, and the type features are used as input to the microbial classification model to distinguish different microbial species and output the microbial species. The specific steps are as follows:
[0035] Select the convolutional neural network CNN as the basic architecture of the microbial classification model;
[0036] The basic architecture of the microbial classification model includes multiple convolutional layers, activation function ReLU, pooling layers, fully connected layers, and Softmax layer;
[0037] Then add a branch for position prediction before the last layer, and this branch predicts the position of each detected microbial sample through a regression method;
[0038] The last layer is the Softmax layer, which is used to output the probability distribution of the microbial species;
[0039] The predicted species is the species with the highest probability.
[0040] As a preferred solution of the digital image target detection method based on medical microorganism inspection according to the present invention, wherein: the output microbial species is compared with known microbial samples to verify the accuracy of the microbial classification model, and according to the verification results, the parameters of the microbial classification model are adjusted. The specific steps are as follows:
[0041] Collect a large number of historical microbial samples, with each sample having a labeled true microbial species, and output the predicted microbial species by the microbial classification model;
[0042] Compare the predicted microbial species with the true microbial species, and calculate the classification accuracy of the microbial classification model ;
[0043] Set the target accuracy according to actual needs. When the classification accuracy does not reach the target accuracy, then dynamically adjust the learning rate of the microbial classification model.
[0044] In a second aspect, the present invention provides a digital image target detection system based on medical microbial inspection, including an acquisition module, a fusion module, a feature extraction module, a prediction module, and an optimization module:
[0045] The acquisition module is responsible for acquiring and preprocessing the multispectral image and polarization image of the microbial sample;
[0046] The fusion module is used to fuse the preprocessed multispectral image and polarization image into a multi-dimensional data set by using the principal component analysis (PCA) technique;
[0047] The feature extraction module applies the Canny edge detection algorithm to capture the microbial boundary information, then improves the feature connectivity and integrity through morphological operations on the edge detection results, then automatically adjusts the enhancement intensity according to environmental changes to obtain an enhanced image, and finally, calculates the shape, size, and color distribution features by using the OpenCV library to form comprehensive type features for classification;
[0048] The prediction module constructs a deep learning classification model, uses the extracted type features as input, distinguishes different microbial species, and outputs a prediction result;
[0049] The optimization module is responsible for evaluating the performance of the microbial classification model and dynamically adjusting the model parameters according to the verification results to optimize the configuration until the expected detection accuracy requirements are met.
[0050] In a third aspect, the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program, and: when the computer program is executed by the processor, it implements any step of the digital image target detection method based on medical microbial inspection as described in the first aspect of the present invention.
[0051] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and: when the computer program is executed by the processor, it implements any step of the digital image target detection method based on medical microbial inspection as described in the first aspect of the present invention.
[0052] The beneficial effects of the present invention are as follows: Through multi-spectral and polarization image acquisition, the present invention enhances the contrast and clarity of microbial features, providing high-quality basic data. Then, an adaptive filtering formula is used for denoising and contrast adjustment, effectively improving the image quality and ensuring the retention of details, laying a foundation for subsequent analysis. Subsequently, principal component analysis (PCA) achieves efficient data fusion and dimensionality reduction, reducing redundant information and highlighting key features, simplifying the data processing process. Applying Canny edge detection, morphological operations, and feature enhancement formulas, the contours and internal structures of microorganisms are finely depicted, greatly improving the robustness of the classification model. A classification model based on convolutional neural network (CNN) is constructed to achieve high-precision classification. Finally, through the verification process, dynamic learning rate adjustment is performed to ensure the continuous optimization of the performance of the microbial classification model, reaching a stable and efficient convergence state. In summary, the present invention not only solves the deficiencies in the prior art but also provides more accurate and reliable technical support for medical microbiological inspection. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0054] Figure 1 It is a flowchart of the digital image target detection method based on medical microbiological inspection in Embodiment 1.
[0055] Figure 2 It is a schematic diagram of the digital image target detection system based on medical microbiological inspection in Embodiment 1. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0056] To make the above objects, features, and advantages of the present invention more obvious and understandable, the specific embodiments of the present invention will be described in detail below with reference to the drawings in the specification.
[0057] Many specific details are set forth in the following description in order to provide a thorough understanding of the present invention. However, the present invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.
[0058] Second, the "one embodiment" or "embodiment" referred to herein means a specific feature, structure or characteristic that may be included in at least one implementation manner of the present invention. The appearances of "in one embodiment" in different places in this specification do not all refer to the same embodiment, nor are they separate or alternative embodiments that are mutually exclusive with other embodiments.
[0059] Embodiment 1, referring to Figure 1 , is the first embodiment of the present invention. This embodiment provides a digital image target detection method based on medical microbiological inspection, including the following steps:
[0060] S1: Photograph the microbial sample to obtain multi-spectral images of different wavelengths. Photograph the same microbial sample by adjusting the incident light angle to obtain a polarization image;
[0061] Use a camera equipped with multiple filter wheels to photograph the microbial sample at different wavelengths to obtain multi-spectral images. The selection of each wavelength should be based on the absorption and scattering characteristics of the target microorganism to ensure that the microbial characteristics can be highlighted;
[0062] Then, under the same conditions, place a linear polarization filter in front of the camera lens and rotate the filter to change the incident light angle, and photograph the same microbial sample to obtain a polarization image;
[0063] One of the key steps of the present invention is to photograph the microbial sample to obtain multi-spectral images of different wavelengths and obtain a polarization image by adjusting the incident light angle. This design idea stems from an in-depth understanding of the optical characteristics of microorganisms. Traditional microscope observation methods rely on a single-wavelength light source and are difficult to comprehensively capture the complex structures and characteristics of microorganisms. In contrast, multi-spectral imaging can select the most suitable wavelength according to the absorption and scattering characteristics of different microorganisms, thereby highlighting specific microbial characteristics. For example, some pathogens may exhibit stronger reflection or absorption phenomena at specific wavelengths, making them easier to identify and classify. In addition, polarization imaging further enhances the understanding of the internal structure of microorganisms because it can reveal the directionality and anisotropy of materials, which is crucial for distinguishing different types of microorganisms;
[0064] In the prior art, due to the tiny size and diverse morphologies of microorganisms, single-wavelength images often cannot provide sufficient information to accurately distinguish different microbial species. The present invention solves this problem by introducing multi-spectral and polarization imaging. Specifically:
[0065] Multispectral imaging utilizes the absorption and scattering characteristics of target microorganisms to select the optimal wavelength combination, significantly enhancing the contrast of microbial features in the image. For example, for bacteria with strong scattering characteristics, short wavelengths (such as ultraviolet light) can better penetrate the cell wall and produce high-contrast images; while for fungi that mainly rely on pigment absorption, red or blue light in the visible light can be selected to maximize their visual differences.
[0066] Polarization imaging effectively reduces the influence of non-target substances (such as culture media or other impurities) on the image by changing the incident light angle. This technique is particularly suitable for transparent or semi-transparent microbial samples because polarized light can highlight the contours and other important structures of microorganisms without additional illumination. Experiments show that under the same conditions, polarization imaging can obtain clearer images with less background noise, which is crucial for subsequent target detection and classification.
[0067] S2: Denoise and remove artifacts from the acquired multispectral images and polarization images and adjust the image contrast;
[0068] Calculate the average value of all pixel values within a small neighborhood around each pixel point using a local mean filter to obtain the average brightness within the local area. ;
[0069] Introduce an adaptive filtering formula based on the pixel values of the image to process the noise and artifacts in the multispectral images and polarization images and adjust the image contrast. This formula takes into account the statistical characteristics of the local area of the image and can automatically adjust the filtering intensity according to the changes in the environment around each pixel point. The expression is:
[0070] ;
[0071] Where, represents the pixel value after filtering at the pixel position , represents the pixel value of the original image at the pixel position , represents the average brightness within the local area, represents the parameter controlling the non-linear response, represents the base of the natural logarithm, represents the smoothed background image calculated using the mean filter;
[0072] The innovation of this formula lies in its combination with the Sigmoid function for adjustment, making the filtering effect more in line with actual needs, especially in maintaining details under complex backgrounds;
[0073] The value range is [0, 255] (assuming an 8-bit grayscale image). When When it is equal to 0, it means that the noise at this pixel position is suppressed to the greatest extent; as increases, it indicates that more original information is retained at this pixel position, especially for edges and other important feature parts, which helps subsequent object detection.
[0074] S3: Use principal component analysis (PCA) to fuse the processed multi-spectral image and polarization image to obtain a multi-dimensional data set;
[0075] Arrange the preprocessed multi-spectral image and polarization image into a data matrix X according to pixel positions. Each row represents a pixel point, and each column represents the eigenvalue at a wavelength. The purpose of doing this is to ensure that all relevant information can be included in the PCA process;
[0076] Perform centering processing on the data matrix X, subtract the average value of each feature from each feature to obtain the centered data matrix , and the purpose of centering is to make the mean of the data zero, which is crucial for the effectiveness of the PCA algorithm. The specific formula is as follows:
[0077] ;
[0078] Among them, represents the centered data matrix, represents the original data matrix, represents the average value vector of each feature;
[0079] Calculate the covariance matrix of the centered data matrix , and the covariance matrix describes the correlation between each feature and provides a basis for subsequent principal component analysis. The calculation formula is:
[0080] ;
[0081] Among them, represents the number of image pixels, in represents the transpose of the data matrix ;
[0082] The covariance matrix is a symmetric matrix. By solving , a set of eigenvalues is obtained. Among them, represents the eigenvalue, represents the identity matrix, represents the dimension of the covariance matrix ;
[0083] For each eigenvalue, by solving the linear equations the corresponding eigenvector is obtained , where denotes the index variable of the eigenvalue, denotes the -th eigenvalue, denotes the eigenvector corresponding to the -th eigenvalue. The eigenvalue represents the importance of each principal component, while the eigenvector defines the direction of the new coordinate axis;
[0084] Sort the eigenvalues in descending order according to their magnitudes, and select the eigenvectors corresponding to the top largest eigenvalues as the principal components;
[0085] Project the centered data matrix onto the new coordinate system formed by the selected principal components to obtain the dimensionality-reduced multi-dimensional dataset , and the expression is:
[0086] ;
[0087] where denotes the matrix composed of the eigenvectors corresponding to the top largest eigenvalues;
[0088] In the formula, the value range is the multi-dimensional vector space, and the value of each element depends on the range of the original image data. When the element in is equal to 0, it means that the information at that position is simplified to the greatest extent; as the value of the element in
[0089] S4: Use image processing algorithms to extract the type features of different microorganisms from the multi-dimensional dataset;
[0090] Apply the Canny edge detection algorithm to process the fused dataset to highlight the contours of the microorganisms. The Canny edge detection can effectively capture the boundary information of the microorganisms and provide a basis for subsequent feature extraction;
[0091] Perform opening and closing operations on the edge detection results to remove noise and fill existing holes. These operations help to improve the connectivity and integrity of the microorganism features;
[0092] Enhance the microorganism features and automatically adjust the enhancement intensity according to the changes in the surrounding environment of each pixel point to obtain the enhanced image, and the expression is:
[0093] ;
[0094] Among them, represents the pixel value after feature enhancement at the pixel position ; represents the parameter controlling the enhancement intensity, represents the pixel value of the original image at the pixel position ; represents the average brightness within the local area, represents the standard deviation, represents pi, represents the base of the natural logarithm;
[0095] According to the enhanced image is segmented into different regions, and each region corresponds to a microbial sample;
[0096] The OpenCV library is applied to calculate the shape features, size features, and color distribution features of the microorganisms for each segmented object;
[0097] All the shape features, size features, and color distribution features are integrated to obtain the comprehensive type features of the microorganism , and the expression is:
[0098] ;
[0099] Among them, represents the shape feature, represents the size feature, represents the color distribution feature;
[0100] The key step S4 of the present invention uses an image processing algorithm to extract the type features of different microorganisms from the multi-dimensional data set. This design not only integrates the traditional edge detection technology, but also combines morphological operations, feature enhancement, and multi-feature integration methods to form a multi-level feature extraction framework. This comprehensive strategy aims to comprehensively capture the structural and appearance characteristics of microorganisms, providing a rich and accurate information source for subsequent classification;
[0101] The key step S4 solves the problems of low feature discrimination and insufficient integrity in the prior art by performing multi-level feature extraction on the multi-dimensional data set, and significantly improves the accuracy and reliability of microorganism classification through a series of innovative means.
[0102] S5: Use a deep learning algorithm to construct a microorganism classification model, input the type features into the microorganism classification model to distinguish different microorganism species, and output the microorganism species;
[0103] Select the Convolutional Neural Network (CNN) as the infrastructure of the microbial classification model;
[0104] The infrastructure of the microbial classification model includes multiple convolutional layers, the ReLU activation function, pooling layers, and fully connected layers;
[0105] Then, a branch for position prediction is added before the last layer, and this branch uses regression methods to predict the positions of each detected microbial sample;
[0106] The last layer is a Softmax layer, which is used to output the probability distribution of microbial species, and the expression is:
[0107] ;
[0108] where, represents the probability of predicting the th microbial species, represents the index variable of the microbial species, represents the activation function, represents the weight matrix of the fully connected layer and represents the bias term of the fully connected layer;
[0109] The predicted species is the one with the highest probability, and the expression is:
[0110] ;
[0111] where, represents the predicted microbial species, represents finding the maximum value;
[0112] The value range of is [0, 1], representing the probability of each microbial species. When
[0113] The key step S5 of the present invention constructs a microbial classification model using deep learning algorithms and introduces a branch for position prediction. This design idea is based on the powerful representation ability of the Convolutional Neural Network (CNN) and the accuracy of regression methods, aiming to achieve high-precision classification simultaneously. Selecting CNN as the infrastructure is because it can automatically learn complex patterns in images and is especially suitable for processing the characteristics of microbial types in multi-dimensional datasets. Through the combination of multiple convolutional layers, the ReLU activation function, pooling layers, and fully connected layers, CNN can effectively extract and compress image features, providing a solid foundation for classification.
[0114] S6: Compare the output microbial species with known microbial samples to verify the accuracy of the microbial classification model. According to the verification results, adjust the parameters of the microbial classification model;
[0115] Collect a large number of historical microbial samples, and each sample has a labeled true microbial species. The microbial classification model outputs the predicted microbial species;
[0116] Compare the predicted microbial species with the true microbial species, and calculate the classification accuracy of the microbial classification model , and the calculation formula is:
[0117] ;
[0118] Among them, represents the number of verification samples, represents the index variable of the verification samples, represents the predicted microbial species, represents the true microbial species, is an indicator function, also known as a characteristic function. In this context, its role is to check whether the predicted microbial species matches the true microbial species;
[0119] Set the target accuracy according to actual needs. When the classification accuracy does not reach the target accuracy, then dynamically adjust the learning rate of the microbial classification model. The expression is:
[0120] ;
[0121] Among them, represents the learning rate of the microbial classification model, represents the initial learning rate, represents the coefficient that controls the decay rate of the learning rate, represents the set target accuracy;
[0122] The value range of is [0, , representing the learning rate. As increases,
[0123] The key step S6 of the present invention introduces a dynamic verification and parameter adjustment mechanism, aiming to accurately evaluate and continuously optimize the performance of the microbial classification model through the verification of a large number of historical microbial samples. This design idea is based on the feedback control theory. By comparing the predicted results output by the microbial classification model with the known true microbial species, the classification accuracy is calculated, and the target value is set according to actual requirements, so as to realize the dynamic adjustment of the model parameters. This method not only ensures the high precision of the model, but also improves its generalization ability and stability;
[0124] The key step S6 solves the problem of unstable performance of the classification model in the prior art through the verification of a large number of historical microbial samples and dynamic parameter adjustment, and significantly improves the stability and accuracy of the microbial classification model through a series of innovative means, providing strong support for medical microbial inspection.
[0125] Please refer to Figure 2 , this embodiment also provides a digital image target detection system based on medical microbial inspection, including: an acquisition module, a fusion module, a feature extraction module, a prediction module and an optimization module:
[0126] The acquisition module is responsible for acquiring and preprocessing the multi-spectral image and polarization image of the microbial sample;
[0127] The fusion module is used to fuse the preprocessed multi-spectral image and polarization image into a multi-dimensional data set by using the principal component analysis (PCA) technology;
[0128] The feature extraction module applies the Canny edge detection algorithm to capture the microbial boundary information, then improves the feature connectivity and integrity through morphological operations on the edge detection results, then automatically adjusts the enhancement intensity according to environmental changes to obtain the enhanced image, and finally, uses the OpenCV library to calculate the shape, size and color distribution features to form comprehensive type features for classification;
[0129] The prediction module constructs a deep learning classification model, uses the extracted type features as input, distinguishes different microbial species, and outputs the prediction results;
[0130] The optimization module is responsible for evaluating the performance of the microbial classification model and dynamically adjusting the model parameters according to the verification results to optimize the configuration until the expected detection accuracy requirements are met.
[0131] This embodiment also provides a computer device applicable to the case of the digital image target detection method based on medical microbial inspection, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the digital image target detection method based on medical microbial inspection as proposed in the above embodiment.
[0132] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a carrier network, NFC (Near Field Communication), or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or may be a button, a trackball, or a touchpad provided on the housing of the computer device, or may also be an external keyboard, touchpad, or mouse, etc.
[0133] This embodiment also provides a storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the digital image target detection method based on medical microbiological inspection as proposed in the above embodiment; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM for short), Electrically Erasable Programmable Read-Only Memory (EEPROM for short), Erasable Programmable Read Only Memory (EPROM for short), Programmable Red-Only Memory (PROM for short), Read-Only Memory (ROM for short), magnetic memory, flash memory, a magnetic disk, or an optical disc.
[0134] In summary, through multi-spectral and polarization image acquisition, the present invention enhances the contrast and clarity of microbial features, providing high-quality basic data. Subsequently, an adaptive filtering formula is used for denoising and contrast adjustment, effectively improving the image quality and ensuring the retention of details, laying a foundation for subsequent analysis. Then, principal component analysis (PCA) achieves efficient data fusion and dimensionality reduction, reducing redundant information and highlighting key features, simplifying the data processing flow. The application of Canny edge detection, morphological operations, and feature enhancement formulas finely depicts the microbial contour and internal structure, significantly improving the robustness of the classification model. A classification model based on convolutional neural network (CNN) is constructed to achieve high-precision classification. Finally, through the verification process, dynamic learning rate adjustment is performed to ensure the continuous optimization of the performance of the microbial classification model, reaching a stable and efficient convergence state. In summary, the present invention not only solves the deficiencies in the prior art but also provides more accurate and reliable technical support for medical microbiological inspection.
[0135] Example 2. Referring to Table 1, this is the second example of the present invention. To further verify the technical solution of the present invention, experimental simulation data of a digital image target detection method based on medical microbiological inspection is given.
[0136] To verify the effectiveness and superiority of the present invention in medical microbiological inspection, an experiment was designed and implemented. The purpose of this experiment was to compare the performance of the prior art and the method combining multi-spectral and polarization imaging proposed by the present invention in microbial classification.
[0137] Experiment Preparation
[0138] First, two common pathogens, Escherichia coli and Staphylococcus aureus, were selected as experimental subjects. These two bacteria are ideal test samples due to their wide distribution and importance. To ensure the representativeness of the experimental results, 100 samples from different sources were collected. Each sample contained known types of Escherichia coli or Staphylococcus aureus and was strictly disinfected to avoid cross-contamination.
[0139] Equipment and Materials
[0140] Microscope and camera system: A high-resolution digital camera equipped with multiple filter wheels was used, which was capable of taking pictures of samples at three wavelengths of 450 nm, 550 nm, and 650 nm. At the same time, a rotatable linear polarization filter was installed in front of the camera lens to obtain polarization images.
[0141] Software Tools: Image processing scripts are written in MATLAB and Python to implement functions such as image denoising, PCA fusion, and feature extraction; a convolutional neural network (CNN) classification model is built using the TensorFlow framework, and the OpenCV library is called through the Python interface for edge detection and other morphological operations.
[0142] Hardware Platform: A workstation configured with an Intel Core i7 processor, 32GB of memory, and an NVIDIA GeForce RTX3080 GPU, which is used to accelerate computationally intensive tasks.
[0143] Experimental Procedures
[0144] 1. Multi-Spectral and Polarization Image Acquisition
[0145] Multispectral images are taken for each sample at the above three wavelengths, and a set of polarization images are obtained by rotating the polarization filter. Each set of images is saved in 8-bit grayscale format with a resolution of 2048×2048 pixels.
[0146] 2. Image Preprocessing
[0147] Apply the local mean filter and the adaptive filtering formula:
[0148] ;
[0149] Denoise and adjust the contrast of the acquired images. This step significantly improves the image quality and preserves the detail information especially in complex backgrounds.
[0150] 3. Data Fusion
[0151] Arrange the preprocessed multispectral images and polarization images into a data matrix X according to pixel positions, and centralize X to obtain , then calculate the covariance matrix , solve for the eigenvalues and their corresponding eigenvectors. Select the eigenvectors corresponding to the top k largest eigenvalues as the principal components, and project into the new coordinate system to generate the dimensionality-reduced multi-dimensional dataset .
[0152] 4. Feature Extraction
[0153] Use the Canny edge detection algorithm to highlight the microbial contours, and remove noise and fill holes through opening and closing operations. Then, according to the expression:
[0154] ;
[0155] Automatically adjust the enhancement intensity, and finally segment different microbial regions. Apply the OpenCV library to calculate the shape, size, and color distribution features to form comprehensive type features 。
[0156] 5. Deep learning classification
[0157] Construct a CNN model consisting of multiple convolutional layers, activation function ReLU, pooling layers, and fully connected layers, and add a position prediction branch. During the training process, output the probability distribution of microbial species through the Softmax layer ,and determine the final classification result according to the maximum probability 。
[0158] 6. Verification and parameter adjustment
[0159] Collect a large number of historical microbial samples, and each sample has a labeled true microbial species. Compare the predicted results output by the model with the true labels and calculate the classification accuracy ; If the classification accuracy does not reach the set target value, dynamically adjust the learning rate to optimize the model performance.
[0160] Specifically as shown in Table 1 below:
[0161] Table 1 Comparison data table of the prior art and the present invention
[0162] Parameter Name Unit Prior Art (Mean ± Standard Deviation) This Invention (Mean ± Standard Deviation) Data Description Image Contrast - 1.2 ± 0.3 2.5 ± 0.4 This invention significantly improves the image contrast through multi - spectral and polarization imaging, making the microbial features more obvious. Noise Suppression Effect % 65 ± 5 92 ± 3 The adaptive filtering formula significantly reduces noise interference and improves the accuracy of subsequent analysis. Edge Sharpness Number of Pixels 50 ± 10 85 ± 7 The combination of Canny edge detection and morphological operations significantly enhances the edge sharpness, which is beneficial for feature extraction. Classification Accuracy % 78 ± 4 95 ± 2 The deep - learning classification model combined with multi - feature integration significantly improves the classification accuracy, proving the effectiveness of the model. Number of Learning Rate Adjustments times 10 ± 2 3 ± 1 The dynamic adjustment mechanism reduces unnecessary iteration times and speeds up the model convergence rate. Object Detection Time seconds 15 ± 2 8 ± 1 The overall process of this invention is optimized, and the time from image acquisition to classification completion is significantly shortened.
[0163] By analyzing the data in Table 1, it can be seen that the present invention shows obvious superiority over the prior art in many aspects:
[0164] 1. Image contrast improvement
[0165] The average image contrast of the prior art is 1.2 ± 0.3, while the present invention reaches 2.5 ± 0.4. This significant improvement is attributed to the combined use of multispectral imaging and polarization imaging, which can select the most suitable wavelength combination according to the absorption and scattering characteristics of different microorganisms, thereby highlighting specific microbial features. For example, for bacteria with strong scattering characteristics, short wavelengths (such as ultraviolet light) can better penetrate the cell wall and produce high-contrast images; while for fungi that rely on pigment absorption, visible red or blue light can be selected to maximize their visual differences.
[0166] 2. Enhanced noise suppression effect
[0167] The introduction of the adaptive filtering formula has improved the noise suppression effect of the present invention from the existing 65±5% to 92±3%. This improvement not only removes more background noise, but more importantly, it can also maintain detailed information in complex backgrounds, which is crucial for subsequent target detection. Experiments show that even in a cluttered environment, the present invention can still effectively capture the key features of microorganisms.
[0168] 3. Improvement in edge sharpness
[0169] In terms of edge sharpness, the present invention achieves 85±7 pixels, which is much higher than the 50±10 pixels of the prior art. This is mainly due to the combined application of Canny edge detection and morphological operations, as well as the role of the feature enhancement formula. These processes not only highlight the microorganism contours, but also improve the feature connectivity and integrity, providing high-quality basic data for subsequent classification.
[0170] 4. Significantly improved classification accuracy
[0171] The combination of the deep learning classification model and multi-feature integration enables the classification accuracy of the present invention to reach (95±2)%, far exceeding the (78±4)% of the prior art. Especially for those difficult-to-distinguish microorganism species, the present invention greatly improves the classification accuracy by comprehensively considering multi-dimensional features such as shape, size, and color distribution. In addition, the introduction of the position prediction branch further enhances the functional diversity of the model, providing more comprehensive support for practical applications.
[0172] 5. Reduction in the number of learning rate adjustments
[0173] The application of the dynamic verification and parameter adjustment mechanism reduces the number of learning rate adjustments of the present invention from the existing 10±2 times to 3±1 times. This method not only ensures the high accuracy of the model, but also improves its generalization ability and stability, reduces the fluctuations during training, and speeds up the model convergence speed.
[0174] 6. Shorter target detection time
[0175] The optimization of the overall process, including efficient data fusion, fast feature extraction, and accurate classification prediction, reduces the target detection time of the present invention from the existing 15±2 seconds to 8±1 seconds. This improvement not only improves work efficiency, but also provides more timely data support for clinical diagnosis and pathological analysis.
[0176] In summary, through a series of innovative measures, the present invention solves the problems in the prior art such as low image contrast, poor noise suppression effect, insufficient edge sharpness, low classification accuracy, frequent adjustment of learning rate, and long target detection time. These improvements not only enhance the stability and accuracy of the model, but also provide strong technical support for medical microbiological inspection, demonstrating the creativity and novelty of the present invention.
Claims
1. A digital image target detection method based on medical microbiology testing, characterized by: include: Microbial samples are photographed to obtain multispectral images of different wavelengths. The same microbial sample is photographed by adjusting the incident light angle to obtain polarized images. Specifically: Microbial samples were photographed at different wavelengths using a camera equipped with multiple filter wheels to obtain multispectral images; Then, under the same conditions, by placing a linear polarization filter in front of the camera lens and rotating the filter to change the angle of incident light, the same microbial sample was photographed to obtain a polarization image; The acquired multispectral images and polarization images are denoised and artifacts are removed, and the image contrast is adjusted, specifically: The local mean filter is used to calculate the average value of all pixel values in a small neighborhood around each pixel to obtain the average brightness in the local area. ; According to the pixel value of the image, an adaptive filtering formula is introduced to process the noise and artifacts in the multispectral image and polarization image and adjust the image contrast. The expression is: ; in, Indicates the pixel position The pixel value after filtering is Indicates the pixel position The pixel values of the original image, Represents the average brightness in a local area. represents the parameter controlling the nonlinear response, represents the base of natural logarithms, represents the smoothed background image calculated using the mean filter; The processed multispectral image and polarization image are fused using principal component analysis (PCA) to obtain a multidimensional data set. Image processing algorithms are used to extract the type features of different microorganisms from multidimensional data sets; Use deep learning algorithms to build a microbial classification model, use type features to input the microbial classification model, distinguish different microbial species, and output the microbial species; The output microbial species are compared with known microbial samples to verify the accuracy of the microbial classification model, and the microbial classification model parameters are adjusted based on the verification results.
2. The digital image target detection method based on medical microbiology testing according to claim 1, characterized in that: The processed multispectral image and polarization image are fused using principal component analysis (PCA) to obtain a multidimensional data set. The specific steps are as follows: Arrange the preprocessed multispectral image and polarization image into a data matrix X according to the pixel position, where each row represents a pixel point and each column represents a characteristic value at a wavelength; Center the data matrix X and subtract the mean value of each feature from the feature to obtain the centralized data matrix ; Calculate the centralized data matrix The covariance matrix of ; Covariance matrix is a symmetric matrix, by solving the covariance matrix , and obtain a set of eigenvalues ,in, represents the eigenvalue, Represents the covariance matrix Dimensions; For each eigenvalue, by solving the linear equation system Get the corresponding feature vector ,in, represents the identity matrix, index variable representing the eigenvalue, Indicates eigenvalues, Indicates The eigenvectors corresponding to the eigenvalues; Sort by eigenvalue in descending order and select the first The eigenvector corresponding to the largest eigenvalue is taken as the principal component; The centralized data matrix Projecting into a new coordinate system consisting of the selected principal components to obtain a multidimensional data set with reduced dimensionality .
3. The digital image target detection method based on medical microbiology testing according to claim 2, characterized in that: The specific steps of extracting the type features of different microorganisms from the multidimensional data set using an image processing algorithm are as follows: Apply Canny edge detection algorithm to the fused data set Processing is performed to highlight the outlines of microorganisms; Perform opening and closing operations on the edge detection results to remove noise and fill the existing holes; Enhance the microbial features and automatically adjust the enhancement intensity according to the changes in the surrounding environment of each pixel to obtain an enhanced image ; according to Segment the enhanced image into different regions, each region corresponding to a microbial sample; The OpenCV library is used to calculate the shape, size, and color distribution characteristics of the microorganisms for each segmented object; Integrate all shape features, size features and color distribution features to obtain the comprehensive type characteristics of the microorganism .
4. The digital image target detection method based on medical microbiology testing according to claim 3, characterized in that: The microbial classification model is constructed by using a deep learning algorithm, and type features are used to input the microbial classification model, distinguish different microbial species, and output the microbial species. The specific steps are as follows: Convolutional neural network (CNN) was selected as the basic architecture of the microbial classification model; The basic architecture of the microbial classification model includes multiple convolutional layers, activation function ReLU, pooling layer, fully connected layer and Softmax layer; Then, a branch for location prediction is added before the last layer, which predicts the location of each detected microbial sample through a regression method; The last layer is the Softmax layer, which is used to output the probability distribution of microbial species; The predicted category is the category with the highest probability.
5. The digital image target detection method based on medical microbiology testing according to claim 4, characterized in that: The output microbial species are compared with known microbial samples to verify the accuracy of the microbial classification model, and the microbial classification model parameters are adjusted according to the verification results. The specific steps are as follows: Collect a large number of historical microbial samples and each sample has a well-labeled real microbial species, and output the predicted microbial species from the microbial classification model; Compare the predicted microbial species with the actual microbial species and calculate the classification accuracy of the microbial classification model ; Set the target accuracy according to actual needs. When the target accuracy is not reached, the learning rate of the microbial classification model is dynamically adjusted.
6. A digital image target detection system based on medical microbiology testing, based on the digital image target detection method based on medical microbiology testing according to any one of claims 1 to 5, characterized in that: Including acquisition module, fusion module, feature extraction module, prediction module and optimization module: The acquisition module is responsible for acquiring and preprocessing multispectral images and polarization images of microbial samples; The fusion module is used to fuse the pre-processed multispectral image and polarization image into a multidimensional data set by using principal component analysis (PCA) technology; The feature extraction module uses the Canny edge detection algorithm to capture the boundary information of microorganisms, and then improves the feature connectivity and integrity by performing morphological operations on the edge detection results, and then automatically adjusts the enhancement strength according to environmental changes to obtain an enhanced image. Finally, the shape, size and color distribution features are calculated using the OpenCV library to form a comprehensive type feature for classification; The prediction module constructs a deep learning classification model, uses the extracted type features as input, distinguishes different types of microorganisms, and outputs prediction results; The optimization module is responsible for evaluating the performance of the microbial classification model and dynamically adjusting the model parameters according to the verification results to optimize the configuration until the expected detection accuracy requirements are met.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the digital image target detection method based on medical microbiology testing according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the digital image target detection method based on medical microbiology testing according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Microorganism classification and identification method and system based on computer vision
CN116843955A
Polarization multispectral fusion OLED defect detection method
CN118982500A