Microglial cell segmentation method and device and microglial cell classification method and device
By combining image processing and deep learning models, microglia segmentation and classification of branches and bodies are solved, and the problems of inaccurate segmentation and insufficient classification accuracy in traditional methods are achieved, and efficient and accurate automated segmentation and classification of microglia are achieved.
Patent Information
- Application Number
- CN202510448921.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-07-11
AI Technical Summary
The existing microglia segmentation and classification methods rely on traditional morphological processing, resulting in poor segmentation effect, branch breakage, information loss, indistinguishable branches and cell bodies, and insufficient classification accuracy, especially in high noise or complex images.
Using a combination of image processing and deep learning model, the branches and soma of microglia are segmented and classified through filter transformation, soma segmentation model and classification model. Homomorphic filtering, Frangi filtering, adaptive threshold segmentation and TransUNet network variants are used for soma segmentation, and combined with Vision Transformer network for classification.
Accurate segmentation and efficient classification of microglia are achieved, segmentation accuracy and classification efficiency are improved, manual intervention is reduced, and it is suitable for automated processing of large-scale data, with strong adaptability, especially when the morphological parameters are small, it can still maintain high accuracy.
Smart Images

Figure CN120298699A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology. Specifically, it relates to a method and device for microglia segmentation and classification. More specifically, it relates to a method and device for microglia segmentation, a method and device for microglia classification, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Microglia are important immune cells in the central nervous system, and their morphological changes usually reflect corresponding functional states, such as resting, activation, inflammatory response, etc. Through precise segmentation and classification of morphology, researchers can automatically identify and quantify microglia populations in different states, thereby helping to evaluate the degree and scope of neuroinflammation.
[0003] Currently, there are very few methods available for microglial morphology analysis, mainly relying on the ImageJ tool. This tool integrates a series of morphological processing operations, but its targeted processing effect on microglia is not good, and still requires a lot of manual operations to assist in the analysis, which is time-consuming and laborious. In addition to analyzing with the ImageJ tool, some related segmentation methods also have certain drawbacks, such as easy branch breakage, and difficulty in distinguishing branches and cell bodies. Summary of the Invention
[0004] This application aims to solve at least one of the technical problems in the related art to some extent. To this end, an object of this application is to propose an accurate and efficient method for microglia segmentation and classification.
[0005] Specifically, the technical solution of this application is as follows:
[0006] In the first aspect of this application, a method for microglia segmentation is proposed. According to an embodiment of this application, the method includes: obtaining an original microglia image; performing a filtering transformation process on the original microglia image to obtain a branch segmentation image of the original microglia; inputting the original microglia image into a cell body segmentation model to obtain a cell body segmentation image of the original microglia; and performing a superimposition process on the branch segmentation result and the cell body segmentation result to obtain a microglia segmentation image.
[0007] The aforementioned method combines image processing and a deep learning model to separately segment the branches and cell bodies of microglia, and superimposes the segmentation results, achieving accurate segmentation of microglia, improving the segmentation accuracy, and effectively overcoming problems such as branch breakage, information loss, and difficulty in distinguishing branches and cell bodies caused by traditional microglial morphology analysis tools. Moreover, this method is suitable for processing microglia images with high noise or complexity, simplifies the processing process, and improves the segmentation efficiency.
[0008] In the second aspect of the present application, a method for classifying microglia is proposed. According to an embodiment of the present application, the method includes: inputting the segmented microglia image into a cell classification model to obtain the category to which each microglia in the segmented microglia image belongs; wherein, the segmented microglia image is obtained by segmenting using the method described in the first aspect.
[0009] Traditional methods for classifying microglia rely on the extraction of morphological parameters, resulting in a cumbersome and inefficient data acquisition and collation process. When facing small differences in some parameters, the classification accuracy is insufficient. The aforementioned method for classifying microglia can achieve efficient and accurate cell classification by inputting the high-precision segmented images obtained by branch segmentation and soma segmentation in the first aspect into a trained classification model, significantly improving the classification efficiency, reducing manual intervention, and being applicable to the automated processing of large-scale data. When the morphological parameters of microglia are slightly different, it still shows strong adaptability and accuracy.
[0010] In the third aspect of the present application, a microglia segmentation device is proposed. According to an embodiment of the present application, the device includes: an image acquisition module for acquiring an original microglia image; a branch image processing module for performing filtering transformation processing on the original microglia image to obtain a branch segmentation image of the original microglia; a soma image processing module for inputting the original microglia image into a soma segmentation model to obtain a soma segmentation image of the original microglia; and a segmented image generation module for superimposing the branch segmentation result and the soma segmentation result to obtain a segmented microglia image.
[0011] The aforementioned device combines image processing and a deep learning model to separately segment the branches and somas of microglia and superimpose the segmentation results, achieving accurate segmentation of microglia, improving the segmentation accuracy, and effectively overcoming problems such as branch breakage, information loss, and difficulty in distinguishing branches and somas caused by traditional microglia morphological analysis tools. Moreover, this device is suitable for processing microglia images with high noise or complexity, simplifies the processing process, and improves the segmentation efficiency.
[0012] In the fourth aspect of the present application, a microglia classification device is proposed, which includes: a classification module for inputting the segmented microglia image into a cell classification model to obtain the category to which each microglia in the segmented microglia image belongs; wherein, the segmented microglia image is obtained by segmenting using the method described in the first aspect.
[0013] Traditional microglia classification methods rely on the extraction of morphological parameters, resulting in a cumbersome and inefficient data collection and collation process. When facing small differences in some parameters, the classification accuracy is insufficient. The aforementioned microglia classification device can achieve efficient and accurate cell classification by inputting the high-precision segmentation images obtained from the first aspect of branch segmentation and cell body segmentation into a trained classification model, significantly improving the classification efficiency, reducing manual intervention, and being suitable for the automated processing of large-scale data. When the morphological parameters of microglia are relatively small, it still shows strong adaptability and accuracy.
[0014] In the fifth aspect of the present application, the present application proposes an electronic device. According to an embodiment of the present application, the device includes: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program to implement the method described in the first aspect or the second aspect.
[0015] In the sixth aspect of the present application, the present application proposes a computer-readable storage medium. According to an embodiment of the present application, the computer-readable storage medium includes computer instructions, and when the instructions are executed by a computer, the computer is caused to implement the method described in the first aspect or the second aspect.
[0016] In the seventh aspect of the present application, the present application proposes a computer program product. According to an embodiment of the present application, the computer program product includes computer instructions, and when part or all of the computer instructions run on a computer, the method described in the first aspect or the second aspect is caused to be executed.
[0017] The aforementioned electronic device, computer-readable storage medium, and computer program product achieve accurate and efficient automated segmentation and classification by automatically executing the microglia segmentation method or the microglia classification method through computer instructions. In addition, due to the characteristics of the instructions, they have better stability in different environments.
[0018] Additional aspects and advantages of the present application will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 It is a schematic flowchart of a microglia segmentation method provided by an embodiment of the present application;
[0021] Figure 2 It is a schematic diagram of the original microglia image provided by an embodiment of the present application;
[0022] Figure 3 It is a schematic diagram of the segmented image of the original microglia provided by an embodiment of the present application; among them, A is the branched segmented image; B is the cell body segmented image; C is the microglia segmented image;
[0023] Figure 4 It is a schematic diagram of the network architecture of the cell body segmentation model provided by an embodiment of the present application;
[0024] Figure 5 It is a schematic diagram of the segmented image of a single microglia provided by an embodiment of the present application;
[0025] Figure 6 It is a schematic diagram of the network architecture of the cell classification model provided by an embodiment of the present application;
[0026] Figure 7 It is a schematic diagram of the microglia segmentation device provided by an embodiment of the present application;
[0027] Figure 8 It is a schematic diagram of the microglia classification device provided by an embodiment of the present application;
[0028] Figure 9 It is a schematic diagram of the electronic device provided by an embodiment of the present application. Detailed implementation manners
[0029] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server including a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0031] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.
[0032] In this article, unless otherwise specified, the term "model" refers to a computational model or algorithm that can automatically perform tasks such as prediction, classification, recognition, or decision-making by learning and analyzing input data. The learning process of the model is based on statistical principles and data pattern recognition, and uses a training data set to adjust model parameters and optimize the model to improve its prediction or reasoning ability. Machine learning models can adopt various algorithms and technologies, such as neural networks, support vector machines, decision trees, random forests, deep learning, etc. These models can be trained and optimized through supervised learning, unsupervised learning, or reinforcement learning. In practical applications, machine learning models can be used in various fields, such as natural language processing, image recognition, pattern recognition, data mining, recommendation systems, predictive analysis, etc. It has important application potential in processing large-scale data, automated decision-making, and intelligent systems. However, it should be noted that in the specific application of machine learning models, in-depth research needs to be carried out on the features and models used for prediction in order to obtain a relatively satisfactory prediction effect. Otherwise, various problems will occur, such as overfitting problems, underfitting problems, and problems with poor generalization ability. The inventors of the present application have verified that using an optimized model architecture to segment and classify microglia can significantly improve the accuracy of microglia image segmentation and classification.
[0033] Currently, the related microglia segmentation methods still mainly rely on traditional morphological processing methods, such as top-hat processing, Gaussian filtering, Split-Bregman, fast threshold segmentation methods, etc. On the one hand, the aforementioned segmentation methods are prone to causing branch breaks, resulting in poor segmentation effects and losing some information. When the collected microglia images are relatively complex and the background is cluttered, the segmentation effect will be greatly reduced; on the other hand, there are differences between the features of branches and cell bodies, and it is difficult for a single segmentation method to segment both of them well at the same time. Generally speaking, traditional image processing methods have large limitations in the usage scenario and low accuracy, and are not suitable for microglia images with a lot of noise or complex microglia morphology. Since the segmentation effect will directly affect the subsequent classification effect, if there is a loss of microglia targets or low segmentation accuracy during the segmentation process, it will also affect the subsequent analysis results.
[0034] In view of the above deficiencies, the inventors have carried out various optimizations, such as adopting different segmentation methods based on branches and cell bodies, optimizing the architecture of the cell body segmentation model, and classifying based on the segmented images, etc.
[0035] In one aspect of the present application, the present application proposes a microglia segmentation method, referring to Figure 1 , the method includes:
[0036] S110, obtaining an original microglia image;
[0037] In some examples of the present application, the original microglia image referred to is as Figure 2 shown.
[0038] S120, performing a filtering transformation process on the original microglia image to obtain a branch segmentation image of the original microglia;
[0039] In some examples of the present application, performing a filtering transformation process on the original microglia image obtained in step S110, the filtering transformation process includes:
[0040] Based on the homomorphic filtering method, performing a first contrast enhancement process on the original microglia image to obtain a first enhanced image; Since the quality of the original microglia image has a great influence on the segmentation result, the brightness and contrast of the original image are adjusted by homomorphic filtering to balance the illumination, reduce the influence of uneven brightness on the segmentation, enhance the cell branches and edge structures, and improve the segmentation accuracy.
[0041] In some examples of the present application, in the homomorphic filtering process, a Gaussian high-pass filter is used for frequency domain filtering.
[0042] Based on the gamma transformation method, performing a second contrast enhancement process on the first enhanced image to obtain a second enhanced image; The image after homomorphic filtering may have uneven gray values, such as some areas of the image being too dark and some areas being overexposed. Therefore, the gamma transformation is used to further adjust the contrast of the image after homomorphic filtering, enhance the overall detail performance of the image, highlight the branch part of the microglia, and improve the segmentation effect.
[0043] Based on the Frangi filtering method, performing a branch structure enhancement process on the second enhanced image to obtain a branch segmentation gray image; Frangi filtering can suppress noise while enhancing the branch structure and is often used in pipeline-like structures such as blood vessels. Since the branches of microglia are thin lines, the Frangi filtering is used to enhance the branch structure, making it easier to segment, reducing branch breakage, improving the segmentation integrity, and suppressing other noises such as the cell bodies of microglia.
[0044] Based on the adaptive threshold segmentation method, perform image binarization on the branch-segmented grayscale image to obtain the branch-segmented image of the original microglia.
[0045] In some examples of the present application, the aforementioned adaptive threshold segmentation method can be selected from the Otsu algorithm. The Otsu algorithm is an adaptive threshold segmentation method commonly used for image binarization, that is, converting a grayscale image into a black-and-white image. Its core idea is to automatically find an optimal threshold to minimize the within-class variance of the foreground (target) and background, or maximize the between-class variance. In the microglia branch segmentation task of the present application, the Otsu algorithm is used to binarize the enhanced image after Frangi filtering to obtain a clear segmentation result of the branches; automatically determine the optimal threshold, avoid manual adjustment, and improve the automation degree of segmentation; reduce background interference and retain the clearest target area (branches).
[0046] In some examples of the present application, the branch-segmented image of the original microglia obtained based on the foregoing scheme is as Figure 3 shown in A.
[0047] S130, input the original microglia image into the soma segmentation model to obtain the soma-segmented image of the original microglia;
[0048] In some examples of the present application, the soma segmentation model is obtained by training in the following manner: Obtain training set data, where the training set data includes: microglia images without soma annotation and microglia images with soma annotation; input the microglia images without soma annotation into the TransUNet network variant, and use the microglia images with soma annotation as labels to train the TransUNet network variant to obtain the soma segmentation model. The soma segmentation model based on the TransUNet network variant effectively improves the soma segmentation effect.
[0049] In some examples of the present application, the microglia images for training can be obtained from a public database or from self-collected data. Those skilled in the art can understand that the training data set can be further amplified, such as by cropping, rotating, scaling, local selection, noise, and contrast, etc.
[0050] In some examples of the present application, the aforementioned microglia images with soma annotation can be obtained by annotating the soma part of the microglia using the LableMe tool.
[0051] In some examples of the present application, refer to Figure 4, the aforementioned cell body segmentation model is based on the TransUNet network architecture, adding an attention mechanism and an edge feature extraction network. Based on the attention mechanism, the feature representation of the TransUNet network is enhanced, and based on the edge feature extraction network, the enhancement of the cell body edge is guided. By combining the attention mechanism and the edge feature extraction network based on the TransUNet network architecture, this cell body segmentation model effectively solves the problems of blurred edges and complex morphology in microglia cell body segmentation. By introducing the attention mechanism, the model can more accurately focus on the key feature regions in the image, enhancing the feature representation ability; while the edge feature extraction network helps to improve the clarity of the cell body edge, thus improving the segmentation accuracy. This model can show stronger adaptability and accuracy when dealing with the complex morphology and unclear edges of microglia, effectively improving the segmentation effect.
[0052] In some examples of the present application, the attention mechanism (CABM) includes: a channel attention mechanism and a spatial attention mechanism. The channel attention module emphasizes useful features by adaptively adjusting the importance of different channels, while the spatial attention module focuses on the spatial information of the feature map to highlight important regions. Specifically, in the present application, after each Decoder block of the TransUNet network architecture, the CBAM attention mechanism is added to enhance important features. The feature map of the Decoder block is input into the CBAM, and redundant features are suppressed through the channel and spatial attention mechanisms, which helps to better capture the details of the target area.
[0053] Since the edge of the microglia cell body is not clear enough and the difference from the branches is not obvious enough, an edge feature extraction network (Edge Feture Extraction, EFE) is designed to guide the enhancement of the cell body edge, extract edge features from the three-layer CNN features in the encoder, and combine them with the backbone features. Among them, the edge feature extraction network is as Figure 4 shown. In some examples of the present application, edge feature extraction based on the edge feature extraction network includes: 1) performing multi-scale feature extraction on the feature map extracted by the ResNet network to obtain multi-channel feature maps of different scales; 2) performing scale alignment on the multi-channel feature maps of different scales to obtain multi-channel feature maps of the same scale; 3) performing splicing and edge feature extraction on the multi-channel feature maps of the same scale to obtain an edge feature map. The use of the edge feature extraction network helps to better capture the edge features of the target area.
[0054] In some examples of the present application, it further includes: 4) Dynamically weighting and splicing the edge feature map and the backbone feature map to generate the feature map of the Decoder block. By dynamically weighting and splicing the edge feature map and the backbone feature map, the feature map of the Decoder block is generated to strengthen the edge information of the target area, enhance the detail expression ability, and improve the adaptability and robustness of the model to targets of different shapes, sizes, and complexities. In this way, the network can capture the edge information in the image more accurately and improve the segmentation accuracy.
[0055] Exemplarily, the feature maps of three different scales extracted by the ResNet network are respectively processed through a 3×3 convolutional layer, the output channels are set to be unified as 64, and then bilinear interpolation is applied to unify the sizes of the three output feature maps to ensure the compatibility of splicing. Further, a final edge feature map is generated through a 3×3 convolution and a ReLu function. Finally, we splice the edge feature and the backbone feature, generate weights through a 1×1 convolutional layer and a sigmoid function, and use the weights to dynamically weight the edge feature and the backbone feature to generate the final feature map of each Decoder block.
[0056] In some examples of the present application, the soma segmentation image of the original microglia obtained based on the foregoing scheme is as Figure 3 shown in B.
[0057] S140, superimpose the branch segmentation result and the soma segmentation result to obtain the microglia segmentation image.
[0058] In some examples of the present application, the microglia segmentation image obtained based on the foregoing scheme is as Figure 3 shown in C.
[0059] It can be understood that the foregoing branch segmentation image, soma segmentation image, and microglia segmentation image of the original microglia can all be obtained as outputs, not limited to the final microglia segmentation image.
[0060] The above branch segmentation method effectively improves problems such as branch breakage, target loss, inaccurate segmentation, and blurred edges caused by traditional methods.
[0061] In some examples of the present application, referring to Figure 5 , the foregoing method further includes: centering on a single soma of the microglia segmentation image, performing a cutting process on the microglia segmentation image to obtain a single microglia segmentation image. The foregoing cutting process includes: removing one or more of the isolated regions with pixels less than 100, retaining the microglia part, and removing noise.
[0062] The existing classification methods mainly use ImageJ to measure the fractal parameters and branch parameters of the morphology of segmented cells, and then cluster the obtained parameters or use machine learning for analysis to divide microglia into different categories. For example, spectral clustering, SVM, etc. Such a classification method requires collecting the morphological parameters of all segmented result images first, rather than directly classifying the images. The morphology of microglia is diverse, and the process of collecting and sorting data using software is time-consuming and laborious. At the same time, different microglia do not differ much in some parameters, and data screening is required, so relying solely on data may lead to inaccurate classification. There are also a small number of methods that use simple CNN networks for automatic classification, but the network is simple and the accuracy is not high enough.
[0063] Therefore, on the other hand of the present application, the present application proposes a microglia classification method, which includes: inputting the microglia segmentation image into a cell classification model to obtain the category to which each microglia in the microglia segmentation image belongs; wherein, the microglia segmentation image is obtained by the method of any of the foregoing examples.
[0064] In some examples of the present application, the categories include: ramified, rod-like, activated, amoeboid, etc.
[0065] The microglia classification method of the present application is based on the image segmentation method of the present application. On the one hand, based on the improvement of segmentation accuracy, the classification accuracy also increases; on the other hand, the classification method based on the vision model effectively improves the efficiency and accuracy of classification, without collecting the morphological parameters of cells in each picture, thus greatly saving labor costs and time costs, and having a better classification effect.
[0066] In some examples of the present application, referring to Figure 6 , the cell classification model is obtained by training in the following manner: obtaining a single microglia and its category; inputting the single microglia into a vision deep learning model, using the category as a label, training the vision deep learning model to obtain the cell classification model.
[0067] In some examples of the present application, the foregoing vision deep learning model is selected from the Vision Transformer network. The classification method using the foregoing vision model can achieve more accurate classification compared with traditional machine learning methods such as clustering. By testing on the test set, an accuracy of more than 99% can be achieved.
[0068] Based on the above microglia segmentation method, the present application further proposes a microglia segmentation device. Referring toFigure 7 The device 700 includes: an image acquisition module 710, a branch image processing module 720, a cell body image processing module 730, and a segmented image generation module 740, where
[0069] The image acquisition module 710 is configured to acquire an original microglia image; the branch image processing module 720 is configured to perform a filtering transformation process on the original microglia image to obtain a branch segmentation image of the original microglia; the cell body image processing module 730 is configured to input the original microglia image into a cell body segmentation model to obtain a cell body segmentation image of the original microglia; the segmented image generation module 740 is configured to perform a superimposition process on the branch segmentation result and the cell body segmentation result to obtain a microglia segmentation image.
[0070] In some examples of the present application, the filtering transformation process includes: performing a first contrast enhancement process on the original microglia image based on a homomorphic filtering method to obtain a first enhanced image; performing a second contrast enhancement process on the first enhanced image based on a gamma transformation method to obtain a second enhanced image; performing a branch structure enhancement process on the second enhanced image based on a Frangi filtering method to obtain a branch segmentation grayscale image; performing an image binarization process on the branch segmentation grayscale image based on an adaptive threshold segmentation method to obtain a branch segmentation image of the original microglia.
[0071] In some examples of the present application, the cell body segmentation model is obtained by training in the following manner: acquiring training set data, where the training set data includes: microglia images without cell body annotations and microglia images with cell body annotations; inputting the microglia images without cell body annotations into a TransUNet network variant, and using the microglia images with cell body annotations as labels to train the TransUNet network variant to obtain the cell body segmentation model.
[0072] In some examples of the present application, the variant includes: adding an attention mechanism and an edge feature extraction network to the TransUNet network.
[0073] In some examples of the present application, the attention mechanism includes: a channel attention mechanism and a spatial attention mechanism.
[0074] In some examples of the present application, edge feature extraction is performed based on the edge feature extraction network, including: 1) performing multi-scale feature extraction on the feature map extracted by the ResNet network to obtain multi-channel feature maps of different scales; 2) performing scale alignment on the multi-channel feature maps of different scales to obtain multi-channel feature maps of the same scale; 3) performing splicing and edge feature extraction on the multi-channel feature maps of the same scale to obtain an edge feature map.
[0075] In some examples of the present application, it further includes: 4) performing dynamic weighted sum and splicing processing on the edge feature map and the backbone feature map to generate the feature map of the Decoder block.
[0076] In some examples of the present application, it further includes: centering on a single cell body of the microglia segmentation image, performing cutting processing on the microglia segmentation image to obtain a single microglia segmentation image.
[0077] It should be understood that the system embodiments and the method embodiments can correspond to each other, and similar descriptions can refer to the method embodiments. To avoid repetition, they will not be elaborated here. Specifically, Figure 7 the illustrated system 700 can execute Figure 1 the corresponding method embodiments, and the foregoing and other operations and / or functions of each module in the system 700 are respectively for implementing Figure 1 the corresponding processes in each method in, and for the sake of brevity, they will not be elaborated here.
[0078] The system 700 of the embodiments of the present application has been described above from the perspective of functional modules in conjunction with the drawings. It should be understood that the functional modules can be implemented in the form of hardware, or in the form of instructions in software, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in the present application can be completed by the integrated logic circuit in the hardware in the processor and / or instructions in software. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by the hardware decoding processor, or executed by a combination of the hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps in the above method embodiments.
[0079] Based on the above microglia classification method, the present application further proposes a microglia classification device. Refer to Figure 8, the device 800 includes: a classification module 810, configured to input the microglia segmentation image into a cell classification model to obtain the category to which each microglia in the microglia segmentation image belongs; wherein, the microglia segmentation image is obtained by the microglia segmentation method of any of the foregoing examples.
[0080] In some examples of the present application, the cell classification model in the foregoing classification module 810 is obtained by training in the following manner: obtaining a single microglia and its category; inputting the single microglia into a visual deep learning model, and using the category as a label to train the visual deep learning model to obtain the cell classification model.
[0081] In some examples of the present application, the visual deep learning model is selected from the Vision Transformer network.
[0082] It should be understood that the system embodiments and the method embodiments can correspond to each other, and similar descriptions can refer to the method embodiments. To avoid repetition, it will not be elaborated here. Specifically, Figure 8 the illustrated system 800 can execute the microglia classification method embodiment, and the foregoing and other operations and / or functions of each module in the system 800 respectively implement the corresponding processes in the microglia classification method. For the sake of brevity, it will not be elaborated here.
[0083] The system 800 of the embodiments of the present application has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in the form of hardware, or can be implemented by instructions in software form, or can be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiments in the present application can be completed by the integrated logic circuit in the hardware in the processor and / or instructions in software form. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or can be executed and completed by a combination of the hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps in the foregoing method embodiments.
[0084] In another aspect of the present application, the present application proposes an electronic device. Refer to Figure 9 , the electronic device 900 can be an execution device of the foregoing method, but is not limited thereto. As Figure 9 shown, the electronic device 900 may include:
[0085] A memory 910 and a processor 920, where the memory 910 is used to store a computer program 990 and transmit the computer program 990 to the processor 920. In other words, the processor 920 can call and run the computer program 990 from the memory 910 to implement the method in the embodiments of the present application.
[0086] For example, the processor 920 can be used to execute the steps in the above method according to the instructions in the computer program 990.
[0087] In some embodiments of the present application, the processor 920 may include, but is not limited to:
[0088] A general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0089] In some embodiments of the present application, the memory 910 includes, but is not limited to:
[0090] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be Read-Only Memory (ROM), Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or flash memory. The volatile memory can be Random Access Memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double DataRate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synch link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0091] In some embodiments of the present application, the computer program 990 can be divided into one or more modules, which are stored in the memory 910 and executed by the processor 920 to complete the method provided by the present application. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 990 in the electronic device.
[0092] As Figure 9 shown, the electronic device 900 may further include:
[0093] A transceiver 940, which can be connected to the processor 920 or the memory 910.
[0094] Among them, the processor 920 can control the transceiver 940 to communicate with other devices. Specifically, it can send information or data to other devices, or receive information or data sent by other devices. The transceiver 940 can include a transmitter and a receiver. The transceiver 940 may further include antennas, and the number of antennas can be one or more.
[0095] It should be understood that the components in the electronic device 900 are connected through a bus system. Among them, the bus system includes not only a data bus, but also a power bus, a control bus, and a status signal bus.
[0096] According to one aspect of the present application, there is provided a computer-readable storage medium, on which computer instructions or programs are stored. When the computer instructions or programs are executed by a computer, the computer can execute the methods in the above method embodiments. Or rather, the embodiments of the present application also provide a computer program product containing instructions. When the instructions are executed by a computer, the computer executes the methods in the above method embodiments.
[0097] According to another aspect of the present application, there is provided a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods in the above method embodiments.
[0098] In other words, when implemented using software, it can be fully or partially implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are fully or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a server, or a data center to another website, a computer, a server, or a data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or a data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)).
[0099] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in connection with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.
[0100] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or modules can be in electrical, mechanical, or other forms.
[0101] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they can be located in one place, or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to implement the solution of this embodiment. For example, in each embodiment of this application, the various functional modules can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0102] The above content is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
[0103] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0104] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application without departing from the principle and spirit of the present application.
Claims
1. A microglia segmentation method, characterized in that Including: Obtain the original microglia image; Perform filtering transformation processing on the original microglia image to obtain the branch segmentation image of the original microglia; Input the original microglia image into the cell body segmentation model to obtain the cell body segmentation image of the original microglia; Perform superposition processing on the branch segmentation result and the cell body segmentation result to obtain the microglia segmentation image.
2. The method according to claim 1, characterized in that The filtering transformation processing includes: Based on the homomorphic filtering method, perform first contrast enhancement processing on the original microglia image to obtain the first enhanced image; Based on the gamma transformation method, perform second contrast enhancement processing on the first enhanced image to obtain the second enhanced image; Based on the Frangi filtering method, perform branch structure enhancement processing on the second enhanced image to obtain the branch segmentation grayscale image; Based on the adaptive threshold segmentation method, perform image binarization processing on the branch segmentation grayscale image to obtain the branch segmentation image of the original microglia.
3. The method according to claim 1 or 2, characterized in that, The cell body segmentation model is obtained by training in the following manner: Obtain training set data, where the training set data includes: microglia images without cell body annotation and microglia images with cell body annotation; Input the microglia images without cell body annotation into the TransUNet network variant, and use the microglia images with cell body annotation as labels to train the TransUNet network variant to obtain the cell body segmentation model.
4. The method according to claim 3, characterized in that The variant includes: adding an attention mechanism and an edge feature extraction network in the TransUNet network.
5. The method according to claim 4, characterized in that The attention mechanism includes: a channel attention mechanism and a spatial attention mechanism.
6. The method according to claim 4 or 5, characterized in that, Based on the edge feature extraction network for edge feature extraction, including: 1) Perform multi-scale feature extraction on the feature map extracted by the ResNet network to obtain multi-channel feature maps of different scales; 2) Align the scales of the multi-channel feature maps of different scales to obtain multi-channel feature maps of the same scale; 3) Perform splicing and edge feature extraction on the multi-channel feature maps of the same scale to obtain the edge feature map.
7. The method according to claim 6, wherein Further including: 4) Perform dynamic weighted and splicing processing on the edge feature map and the backbone feature map to generate the feature map of the Decoder block.
8. The method according to claim 1, wherein Further including: Taking the single cell body of the microglia segmentation image as the center, perform cutting processing on the microglia segmentation image to obtain a single microglia segmentation image.
9. A method for classifying microglia, characterized in that Including: Input the microglia segmentation image into the cell classification model to obtain the category to which each microglia in the microglia segmentation image belongs; Wherein, the microglia segmentation image is obtained by segmenting according to the method described in any one of claims 1-7.
10. The method according to claim 9, wherein The cell classification model is obtained by training in the following manner: Obtain a single microglia and its category; Input the single microglia into the visual deep learning model, and use the category as a label to train the visual deep learning model to obtain the cell classification model; Optionally, the visual deep learning model is selected from Vision Transformer networks.
11. A microglia segmentation device, characterized in that, Comprising: An image acquisition module for acquiring raw microglia images; A branched image processing module for performing filtering transformation processing on the raw microglia images to obtain branched segmentation images of the raw microglia; A cell body image processing module for inputting the raw microglia images into a cell body segmentation model to obtain cell body segmentation images of the raw microglia; A segmentation image generation module for superimposing the branched segmentation result and the cell body segmentation result to obtain microglia segmentation images.
12. A microglia classification device, characterized in that, Comprising: A classification module for inputting the microglia segmentation images into a cell classification model to obtain the category to which each microglia in the microglia segmentation images belongs; Wherein, the microglia segmentation images are obtained by segmenting using the method according to any one of claims 1-7.
13. An electronic device, characterized in that, Comprising: A processor and a memory; The memory for storing computer programs; The processor for executing the computer programs to implement the method according to any one of claims 1 to 10.
14. A computer-readable storage medium, characterized in that, The storage medium includes computer instructions, which when executed by a computer, cause the computer to implement the method according to any one of claims 1 to 10.
15. A computer program product, characterized in that, The computer program product includes computer instructions, which when part or all of the computer instructions are run on a computer, cause the model training method according to any one of claims 1 to 10 to be executed.