A knowledge graph-based method for generating cell pathology reports
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-19
- Publication Date
- 2026-08-11
AI Technical Summary
[0002]随着血液疾病细胞形态学及多染色病理切片图像数据的持续累积,现有跨模态实体对齐方法主要依赖全局特征相似度进行图文关联,忽略了细胞形态学图像中隐含的空间拓扑结构与深层病理语义关联,导致高维特征矩阵构建发生结构失真,且在多尺度细胞分割下易保留碎片化噪声节点,增加了细胞图谱构建的计算开销
[0060] By constructing a spatial decoupling mechanism based on molecular dynamics repulsive equilibrium in the improved FastGCN model, the discretization reconstruction of the topology of a highly connected graph and the generation of stable configurations are achieved. The variance importance calculation layer of the improved FastGCN model extracts the L2 norm variance sequence of nodes and performs benchmark division and square root truncation to accurately quantify the probability distribution of node importance. The molecular repulsive potential field sampling layer maps nodes to charged particles and assigns electrostatic charge based on probability vectors, dynamically calculating the force gradient including electrostatic repulsion and van der Waals attraction terms, driving iterative updates of feature space positions. The system's total potential energy change sequence is calculated in real time, and the potential energy fluctuation convergence threshold is dynamically determined based on the variance distribution characteristics until dynamic equilibrium is reached and a spatially discrete node set is extracted. The chemical bond mapping layer backtracks the graph topology to extract the original connecting edges and maps them to continuous-value chemical bond-level topology, dynamically determining the bond energy decay threshold to accurately identify and eliminate weak interaction edges, outputting a stable molecular configuration node set and a chemical bond adjacency matrix. This mechanism transforms the discrete graph sampling process into a molecular dynamics potential field evolution process. By breaking node clustering through the competitive game of electrostatic repulsion and attraction, it perfectly filters out the topological collapse caused by redundant connecting edges, providing stable graph structure data that simultaneously possesses high-order logical integrity and spatial distribution discreteness.
Smart Images

Figure CN122552013A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to a method for generating cell pathology reports based on knowledge graphs. Background Technology
[0002] With the continuous accumulation of hematological cell morphology and multi-stained pathological slide image data, existing cross-modal entity alignment methods mainly rely on global feature similarity for image-text association, ignoring the implicit spatial topology and deep pathological semantic associations in cell morphology images. This leads to structural distortion in the construction of high-dimensional feature matrices and easily retains fragmented noise nodes under multi-scale cell segmentation, increasing the computational cost of cell atlas construction. In the knowledge graph reasoning stage, existing graph neural network sampling algorithms mainly rely on feature variance for independent probability sampling, ignoring the implicit exclusionary dependencies and dynamic equilibrium states between cell nodes, resulting in structural collapse and node clustering in the feature space. At the same time, the lack of physical potential field constraints to decouple high-density cell nodes results in a large number of weakly interacting redundant edges remaining in highly connected subgraphs, obscuring key hematological pathology-related feature paths. In the structured report generation stage, existing autoregressive decoding models mainly rely on positive probability propagation for vocabulary prediction, ignoring the implicit missing feature constraints and negative prompt exclusion associations in graph reasoning, leading to excessive logical speculation and hallucination problems such as fictitious blood cell entities; and lacking dynamic semantic boundary verification based on feature decay difference, it is easy to generate taboo features in violation of regulations, losing the rigor of clinical hematological auxiliary diagnosis.
[0003] Therefore, how to provide a knowledge graph-based method for generating cell pathology reports is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] This invention proposes a knowledge graph-based method for generating cell pathology reports. It utilizes a spatial decoupling mechanism based on molecular dynamics repulsion equilibrium and an anti-hallucination generation mechanism based on negative penalty inhibition. The sampled subgraph features are input into an improved FastGCN model to extract variance and generate probability vectors. Intermolecular force gradients are dynamically calculated based on node feature distances and assigned static charges. Iterative updates of feature spatial positions are performed until the total system potential converges. Equilibrium-state discrete nodes are extracted, mapped to chemical bond-level topology, and weak interaction edges are eliminated. The key accompanying feature path set is then truncated in descending order of conditional probability expectation. The attenuation difference between the activation mean and the original response is calculated for the end nodes of the paths. The output latent missing feature set is adaptively truncated and injected into a dynamic matching template to generate weak prompt text fragments. The sampled subgraph features are mapped to graph embeddings, combined with the weak prompt fragments and the latent missing feature set to generate a weighted token matrix. This matrix is then decoded using multi-head self-attention autoregression, and the cell pathology report is generated based on the penalty factor-inhibited vocabulary probability distribution. The latent missing feature set is mapped and compared with the report features to verify that the missing features have not been generated illegally. This invention overcomes the limitations of traditional methods, such as distorted graph sampling structure, single feature fusion dimension, and lack of negative constraints, and provides a highly reliable solution for auxiliary diagnosis of cytopathology.
[0005] A method for generating cell pathology reports based on a knowledge graph according to an embodiment of the present invention specifically includes:
[0006] S1. Perform morphological visual segmentation on the cytopathological image to extract visual features, align and fuse them with the text medical entity cross-modal to construct a feature matrix, and then perform dimensionality reduction and reverse lookup to remove noise, outputting the initial entity node set;
[0007] S2. Perform a one-hop neighborhood query based on the initial entity node set to obtain the diagnostic attribute subgraph, extract risk labels based on node semantic categories and output the preliminary logical state;
[0008] S3. Extract high-risk nodes from the initial logical state as anchor points to construct a two-hop subgraph. Perform hierarchical decoupling sampling based on historical co-occurrence frequency and output the features of the sampled subgraph.
[0009] S4. Input the sampled subgraph features into the improved FastGCN, generate probability vectors through variance evaluation, introduce a decoupling mechanism based on spatial repulsion balance to obtain discrete node sets, construct a stable structure graph through topological dependency mapping and weak interaction elimination, and output the set of key accompanying feature paths by conditional probability expectation descending order.
[0010] S5. Extract the terminal nodes of each path in the key accompanying feature path set, fuse the path activation mean and the original response to calculate the decay difference and adaptively truncate low decay terminal nodes, and output the latent missing feature set.
[0011] S6. Transform the latent missing feature set into negative constraint instructions and inject them into the dynamic matching template to output weak prompt text fragments;
[0012] S7. Extract the token sequence and latent missing feature set of the text medical entities, map the sampled subgraph features into graph embeddings and combine them with weak cue fragments to generate a weighted token matrix, decode it through multi-head self-attention autoregression, suppress the vocabulary probability distribution according to the penalty factor, and generate a cell pathology report.
[0013] S8. Map the latent missing feature set to the semantic space and compare its feature similarity with the cytopathology report to verify that the missing features have not been generated illegally. If the verification is successful, trigger the release command to output the cytopathology report.
[0014] Optionally, S1 specifically includes:
[0015] S11. Perform named entity recognition based on cytopathological text, perform cross-modal entity link alignment between medical entities and morphological visual segmentation results, dynamically determine the confidence threshold based on the co-occurrence statistical distribution of entities in the image-text bimodal context, fuse successfully aligned image-text node pairs, and output a multimodal fused node set.
[0016] S12. Extract the morphological feature vectors of each node in the multimodal fusion node set, and call the pre-trained language model to map the medical entity text of the corresponding node into text word embedding vectors. Concatenate the morphological feature vectors of the multimodal fusion node set with the text word embedding vectors, generate the initial graph embedding features through nonlinear mapping, construct heterogeneous association edges based on the spatial coordinate proximity and text syntactic dependency relationship between fusion nodes, and output a graph embedding feature set with topological structure.
[0017] S13. Using the graph embedding feature set as the query center, calculate the multi-hop path transition probability based on the topological connectivity of the associated edges, and extract heterogeneous nodes in the multi-hop neighborhood; perform cross-modal attention weighted aggregation on the neighborhood nodes, fuse the local morphological context with the text semantic context, and output the standard semantic description of each node.
[0018] S14. Perform dimensional concatenation between the standard semantic description and the initial graph embedding features of the corresponding nodes in the graph embedding feature set to construct a node-level high-dimensional feature matrix. Adaptively determine the sensitive dimension threshold based on the variance distribution characteristics of each dimension on the morphological change gradient to filter out low-sensitivity dimensions and output a compact node feature matrix.
[0019] S15. Based on the effective row index of the node compact feature matrix, extract the corresponding node entities in reverse from the multimodal fusion node set, divide the remaining nodes into topological subsets according to graph connectivity and perform text stemming normalization, and output the initial entity node set.
[0020] Optionally, S2 specifically includes:
[0021] S21. Based on the initial entity node set, perform a one-hop neighborhood query to extract associated nodes, calculate the edge connection weights according to the topological connectivity of the associated nodes, and dynamically determine the screening threshold according to the statistical distribution characteristics of the weights to filter out low-weight edges, and output the diagnostic attribute subgraph.
[0022] S22. Extract the character sequence and type attributes of the heterogeneous associated edges of the diagnostic attribute subgraph, perform multidimensional discrete mapping and one-hot encoding respectively to generate node feature matrices and edge feature matrices, and splice the heterogeneous feature matrix of the subgraph.
[0023] S23. Calculate the spatial distance statistical distribution characteristics of node feature vectors in the heterogeneous feature matrix of the subgraph, dynamically determine the cluster boundary radius to divide the feature subspace, and output the node feature cluster set.
[0024] S24. Extract the central feature vector of the node feature cluster set, and perform word frequency inverse document frequency weighted cosine similarity calculation with the risk label vocabulary generated based on feature subspace mapping. Dynamically determine the classification confidence threshold based on the statistical distribution characteristics of the similarity extreme values to extract risk labels, and output the node risk label set.
[0025] S25. Map the node risk label set to the node feature cluster set, construct the label transition probability matrix based on the statistical distribution characteristics of the label co-occurrence frequency, and adaptively determine the frequency threshold according to the probability distribution to filter out low-frequency elements to construct a directed state graph and output the preliminary logical state.
[0026] Optionally, S3 specifically includes:
[0027] S31. Calculate the sum of the in-degree and out-degree of each node in the directed state graph of the preliminary logical state to generate the node activity; based on the statistical distribution characteristics of the node activity, dynamically define the risk level threshold to extract high-risk nodes, and use the high-risk nodes as anchors to perform a two-hop neighborhood query to output a two-hop subgraph.
[0028] S32. Calculate the historical co-occurrence frequency between nodes based on the historical interaction records of the two-hop subgraph. Based on the statistical distribution characteristics of the historical co-occurrence frequency, dynamically define the co-occurrence intensity threshold and remove connection edges below the co-occurrence intensity threshold to output a denoised two-hop subgraph.
[0029] S33. Calculate the statistical distribution characteristics of the number of nodes in each hop in the two-hop subgraph with the high-risk node as the center. This is used to dynamically determine the hierarchical sampling ratio to perform downsampling and output the hierarchical decoupling node set.
[0030] S34. Map the hierarchical decoupling node set back to the denoised two-hop subgraph to extract associated connection edges. Based on the statistical distribution characteristics of edge weights, dynamically define the attenuation threshold to remove low-weight edges. Construct the graph topology structure with the hierarchical decoupling node set and the remaining associated connection edges, and output the sampling subgraph features.
[0031] Optionally, the improved FastGCN model includes a variance importance calculation layer, a molecular repulsive potential sampling layer, a chemical bond mapping layer, and an expected truncation output layer:
[0032] The variance importance calculation layer is used to extract the L2 norm variance sequence of the nodes in the feature matrix of the sampled subgraph, dynamically define the normalized benchmark value based on the statistical distribution of the L2 norm variance sequence, perform benchmark division and square root truncation on the variance of the nodes, and output the node importance probability vector.
[0033] The molecular repulsive potential sampling layer is used to introduce a spatial decoupling mechanism based on molecular dynamics repulsive equilibrium, specifically including:
[0034] Based on the node importance probability vector, sampling with replacement is performed to generate an initial sampling sequence. The nodes in the initial sampling sequence are mapped to chemical molecules. The electrostatic charge of the corresponding molecules is assigned according to the node importance probability vector. The Coulomb force equilibrium distance threshold is dynamically determined based on the statistical distribution characteristics of the characteristic distances of each node in the initial sampling sequence. Based on the characteristic distances between nodes and the electrostatic charge, the intermolecular force gradient including electrostatic repulsion and van der Waals attraction terms is dynamically calculated.
[0035] Driven by the gradient of intermolecular forces, the system performs iterative updates of positions in the feature space, calculates the sequence of changes in the total potential energy of the system between adjacent iterations in real time, dynamically defines the potential energy fluctuation convergence threshold based on the variance distribution characteristics of the sequence of changes in the total potential energy of the system, and reaches dynamic equilibrium when the current change in the total potential energy of the system is lower than the potential energy fluctuation convergence threshold; extracts molecules whose feature distance is greater than or equal to the Coulomb force equilibrium distance threshold in the equilibrium state as effective nodes, and outputs a spatially discrete set of nodes;
[0036] The chemical bond mapping layer is used to backtrack the graph topology of the initial sampling sequence based on the spatially discrete node set, extract the original connection edges between discrete nodes, and map them to the chemical bond level topology of continuous values; dynamically define the bond energy decay threshold based on the updated feature distance between nodes and the statistical distribution characteristics of node electrostatic charge, determine the connection edges with chemical bond levels below the bond energy decay threshold as weak interaction edges and remove them, and output the set of stable molecular configuration nodes and the chemical bond adjacency matrix.
[0037] The expected truncation output layer is used to drive the hidden state of the stable molecular configuration nodes and the chemical bond adjacency matrix through multi-level graph convolution message passing, and generate a conditional probability distribution through normalized exponential mapping; the confidence threshold is dynamically determined according to the maximum value sequence of the probability distribution, the expected conditional probability of each node is calculated, and nodes exceeding the confidence threshold and their corresponding connection edges are truncated in descending order, and the set of key accompanying feature paths is output.
[0038] Optionally, S5 specifically includes:
[0039] S51. Extract the terminal nodes of each path in the key accompanying feature path set, and calculate the mean local feature activation response of each terminal node on its respective path.
[0040] S52. Extract the global original feature response of each end node in the initial entity node set, and perform element-by-element difference operation between the mean of the local feature activation response and the corresponding global original feature response to generate a feature decay difference sequence.
[0041] S53. Based on the statistical distribution characteristics of the characteristic decay difference sequence, calculate the distribution mean and distribution variance. Calculate the dynamic adjustment coefficient according to the data length and distribution variance of the characteristic decay difference sequence. Subtract the product of the dynamic adjustment coefficient and the distribution variance from the distribution mean to calculate the decay threshold.
[0042] S54. Compare each decay difference in the feature decay difference sequence with the decay threshold, remove low decay end nodes that are less than the decay threshold, and retain end nodes that are greater than or equal to the decay threshold to aggregate them into a latent missing feature set.
[0043] Optionally, S6 specifically includes:
[0044] S61. Extract the semantic labels of each missing feature in the latent missing feature set, calculate the information weights based on the word frequency statistical distribution of the semantic labels, and concatenate each semantic label with the corresponding information weights to generate a negative constraint instruction sequence.
[0045] S62. Obtain a corpus of historical pathology report texts, statistically analyze the transition probability distribution of each syntactic structure in the corpus of historical pathology report texts, and calculate the syntactic template matching degree based on the transition probability distribution;
[0046] S63. Based on the syntactic template matching degree, the candidate syntactic templates in the historical pathology report text corpus are sorted in descending order, and the target syntactic template ranked first is extracted as the dynamic matching template.
[0047] S64. Inject the negative constraint instruction sequence into the dynamic matching template, perform syntax dependency parsing on the dynamic matching template to dynamically locate the filling slots, map the negative constraint instruction sequence to the filling slots and perform part-of-speech alignment, and output the weak prompt text fragment.
[0048] Optionally, S7 specifically includes:
[0049] S71. Extract the token sequence, sampled subgraph features and latent missing feature set of the medical entities in the text, map the sampled subgraph features to the text semantic space to generate graph embedding vectors, and concatenate the graph embedding vectors with weak cue fragments to generate enhanced instruction sequences.
[0050] S72. Based on the token sequence and enhanced instruction sequence of the text medical entity, perform position encoding, calculate the cross-attention score between the position-encoded token sequence and the enhanced instruction sequence, and align and fuse the token sequence and enhanced instruction sequence of the text medical entity based on the cross-attention score to generate a token matrix.
[0051] S73. Extract the node feature vectors of the latent missing feature set, calculate the semantic similarity between each token and the node feature vector in the token matrix, dynamically determine the similarity threshold based on the statistical distribution characteristics of the extreme similarity values, and map the similarity below the similarity threshold to the confidence weight of each token.
[0052] S74. Add the confidence weight as a prior penalty factor to the token matrix to generate a weighted token matrix.
[0053] S75. Based on the weighted token matrix, through multi-head self-attention autoregressive decoding, the prior penalty factor is applied to the vocabulary probability distribution at each decoding time step to suppress the generation probability of low-confidence tokens, block the generation of speculative hallucinations, and generate cellular pathology reports.
[0054] Optionally, S8 specifically includes:
[0055] S81. Map the latent missing feature set to the semantic space to generate a missing semantic vector, extract the token sequence of the cytopathology report and map it to generate a report semantic matrix, calculate the cosine similarity between the missing semantic vector and each token vector in the report semantic matrix to generate a risk similarity matrix.
[0056] S82. Determine the dynamic verification threshold based on the statistical distribution characteristics of the risk similarity matrix, and extract elements in the risk similarity matrix that are greater than the dynamic verification threshold to generate a set of violation feature indexes.
[0057] S83. Calculate the number of elements in the violation feature index set to generate the violation feature density, determine the dynamic blocking density threshold based on the statistical distribution characteristics of the violation feature density, and output the verification status flag by comparing the violation feature density with the dynamic blocking density threshold.
[0058] S84. Trigger release command based on verification status identifier and output cell pathology report.
[0059] The beneficial effects of this invention are:
[0060] By constructing a spatial decoupling mechanism based on molecular dynamics repulsive equilibrium in the improved FastGCN model, the discretization reconstruction of the topology of a highly connected graph and the generation of stable configurations are achieved. The variance importance calculation layer of the improved FastGCN model extracts the L2 norm variance sequence of nodes and performs benchmark division and square root truncation to accurately quantify the probability distribution of node importance. The molecular repulsive potential field sampling layer maps nodes to charged particles and assigns electrostatic charge based on probability vectors, dynamically calculating the force gradient including electrostatic repulsion and van der Waals attraction terms, driving iterative updates of feature space positions. The system's total potential energy change sequence is calculated in real time, and the potential energy fluctuation convergence threshold is dynamically determined based on the variance distribution characteristics until dynamic equilibrium is reached and a spatially discrete node set is extracted. The chemical bond mapping layer backtracks the graph topology to extract the original connecting edges and maps them to continuous-value chemical bond-level topology, dynamically determining the bond energy decay threshold to accurately identify and eliminate weak interaction edges, outputting a stable molecular configuration node set and a chemical bond adjacency matrix. This mechanism transforms the discrete graph sampling process into a molecular dynamics potential field evolution process. By breaking node clustering through the competitive game of electrostatic repulsion and attraction, it perfectly filters out the topological collapse caused by redundant connecting edges, providing stable graph structure data that simultaneously possesses high-order logical integrity and spatial distribution discreteness. Attached Figure Description
[0061] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0062] Figure 1 This is an overall flowchart of a knowledge graph-based cell pathology report generation method proposed in this invention;
[0063] Figure 2 This is a flowchart illustrating the working principle of the improved FastGCN model, a knowledge graph-based method for generating cell pathology reports proposed in this invention. Detailed Implementation
[0064] The invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0065] refer to Figure 1 and Figure 2 A knowledge graph-based method for generating cell pathology reports, specifically including:
[0066] S1. Perform morphological visual segmentation on the cytopathological image to extract visual features, align and fuse them with the text medical entity cross-modal to construct a feature matrix, and then perform dimensionality reduction and reverse lookup to remove noise, outputting the initial entity node set;
[0067] S2. Perform a one-hop neighborhood query based on the initial entity node set to obtain the diagnostic attribute subgraph, extract risk labels based on node semantic categories and output the preliminary logical state;
[0068] S3. Extract high-risk nodes from the initial logical state as anchor points to construct a two-hop subgraph. Perform hierarchical decoupling sampling based on historical co-occurrence frequency and output the features of the sampled subgraph.
[0069] S4. Input the sampled subgraph features into the improved FastGCN, generate probability vectors through variance evaluation, introduce a decoupling mechanism based on spatial repulsion balance to obtain discrete node sets, construct a stable structure graph through topological dependency mapping and weak interaction elimination, and output the set of key accompanying feature paths by conditional probability expectation descending order.
[0070] S5. Extract the terminal nodes of each path in the key accompanying feature path set, fuse the path activation mean and the original response to calculate the decay difference and adaptively truncate low decay terminal nodes, and output the latent missing feature set.
[0071] S6. Transform the latent missing feature set into negative constraint instructions and inject them into the dynamic matching template to output weak prompt text fragments;
[0072] S7. Extract the token sequence and latent missing feature set of the text medical entities, map the sampled subgraph features into graph embeddings and combine them with weak cue fragments to generate a weighted token matrix, decode it through multi-head self-attention autoregression, suppress the vocabulary probability distribution according to the penalty factor, and generate a cell pathology report.
[0073] S8. Map the latent missing feature set to the semantic space and compare its feature similarity with the cytopathology report to verify that the missing features have not been generated illegally. If the verification is successful, trigger the release command to output the cytopathology report.
[0074] In this embodiment, S1 specifically includes:
[0075] S11. Perform cross-modal entity linking based on cytopathological text and morphological visual segmentation results. Specifically, extract medical entities obtained from named entity recognition in the cytopathological text and their corresponding text boundary coordinates; extract the minimum bounding rectangle of the segmentation mask in the morphological visual segmentation results and its corresponding image boundary coordinates; calculate the text-image boundary intersection-union ratio (CIU) between the medical entities and the segmentation mask; and call the 768-dimensional BioBERT encoder to extract the feature vectors of the image regions where the medical entity text and the segmentation mask are located to calculate the cosine similarity. Multiply the CIU by 0.6 and the cosine similarity by 0.4 to obtain the image-text matching degree. Record image-text node pairs with an image-text matching degree greater than a preset preliminary threshold as a valid co-occurrence and count the co-occurrence frequency. Dynamically define the confidence threshold as 0.85 using the 90th percentile; divide the co-occurrence frequency by 0.85 to obtain the alignment score; select node pairs with an alignment score greater than or equal to 1 for fusion and output a multimodal fusion node set.
[0076] S12. Extract the morphological feature vectors of each node in the multimodal fusion node set, call the 768-dimensional BioBERT encoder to map the medical entity text of the corresponding node into a 768-dimensional text word embedding vector, concatenate the two and input them into a 256-dimensional fully connected layer and map them through a modified linear unit activation function to generate the initial graph embedding features; calculate the sum of the Euclidean distance between the spatial coordinates of the nodes multiplied by 0.6 and the text syntactic dependency distance multiplied by 0.4 as the heterogeneous association weight, retain the connection edges with weights greater than 0.5, and output a graph embedding feature set with topological structure.
[0077] S13. Using each node in the graph embedding feature set as the center, calculate the transition probability based on the heterogeneous association weight, and extract multi-hop heterogeneous nodes with a probability greater than 0.3; extract the initial graph embedding feature of the center node as the query vector, and concatenate the original morphological feature vector corresponding to the heterogeneous node with the 768-dimensional text word embedding vector, input it into the same 256-dimensional fully connected layer and map it to 256-dimensional heterogeneous node features through the modified linear unit activation function, use the heterogeneous node features as key vector and value vector, perform scaling dot product attention calculation, and weighted sum the attention weight and value vector to fuse the local morphology and text semantic context, and output the standard semantic description of each node.
[0078] S14. Input the standard semantic description of each node into a 256-dimensional fully connected layer and map it to a 256-dimensional semantic mapping feature through a modified linear unit activation function. Concatenate the initial graph embedding features of each node in the graph embedding feature set with the corresponding semantic mapping features in the column dimension to construct a node-level high-dimensional feature matrix. Calculate the variance of each dimension on the morphological change gradient. Set 0.2 times the mean variance of the first 10% of dimensions as the sensitive dimension threshold, and directly remove low-sensitivity dimensions with variances lower than this threshold to output a compact node feature matrix.
[0079] S15. Based on the non-all-zero row index of the node compact feature matrix, extract the corresponding node entities in reverse from the multimodal fusion node set, and simultaneously extract the feature vectors of the corresponding indexes in the node compact feature matrix as node attributes; calculate the graph connectivity for the remaining nodes, divide the nodes with connectivity greater than 0.7 into the same topological subset and perform the Porter stemming algorithm to complete the text stemming normalization, generate all-zero vectors with the same length as the number of columns of the node compact feature matrix as the default attributes of the remaining text nodes, merge the node entities with feature vectors extracted in reverse with the text nodes in the normalized topological subset as a unified graph node set, and output the initial entity node set.
[0080] In this embodiment, S2 specifically includes:
[0081] S21. Based on the initial entity node set, perform a one-hop neighborhood query to extract associated nodes. Specifically, traverse each node in the initial entity node set as the center node, query the neighbor nodes directly connected to the center node as associated nodes, calculate the edge connection weights based on the topological connectivity of associated nodes, statistically analyze the numerical distribution of all edge connection weights and extract their 90th percentile as the filtering threshold, remove the connection edges whose edge connection weights are lower than the filtering threshold, and output the diagnostic attribute subgraph.
[0082] S22. Receive the character sequence and type attribute of the heterogeneous associated edge of the diagnostic attribute subgraph, perform multi-dimensional discrete mapping on the character sequence of each node to generate a node feature matrix, perform one-hot encoding on the type attribute of the heterogeneous associated edge to generate an edge feature matrix, and concatenate the node feature matrix and the edge feature matrix in the row dimension to generate the subgraph heterogeneous feature matrix.
[0083] S23. Receive the heterogeneous feature matrix of the subgraph, select the unclustered nodes as the current seed nodes in turn, calculate the Euclidean distance between the feature vector of the current seed node and the feature vectors of all other nodes in the heterogeneous feature matrix of the subgraph, count the distribution features of all Euclidean distance values corresponding to the current seed node and extract its 85th quantile as the current cluster boundary radius, divide the feature vectors of nodes whose Euclidean distance is less than the current cluster boundary radius into the same feature subspace, iterate until all nodes are divided, and output the node feature cluster set containing multiple feature subspaces;
[0084] S24. Receive the center feature vector of each feature subspace in the node feature cluster set, calculate the cosine similarity with each tag word vector in the risk tag vocabulary generated based on the feature subspace mapping, count the numerical distribution features of all cosine similarities and extract its 95th quantile as the classification confidence threshold, retain the risk tags corresponding to the cosine similarity greater than the classification confidence threshold, and output the node risk tag set.
[0085] S25. Receive the node risk label set, map it to the feature subspace corresponding to the node feature cluster set, count the co-occurrence frequency of any two risk labels appearing simultaneously in the same feature subspace, calculate the co-occurrence frequency divided by the sum of all co-occurrence frequencies to obtain the label transition probability, construct the label transition probability matrix, extract the 80th percentile of the probability value distribution in the label transition probability matrix as the frequency threshold, remove transition edges with probabilities lower than the frequency threshold and retain the direction to construct a directed state graph, and output the preliminary logical state.
[0086] In this embodiment, S3 specifically includes:
[0087] S31. Calculate the sum of the number of outgoing edges from each node to other nodes and the number of incoming edges pointed to by other nodes in the directed state graph of the initial logic state as the node activity. Statistically analyze the numerical distribution characteristics of the activity of all nodes and extract its 90th percentile as the risk level threshold. Extract nodes with activity greater than the risk level threshold as high-risk nodes. Traverse the directly connected neighbor nodes of the high-risk node as one-hop nodes. Continue to traverse the directly connected neighbor nodes of the one-hop node as two-hop nodes. Combine the high-risk nodes, one-hop nodes, and two-hop nodes and the connecting edges between them to output a two-hop subgraph.
[0088] S32. Receive the two-hop subgraph, count the historical co-occurrence frequency of any two connected nodes in the two-hop subgraph appearing simultaneously in the historical interaction record, count the numerical distribution characteristics of all historical co-occurrence frequencies and extract its 85th percentile as the co-occurrence intensity threshold, remove the connecting edges in the two-hop subgraph whose historical co-occurrence frequency is lower than the co-occurrence intensity threshold, retain the remaining nodes and connecting edges, and output the denoised two-hop subgraph.
[0089] S33. Receive the two-hop subgraph for noise reduction. Count the number of nodes within one hop and two hops of the high-risk node. Calculate the number of nodes within one hop and the number of nodes within two hops to obtain the hierarchical proportion. Set the basic sampling ratio to 0.5. Calculate the sum of the basic sampling ratio 0.5 and the hierarchical proportion multiplied by 0.3 as the actual sampling ratio for the one-hop region. Calculate the difference between the basic sampling ratio 0.5 and the hierarchical proportion multiplied by 0.3 as the actual sampling ratio for the two-hop region. Randomly remove redundant nodes in the corresponding hop region according to their respective actual sampling ratios, and output the hierarchical decoupling node set.
[0090] S34. Receive the set of decoupled nodes at the hierarchical level, traverse the connection relationships between any two nodes in the set to extract associated connection edges, statistically analyze the distribution characteristics of the edge weight values of all associated connection edges and extract their 75th percentile as the attenuation threshold, remove low-weight edges in the associated connection edges whose edge weights are lower than the attenuation threshold, construct the graph topology using the set of decoupled nodes at the hierarchical level as the nodes of the graph and the remaining associated connection edges after removing low-weight edges as the edges of the graph, and output the sampled subgraph features.
[0091] In this embodiment, the improved FastGCN model includes a variance importance calculation layer, a molecular repulsive potential sampling layer, a chemical bond mapping layer, and an expected truncation output layer:
[0092] The variance importance calculation layer is used to extract the square root of the sum of squares of the elements of the feature vector of each node in the feature matrix of the sampled subgraph as the L2 norm of the node. The L2 norms of all nodes are arranged in the order of nodes to obtain the node L2 norm sequence. The numerical distribution characteristics of the node L2 norm sequence are statistically analyzed and its 50th percentile is extracted as the normalization benchmark value. The L2 norm of each node is divided by the normalization benchmark value to obtain the quotient value. The square root of the quotient value is taken and the result is restricted to a value between 0.5 and 1 to perform square root truncation. The truncated values are arranged in the order of nodes and the node importance probability vector is output.
[0093] The molecular repulsive potential sampling layer is used to introduce a spatial decoupling mechanism based on molecular dynamics repulsive equilibrium, specifically including:
[0094] Extract the node importance probability vector output from the previous step, perform sampling with replacement based on the probability values of each node in the vector to generate an initial sampling sequence, map the nodes in the initial sampling sequence to chemical molecules in space, directly assign the probability values corresponding to the nodes in the node importance probability vector to the corresponding molecules as electrostatic charge, calculate the Euclidean distance between the feature vectors of any two molecules in the initial sampling sequence as the feature distance, statistically analyze the numerical distribution characteristics of all feature distances and extract their 60th quantile as the Coulomb force equilibrium distance threshold, calculate the product of the electrostatic charges of two molecules divided by the square of the feature distance to obtain the electrostatic repulsion term, calculate the value 1 divided by the 6th power of the feature distance and multiplied by the coefficient 0.5 to obtain the van der Waals attraction term, and subtract the van der Waals attraction term from the electrostatic repulsion term to obtain the intermolecular force gradient;
[0095] Extract the intermolecular force gradient output from the previous step, add the intermolecular force gradient multiplied by the step size coefficient 0.01 to the current position coordinates of each molecule, perform position iteration update in the feature space, calculate the difference between the electrostatic repulsion term and the van der Waals attraction term of all molecular pairs in the current iteration step and sum them to obtain the current total potential energy of the system, calculate the total potential energy of the system in the current iteration step minus the total potential energy of the system in the previous iteration step to obtain the change in total potential energy of the system, continuously record the change in total potential energy of the system in each iteration step to generate a sequence of total potential energy change, calculate the variance of the sequence of total potential energy change, set the variance threshold of 0.001 as the potential energy fluctuation convergence threshold, and determine that dynamic equilibrium has been reached when the calculated variance is less than the potential energy fluctuation convergence threshold, extract molecules whose feature distance in the equilibrium state is greater than or equal to the Coulomb force equilibrium distance threshold as effective nodes, and output a spatially discrete set of nodes;
[0096] The chemical bond mapping layer is used to extract the spatially discrete node set output from the previous step, backtrack the graph topology of the initial sampling sequence, extract the original connection edges between any two nodes in the spatially discrete node set as the chemical bond level topology, calculate the product of the feature distance between the updated nodes and the electrostatic charge of the nodes as the bond energy index, statistically analyze the numerical distribution characteristics of all bond energy indices and extract their 70th percentile as the bond energy decay threshold, remove the connection edges with bond energy indices lower than the bond energy decay threshold, and use the remaining nodes as the set of stable molecular configuration nodes. The existence of the remaining connection edges is marked as a value of 1 and the absence of the remaining edges is marked as a value of 0 to construct a matrix, and output the set of stable molecular configuration nodes and the chemical bond adjacency matrix.
[0097] The output layer is expected to be truncated to extract the set of stable molecular configuration nodes and the chemical bond adjacency matrix output from the previous step. The node features are subjected to a three-stage weighted summation of adjacent nodes and a linear transformation to achieve multi-level graph convolutional message passing. The hidden state of the node is output. Each element of the hidden state is taken as an exponential function with the natural constant e as the base and divided by the sum of the exponential functions of all elements. A normalized exponential mapping is performed to generate a conditional probability distribution. The maximum value in the conditional probability distribution is extracted as the maxima. The maxima are multiplied by a coefficient of 0.8 as the confidence threshold. The conditional probability value corresponding to each node is calculated as the expected conditional probability. Nodes with expected conditional probabilities greater than the confidence threshold and the connecting edges between these nodes are retained. The set of key accompanying feature paths is output.
[0098] The improved FastGCN model proposed in this step shares the same basic framework as the traditional FastGCN model. Both are based on graph convolution theory of variance importance assessment and Monte Carlo independent sampling. Specifically, node importance is quantified and probability vectors are generated by calculating the L2 norm variance of the node feature matrix. Node sampling is performed using a probability distribution mechanism, and both use graph convolutional layers to perform message passing on the sampled subgraphs to aggregate higher-order topological features, ultimately outputting a set of feature representations at the subgraph level.
[0099] The difference lies in that this invention breaks through the limitations of the traditional FastGCN model, which relies solely on variance probability for independent sampling and ignores the spatial distribution characteristics between nodes, easily leading to the aggregation of highly connected nodes and topological collapse. It adds a molecular repulsion potential field sampling layer and a chemical bond mapping layer to replace the traditional direct probability sampling. It innovatively introduces a spatial decoupling mechanism based on molecular dynamics repulsion equilibrium, maps the sampling nodes to charged molecules and assigns them electrostatic charge. Based on the characteristic distance, it dynamically calculates the intermolecular force gradient containing electrostatic repulsion and van der Waals attraction terms to drive position iteration until the potential energy converges. After equilibrium, it uses chemical bond-level topological mapping and bond energy decay threshold to remove weak interaction edges. Finally, it uses conditional probability expectation to truncate the critical path of the output, rather than a single variance probability sampling.
[0100] The beneficial effects of the improvements are that this invention, through a spatial decoupling mechanism based on molecular dynamics repulsion equilibrium and bond energy decay elimination, forcibly embeds the evolution of physical potential field and topological stability constraints into the forward propagation of the network. This breaks the limitation of the traditional FastGCN model in processing high-density pathological knowledge graphs, where node aggregation leads to blurred feature representation. It achieves spatial decoupling and reconstruction from black-box probabilistic sampling to strong constraints of physical mechanisms. This design significantly enhances the defense capability against local topological congestion in the graph, accurately breaks node aggregation and filters out weakly correlated redundant edges in dynamic equilibrium, effectively improving the spatial discreteness and topological purity of key pathological logic path extraction, and providing absolutely stable graph structure data support for downstream anti-hallucination text generation.
[0101] In this embodiment, S5 specifically includes:
[0102] S51. Extract the last node on each path in the key accompanying feature path set as the terminal node, extract the node hidden state vector of each terminal node after graph convolution on its respective path, calculate the element values of the node hidden state vector of each node in each dimension as the mean of the local feature activation response in that dimension, and concatenate the mean of the local feature activation response in all dimensions in dimensional order to generate the mean vector of local feature activation response.
[0103] S52. Extract the original feature vectors of each end node output in the previous step that are not transmitted by the network in the initial entity node set as the global original feature response. Subtract the element values of the same dimension in the global original feature response from the mean vector of the local feature activation response of each end node. Perform element-wise difference operation, flatten the difference results of all dimensions and arrange them in the order of the end nodes to generate the feature decay difference sequence.
[0104] S53. Extract the feature attenuation difference sequence output from the previous step, calculate the sum of all values in the sequence and divide it by the data length of the sequence to obtain the distribution mean, calculate the sum of the squares of each value in the sequence minus the distribution mean and divide it by the data length to obtain the distribution variance, calculate the square root of the data length and divide it by the value 1.5 to obtain the base scaling factor, subtract the base scaling factor from the value 1 and multiply it by the coefficient 0.8 to obtain the dynamic adjustment coefficient, calculate the attenuation threshold by subtracting the product of the distribution mean and the dynamic adjustment coefficient multiplied by the distribution variance.
[0105] S54. Extract the attenuation threshold and feature attenuation difference sequence output from the previous step. Compare the attenuation difference value corresponding to each terminal node in the feature attenuation difference sequence with the attenuation threshold. Remove low attenuation terminal nodes whose attenuation difference value is less than the attenuation threshold. Aggregate the terminal nodes whose attenuation difference value is greater than or equal to the attenuation threshold and output the latent missing feature set.
[0106] The latent missing feature mining process proposed in this step is similar to the traditional graph neural network feature post-processing mechanism in that it is based on the theory of node feature space mapping and response difference calculation. That is, by projecting the node features on the topological path to a high-dimensional activation space to quantify the state response, the element-wise operation of the feature vector is used to capture the state change pattern of the node in different contexts, and a threshold comparison mechanism is used to filter the feature nodes to output the target subset.
[0107] The difference lies in that this invention breaks away from the limitations of traditional methods that only focus on extracting positive high-activation features while ignoring logical propagation losses. Instead of the traditional fixed threshold filtering, it adds a step of comparing the response of the end node on the critical path and calculating the dynamic decay threshold. The difference is calculated between the mean local activation of the end node on the critical path and the global original response in the initial entity set. The decay threshold is adaptively calculated based on the mean, variance and data length of the decay difference sequence. Finally, low-decay nodes are eliminated by comparison to reversely aggregate the latent missing feature set, rather than retaining only positive features.
[0108] The beneficial effects of the improvements are that this invention, through the calculation of local-global response differences and adaptive attenuation threshold truncation, forcibly embeds the logic transmission loss constraint into the forward propagation of feature mining, breaking the limitation of traditional methods that easily miss latent pathological correlation features when facing complex pathological maps, and realizing the accurate conversion from forward highlighting extraction to reverse attenuation perception; this design significantly enhances the defense capability against deep topological logic breaks, can accurately capture feature attenuation trajectories in a dynamically adjusted probability distribution space, and combined with adaptive low-attenuation node removal, effectively improves the sensitivity and completeness of latent missing feature mining, providing indispensable prior evidence for the generation of downstream negative constraint anti-hallucination.
[0109] In this embodiment, S6 specifically includes:
[0110] S61. Extract the text strings corresponding to each missing feature in the latent missing feature set as semantic labels. Count the total number of times each semantic label appears in the latent missing feature set and divide it by the total number of latent missing features to obtain the word frequency of each semantic label. Calculate the sum of the word frequencies of each semantic label and the sum of the numerical value 1 and the logarithm with the natural constant e as the base. Add the numerical value 1 to the logarithm result and divide it by the logarithm result to obtain the information weight of each semantic label. Arrange each semantic label in the order of the latent missing features to form a negative constraint instruction sequence, and use the information weight corresponding to each semantic label as the accompanying weight parameter at each position in the negative constraint instruction sequence.
[0111] S62. Obtain a corpus of historical pathology reports. Decompose each sentence in the corpus into a sequence of nouns, verbs, and adjectives. Count the number of times two adjacent parts of speech appear simultaneously in the corpus and divide the total number of times the previous part of speech appears to obtain the transition probability of each part of speech pair. Similarly, decompose the negative constraint instruction sequence output in the previous step into instruction part of speech sequences of nouns, verbs, and adjectives. Calculate the sum of the transition probabilities of historical part of speech pairs corresponding to adjacent parts of speech in the instruction part of speech sequence, and then divide it by the total number of adjacent part of speech pairs in the instruction part of speech sequence to calculate the syntactic template matching degree.
[0112] S63. Extract the syntactic template matching degree and instruction part-of-speech sequence output from the previous step. Take the part-of-speech sequence of each sentence in the historical pathology report text corpus as candidate syntactic templates. Calculate the syntactic template matching degree between each candidate syntactic template and the extracted instruction part-of-speech sequence. Sort all the calculated syntactic template matching degrees in descending order from largest to smallest. Extract the target syntactic template ranked first in descending order and use it as the dynamic matching template.
[0113] S64. Extract the dynamic matching template and the negative constraint instruction sequence output in the previous step. Perform syntactic dependency parsing on the dynamic matching template to extract the positions of noun phrases in the syntactic tree structure as filling slots. Map nouns in the negative constraint instruction sequence to the first position of the filling slot, verbs to verb slots, and adjectives to modifier slots to perform part-of-speech alignment. Replace each slot in the aligned dynamic matching template with the corresponding text words in the negative constraint instruction sequence and output a weak prompt text fragment.
[0114] The improved negative constraint instruction construction process proposed in this step is similar to the traditional prompt engineering template filling mechanism in that it is based on natural language processing and syntactic structure mapping theory. That is, by projecting the discrete medical text feature representation onto a predefined grammatical pattern space to perform lexical dependency calculation, the statistical regularity of historical corpus is used to capture the dynamic evolution of sentence patterns, and the sequence mapping method is used to transform the final entity labels into structured text instruction fragments.
[0115] The difference lies in that this invention breaks through the limitations of traditional static hard-coding of prompt words, which ignores the dynamic decay of features and the association with latent defects. It adds a word frequency information weight decoupling step to filter out redundant noise labels, and replaces the traditional rule matching tree with a Markov transition probability retrieval mechanism. It maps the instruction part-of-speech sequence and the part-of-speech pairs in the corpus to the transition probability to perform dynamic syntactic template adaptation. Finally, it outputs weak prompt fragments by combining the filling slots of dependency parsing and the part-of-speech alignment results, rather than a single manually preset template splicing.
[0116] The beneficial effects of the improvements are that, through weight decoupling and probabilistic retrieval, the negative inhibition constraint of latent missing features is forcibly implanted into the template forward generation process, breaking the limitation of traditional methods that are prone to feature detachment and prompt deviation in complex pathological contexts. This achieves a precise conversion from static string matching to dynamic statistical probability strong constraint. This design significantly enhances the defense against pathological hallucination feature induction, can accurately block the generation path of unfounded words in the syntactic transfer space, and, combined with dynamic slot part-of-speech alignment, effectively improves the contextual adaptability of weak prompt instructions and the absolute reliability of pathology reports generated by large models.
[0117] In this embodiment, S7 specifically includes:
[0118] S71. Extract the token sequence, sampling subgraph features, and latent missing feature set of the medical entity in the text. Input the sampling subgraph features into a fully connected layer with 128 hidden layer nodes and activate it through a linear rectified function. Map it to the text semantic space to generate a graph embedding vector. Extract the text feature vector corresponding to the weak prompt text fragment output by the previous step. Concatenate the graph embedding vector and the text feature vector of the weak prompt text fragment in the feature dimension to generate an enhanced instruction sequence.
[0119] S72. Extract the token sequence and enhancement instruction sequence of the text medical entity output in the previous step. Calculate the sine function value of the result of multiplying the position index value of each token in the token sequence by the power of -1 / 20000 and then by the dimension index value, and use it as the sine position code. Calculate the cosine function value of the result of multiplying the position index value of each token in the token sequence by the power of -1 / 20000 and then by the dimension index value, and use it as the cosine position code. Add the sine position code and the cosine position code to the token sequence and the enhancement instruction sequence. Calculate the product of the query matrix of the position-coded token sequence and the transpose of the key matrix of the enhancement instruction sequence, and divide it by the square root of 8. Map it to the cross-attention score through the Softmax activation function. Based on the cross-attention score, perform a weighted summation on the token sequence and the enhancement instruction sequence of the text medical entity to achieve alignment and fusion, and generate a token matrix.
[0120] S73. Extract the node feature vectors of each node in the latent missing feature set output by the previous step. Calculate the dot product between each token vector and each node feature vector in the token matrix output by the previous step and divide it by the product of the magnitudes of the two vectors to obtain the cosine similarity as the semantic similarity. Extract the minimum value among all semantic similarity values as the similarity extreme value. Statistically analyze the distribution characteristics of all semantic similarity values and calculate the similarity extreme value plus the value of 0.1 as the similarity threshold. Compare the semantic similarity value corresponding to each token in the token matrix with the similarity threshold. When the semantic similarity value is lower than the similarity threshold, multiply the semantic similarity value by the value of 0.1 as the confidence weight of the corresponding token. When the semantic similarity value is greater than or equal to the similarity threshold, set the value of 1 as the confidence weight of the corresponding token.
[0121] S74. Extract the confidence weights and token matrix output from the previous step. Use the confidence weight of each token as a scalar multiplier and multiply it element by element with the feature vector of the corresponding token in the token matrix. Add the confidence weights as prior penalty factors to each feature dimension of the token matrix to generate a weighted token matrix.
[0122] S75. Extract the weighted token matrix output from the previous step and input it into the backbone network containing 8 attention heads to perform multi-head self-attention calculation. After autoregressive decoding, output the predicted words step by step. At each decoding time step, extract the initial generation probability of each candidate word. Calculate the negative of the prior penalty factor of the token corresponding to each candidate word in the weighted token matrix and add the value 1 as the probability scaling factor. Multiply the initial generation probability of each candidate word by the corresponding probability scaling factor. Set the generation probability of the multiplication result below 0.05 to zero to suppress the generation probability of low confidence tokens and block the generation of speculative illusions. Take the candidate word with the largest value in the scaled probability distribution as the output of the current time step. Concatenate the output words of all time steps to generate the cytopathology report.
[0123] The improved cross-modal instruction fusion and autoregressive decoding process proposed in this step is similar to the traditional Transformer text generation mechanism in that it is based on deep semantic representation learning and sequence-to-sequence generation theory. That is, it calculates contextual dependencies by projecting multi-source heterogeneous features into a high-dimensional latent space, captures the dynamic interaction rules between features by using the weight update rules of the attention mechanism, and uses an autoregressive decoder to map the final latent state into serialized text output.
[0124] The difference lies in that this invention breaks the limitation of traditional pure data-driven black-box generation ignoring the physical boundaries of pathological entities. It adds an extreme value adaptive threshold decoupling step to filter out noise interference from missing features, and replaces the traditional single Softmax sampling with a two-stage prior penalty mechanism. It maps the extreme value of the similarity between the token and the missing node to a dynamic threshold to perform low-confidence feature truncation. Finally, it combines the weighted token matrix with the probability scaling of the decoding step to block hallucination generation, rather than a single attention-weighted prediction.
[0125] The beneficial effects of the improvements are that, through threshold decoupling and two-stage penalty truncation, the negative inhibition constraint of latent missing features is forcibly implanted into the forward propagation and decoding space of the network, breaking the limitation of traditional methods that easily violate entity dependency boundaries in complex pathological images and texts, leading to speculative out-of-bounds errors. This achieves a precise conversion from black-box probabilistic generation to strong constraints of pathological mechanisms. This design significantly enhances the defense capability against irrelevant medical entities, accurately suppresses the generation probability of phantom words in both feature flow and probability flow spaces, and, combined with dynamic slot alignment fusion, effectively improves the robustness of multimodal feature expression and the absolute reliability of cellular pathology report generation.
[0126] In this embodiment, S8 specifically includes:
[0127] S81. Extract the latent missing feature set output from the previous step, input the latent missing feature set into a fully connected layer containing 64 hidden layer nodes and map it to the semantic space through the Tanh activation function to generate a missing semantic vector, extract the token sequence of the cytopathology report output from the previous step, map the token sequence through a word embedding lookup table to generate a report semantic matrix, calculate the dot product between the missing semantic vector and each token vector in the report semantic matrix and divide it by the product of the magnitudes of the two vectors to obtain the cosine similarity, and arrange all the cosine similarities in the order of the tokens to generate a risk similarity matrix.
[0128] S82. Extract the risk similarity matrix output from the previous step, calculate the arithmetic mean of all element values in the risk similarity matrix and add 0.15 to generate a dynamic verification threshold, compare each element value in the risk similarity matrix with the dynamic verification threshold one by one, extract the position index of the element with a value greater than the dynamic verification threshold as the violation index, and aggregate all violation indexes in order to generate a violation feature index set.
[0129] S83. Extract the violation feature index set output from the previous step, count the total number of violation indexes contained in the violation feature index set divided by the total number of elements of the risk similarity matrix output from the previous step, and multiply by the value 100 to obtain the violation feature density. Set the value 5 as the dynamic blocking density threshold, compare the violation feature density with the dynamic blocking density threshold. When the violation feature density is less than the dynamic blocking density threshold, set the value 0 as the verification status indicator. When the violation feature density is greater than or equal to the dynamic blocking density threshold, set the value 1 as the verification status indicator.
[0130] S84. Extract the verification status flag output from the previous step, read the specific value of the verification status flag, and when the specific value of the verification status flag is equal to 0, trigger the release command and directly output the cell pathology report output from the previous step as the final result.
[0131] Example 1: To verify the feasibility of this invention in the auxiliary diagnosis of hematological diseases, the method of this invention was applied to the digital pathology scanning intelligent analysis system of a provincial tertiary-level Class A oncology hospital (hereinafter referred to as "Hospital M"). In traditional hematological disease cell morphology and multi-stain pathological slide image report generation systems, image-text direct mapping based on a vision-language pre-trained model or knowledge graph traversal algorithms based on simple rules are usually used. These methods not only struggle to extract complete hematological pathology accompanying logic in complex high-dimensional multimodal feature spaces, but also fail to effectively suppress speculative illusions generated by the model during the decoding stage, easily leading to false positives for high-risk hematological pathology features or fabrication of key negative features. To solve the above problems, Hospital M decided to adopt the cell pathology report generation method based on knowledge graph proposed in this invention.
[0132] During implementation, Hospital M first utilized a morphological visual segmentation module deployed on a high-resolution digital slide scanner to acquire visual segmentation results of hematological disease cell morphology and multi-stained pathological slide images. This was then aligned with cross-modal entity links using clinical text information entered by pathologists. After dimensionality reduction and noise reduction operations such as nonlinear mapping, sensitive dimension threshold filtering, and text stemming normalization, an initial set of entity nodes containing precise semantic descriptions was constructed. Simultaneously, senior pathology experts at Hospital M meticulously labeled the extracted graph nodes and connecting edges with risk tags and reviewed their logical states, serving as the benchmark for graph reasoning and model training.
[0133] Hospital M anchors high-risk nodes in the initial logical state, performs a two-hop neighborhood query, and performs hierarchical decoupling sampling based on historical co-occurrence frequency, outputting sampled subgraph features. Next, the sampled subgraph features are input into an improved FastGCN model, and a variance importance calculation layer outputs node importance probability vectors. In the core molecular repulsive potential field sampling layer, the system introduces a spatial decoupling mechanism based on molecular dynamics repulsive equilibrium, mapping nodes to charged particles and dynamically calculating the intermolecular force gradient, including electrostatic repulsion and van der Waals attraction terms. This gradient drives iterative updates of the feature spatial position until the total system potential energy reaches dynamic equilibrium. Subsequently, a chemical bond mapping layer removes weak interaction edges, and an expectation truncation output layer truncates the output in descending order, outputting a set of key hematological pathology-related feature paths.
[0134] In the feature mining and structured report generation stages, this invention calculates the feature decay difference of terminal nodes and adaptively truncates low-decay nodes to accurately output the latent missing feature set. This feature set is then transformed into negative constraint instructions and injected into a dynamic matching template to generate weak prompt text fragments. A weighted token matrix is constructed using graph embedding. After multi-head self-attention autoregressive decoding, the probability distribution of the vocabulary is suppressed by a penalty factor to block hallucination generation. Finally, the system maps the latent missing feature set to the semantic space and performs a cosine similarity comparison with the generated structured report. Once it verifies that the missing features have not been illegally generated, a release instruction is triggered, achieving a closed-loop transition from graph topological decoupling to anti-hallucination text generation.
[0135] During implementation, the technical team at Hospital M discovered that, compared to traditional direct image-text generation and conventional atlas sampling methods, the method of this invention significantly improves the clinical consistency and logical rigor of the generated structured pathology reports for hematological diseases. Traditional methods cannot perceive subtle changes in the higher-order topology of the atlas and lack constraints on negative missing features in complex hematological pathology contexts. In contrast, the method of this invention, through molecular dynamics potential field spatial decoupling, negative prior penalty, and dual-space semantic cross-comparison, effectively achieves the precise transmission of hematological pathology logic and the quantitative interception of hallucination risks.
[0136] To further verify the actual performance of the method of the present invention, Hospital M conducted a detailed comparative test between the method of the present invention and the traditional method. The specific performance data is shown in Table 1:
[0137] Table 1. Performance Comparison of Structured Pathology Report Generation Methods for Hematological Diseases in Hospital M
[0138] Accuracy rate of pathological entity identification (%) 85.2 97.5 +12.3% Completeness rate of key accompanying path extraction (%) 72.6 95.8 +23.2% Recall rate (%) of latent missing feature mining 60.5 91.2 +30.7% Pathological relation hallucination generation rate (%) 14.8 1.2 -91.9% Prohibited feature violation trigger rate (%) 8.5 0.3 -96.5% Time taken (seconds) for inference of a single slice of map 12.5 6.8 -45.6% Average time (seconds) to generate report text 4.2 2.1 -50.0% Semantic boundary validation pass rate (%) 88.0 99.6 +13.2% Physician's second revision rate (%) 35.5 4.8 -86.5% Clinical auxiliary diagnostic adoption rate (%) 76.0 96.5 +20.5% The average time (in minutes) for reviewing pathology reports 15.0 5.5 -63.3%
[0139] As shown in Table 1, the performance of the digital pathology scanning intelligent analysis system was comprehensively improved after applying the method of this invention. The accuracy of pathological entity recognition increased from 85.2% with traditional methods to 97.5%, and the completeness rate of key accompanying path extraction increased from 72.6% to 95.8%, significantly improving the accuracy of logic mining of hematological atlases and providing a reliable basis for subsequent structured report generation. The rate of pathological relationship illusion generation decreased significantly from 14.8% to 1.2%, and the rate of violation triggering contraindication features decreased from 8.5% to 0.3%, effectively avoiding the risk of serious misleading in the clinical diagnosis of hematological diseases. The rate of physician secondary revision decreased from 35.5% to 4.8%, and the adoption rate of clinical auxiliary diagnosis increased from 76.0% to 96.5%, significantly enhancing the system's practicality and trustworthiness. In addition, the average time for pathology report review was shortened from 15.0 minutes to 5.5 minutes, significantly reducing the workload of pathologists.
[0140] Through the method of this invention, Hospital M has successfully achieved deep decoupling of the logic accompanying hematological morphology and multi-stain pathological slide images and automatic generation of highly reliable structured reports. This effectively eliminates the illusionary problems inherent in large language models in the vertical field of hematological medicine, ensures the objectivity and security of pathological diagnostic conclusions, significantly improves the efficiency and quality of digital slide reading in the pathology department, significantly reduces the review and approval burden of senior pathology experts, enhances the stability and robustness of the intelligent auxiliary diagnostic system, and provides strong technical support for the construction of smart hospitals.
[0141] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for generating cell pathology reports based on knowledge graphs, characterized in that, Includes the following steps: S1. Perform morphological visual segmentation on the cytopathological image to extract visual features, align and fuse them with the text medical entity cross-modal to construct a feature matrix, and then perform dimensionality reduction and reverse lookup to remove noise, outputting the initial entity node set; S2. Perform a one-hop neighborhood query based on the initial entity node set to obtain the diagnostic attribute subgraph, extract risk labels based on node semantic categories and output the preliminary logical state; S3. Extract high-risk nodes from the initial logical state as anchor points to construct a two-hop subgraph. Perform hierarchical decoupling sampling based on historical co-occurrence frequency and output the features of the sampled subgraph. S4. Input the sampled subgraph features into the improved FastGCN, generate probability vectors through variance evaluation, introduce a decoupling mechanism based on spatial repulsion balance to obtain discrete node sets, construct a stable structure graph through topological dependency mapping and weak interaction elimination, and output the set of key accompanying feature paths by conditional probability expectation descending order. S5. Extract the terminal nodes of each path in the key accompanying feature path set, fuse the path activation mean and the original response to calculate the decay difference and adaptively truncate low decay terminal nodes, and output the latent missing feature set. S6. Transform the latent missing feature set into negative constraint instructions and inject them into the dynamic matching template to output weak prompt text fragments; S7. Extract the token sequence and latent missing feature set of the text medical entities, map the sampled subgraph features into graph embeddings and combine them with weak cue fragments to generate a weighted token matrix, decode it through multi-head self-attention autoregression, suppress the vocabulary probability distribution according to the penalty factor, and generate a cell pathology report. S8. Map the latent missing feature set to the semantic space and compare its feature similarity with the cytopathology report to verify that the missing features have not been generated illegally. If the verification is successful, trigger the release command to output the cytopathology report.
2. The method for generating cell pathology reports based on knowledge graphs according to claim 1, characterized in that, S1 specifically includes: S11. Perform named entity recognition based on cytopathological text, perform cross-modal entity link alignment between medical entities and morphological visual segmentation results, dynamically determine the confidence threshold based on the co-occurrence statistical distribution of entities in the image-text bimodal context, fuse successfully aligned image-text node pairs, and output a multimodal fused node set. S12. Extract the morphological feature vectors of each node in the multimodal fusion node set, and call the pre-trained language model to map the medical entity text of the corresponding node into text word embedding vectors. Concatenate the morphological feature vectors of the multimodal fusion node set with the text word embedding vectors, generate the initial graph embedding features through nonlinear mapping, construct heterogeneous association edges based on the spatial coordinate proximity and text syntactic dependency relationship between fusion nodes, and output a graph embedding feature set with topological structure. S13. Using the graph embedding feature set as the query center, calculate the multi-hop path transition probability based on the topological connectivity of the associated edges, and extract heterogeneous nodes in the multi-hop neighborhood; perform cross-modal attention weighted aggregation on the neighborhood nodes, fuse the local morphological context with the text semantic context, and output the standard semantic description of each node. S14. Perform dimensional concatenation between the standard semantic description and the initial graph embedding features of the corresponding nodes in the graph embedding feature set to construct a node-level high-dimensional feature matrix. Adaptively determine the sensitive dimension threshold based on the variance distribution characteristics of each dimension on the morphological change gradient to filter out low-sensitivity dimensions and output a compact node feature matrix. S15. Based on the effective row index of the node compact feature matrix, extract the corresponding node entities in reverse from the multimodal fusion node set, divide the remaining nodes into topological subsets according to graph connectivity and perform text stemming normalization, and output the initial entity node set.
3. The method for generating cell pathology reports based on knowledge graphs according to claim 1, characterized in that, S2 specifically includes: S21. Based on the initial entity node set, perform a one-hop neighborhood query to extract associated nodes, calculate the edge connection weights according to the topological connectivity of the associated nodes, and dynamically determine the screening threshold according to the statistical distribution characteristics of the weights to filter out low-weight edges, and output the diagnostic attribute subgraph. S22. Extract the character sequence and type attributes of the heterogeneous associated edges of the diagnostic attribute subgraph, perform multidimensional discrete mapping and one-hot encoding respectively to generate node feature matrices and edge feature matrices, and splice the heterogeneous feature matrix of the subgraph. S23. Calculate the spatial distance statistical distribution characteristics of node feature vectors in the heterogeneous feature matrix of the subgraph, dynamically determine the cluster boundary radius to divide the feature subspace, and output the node feature cluster set. S24. Extract the central feature vector of the node feature cluster set, and perform word frequency inverse document frequency weighted cosine similarity calculation with the risk label vocabulary generated based on feature subspace mapping. Dynamically determine the classification confidence threshold based on the statistical distribution characteristics of the similarity extreme values to extract risk labels, and output the node risk label set. S25. Map the node risk label set to the node feature cluster set, construct the label transition probability matrix based on the statistical distribution characteristics of the label co-occurrence frequency, and adaptively determine the frequency threshold according to the probability distribution to filter out low-frequency elements to construct a directed state graph and output the preliminary logical state.
4. The method for generating cell pathology reports based on knowledge graphs according to claim 1, characterized in that, S3 specifically includes: S31. Calculate the sum of the in-degree and out-degree of each node in the directed state graph of the preliminary logical state to generate the node activity; based on the statistical distribution characteristics of the node activity, dynamically define the risk level threshold to extract high-risk nodes, and use the high-risk nodes as anchors to perform a two-hop neighborhood query to output a two-hop subgraph. S32. Calculate the historical co-occurrence frequency between nodes based on the historical interaction records of the two-hop subgraph. Based on the statistical distribution characteristics of the historical co-occurrence frequency, dynamically define the co-occurrence intensity threshold and remove connection edges below the co-occurrence intensity threshold to output a denoised two-hop subgraph. S33. Calculate the statistical distribution characteristics of the number of nodes in each hop in the two-hop subgraph with the high-risk node as the center. This is used to dynamically determine the hierarchical sampling ratio to perform downsampling and output the hierarchical decoupling node set. S34. Map the hierarchical decoupling node set back to the denoised two-hop subgraph to extract associated connection edges. Based on the statistical distribution characteristics of edge weights, dynamically define the attenuation threshold to remove low-weight edges. Construct the graph topology structure with the hierarchical decoupling node set and the remaining associated connection edges, and output the sampling subgraph features.
5. The method for generating cell pathology reports based on knowledge graphs according to claim 1, characterized in that, The improved FastGCN model includes a variance importance calculation layer, a molecular repulsive potential sampling layer, a chemical bond mapping layer, and an expected truncation output layer: The variance importance calculation layer is used to extract the L2 norm variance sequence of the nodes in the feature matrix of the sampled subgraph, dynamically define the normalized benchmark value based on the statistical distribution of the L2 norm variance sequence, perform benchmark division and square root truncation on the variance of the nodes, and output the node importance probability vector. The molecular repulsive potential sampling layer is used to introduce a spatial decoupling mechanism based on molecular dynamics repulsive equilibrium, specifically including: Based on the node importance probability vector, sampling with replacement is performed to generate an initial sampling sequence. The nodes in the initial sampling sequence are mapped to chemical molecules. The electrostatic charge of the corresponding molecules is assigned according to the node importance probability vector. The Coulomb force equilibrium distance threshold is dynamically determined based on the statistical distribution characteristics of the characteristic distances of each node in the initial sampling sequence. Based on the characteristic distances between nodes and the electrostatic charge, the intermolecular force gradient including electrostatic repulsion and van der Waals attraction terms is dynamically calculated. Driven by the gradient of intermolecular forces, the system performs iterative updates of positions in the feature space, calculates the sequence of changes in the total potential energy of the system between adjacent iterations in real time, dynamically defines the potential energy fluctuation convergence threshold based on the variance distribution characteristics of the sequence of changes in the total potential energy of the system, and reaches dynamic equilibrium when the current change in the total potential energy of the system is lower than the potential energy fluctuation convergence threshold; extracts molecules whose feature distance is greater than or equal to the Coulomb force equilibrium distance threshold in the equilibrium state as effective nodes, and outputs a spatially discrete set of nodes; The chemical bond mapping layer is used to backtrack the graph topology of the initial sampling sequence based on the spatially discrete node set, extract the original connection edges between discrete nodes, and map them to the chemical bond level topology of continuous values; dynamically define the bond energy decay threshold based on the updated feature distance between nodes and the statistical distribution characteristics of node electrostatic charge, determine the connection edges with chemical bond levels below the bond energy decay threshold as weak interaction edges and remove them, and output the set of stable molecular configuration nodes and the chemical bond adjacency matrix. The expected truncation output layer is used to drive the hidden state of the stable molecular configuration nodes and the chemical bond adjacency matrix through multi-level graph convolution message passing, and generate a conditional probability distribution through normalized exponential mapping; the confidence threshold is dynamically determined according to the maximum value sequence of the probability distribution, the expected conditional probability of each node is calculated, and nodes exceeding the confidence threshold and their corresponding connection edges are truncated in descending order, and the set of key accompanying feature paths is output.
6. The method for generating cell pathology reports based on knowledge graphs according to claim 1, characterized in that, S5 specifically includes: S51. Extract the terminal nodes of each path in the key accompanying feature path set, and calculate the mean local feature activation response of each terminal node on its respective path. S52. Extract the global original feature response of each end node in the initial entity node set, and perform element-by-element difference operation between the mean of the local feature activation response and the corresponding global original feature response to generate a feature decay difference sequence. S53. Based on the statistical distribution characteristics of the characteristic decay difference sequence, calculate the distribution mean and distribution variance. Calculate the dynamic adjustment coefficient according to the data length and distribution variance of the characteristic decay difference sequence. Subtract the product of the dynamic adjustment coefficient and the distribution variance from the distribution mean to calculate the decay threshold. S54. Compare each decay difference in the feature decay difference sequence with the decay threshold, remove low decay end nodes that are less than the decay threshold, and retain end nodes that are greater than or equal to the decay threshold to aggregate them into a latent missing feature set.
7. The method for generating cell pathology reports based on knowledge graphs according to claim 1, characterized in that, S6 specifically includes: S61. Extract the semantic labels of each missing feature in the latent missing feature set, calculate the information weights based on the word frequency statistical distribution of the semantic labels, and concatenate each semantic label with the corresponding information weights to generate a negative constraint instruction sequence. S62. Obtain a corpus of historical pathology report texts, statistically analyze the transition probability distribution of each syntactic structure in the corpus of historical pathology report texts, and calculate the syntactic template matching degree based on the transition probability distribution; S63. Based on the syntactic template matching degree, the candidate syntactic templates in the historical pathology report text corpus are sorted in descending order, and the target syntactic template ranked first is extracted as the dynamic matching template. S64. Inject the negative constraint instruction sequence into the dynamic matching template, perform syntax dependency parsing on the dynamic matching template to dynamically locate the filling slots, map the negative constraint instruction sequence to the filling slots and perform part-of-speech alignment, and output the weak prompt text fragment.
8. The method for generating cell pathology reports based on knowledge graphs according to claim 1, characterized in that, Specifically, S7 includes: S71. Extract the token sequence, sampled subgraph features and latent missing feature set of the medical entities in the text, map the sampled subgraph features to the text semantic space to generate graph embedding vectors, and concatenate the graph embedding vectors with weak cue fragments to generate enhanced instruction sequences. S72. Based on the token sequence and enhanced instruction sequence of the text medical entity, perform position encoding, calculate the cross-attention score between the position-encoded token sequence and the enhanced instruction sequence, and align and fuse the token sequence and enhanced instruction sequence of the text medical entity based on the cross-attention score to generate a token matrix. S73. Extract the node feature vectors of the latent missing feature set, calculate the semantic similarity between each token and the node feature vector in the token matrix, dynamically determine the similarity threshold based on the statistical distribution characteristics of the extreme similarity values, and map the similarity below the similarity threshold to the confidence weight of each token. S74. Add the confidence weight as a prior penalty factor to the token matrix to generate a weighted token matrix. S75. Based on the weighted token matrix, through multi-head self-attention autoregressive decoding, the prior penalty factor is applied to the vocabulary probability distribution at each decoding time step to suppress the generation probability of low-confidence tokens, block the generation of speculative hallucinations, and generate cellular pathology reports.
9. The method for generating cell pathology reports based on knowledge graphs according to claim 1, characterized in that, S8 specifically includes: S81. Map the latent missing feature set to the semantic space to generate a missing semantic vector, extract the token sequence of the cytopathology report and map it to generate a report semantic matrix, calculate the cosine similarity between the missing semantic vector and each token vector in the report semantic matrix to generate a risk similarity matrix. S82. Determine the dynamic verification threshold based on the statistical distribution characteristics of the risk similarity matrix, and extract elements in the risk similarity matrix that are greater than the dynamic verification threshold to generate a set of violation feature indexes. S83. Calculate the number of elements in the violation feature index set to generate the violation feature density, determine the dynamic blocking density threshold based on the statistical distribution characteristics of the violation feature density, and output the verification status flag by comparing the violation feature density with the dynamic blocking density threshold. S84. Trigger release command based on verification status identifier and output cell pathology report.