A cell phenotype diagnosis system, medium, device and program product
By using the spatially constrained neural network of the watershed algorithm and the dual attention mechanism in medical image processing, combined with the median pooling operation, the problems of cell image differences and impurity effects are solved, and the identification and classification of cell phenotypes are improved. sex.
Patent Information
- Application Number
- CN202410923932.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-11
AI Technical Summary
In traditional medical image processing, cell images are highly variable and contain solution impurities and tissue debris, which makes image feature extraction difficult and affects the accuracy of cell segmentation and phenotypic diagnosis.
The spatially constrained neural network using the watershed algorithm and dual attention mechanism, combined with the median pooling operation, reduces the loss of image information and improves the recognition and classification capabilities of cell phenotypes.
It effectively reduces the loss of image information, improves the ability to accurately identify and classify cell phenotypes, reduces the depth of the neural network, and enhances the ability to extract cell image features.
Smart Images

Figure CN118470008B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and in particular to a cell phenotype diagnosis system, medium, equipment and program product. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] In today's medical image processing and analysis process, histopathological cell phenotype diagnosis is an extremely important part, and it is also an important basis for current medical diagnosis.
[0004] However, since there are great differences in actual cell images and there may be multiple layers of cell coverage on tissue sections, this has placed great limitations on the reading of manual tissue pathology. Moreover, the process of acquiring cell images requires staining and other processes, which leads to the presence of solution impurities, tissue debris, etc. in the acquired cell images. Traditional image feature extraction methods are interfered by impurities, image information is easily lost, and it is difficult to extract image features, which can easily lead to huge impacts and deviations in cell segmentation and subsequent phenotypic diagnosis. Summary of the invention
[0005] In order to solve the above problems, the present invention provides a cell phenotype diagnosis system, medium, device and program product, which takes a spatially constrained neural network with a watershed algorithm and a dual attention mechanism as the basis for cell phenotype diagnosis, reducing the loss of image information and the depth of the neural network; and proposes a median pooling operation, which is introduced into the dual attention mechanism to improve the ability to extract image features; and improves the ability of the spatially constrained neural network to accurately identify and classify cell phenotypes.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] The first aspect of the present invention provides a cell phenotype diagnosis system, comprising:
[0008] An image acquisition module, used for acquiring images of cells to be classified;
[0009] An image segmentation module, used to segment the cell image to be classified using a watershed algorithm to obtain segmented cells;
[0010] The classification module is used to input the segmented cells into the trained spatial constraint neural network to predict the cell phenotype;
[0011] Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
[0012] Furthermore, the median pooling layer is used to take the median of each spatial position element on the channel axis as the value of the spatial position element.
[0013] Furthermore, it also includes a picture acquisition module and an image processing module;
[0014] The image acquisition module is used to collect images of various cell phenotypes to form a training set;
[0015] The image processing module is used to crop and / or rotate and / or contrast enhance and / or mirror flip the images in the training set.
[0016] Furthermore, it also includes a model training module;
[0017] The image segmentation module is further used to segment the images in the training set and give the segmented cells the labels of the images before segmentation;
[0018] The model training module is used to train the spatial constraint neural network using the segmented images in the training set.
[0019] Furthermore, the watershed algorithm includes: graying, opening and closing operations, dilation operations, distance transformation and connecting connected components.
[0020] Furthermore, it also includes an evaluation and optimization module, which is used to evaluate the trained spatial constraint neural network through cross-validation and / or test set evaluation methods, and adjust the trained spatial constraint neural network according to the evaluation results.
[0021] Furthermore, an updating module is included for collecting images of new cell phenotypes and adjusting parameters of the trained spatial constraint neural network.
[0022] A second aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, the program being executed by a processor, and the program implementing the following steps when executed by the processor:
[0023] Acquire the cell image to be classified;
[0024] Using a watershed algorithm to segment the cell image to be classified to obtain segmented cells;
[0025] The segmented cells are input into the trained spatial constraint neural network to predict the cell phenotype;
[0026] Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
[0027] A third aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the program, the following steps are implemented:
[0028] Acquire the cell image to be classified;
[0029] Using a watershed algorithm to segment the cell image to be classified to obtain segmented cells;
[0030] The segmented cells are input into the trained spatial constraint neural network to predict the cell phenotype;
[0031] Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
[0032] A fourth aspect of the present invention provides a computer program product or a computer program, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the following steps:
[0033] Acquire the cell image to be classified;
[0034] Using a watershed algorithm to segment the cell image to be classified to obtain segmented cells;
[0035] The segmented cells are input into the trained spatial constraint neural network to predict the cell phenotype;
[0036] Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] The present invention uses a spatially constrained neural network with a watershed algorithm and a dual attention mechanism as the basis for cell phenotype diagnosis, which not only reduces the loss of image information and the depth of the neural network, but also improves the ability of the spatially constrained neural network to accurately identify and classify cell phenotypes.
[0039] The present invention improves the dual attention mechanism (CBAM) and abandons the maximum pooling layer of the attention mechanism to avoid the influence of impurity pixels on the feature extraction of cell images, retains the information contained in the original cell image to the greatest extent, reduces the loss of image information and the depth of the model; at the same time, a median pooling operation is proposed to be introduced into the spatial dimension attention module to improve the ability to extract image features. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which constitute a part of the specification of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but do not constitute limitations of the present invention.
[0041] Figure 1 Schematic diagram of a dual attention mechanism according to Embodiment 1 of the present invention;
[0042] Figure 2 This is a structural diagram of a spatial constraint neural network according to a first embodiment of the present invention;
[0043] Figure 3 4 is a structural diagram of a channel attention module according to the first embodiment of the present invention;
[0044] Figure 4 This is a structural diagram of a spatial attention module according to the first embodiment of the present invention;
[0045] Figure 5 Schematic diagram of median pooling according to Embodiment 1 of the present invention. DETAILED DESCRIPTION
[0046] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0047] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0048] In the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other. The present invention is further described below with reference to the accompanying drawings and embodiments.
[0049] Embodiment 1
[0050] The purpose of this first embodiment is to provide a cell phenotype diagnosis system.
[0051] This embodiment provides a cell phenotype diagnosis system for histopathological cell phenotype diagnosis.
[0052] A cell phenotype diagnosis system provided in this embodiment includes: an image acquisition module, an image processing module, an image acquisition module, an image segmentation module, a model training module and a classification module.
[0053] The image acquisition module is used to collect image features of various cell phenotypes to form a training set.
[0054] In this embodiment, pictures of various cell phenotypes are collected: a large number of pathological pictures containing different cell phenotypes are collected, and these pictures can be obtained through channels such as medical databases, pathology books or cooperative hospitals.
[0055] Use the image annotation tool (labelimg) to annotate the original image, use the frame to annotate the cells with the same phenotype in the original image, generate an XML (Extensible Markup Language) format document based on the image size, rectangular frame coordinates, and disease type information, and then use the programming software (Python) to write a script to convert the XML file into a TXT (text file) format file. The TXT file records the cell phenotype information and coordinate information in each image. Create a target detection dataset (VOC dataset) based on the image and annotation file. Common cell phenotypes include normal, proliferation, migration, apoptosis, cloning, invasion, autophagy, etc. For example, if the image is lung cancer tissue, then according to its degree of differentiation, the cell phenotype can be divided into: normal cells, poorly differentiated lung cancer, moderately differentiated lung cancer, and well-differentiated lung cancer.
[0056] The image processing module is used to pre-process the collected images, such as flipping them, and to establish a foundation for the subsequent watershed algorithm.
[0057] In this embodiment, image preprocessing, such as rotation and padding, is performed: the images collected in the training set are preprocessed to improve the accuracy of subsequent analysis and diagnosis. The preprocessing step may include operations such as image rotation and padding to ensure the consistency and usability of the image.
[0058] In this embodiment, a large number of pathological images mixed with different cell phenotypes are obtained, and image enhancement operations, i.e., preprocessing, are performed on the images, including top, bottom, left, and right cropping, random rotation, image contrast enhancement, and mirror flipping.
[0059] The image acquisition module is used to acquire the image of cells to be classified.
[0060] The image segmentation module is used to segment the collected cell images; or to segment the cell images to be classified.
[0061] The watershed algorithm is used for cell segmentation to expand the data set and ensure accuracy. The specific implementation steps are as follows:
[0062] S1. Read in a color image and convert it into a grayscale image after processing;
[0063] S2. Process the different colors caused by noise and uneven cell surface through opening and closing operations;
[0064] S3. Determine the foreground and background through dilation operation;
[0065] S4. Find the center point of each cell grayscale image through distance transformation as the initial point of the watershed algorithm;
[0066] S5. Connect the connected components and find the boundaries through the watershed algorithm to obtain the segmented cells;
[0067] S6. For the images used for training, it is also necessary to give the divided cells the labels of the images before segmentation, and write a python script to write the labels corresponding to each cell image into a TXT document.
[0068] The model training module is used to train the deep learning model (spatial constraint neural network) using the collected cell images after segmentation.
[0069] The classification module is used to import the segmented cell images to be classified (segmented cells) into a deep learning model (spatial constraint neural network) that has completed large-scale data training to obtain the prediction results (cell phenotype).
[0070] In this embodiment, if Figure 1 As shown in Figure 1, the spatial constraint neural network model is based on the traditional Res-net50 (residual network) model as the backbone network and is modified by adding a dual attention mechanism. The improved attention mechanism is added to the residual block of Res-net50. The specific structure is as follows: Figure 2 As shown, it includes three convolutional layers (BN), a channel attention module and a spatial attention module connected in sequence, and the input of the spatial constraint neural network model and the output of the spatial attention module are added together and then passed through an activation function (ReLU) to obtain the output of the spatial constraint neural network model.
[0071] The dual attention mechanism mainly includes: channel attention module and spatial attention module. The channel attention module mainly compresses the content of the feature map space level, performs global maximum pooling and global average pooling operations on the feature map space, and generates a new feature map after a series of operations. The following formula is its specific process: .
[0072] In the formula, is the final result obtained through the attention weighted operation, It represents the logistic normalization operation; AvgPool is the average pooling operation, MaxPool is the maximum pooling operation; MLP represents a shared network composed of a multi-layer perceptron with one hidden layer.
[0073] In this embodiment, the traditional Res-net50 model is adjusted by replacing the 7×7 large convolution kernel of the first layer of the Res-net50 network with three 3×3 small convolution kernels, thereby reducing the computer burden while ensuring the receptive field.
[0074] The double attention mechanism (CBAM) was improved, and the maximum pooling layer of the attention mechanism was discarded, which reduced the loss of image information and the depth of the model. At the same time, a median pooling operation was proposed to introduce into the spatial attention module to avoid the influence of impurity pixels on the cell image feature extraction, retain the information contained in the original cell image to the greatest extent, effectively avoid the loss of cell image information, and improve the ability to extract image features. Images of different cell phenotypes were substituted into the improved Res-net50 network for training and verification to obtain the results.
[0075] In this embodiment, the channel attention in the attention mechanism and the maximum pooling layer in the spatial attention module are abandoned, and a new median pooling operation is introduced to improve the spatial attention module. Median pooling is used to take the median of each spatial position element on the channel axis as its representative value, such as Figure 5 shown.
[0076] Figure 3 The improved channel attention module includes an average pooling layer and a multi-layer perceptron connected in sequence; and after the input of the channel attention module is residual mapped, it is added with the output of its last layer to obtain the output of the channel attention module.
[0077] Figure 4 The improved spatial attention module includes a median pooling layer, an average pooling layer, and a fully connected layer connected in sequence; and the input of the spatial attention module is added to the output of the fully connected layer to obtain the output of the spatial attention module.
[0078] In this embodiment, a deep learning model framework is built: a deep learning model framework suitable for cell phenotype diagnosis is established. Commonly used deep learning frameworks such as TensorFlow (end-to-end open source machine learning platform) and PyTorch (open source Python machine learning library) can be selected to build appropriate network structures and layers according to needs.
[0079] In this embodiment, the cell phenotype diagnosis model is constructed by using the improved Res-net50 spatial constraint network with the addition of the watershed algorithm and the dual attention mechanism: the improved Res-net50 spatial constraint network with the addition of the watershed algorithm and the dual attention mechanism is used as the basis of the cell phenotype diagnosis model. This network structure can improve the model's ability to accurately identify and classify cell phenotypes.
[0080] Using preprocessed cell phenotype data to train the spatial constraint neural network model: Use the preprocessed cell phenotype data to train the spatial constraint neural network model. The training process can use supervised learning methods to optimize and adjust model parameters using labeled image data.
[0081] Input new and different cell phenotypes into the trained model to obtain the model's prediction results: Use the trained model to predict new cell phenotype images and obtain diagnostic results. By inputting cell images into the model, the model will output the corresponding cell phenotype label or probability distribution, thereby helping doctors or researchers to make pathological phenotype diagnoses.
[0082] Evaluation and optimization module: Evaluate and optimize the trained model to improve its performance in different cell phenotype diagnosis tasks. Evaluation can be performed through cross-validation, test set evaluation, etc., and the model can be adjusted and improved based on the evaluation results.
[0083] Dataset expansion: In order to increase the generalization ability and accuracy of the model, you can consider expanding the dataset. This can include collecting more pathological images, increasing the number of samples of different cell phenotypes, or expanding existing data through data augmentation techniques, such as random rotation, translation, scaling, etc.
[0084] Update module for continuous improvement and updating: As new data and research results emerge, the system can be continuously improved and updated to enhance the performance and application scope of the cell phenotyping diagnostic system.
[0085] Embodiment 2
[0086] This embodiment provides a computer-readable storage medium, on which a computer program is stored. The program is executed by a processor, and when the program is executed by the processor, the following steps are implemented:
[0087] Acquire the cell image to be classified;
[0088] Using a watershed algorithm to segment the cell image to be classified to obtain segmented cells;
[0089] The segmented cells are input into the trained spatial constraint neural network to predict the cell phenotype;
[0090] Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
[0091] Embodiment 3
[0092] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the following steps when executing the program:
[0093] Acquire the cell image to be classified;
[0094] Using a watershed algorithm to segment the cell image to be classified to obtain segmented cells;
[0095] The segmented cells are input into the trained spatial constraint neural network to predict the cell phenotype;
[0096] Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
[0097] Embodiment 4
[0098] This embodiment provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the following steps:
[0099] Acquire the cell image to be classified;
[0100] Using a watershed algorithm to segment the cell image to be classified to obtain segmented cells;
[0101] The segmented cells are input into the trained spatial constraint neural network to predict the cell phenotype;
[0102] Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
[0103] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0104] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A cell phenotype diagnostic system, characterized in that: include: An image acquisition module, used for acquiring images of cells to be classified; The image segmentation module is used to segment the cell image to be classified by using a watershed algorithm to obtain segmented cells. Specifically, a color image is read in and converted into a grayscale image after processing; different colors caused by noise and uneven cell surfaces are processed by opening and closing operations; and foreground and background are determined by expansion operations; The center point of each cell grayscale image is found through distance transformation as the initial point of the watershed algorithm; Connect the connected components and find the boundaries through the watershed algorithm to obtain the segmented cells; The classification module is used to input the segmented cells into the trained spatial constraint neural network to predict the cell phenotype; Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
2. A cell phenotype diagnostic system as claimed in claim 1, characterized in that: The median pooling layer is used to take the median of each spatial position element on the channel axis as the value of the spatial position element.
3. A cell phenotype diagnostic system as claimed in claim 1, characterized in that: It also includes a picture acquisition module and an image processing module; The image acquisition module is used to collect images of various cell phenotypes to form a training set; The image processing module is used to crop and / or rotate and / or contrast enhance and / or mirror flip the images in the training set.
4. A cell phenotype diagnostic system as claimed in claim 3, characterized in that: It also includes a model training module; The image segmentation module is further used to segment the images in the training set and give the segmented cells the labels of the images before segmentation; The model training module is used to train the spatial constraint neural network using the segmented images in the training set.
5. A cell phenotype diagnostic system as claimed in claim 1, characterized in that: The watershed algorithm includes: graying, opening and closing operations, dilation operations, distance transformation and connecting connected components.
6. A cell phenotype diagnostic system as claimed in claim 1, characterized in that: It also includes an evaluation and optimization module, which is used to evaluate the trained spatial constraint neural network through cross-validation and / or test set evaluation methods, and adjust the trained spatial constraint neural network according to the evaluation results.
7. A cell phenotype diagnostic system as claimed in claim 1, characterized in that: It also includes an updating module for collecting images of new cell phenotypes and adjusting parameters of the trained spatial constraint neural network.
8. A computer-readable storage medium having a computer program stored thereon, the program being executed by a processor, characterized in that: When the program is executed by the processor, the following steps are implemented: Acquire the cell image to be classified; The watershed algorithm is used to segment the cell image to be classified to obtain segmented cells. Specifically, a color image is read in and converted into a grayscale image after processing; different colors caused by noise and uneven cell surfaces are processed through opening and closing operations; and foreground and background are determined through expansion operations; The center point of each cell grayscale image is found through distance transformation as the initial point of the watershed algorithm; Connect the connected components and find the boundaries through the watershed algorithm to obtain the segmented cells; The segmented cells are input into the trained spatial constraint neural network to predict the cell phenotype; Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the following steps are implemented: Acquire the cell image to be classified; The watershed algorithm is used to segment the cell image to be classified to obtain segmented cells. Specifically, a color image is read in and converted into a grayscale image after processing; different colors caused by noise and uneven cell surfaces are processed through opening and closing operations; and foreground and background are determined through expansion operations; The center point of each cell grayscale image is found through distance transformation as the initial point of the watershed algorithm; Connect the connected components and find the boundaries through the watershed algorithm to obtain the segmented cells; The segmented cells are input into the trained spatial constraint neural network to predict the cell phenotype; Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the following steps are implemented: Acquire the cell image to be classified; The watershed algorithm is used to segment the cell image to be classified to obtain segmented cells. Specifically, a color image is read in and converted into a grayscale image after processing; different colors caused by noise and uneven cell surfaces are processed through opening and closing operations; and foreground and background are determined through expansion operations; The center point of each cell grayscale image is found through distance transformation as the initial point of the watershed algorithm; Connect the connected components and find the boundaries through the watershed algorithm to obtain the segmented cells; The segmented cells are input into the trained spatial constraint neural network to predict the cell phenotype; Among them, the spatial constraint neural network extracts feature maps from the segmented cells through multi-layer convolutional layers, compresses the feature maps at the spatial level through average pooling and multi-layer perceptron, and then compresses channel features through median pooling layers and average pooling layers.
