A population cell classification system, method, computer device, and storage medium
Patent Information
- Application Number
- CN202611170140.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-27
AI Technical Summary
不同细胞之间在形态、分化阶段以及空间分布上往往存在较强关联,仅依赖对单个细胞特征的独立建模,难以充分刻画病例内部的整体结构信息
1、突破传统假设:与传统方法通常假设细胞之间相互独立,仅对单个细胞特征独立建模相比,本发明通过引入Transformer结构和自注意力机制,实现了全局关系建模,让每个细胞的特征表示能够融合同一病例中其他细胞的信息。
Smart Images

Figure CN122990688A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical image processing and artificial intelligence technology, specifically relating to a population cell classification system, method, computer device, and storage medium. Background Technology
[0002] In medical image analysis and computational pathology tasks, a case typically consists of a large number of cells or localized regions. For example, a tissue section or pathological image may contain thousands of cell instances, each of which can have a high-dimensional feature vector extracted using a deep neural network. However, traditional image classification tasks usually use single-cell images as input for cell classification, which makes it difficult to utilize case information and the relationships between cell groups.
[0003] In real biological scenarios, cells are not independent entities. Different cells often exhibit strong correlations in morphology, differentiation stage, and spatial distribution. Relying solely on independent modeling of individual cell characteristics is insufficient to fully depict the overall structural information within a case. Therefore, it is necessary to explicitly introduce a modeling mechanism for "relationships between cells" into the model. Summary of the Invention
[0004] To address the problems existing in the prior art, this invention provides a population cell classification system, method, computer device, and storage medium based on a multi-layer Transformer structure and a dual-branch attention mechanism. This method uses the features of all cells under each case as model input, and achieves cell-level classification tasks through multi-layer relationship modeling and attention weighting, while also taking into account case-level classification and feature representation learning.
[0005] To solve the above-mentioned technical problems and achieve the above-mentioned technical effects, the present invention is implemented through the following technical solution: A population cell classification system includes a population cell classification model based on a multi-layer Transformer structure and a two-branch attention mechanism. The main architecture of the population cell classification model includes a cell-level feature input module, a Transformer relationship modeling module, a gated attention mechanism module, a case-level feature aggregation and cell classification module, and a clustering representation module.
[0006] The cell-level feature input module is responsible for receiving cell-level features of all cells in a single case as model input.
[0007] The Transformer relation modeling module is responsible for performing global cell relation modeling on the cell-level features of all input cells through self-attention computation and nonlinear transformation. This enables each cell to perceive feature information from other cells in the same case when updating its features, thereby effectively capturing the overall cell distribution pattern within the same case and obtaining a relation-enhanced cell-level feature representation that integrates global cell context information of the same case.
[0008] The gated attention mechanism module is responsible for calculating the attention score of each cell and assigning attention weights to each cell through a two-branch attention mechanism based on the hyperbolic tangent function and the sigmoid function, thereby highlighting cell instances that are more critical to case discrimination.
[0009] The case-level feature aggregation and cell classification module is responsible for weighted summation of all relation-enhanced cell-level feature representations based on the attention weights of each cell, resulting in a fixed-dimensional case-level feature representation vector. This vector is then used to perform case-level classification prediction, outputting the prediction results for each case category (i.e., case-level classification prediction results). The module also utilizes the previously obtained relation-enhanced cell-level feature representations to perform cell-level classification prediction, outputting the type prediction results for individual cells within the case (i.e., cell-level classification prediction results). These cell-level classification prediction results are used as auxiliary supervisory signals to constrain the feature learning process.
[0010] The clustering representation module is responsible for learning cluster center representations related to categories in the cell-level feature space, and obtaining cluster center feature representations based on prototype learning.
[0011] Furthermore, the cell-level features of all cells in a single case received by the cell-level feature input module are represented as a cell-level feature matrix of size 1×N×M, where 1 represents a fixed batch size, N represents the number of cells in a single case, and M represents the vector dimension of the cell-level features of each cell.
[0012] Furthermore, the Transformer relationship modeling module consists of a multi-layer Transformer structure, and each layer of the Transformer structure contains a multi-head attention mechanism (MHA) and a feedforward neural network (FFN). In a single-layer Transformer structure, the multi-head attention mechanism is responsible for information interaction between cells. Specifically, it maps the input cell-level features into multiple sets of queries, keys, and vector values. By calculating the similarity between queries and keys, attention weights are obtained, and the value vectors are weighted and summed to obtain a cell-level feature representation that integrates global cell context information of the same case. This allows each cell's cell-level features to contain the association information of other cells in the same case, accurately capturing the dependencies between cells. In the single-layer Transformer structure, the feedforward neural network is responsible for feature processing within a single cell. Specifically, it performs independent, refined, and nonlinear processing on each cell-level feature representation output by the multi-head attention mechanism that integrates global cell context information of the same case. It also abstracts and refines the association information collected by the multi-head attention mechanism, enhancing the fitting ability and nonlinear expression ability of the Transformer relationship modeling module, thereby obtaining a relationship-enhanced feature representation that integrates global cell context information of the same case. The multi-head attention mechanism and the feedforward neural network, along with the multi-layer stacking of the Transformer structure, gradually upgrade the cell-level features, jointly completing the global cell relationship modeling task of all cell-level features, and outputting cell-level features that incorporate inter-cell correlation information and have stronger expressive power.
[0013] Furthermore, the multi-head attention mechanism performs block processing during the attention calculation process, dividing the query Q vector into segments for calculation according to a fixed window size, thereby significantly reducing memory usage and improving the scalability of the model without affecting the calculation results.
[0014] Furthermore, the gated attention mechanism module includes two parallel nonlinear transformation branches. One of the nonlinear transformation branches uses the hyperbolic tangent (Tanh) function to enhance feature representation, while the other uses the Sigmoid function to control the degree of information transmission. The gated attention mechanism module is responsible for processing the cell-level features of all cells in a single case using the two parallel nonlinear transformation branches. The outputs of the two parallel nonlinear transformation branches are then fused element-wise to finally map a scalar attention score, i.e., attention weight, which is used to measure the importance of each cell in case-level decision-making in a single case.
[0015] Furthermore, the case-level feature aggregation and cell classification module includes a case-level classification prediction head and a cell-level classification prediction head; The case-level classification prediction head is responsible for weighted summation of all relation-enhanced cell-level feature representations based on the attention weights of each cell, resulting in a fixed-dimensional case-level feature representation vector. This vector comprehensively reflects the most discriminative cell information in the current case and provides a high-level semantic description of the entire case. It is also responsible for linear classification of the case-level feature representation vector, outputting the prediction results (prediction scores) for each case category, i.e., the case-level classification prediction results, to complete the final population cell classification task. The cell-level classification prediction head projects the relation-enhanced cell-level feature representation onto the cell category space through a linear mapping, and outputs the type prediction result of a single cell in the case, i.e., the cell-level classification prediction result; it is also responsible for using the cell-level classification prediction result as an auxiliary supervision signal to constrain the feature learning process, so that the model can maintain the discriminativeness and separability of cell-level features while optimizing the case-level objective.
[0016] Furthermore, the clustering representation module introduces a learnable prototype vector for each cell category and maps cell-level features to multiple cluster centers of the corresponding cell category in a soft-assignment manner through feature similarity calculation. It also calculates the weighted average feature corresponding to each prototype vector, thereby obtaining a more stable and discriminative category representation, namely, the cluster center feature representation obtained based on prototype learning. This representation is used to characterize the feature structure within a category and for subsequent clustering analysis and other tasks. The goal of the clustering representation module is to learn the cluster center feature representations corresponding to different categories under supervised signal constraints. During training, the cluster center feature representations are used as learnable parameters and jointly optimized with the backbone network to achieve adaptive modeling of the category feature distribution.
[0017] A population cell classification method includes the following steps: Step 1: Obtain tissue sections or case images of the patient; Step 2: Use a feature extraction network to extract cell features from the obtained tissue slices or case images to obtain the cell-level features of all cells in a single case, and represent them as a cell-level feature matrix of size 1×N×M, where 1 represents a fixed batch size, N represents the number of cells in a single case, and M represents the vector dimension of the cell-level features of each cell. Step 3: Input the obtained cell-level feature matrix into the population cell classification system described above for processing; Step 4: Output the case classification prediction results, cell classification prediction results, and cluster center feature representations obtained based on prototype learning.
[0018] A computer device includes a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface communicate with each other via the communication bus. The memory stores at least one executable instruction, which causes the processor to perform the operation corresponding to the above-mentioned population cell classification method.
[0019] A computer-readable storage medium storing at least one executable instruction that causes a processor to perform operations corresponding to the above-described population cell classification method.
[0020] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. Breaking through traditional assumptions: Compared with traditional methods that usually assume that cells are independent of each other and model only the features of individual cells independently, this invention achieves global relationship modeling by introducing the Transformer structure and self-attention mechanism, so that the feature representation of each cell can be integrated with the information of other cells in the same case.
[0021] 2. Capturing the overall distribution pattern: Compared with methods that rely solely on local cell features, this invention can effectively capture the overall cell distribution pattern within a case, making full use of the prior knowledge that cells are related in terms of morphology, differentiation stage, and spatial distribution in real biological scenarios.
[0022] 3. Supports variable length input: This invention uses the feature matrix of all cells in a single case as the model input. With a fixed batch size of 1, it naturally supports cases where the number of cells varies greatly in different cases. There is no need to fix or fill the number of cells, making the adaptation more flexible.
[0023] 4. Optimized attention mechanism: This invention adopts a gated attention module, which uses a bi-branch nonlinear transformation (hyperbolic tangent + sigmoid) to more flexibly control the contribution of different feature dimensions. Compared with ordinary attention mechanisms, this invention has better suppression of noisy cells and irrelevant instances, and can more accurately highlight the cell instances that are key to case discrimination.
[0024] 5. Block processing enhances scalability: For scenarios with a large number of cells, this invention performs block processing on attention calculation, which significantly reduces memory overhead without affecting the accuracy of the results, enabling the model to handle large cases containing thousands of cells, making it more practical and scalable.
[0025] 6. Simultaneous support for two-level prediction: The model of this invention outputs case-level classification results and cell-level classification results simultaneously in one forward propagation, which can not only complete the final population classification task, but also predict individual cell types, and can optimize multiple objectives at the same time.
[0026] 7. Enhanced Feature Learning with Auxiliary Supervision: This invention also uses cell-level classification tasks as auxiliary supervision signals, which can effectively constrain the feature learning process, enabling the model to maintain the discriminativeness and separability of cell-level features while optimizing case-level objectives.
[0027] 8. Enhanced Representation Capability: The clustering module based on prototype learning in this invention can learn cluster center representations related to categories in the feature space, obtaining more stable and discriminative category representations through soft assignment. The cluster centers, as learnable parameters, are jointly optimized with the backbone network, achieving adaptive modeling of category feature distribution, which helps to characterize the internal structure of categories and improves the overall expressive power of the model.
[0028] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it according to the contents of the specification, the preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings. Specific embodiments of the present invention are given in detail below with reference to the accompanying drawings. Attached Figure Description
[0029] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings: Figure 1 This is a schematic diagram of the overall network structure of the population cell classification system of the present invention.
[0030] Figure 2 This is a schematic diagram of the network structure of the Transformer relationship modeling module in the population cell classification system of the present invention. Detailed Implementation
[0031] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings to provide a clearer understanding of the invention's purpose, features, and advantages. It should be understood that the embodiments shown in the drawings are not intended to limit the scope of the invention, but are merely illustrative of the essential spirit of the invention's technical solution.
[0032] In the following description, certain specific details are set forth for the purpose of illustrating various disclosed embodiments in order to provide a thorough understanding of the various disclosed embodiments. However, those skilled in the art will recognize that embodiments may be practiced without one or more of these specific details. In other instances, well-known apparatuses, structures, and techniques associated with this application may not have been shown or described in detail to avoid unnecessarily obscuring the description of the embodiments.
[0033] Unless the context requires otherwise, throughout the specification and claims, the word “comprising” and its variations, such as “including” and “having”, shall be understood to have an open, inclusive meaning, that is, to be interpreted as “including, but not limited to”.
[0034] Throughout this specification, references to "an embodiment" or "an embodiment" indicate that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Therefore, the appearance of "in an embodiment" or "an embodiment" in various places throughout the specification does not necessarily refer to the same embodiment. Furthermore, a particular feature, structure, or characteristic may be combined in any manner in one or more embodiments.
[0035] The singular forms “a” and “the” used in this specification and the appended claims include plural references unless otherwise expressly stated herein. It should be noted that the term “or” is generally used to mean “and / or” unless otherwise expressly stated herein.
[0036] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0037] See Figure 1 As shown, this invention provides a population cell classification system, the core of which is a population cell classification model based on a multi-layer Transformer structure and a two-branch attention mechanism. This model uses a "cell-level feature set" as the basic input unit and employs a hierarchical structure to progressively complete feature modeling and information aggregation. In the overall process, the model first performs global relational modeling on the input cell features, enabling the representation of each cell to incorporate information from other cells in the same case. Subsequently, an attention mechanism is used to assign weights to different cells, thereby highlighting cell instances that are more crucial for case differentiation. Based on this, the model then aggregates the weighted cell features into a case-level representation for final case classification prediction. Simultaneously, the model retains and outputs cell-level features for cell type prediction or further analysis tasks. This model structure simultaneously considers local cell information and the overall case structure, exhibiting strong expressive power and good interpretability.
[0038] The population cell classification model of this invention employs a multi-task learning framework, simultaneously optimizing case-level classification, cell-level classification, and category prototype representation learning tasks. Its network structure mainly includes a cell-level feature input module, a Transformer relationship modeling module, a gated attention mechanism module, a case-level feature aggregation and cell classification module, and a cluster representation module.
[0039] 1. Cell-level feature input module: The cell-level feature input module is responsible for receiving cell-level features of all cells in a single case as model input.
[0040] The cell-level feature input module receives cell-level features of all cells in a single case, represented as a 1×N×M cell-level feature matrix, where 1 represents a fixed batch size, N represents the number of cells in a single case, and M represents the vector dimension of the cell-level features for each cell. Since the number of cells varies significantly across different cases, fixing the batch size to 1 allows the model to support variable-length inputs without needing to fix or pad the cell count.
[0041] 2. Transformer Relationship Modeling Module: See Figure 2 As shown, the Transformer relation modeling module is responsible for performing global cell relation modeling on the cell-level features of all input cells through self-attention calculation and nonlinear transformation. This enables each cell to perceive feature information from other cells in the same case when updating its features, thereby effectively capturing the overall cell distribution pattern within the same case and obtaining a relation-enhanced cell-level feature representation that integrates global cell context information of the same case.
[0042] Traditional multi-instance learning methods typically assume that different instances are independent of each other, and aggregate instances only through weighted attention. However, this assumption does not hold entirely in cell analysis tasks. Different cells often have intrinsic relationships; for example, cells at the same differentiation stage should have similar representations in the feature space. To address this issue, this invention introduces a multi-layer Transformer structure in the cell-level feature modeling stage of the model. The Transformer relationship modeling module consists of a multi-layer Transformer structure, with each layer containing a multi-head attention mechanism (MHA) and a feedforward neural network (FFN).
[0043] In a single-layer Transformer structure, the multi-head attention mechanism is responsible for information interaction between cells. Specifically, it maps the input cell-level features into multiple sets of queries, keys, and vector values. By calculating the similarity between queries and keys, attention weights are obtained, and the value vectors are weighted and summed to obtain a cell-level feature representation that integrates global cell context information of the same case. This ensures that the cell-level features of each cell can contain the association information of other cells in the same case, accurately capturing the dependencies between cells. Compared to methods that rely solely on local features, the multi-head attention mechanism can effectively capture the overall cell distribution pattern within a case.
[0044] In the single-layer Transformer structure, the feedforward neural network is responsible for feature processing within a single cell. Specifically, it performs independent, refined, and nonlinear processing on each cell-level feature representation output by the multi-head attention mechanism that integrates global cell context information of the same case. It also abstracts and refines the association information collected by the multi-head attention mechanism, enhancing the fitting ability and nonlinear expression ability of the Transformer relationship modeling module, thereby obtaining a relationship-enhanced feature representation that integrates global cell context information of the same case.
[0045] The multi-head attention mechanism and the feedforward neural network, along with the multi-layer stacking of the Transformer structure, gradually upgrade the cell-level features, jointly completing the global cell relationship modeling task of all cell-level features, and outputting cell-level features that incorporate inter-cell correlation information and have stronger expressive power.
[0046] The multi-head attention mechanism works as follows: (1) Through a Linear layer, the cell-level feature matrix of all cells under the input single case is linearly transformed to generate the initial query Q, key K and value V respectively; (2) Based on the number of multi-head attention mechanisms, the complete query Q, key K and value V are split into multiple Q / K / V sub-tensors, allowing each attention head to learn different attention representations; (3) Perform dimension reshaping on the split Q / K / V subtensors and adjust the tensor shape to adapt to the dimension requirements of subsequent matrix multiplication; (4) Calculate the matrix product of the transpose of query Q and key K under each attention head to obtain the original attention score; (5) The attention scores are normalized by using the Softmax activation function, and the original attention scores are converted into attention weights in the range [0,1] with a sum of 1. At the same time, the scaling operation of the scaling dot product attention is completed. (6) Perform matrix multiplication on the normalized attention weights and values V to obtain the attention output of each attention head; (7) Reassemble and merge the outputs of the multiple independent attention heads according to their dimensions to integrate the different attention information learned by the multiple attention heads; (8) Through another Linear layer, the final linear projection transformation is performed on the spliced result to map the features of the multi-head splicing to the target output dimension; (9) By using the Dropout layer, regularization is performed to randomly deactivate some neurons with a certain probability to prevent the model from overfitting and finally complete the output of the entire multi-head attention mechanism.
[0047] Furthermore, the working process of the feedforward neural network is as follows: (1) Through the first Linear layer, the feature representation of the fusion of global cell context information of the same case output by the multi-head attention mechanism is linearly transformed to increase the feature dimension and expand the feature space; (2) By using the Norm layer, the features after dimensionality increase are normalized to standardize the feature distribution, making the model training more stable and convergence faster; (3) Through the second Linear layer, the activated features are linearly transformed to reduce the feature dimension and map the dimension back to the same dimension as the input, so as to adapt to the subsequent modules. (4) By using the Gaussian error linear unit activation function, nonlinearity is introduced into the network to improve the model's expressive power; (5) Regularization is performed through the first Dropout layer to randomly deactivate a portion of neurons with a certain probability, thereby preventing model overfitting and reducing the risk of model overfitting. (6) The features are adjusted again by linear transformation through the third Linear layer; (7) Through the second Dropout layer, regularization is performed again to randomly deactivate a portion of neurons with a certain probability, thereby continuing to suppress model overfitting and obtaining the final features; (8) The feature representation of the fusion of global cell context information of the same case is added to the feature representation obtained after the above path transformation. Through residual connection, the feature representation of the fusion of global cell context information of the same case is transformed into a more discriminative feature representation, which solves the gradient vanishing problem in deep network training and preserves the original input information.
[0048] Considering that a single case may contain a large number of cells in practical applications, directly calculating the complete attention matrix would result in high GPU memory overhead. Therefore, the multi-head attention mechanism described herein performs block processing during the attention calculation process, dividing the query Q-vector into segments for calculation according to a fixed window size. This significantly reduces GPU memory usage and improves the scalability of the model without affecting the calculation results.
[0049] 3. Gated Attention Mechanism Module: The gated attention mechanism module is responsible for calculating the attention score of each cell and assigning attention weights to each cell through a two-branch attention mechanism based on the hyperbolic tangent function and the sigmoid function, thereby highlighting cell instances that are more critical to case discrimination.
[0050] After modeling the intercellular relationships, the model needs to select the most important instances for case discrimination from a large number of cells. To this end, this invention introduces a gated attention module as a key component in multi-instance learning. This gated attention module contains two parallel nonlinear transformation branches. One branch uses a hyperbolic tangent function to enhance feature representation, while the other uses a sigmoid function to control the degree of information transmission.
[0051] The gated attention mechanism module is responsible for processing the cell-level features of all cells in a single case using two parallel nonlinear transformation branches. The outputs of the two parallel nonlinear transformation branches are then fused together by element-wise multiplication, and finally mapped to a scalar attention score, i.e. attention weight, which is used to measure the importance of each cell in the case-level decision-making of a single case.
[0052] Compared to conventional attention mechanisms, this invention's attention mechanism structure, featuring two parallel nonlinear transformation branches, offers more flexible control over the contributions of different feature dimensions and exhibits better suppression of noisy cells and irrelevant instances. Within the model, this attention mechanism can be stacked to progressively refine cell features and generate the final attention weights.
[0053] The working process of the gating attention mechanism module is as follows: (1) The cell-level features of all cells in the input single case are initially linearly transformed through a fully connected layer, and then nonlinearly transformed through the ReLU activation function to perform preliminary purification of the cell-level features; (2) In one of the nonlinear transformation branches, a second linear transformation is performed on the cell-level features after the first linear transformation and the nonlinear transformation, and then nonlinear activation is performed using the hyperbolic tangent function to further enhance the expressive power of the cell-level features; (3) In another nonlinear branch, the cell-level features after the initial linear transformation and nonlinear transformation are also subjected to a second linear transformation, and then activated by the Sigmoid function to compress the output to [0,1]. This is equivalent to outputting a "gating switch" for each cell-level feature dimension to control which information needs to be retained and which needs to be suppressed. (4) Multiply the outputs of the two nonlinear branches element by element and fuse the results of the two nonlinear branches. This is equivalent to using the “gating weights” output by the Sigmoid function to filter the cell-level features enhanced by the hyperbolic tangent function and retain only the key information. (5) Perform a final linear transformation on the cell-level features after element-wise multiplication fusion to map them into a single scalar value. This value is the attention score corresponding to the current cell, which is used to measure the importance of the cell to the case classification.
[0054] 4. Case-level feature aggregation and cell classification module: The case-level feature aggregation and cell classification module is responsible for weighted summation of all the relationship-enhanced cell-level feature representations based on the attention weights of each cell, and then aggregating them into a fixed-dimensional case-level feature representation vector. The module then uses this case-level feature representation vector to complete the case-level classification prediction task and outputs the prediction results of the cases in each case category, i.e., the case-level classification prediction results.
[0055] The case-level feature aggregation and cell classification module is also responsible for using the previously obtained relation-enhanced cell-level feature representation to complete the cell-level classification prediction task, outputting the type prediction result of a single cell in the case, i.e., the cell-level classification prediction result, and using the cell-level classification prediction result as an auxiliary supervision signal to constrain the feature learning process.
[0056] The case-level feature aggregation and cell classification module includes a case-level classification prediction head and a cell-level classification prediction head.
[0057] The case-level classification prediction head is responsible for weighted summation of all relation-enhanced cell-level feature representations based on the attention weights of each cell, and converging them to obtain a fixed-dimensional case-level feature representation vector. This case-level feature representation vector comprehensively reflects the most discriminative cell information in the current case and is a high-level semantic description of the entire case. It is also responsible for linear classification of the case-level feature representation vector and outputting the prediction results (prediction scores) of the case in each case category, i.e., a case-level classification prediction result of size 1×C1 (Pred1, where 1 is the number of cases and C1 is the number of case-level categories), to complete the final population cell classification task.
[0058] The process of the case-level classification prediction head performing case-level classification prediction tasks is as follows: (1) Transpose the dimension of the attention weights for each cell; (2) Perform Softmax normalization on the attention scores after dimension transpose to compress the attention weights of all cells to a distribution that sums to 1; normalization makes cell-level features more suitable for distance measurement. (3) Perform matrix multiplication between the normalized attention weights and all the aforementioned relation-enhanced cell-level feature representations to obtain the aggregated case-level feature representation vector; (4) The case-level feature representation vector is linearly classified through a linear layer to output the case-level classification prediction result.
[0059] In addition to case-level prediction, the model of this invention also retains cell-level features and sets up an independent cell classification branch. The cell-level classification prediction head projects the relation-enhanced cell-level feature representation onto the cell category space through linear mapping, and outputs the type prediction result of a single cell in the case, that is, the cell-level classification prediction result of size N×C2 (Pred2, where N is the number of cells and C2 is the number of cell-level categories); it is also responsible for using the cell-level classification prediction result as an auxiliary supervision signal to constrain the feature learning process, so that the model can maintain the discriminativeness and separability of cell-level features while optimizing the case-level objective.
[0060] The cell-level classification prediction head performs the cell-level classification prediction task as follows: Through a linear layer, the relationship-enhanced cell-level feature representation that has already completed global cell relationship modeling is directly subjected to linear transformation processing, and the cell-level classification prediction results are output.
[0061] 5. Clustering Representation Module: The clustering representation module is responsible for learning cluster center representations related to categories in the cell-level feature space, and obtaining cluster center feature representations based on prototype learning.
[0062] The clustering representation module introduces a learnable prototype vector for each cell category and maps cell-level features to multiple cluster centers of the corresponding cell category through feature similarity calculation. It also calculates the weighted average feature corresponding to each prototype vector, thereby obtaining a more stable and discriminative category representation, namely the cluster center feature representation (Cluster) obtained based on prototype learning. This cluster is used to characterize the feature structure within a category and for subsequent clustering analysis and other tasks. The main goal of the clustering representation module is not to explicitly divide cell subpopulations, but to learn the cluster center feature representations corresponding to different categories under supervised signal constraints. During training, the cluster center feature representations are used as learnable parameters and jointly optimized with the backbone network to achieve adaptive modeling of the category feature distribution.
[0063] The present invention also provides a method for classifying population cells, comprising the following steps: Step 1: Obtain tissue sections or case images of the patient, such as electron microscopic scan images of bone marrow or peripheral blood slides stained with Wright-Gymsa.
[0064] Step 2: Use a feature extraction network to extract cell features from the obtained tissue slices or case images to obtain the cell-level features of all cells in a single case, and represent them as a cell-level feature matrix of size 1×N×M, where 1 represents a fixed batch size, N represents the number of cells in a single case, and M represents the vector dimension of the cell-level features of each cell.
[0065] Step 3: Input the obtained cell-level feature matrix into the above-mentioned population cell classification system for processing.
[0066] Step 4: Output the case classification prediction results, cell classification prediction results, and cluster center feature representations obtained based on prototype learning.
[0067] The present invention also provides a computer device, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus, and the memory is used to store at least one executable instruction, wherein the executable instruction causes the processor to perform the operation corresponding to the above-described population cell classification method.
[0068] The present invention also provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores at least one executable instruction, the executable instruction causing a processor to perform the operation corresponding to the above-described population cell classification method.
[0069] The population cell classification method of the present invention and the traditional single-target cell classification method were respectively applied to various cell classification and counting after Wright-Gymsa staining of peripheral blood slides. The comparison results are shown in Table 1. Table 1. Comparison of peripheral blood cell classification using the population cell classification method of the present invention and the traditional single-target cell classification method.
[0070] As shown in Table 1, the comparison results demonstrate the correct number, total number, accuracy rate, and overall accuracy rate of the population cell classification method of this invention and the traditional single-target cell classification method for various peripheral blood cell types. It is evident that the overall accuracy rate of the traditional single-target cell classification method is only 89.85%, less than 90%, while the overall accuracy rate of the population cell classification method of this invention exceeds 90%, reaching as high as 92%. Therefore, compared to the traditional single-target cell classification method, the population cell classification method of this invention has a higher accuracy rate.
[0071] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A population cell classification system, characterized in that, It includes a population cell classification model based on a multi-layer Transformer structure and a two-branch attention mechanism. The main architecture of the population cell classification model includes a cell-level feature input module, a Transformer relationship modeling module, a gated attention mechanism module, a case-level feature aggregation and cell classification module, and a clustering representation module. The cell-level feature input module is responsible for receiving the cell-level features of all cells in a single case as model input. The Transformer relation modeling module is responsible for performing global cell relation modeling on the cell-level features of all input cells through self-attention calculation and nonlinear transformation. This enables each cell to perceive feature information from other cells in the same case when updating its features, thereby effectively capturing the overall cell distribution pattern within the same case and obtaining a relation-enhanced cell-level feature representation that integrates global cell context information of the same case. The gated attention mechanism module is responsible for calculating the attention score of each cell and assigning attention weights to each cell through a two-branch attention mechanism based on the hyperbolic tangent function and the sigmoid function, thereby highlighting cell instances that are more critical to case discrimination. The case-level feature aggregation and cell classification module is responsible for weighted summation of all the relation-enhanced cell-level feature representations based on the attention weights of each cell, resulting in a fixed-dimensional case-level feature representation vector. This vector is then used to perform case-level classification prediction, outputting the prediction results for each case category, i.e., the case-level classification prediction results. The module also utilizes the previously obtained relation-enhanced cell-level feature representations to perform cell-level classification prediction, outputting the type prediction results for individual cells within the case, i.e., the cell-level classification prediction results. These cell-level classification prediction results are used as auxiliary supervisory signals to constrain the feature learning process. The clustering representation module is responsible for learning cluster center representations related to categories in the cell-level feature space, and obtaining cluster center feature representations based on prototype learning.
2. The population cell classification system according to claim 1, characterized in that: The cell-level feature input module receives cell-level features of all cells in a single case, represented as a cell-level feature matrix of size 1×N×M, where 1 represents a fixed batch size, N represents the number of cells in a single case, and M represents the vector dimension of the cell-level features of each cell.
3. The population cell classification system according to claim 1, characterized in that, The Transformer relationship modeling module consists of a multi-layer Transformer structure, and each layer of the Transformer structure contains a multi-head attention mechanism and a feedforward neural network. In a single-layer Transformer structure, the multi-head attention mechanism is responsible for information interaction between cells. Specifically, it maps the input cell-level features into multiple sets of queries, keys, and vector values. By calculating the similarity between queries and keys, attention weights are obtained, and the value vectors are weighted and summed to obtain a cell-level feature representation that integrates global cell context information of the same case. This allows each cell's cell-level features to contain the association information of other cells in the same case, accurately capturing the dependencies between cells. In the single-layer Transformer structure, the feedforward neural network is responsible for feature processing within a single cell. Specifically, it performs independent, refined, and nonlinear processing on each cell-level feature representation output by the multi-head attention mechanism that integrates global cell context information of the same case. It also abstracts and refines the association information collected by the multi-head attention mechanism, enhancing the fitting ability and nonlinear expression ability of the Transformer relationship modeling module, thereby obtaining a relationship-enhanced feature representation that integrates global cell context information of the same case. The multi-head attention mechanism and the feedforward neural network, along with the multi-layer stacking of the Transformer structure, gradually upgrade the cell-level features, jointly completing the global cell relationship modeling task of all cell-level features, and outputting cell-level features that incorporate inter-cell correlation information and have stronger expressive power.
4. The population cell classification system according to claim 3, characterized in that, The multi-head attention mechanism performs block processing during the attention calculation process, dividing the query Q vector into segments for calculation according to a fixed window size, thereby significantly reducing memory usage without affecting the calculation results.
5. The population cell classification system according to claim 1, characterized in that, The gated attention mechanism module includes two parallel nonlinear transformation branches. One branch uses a hyperbolic tangent function to enhance feature representation, while the other uses a sigmoid function to control the degree of information transmission. The gated attention mechanism module is responsible for processing the cell-level features of all cells in a single case using the two parallel nonlinear transformation branches. The outputs of the two parallel nonlinear transformation branches are then fused element-wise to finally map a scalar attention score, i.e., attention weight, which is used to measure the importance of each cell in case-level decision-making in a single case.
6. The population cell classification system according to claim 1, characterized in that, The case-level feature aggregation and cell classification module includes a case-level classification prediction head and a cell-level classification prediction head; The case-level classification prediction head is responsible for weighted summation of all relation-enhanced cell-level feature representations based on the attention weights of each cell, and aggregating them to obtain a fixed-dimensional case-level feature representation vector. This case-level feature representation vector comprehensively reflects the most discriminative cell information in the current case and is a high-level semantic description of the entire case. It is also responsible for linear classification of the case-level feature representation vector and outputting the prediction results of the case in each case category, i.e., the case-level classification prediction results, to complete the final population cell classification task. The cell-level classification prediction head projects the relation-enhanced cell-level feature representation onto the cell category space through a linear mapping, and outputs the type prediction result of a single cell in the case, i.e., the cell-level classification prediction result; it is also responsible for using the cell-level classification prediction result as an auxiliary supervision signal to constrain the feature learning process, so that the model can maintain the discriminativeness and separability of cell-level features while optimizing the case-level objective.
7. The population cell classification system according to claim 1, characterized in that, The clustering representation module introduces a learnable prototype vector for each cell category and maps cell-level features to multiple cluster centers of the corresponding cell category in a soft-assignment manner through feature similarity calculation. It also calculates the weighted average feature corresponding to each prototype vector, thereby obtaining a more stable and discriminative category representation—the cluster center feature representation based on prototype learning—used to characterize the feature structure within a category and for subsequent clustering analysis and other tasks. The goal of the clustering representation module is to learn the cluster center feature representations corresponding to different categories under supervised signal constraints. During training, the cluster center feature representations are used as learnable parameters and jointly optimized with the backbone network to achieve adaptive modeling of the category feature distribution.
8. A method for classifying population cells, characterized in that, Includes the following steps: Step 1: Obtain tissue sections or case images of the patient; Step 2: Use a feature extraction network to extract cell features from the obtained tissue slices or case images to obtain the cell-level features of all cells in a single case, and represent them as a cell-level feature matrix of size 1×N×M, where 1 represents a fixed batch size, N represents the number of cells in a single case, and M represents the vector dimension of the cell-level features of each cell. Step 3: Input the obtained cell-level feature matrix into the population cell classification system as described in any one of claims 1-7 for processing; Step 4: Output the case classification prediction results, cell classification prediction results, and cluster center feature representations obtained based on prototype learning.
9. A computer device, characterized in that, include: The system includes a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface communicate with each other via the communication bus. The memory stores at least one executable instruction, which causes the processor to perform the operation corresponding to the population cell classification method as described in claim 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one executable instruction that causes a processor to perform the operation corresponding to the population cell classification method as described in claim 8.
