Image detection model training method, image detection method, device and equipment

By employing an image detection model training method and a two-stage segmentation framework, combined with heatmaps and density maps, optimizing model parameters, and introducing vascular centerline connectivity constraints, the accuracy and topological integrity issues in intracranial aneurysm detection in existing technologies are resolved, achieving efficient CFD modeling and simulation.

CN121504831APending Publication Date: 2026-02-10SHANGHAI INSTITUTE OF SCIENCE & INTELLIGENCE +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511563654.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately locate and distinguish small aneurysms in intracranial three-dimensional magnetic resonance angiography data, leading to false positives or missed small aneurysms. This increases the complexity and error rate of subsequent geometric modeling and lacks attention to geometric topological integrity, failing to meet the requirements of computational fluid dynamics analysis.

Method used

An image detection model training method is adopted, which combines heatmaps and density maps, introduces a pre-set counting head module and global non-maximum suppression operation, optimizes model parameters using a comprehensive loss function, and performs a two-stage segmentation framework, including aneurysm detection and aneurysm-bearing vessel segmentation. It also introduces vessel centerline connectivity constraints and provides an automated CFD verification process.

Benefits of technology

It improves the detection accuracy of intracranial three-dimensional magnetic resonance angiography data, reduces the complexity and error rate of geometric modeling, ensures the geometric topological integrity of the segmentation results and the reliability of blood flow simulation, and realizes the automated conversion from segmentation mask to CFD model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504831A_ABST
    Figure CN121504831A_ABST
Patent Text Reader

Abstract

The invention discloses an image detection model training method, an image detection method, a device and equipment, which are applied to the technical field of image processing, and the method comprises the steps: obtaining training samples from a training sample set, the training samples being image blocks in intracranial three-dimensional magnetic resonance angiography data, the label information of the training sample comprises a thermodynamic diagram label and an aneurysm quantity label, and the thermodynamic diagram label represents the central point position of the aneurysm in the training sample; inputting the training sample into a preset detection network model to obtain a predicted thermodynamic diagram and a predicted density diagram; calculating the comprehensive loss based on the predicted thermodynamic diagram and the thermodynamic diagram label, and based on the predicted density map and the aneurysm number label; and updating parameters of the preset detection network model by using the comprehensive loss until a training ending condition is met, and determining the preset detection network model with the updated current parameters as a target image detection model. In this way, the accuracy of intracranial three-dimensional magnetic resonance angiography data detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to image detection model training methods, image detection methods, apparatus and equipment. Background Technology

[0002] Currently, automated detection of intracranial aneurysms and their carrier vessels primarily relies on end-to-end segmentation networks. Typically, the entire 3D MRA (3D Magnetic Resonance Angiography) image is processed directly to output a segmentation mask for the target vessel region. However, end-to-end segmentation methods struggle to accurately locate and distinguish small aneurysms and other background vessels with similar morphology to the target carrier vessel within the global image. This leads to numerous false positives or missed small aneurysms; in other words, it is inaccurate in detecting small targets in the image, resulting in segmentation results containing too many irrelevant structures or missing crucial parts. This directly increases the complexity and error rate of subsequent geometric modeling.

[0003] Therefore, improving the accuracy of intracranial three-dimensional magnetic resonance angiography data detection, thereby reducing the complexity and error rate of subsequent geometric modeling, is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide an image detection model training method, an image detection method, a device, and equipment, which can improve the accuracy of intracranial three-dimensional magnetic resonance angiography data detection, thereby reducing the complexity and error rate of subsequent geometric modeling. The specific solution is as follows:

[0005] Firstly, this application provides an image detection model training method, including:

[0006] Training samples are obtained from the training sample set. The training samples are image patches in the intracranial three-dimensional magnetic resonance angiography data. The label information of the training samples includes heat map labels and aneurysm number labels. The heat map labels represent the center point position of the aneurysm in the training sample. Each center point position corresponds to a three-dimensional Gaussian distribution with the heat value of that center point position as the peak value.

[0007] The training samples are input into a preset detection network model to obtain a prediction heatmap and a prediction density map, wherein the prediction heatmap represents the center point location of the predicted aneurysm, and the prediction density map represents the number of predicted aneurysms.

[0008] A first loss is calculated based on the predicted heatmap and the heatmap labels; a second loss is calculated based on the predicted density map and the aneurysm number labels; and a combined loss is calculated based on the first loss and the second loss.

[0009] The parameters of the preset detection network model are updated using the comprehensive loss until the training termination condition is met. Then, the preset detection network model with the updated parameters is determined as the target image detection model.

[0010] Optionally, calculating the first loss based on the predicted heatmap and the heatmap labels includes:

[0011] The first loss is calculated using the first loss calculation formula, based on the predicted heatmap and the heatmap labels, wherein the first loss calculation formula is:

[0012] ;

[0013] in, Indicates the first loss. Indicates the number of positive sample points. This indicates that the data point is a positive sample point in the training samples, and x, y, and z represent the three-dimensional coordinate axes of the coordinate system corresponding to the intracranial three-dimensional magnetic resonance angiography data. The thermal values ​​of the data points in the predicted heatmap. The heat values ​​of the data points in the heatmap labels. , It is a regulating factor.

[0014] Optionally, the preset detection network model includes an encoder, a decoder, and a preset counting head module;

[0015] Accordingly, the training samples are input into a preset detection network model to obtain a predicted heatmap and a predicted density map, including:

[0016] The training samples are input into the encoding module of a preset detection network model to obtain image features;

[0017] The decoder outputs the predicted heatmap based on the image features;

[0018] The preset counting head module outputs the predicted density map based on the image features;

[0019] The preset counting head module includes a preset convolutional layer and a preset global nonmaximum suppression operation layer, or an attention module and a preset global nonmaximum suppression operation layer.

[0020] Secondly, this application provides an image detection method, including:

[0021] The intracranial three-dimensional magnetic resonance angiography data to be detected is segmented into image blocks to obtain the image blocks to be detected.

[0022] The image patch to be detected is input into the target image detection model to obtain the heatmap and density map corresponding to the image patch to be detected; wherein, the target image detection model is trained by the aforementioned image detection model training method;

[0023] The heatmaps of each of the image blocks to be detected are aggregated into a global heatmap of the intracranial three-dimensional magnetic resonance angiography data to be detected.

[0024] The density maps of each of the image blocks to be detected are aggregated into a global density map of the intracranial three-dimensional magnetic resonance angiography data to be detected;

[0025] Based on the global density map, a connected component analysis is performed to obtain the number of aneurysms contained in each connected component, and the total number of aneurysms is calculated based on the number of aneurysms in each connected component.

[0026] The global density map is used to enhance the global heatmap, resulting in an enhanced heatmap.

[0027] The local nonmaximum suppression result is obtained by performing local nonmaximum suppression on the enhanced heat map result;

[0028] Based on the results of the local nonmaximum suppression, the data points with the highest thermal values ​​of the total number of aneurysms are selected to obtain the target location.

[0029] Optional, also includes:

[0030] The intracranial three-dimensional magnetic resonance angiography data to be detected is cropped based on each target location to obtain a target image block corresponding to each target location;

[0031] The target image block is input into the tumor-bearing vessel segmentation model to obtain the segmentation result;

[0032] The tumor-bearing vessel segmentation model is a model obtained by training an image segmentation model using tumor-bearing vessel image training samples.

[0033] Optionally, the training process of the tumor-bearing vessel segmentation model includes:

[0034] Acquire training samples of aneurysm-bearing vascular images, wherein the label information of the training samples of aneurysm-bearing vascular images includes aneurysm and vascular labels;

[0035] The training samples of the tumor-bearing blood vessel images are input into the image segmentation model to obtain the prediction results;

[0036] Extract the pixels of the central region of the blood vessel from the prediction results;

[0037] The basic segmentation loss is calculated using the prediction results and the label information, and the central region pixel loss corresponding to the central region pixel of the blood vessel is calculated using the central region pixel of the blood vessel. The training loss is then calculated based on the basic segmentation loss and the central region pixel loss.

[0038] The image segmentation model is updated using the training loss until the model converges, resulting in a tumor-bearing vessel segmentation model.

[0039] Optional, also includes:

[0040] The segmentation results are subjected to geometric defect detection and repair of vascular topology, and a watertight three-dimensional model is generated.

[0041] Identify the topological endpoints of the blood vessel inlets and outlets in the watertight 3D model, and generate the blood vessel centerline based on the topological endpoints;

[0042] The end face is cut off along the normal plane of the blood vessel centerline based on the topological endpoint;

[0043] A target mesh labeled with boundary conditions is generated based on the end face and the watertight 3D model.

[0044] Computational fluid dynamics simulations are performed based on the target mesh.

[0045] Thirdly, this application provides an image detection apparatus, comprising:

[0046] The image segmentation module is used to segment the intracranial three-dimensional magnetic resonance angiography data to be detected into image blocks to obtain the image blocks to be detected.

[0047] An image detection module is used to input the image block to be detected into a target image detection model to obtain a heatmap and a density map corresponding to the image block to be detected; wherein, the target image detection model is trained by the aforementioned image detection model training method;

[0048] A heatmap aggregation module is used to aggregate the heatmaps of each of the image blocks to be detected into a global heatmap of the intracranial three-dimensional magnetic resonance angiography data to be detected.

[0049] The density map aggregation module is used to aggregate the density maps of each of the image blocks to be detected into a global density map of the intracranial three-dimensional magnetic resonance angiography data to be detected.

[0050] The quantity determination module is used to perform connected component analysis based on the global density map to obtain the number of aneurysms contained in each connected component, and to calculate the total number of aneurysms based on the number of aneurysms in each connected component.

[0051] An image enhancement module is used to enhance the global heatmap using the global density map to obtain a heatmap enhancement result;

[0052] The non-maximum suppression processing module is used to perform local non-maximum suppression on the heatmap enhancement result to obtain the local non-maximum suppression result.

[0053] The center point filtering module is used to filter the data points with the highest thermal values ​​of the total number of aneurysms based on the local non-maximum suppression results, and obtain the target location.

[0054] Fourthly, this application provides an electronic device, including a memory and a processor, wherein:

[0055] The memory is used to store computer programs;

[0056] The processor is configured to execute the computer program to implement the aforementioned image detection model training method, and / or the aforementioned image detection method.

[0057] Fifthly, this application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned image detection model training method, and / or the aforementioned image detection method.

[0058] As can be seen from the above scheme, the present invention provides an image detection model training method, including: obtaining training samples from a training sample set, wherein the training samples are image blocks in intracranial three-dimensional magnetic resonance angiography data, and the label information of the training samples includes heat map labels and aneurysm number labels, wherein the heat map labels represent the center point position of the aneurysms in the training samples, and each center point position corresponds to a three-dimensional Gaussian distribution with a peak heat value at that center point position; inputting the training samples into a preset detection network model to obtain a predicted heat map and a predicted density map, wherein the predicted heat map represents the predicted center point position of the aneurysms, and the predicted density map represents the predicted number of aneurysms; calculating a first loss based on the predicted heat map and the heat map labels, calculating a second loss based on the predicted density map and the aneurysm number labels, and calculating a comprehensive loss based on the first loss and the second loss; updating the parameters of the preset detection network model using the comprehensive loss until the training termination condition is met, and then determining the preset detection network model with the updated parameters as the target image detection model.

[0059] As can be seen, the beneficial effects of this application are as follows: the training samples are image patches from intracranial three-dimensional magnetic resonance angiography data, which can pay more attention to local details. The label information includes heat map labels and aneurysm number labels. The heat map labels represent the center point position of the aneurysm in the training samples. Through such labels, the model learns the ability to detect the location and number of aneurysms. The point representation method eliminates the sensitivity to changes in target size, making the target image detection model applicable to small aneurysms. It avoids the problem of difficulty in accurately locating and distinguishing small aneurysms, thereby further ensuring accurate identification of the target aneurysm-bearing vessel, improving the accuracy of intracranial three-dimensional magnetic resonance angiography data detection, and thus reducing the complexity and error rate of subsequent geometric modeling.

[0060] Correspondingly, the image detection method, apparatus, device, and readable storage medium provided in this application also have the above-mentioned technical effects. Attached Figure Description

[0061] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0062] Figure 1 A flowchart of an image detection model training method provided in this application embodiment;

[0063] Figure 2 This is a flowchart of an image detection method provided in an embodiment of this application;

[0064] Figure 3 A schematic diagram of intracranial blood vessels provided in an embodiment of this application;

[0065] Figure 4 This application provides a dataset and a schematic diagram of the annotation process as an embodiment of the present application;

[0066] Figure 5 A schematic diagram of a two-stage framework for segmenting an intracranial aneurysm and its carrier vessel is provided for an embodiment of this application.

[0067] Figure 6 A flowchart illustrating the conversion from a segmentation mask to a CFD model is provided for embodiments of this application.

[0068] Figure 7 This is a schematic diagram of the structure of an image detection device provided in an embodiment of this application;

[0069] Figure 8 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0070] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0071] Intracranial aneurysms (IAs) are pathological dilatations of the intracranial vessel walls, frequently occurring at arterial bifurcation points. Rupture of IAs can lead to high rates of death and disability. Computational Fluid Dynamics (CFD) provides crucial biomechanical evidence for aneurysm rupture risk assessment by quantifying hemodynamic parameters (such as wall shear force and pressure distribution). Segmentation of intracranial aneurysms and their carrier vessels (IA-Vessel) based on magnetic resonance angiography (MRA) is a prerequisite for CFD analysis. The geometric integrity and topological accuracy of the segmentation results directly affect the feasibility and reliability of subsequent CFD modeling. Traditional segmentation methods rely on manual annotation, which is inefficient and subject to subjective variations. Current mainstream solutions employ deep learning models (such as 3D UNet and nnUNet) for automated segmentation, evaluating segmentation accuracy through region overlap indices (such as the Dice coefficient). However, CFD analysis requires segmentation results to meet strict geometric constraints: vessel topological integrity: tumor-bearing vessels must maintain connectivity, avoiding branch adhesion or breakage; surface smoothness: vessel surfaces must be free of anomalies such as holes and jagged edges to ensure mesh generation quality; boundary adaptability: cut-off surfaces must be perpendicular to the vessel centerline to define accurate CFD boundary conditions. Existing segmentation methods only focus on pixel accuracy at the image level, lacking targeted optimization for the above CFD application requirements. This often results in segmentation results that fail to generate effective CFD meshes or cause flow field distortion due to geometric errors (such as vessel adhesion and surface unevenness). Therefore, there is an urgent need to establish a CFD applicability optimization scheme covering the entire process of segmentation, modeling, and simulation.

[0072] Currently, automated intracranial aneurysm and carrier vessel segmentation mainly relies on deep learning models, such as end-to-end segmentation networks based on the 3D UNet architecture or its improved versions (e.g., nnUNet). These methods typically process the entire 3D MRA image directly, outputting a segmentation mask for the target vessel region. For evaluation, metrics based on image pixel overlap, such as the Dice similarity coefficient (DSC), Hausdorff distance (HD95), or BIoU (Boundary Intersection over Union, calculated for the edge portions of the segmentation result), are commonly used to measure the closeness of the segmentation result to manually labeled data. However, this approach has significant drawbacks, making it difficult to effectively apply the segmentation results to subsequent computational fluid dynamics analysis. First, end-to-end segmentation struggles to accurately locate and distinguish small aneurysms and other background vessels with similar morphology to the target carrier vessel in the global image, easily generating numerous false positives or missing small aneurysms. This results in segmentation results containing too many irrelevant structures or missing crucial parts, directly increasing the complexity and error rate of subsequent geometric modeling. Secondly, and more importantly, existing segmentation models only optimize and focus on pixel-level precision metrics (such as the Dice coefficient) during training and evaluation. These metrics are extremely insensitive to the topological integrity of vascular structures (such as whether vessels are connected, whether there are abnormal branch adhesions or breaks) and geometric smoothness (such as whether there are holes or jagged edges on the surface). A segmentation result that performs well on the Dice score may have serious topological errors such as vessel adhesions or surface irregularities in the actual geometric model. These geometric and topological defects can easily lead to process interruptions (such as mesh generation failure) or introduce physical distortions (such as non-convergence or incorrect results in flow field calculations) during key steps of CFD modeling (such as centerline extraction, vessel cross-section cutting, and surface mesh generation). Furthermore, existing technologies lack an automated and standardized process to verify whether the segmentation results truly meet the requirements of CFD modeling. The conversion process from segmentation mask to usable CFD model often relies on manual operation of multiple commercial software programs (such as 3D Slicer, MeshLab, ANSYS, etc.), which is cumbersome, subjective, and inefficient, and cannot quickly and objectively evaluate the CFD applicability of the segmentation results.Therefore, while the closest existing technical solutions may perform well in general medical image segmentation metrics, their core flaw lies in the disconnect between the segmentation target and the needs of downstream CFD applications. They neglect the crucial prerequisite of ensuring geometric topological correctness in CFD modeling and lack effective automated evaluation methods to connect segmentation and simulation. This results in low actual usability of the segmentation results (i.e., the proportion that can be successfully used for CFD analysis) and makes it unreliable for CFD-based aneurysm hemodynamic research and clinical risk assessment.

[0073] This application addresses key issues in existing intracranial aneurysm and tumor-bearing vessel segmentation methods for computational fluid dynamics applications: Lack of CFD applicability in segmentation results: Existing deep learning segmentation models (such as nnUNet) only optimize pixel precision at the image level (e.g., Dice coefficients), neglecting geometric topological integrity (e.g., vessel adhesion, fracture) and surface smoothness, resulting in segmentation results that fail to meet the geometric constraints of CFD modeling (e.g., mesh generation failure, flow field distortion); Disconnect between evaluation systems and CFD requirements: Traditional segmentation metrics (Dice, HD95) cannot reflect the feasibility of CFD modeling, and there is a lack of automated, standardized end-to-end verification systems from segmentation masks to CFD models; Insufficient accuracy in small target localization and local vessel segmentation: End-to-end segmentation methods have weak localization capabilities for small aneurysms and struggle to accurately separate tumor-bearing vessels from background vessels in complex vascular contexts, further reducing CFD usability. To this end, this invention proposes a segmentation and evaluation scheme for intracranial aneurysms oriented towards CFD applications. By constructing a dedicated dataset, a two-stage segmentation framework, and an automated CFD verification process, it achieves the core objectives of geometrically modelable, topologically faithful, and convergent blood flow simulation results for segmentation, providing reliable input for clinical CFD analysis.

[0074] See Figure 1 As shown in the figure, this application discloses an image detection model training method, including:

[0075] Step S11: Obtain training samples from the training sample set. The training samples are image blocks in the intracranial three-dimensional magnetic resonance angiography data. The label information of the training samples includes heat map labels and aneurysm number labels. The heat map labels represent the center point location of the aneurysms in the training samples. Each center point location corresponds to a three-dimensional Gaussian distribution with the peak heat value at that center point location.

[0076] In this embodiment, the intracranial three-dimensional magnetic resonance angiography data can be divided into multiple image blocks according to a preset size as training samples, and label information for each image block can be generated. The three-dimensional Gaussian distribution decays radially from the peak.

[0077] Step S12: Input the training samples into a preset detection network model to obtain a prediction heatmap and a prediction density map, wherein the prediction heatmap represents the center point location of the predicted aneurysm, and the prediction density map represents the number of predicted aneurysms.

[0078] The preset detection network model can be a deep learning-based image detection model, which can be built based on networks such as Unet. In this embodiment, a preset counting head module is added.

[0079] The preset detection network model includes an encoder, a decoder, and a preset counting head module. Correspondingly, inputting the training samples into the preset detection network model to obtain a predicted heatmap and a predicted density map includes: inputting the training samples into the encoding module of the preset detection network model to obtain image features; using the decoder to output the predicted heatmap based on the image features; and using the preset counting head module to output the predicted density map based on the image features. The preset counting head module includes a preset convolutional layer and a preset global non-maximum suppression (GNPS) operation layer, or an attention module and a preset GNPS operation layer.

[0080] The process involves inputting the training samples into the encoding module of a preset detection network model to obtain image features; processing these features using a bottleneck layer to obtain processed features; inputting these processed features into the decoder to obtain a predicted heatmap output by the decoder; and inputting these processed features into a preset counting head module to obtain a predicted density map output by the preset counting head module. The preset convolutional layer is a 1×1×1 convolutional layer, and a global non-maximum suppression layer is used to perform global non-maximum suppression, processing each channel value of each point in the image patch to the maximum value of all channel values ​​in that channel within that image patch. That is, each channel value of each point corresponding to that image patch is the maximum value of that channel. The number of channels represents the number of aneurysms; for example, if there are 0 to 5 aneurysms, there are 6 channels, with each point corresponding to 6 channel values. The decoder output then generates a single-channel heatmap using a sigmoid activation function.

[0081] Step S13: Calculate the first loss based on the predicted heatmap and the heatmap label, calculate the second loss based on the predicted density map and the aneurysm number label, and calculate the comprehensive loss based on the first loss and the second loss.

[0082] Specifically, the first loss is calculated using a first loss calculation formula, based on the predicted heatmap and the heatmap labels. The first loss calculation formula is as follows:

[0083] .

[0084] in, Indicates the first loss. Indicates the number of positive sample points. This indicates that the data point is a positive sample point in the training samples, and x, y, and z represent the three-dimensional coordinate axes of the coordinate system corresponding to the intracranial three-dimensional magnetic resonance angiography data. The thermal values ​​of the data points in the predicted heatmap. The heat values ​​of the data points in the heatmap labels. , This is the adjustment factor. In the coordinate system, the top-left corner is the origin, the horizontal axis to the right is the x-axis, the vertical axis downwards is the y-axis, and the direction perpendicular to the xoy plane pointing into the screen is the z-axis. Data points are voxels.

[0085] Furthermore, the second loss can be the cross-entropy loss. The sum of the first and second losses is the overall loss.

[0086] Step S14: Update the parameters of the preset detection network model using the comprehensive loss until the training termination condition is met, then determine the preset detection network model with the updated parameters as the target image detection model.

[0087] The training termination condition can be that the number of model iterations reaches a preset threshold, or the loss converges, etc.

[0088] As can be seen, in this embodiment, the training samples are image patches from intracranial three-dimensional magnetic resonance angiography data, which can pay more attention to local details. The label information includes heat map labels and aneurysm number labels. The heat map labels represent the center point position of the aneurysm in the training samples. Through such labels, the model learns the ability to detect the location and number of aneurysms. The point representation eliminates the sensitivity to changes in target size, making the target image detection model applicable to small aneurysms. It avoids the problem of difficulty in accurately locating and distinguishing small aneurysms, thereby further ensuring accurate identification of the target aneurysm-bearing vessel, improving the accuracy of intracranial three-dimensional magnetic resonance angiography data detection, and thus reducing the complexity and error rate of subsequent geometric modeling.

[0089] Further, see Figure 2 As shown, this application provides an image detection method, including:

[0090] Step S21: Divide the intracranial three-dimensional magnetic resonance angiography data to be detected into image blocks to obtain the image blocks to be detected.

[0091] In this embodiment, the intracranial three-dimensional magnetic resonance angiography data to be detected can be divided into image blocks based on a preset size to obtain the image blocks to be detected.

[0092] Step S22: Input the image block to be detected into the target image detection model to obtain the heat map and density map corresponding to the image block to be detected; wherein, the target image detection model is trained by the image detection model training method disclosed in the foregoing embodiments.

[0093] Step S23: Aggregate the heatmaps of each of the image blocks to be detected into a global heatmap of the intracranial three-dimensional magnetic resonance angiography data to be detected.

[0094] Specifically, the heatmaps of each image block to be detected can be aggregated into a global heatmap of the intracranial three-dimensional magnetic resonance angiography data to be detected based on a sliding window.

[0095] Step S24: Aggregate the density maps of each of the image blocks to be detected into a global density map of the intracranial three-dimensional magnetic resonance angiography data to be detected.

[0096] Specifically, the density maps of each image block to be detected can be aggregated into a global density map of the intracranial three-dimensional magnetic resonance angiography data to be detected based on a sliding window.

[0097] Step S25: Perform connected component analysis based on the global density map to obtain the number of aneurysms contained in each connected component, and calculate the total number of aneurysms based on the number of aneurysms in each connected component.

[0098] This embodiment can perform argmax (i.e., the parameter with the maximum value) operation on the global density map to obtain the argmax operation result; perform connected component analysis on the argmax operation result to obtain the number of aneurysms contained in each connected component, and calculate the total number of aneurysms based on the number of aneurysms in each connected component.

[0099] The argmax operation takes the maximum value of all channel values ​​at a given point as the corresponding prediction result. The channel value can be a probability value. For example, if the channel value is the largest for the predicted number of aneurysms (4), then the value at that point is 4.

[0100] Step S26: Enhance the global heatmap using the global density map to obtain the heatmap enhancement result.

[0101] In this embodiment, the result of the argmax operation can be binarized to obtain a binarized result. The binarized result is then multiplied by the global heatmap to obtain an enhanced heatmap result.

[0102] Understandably, binarization processes the result of the argmax operation into an image composed of 0 and 1 values. Points with non-zero values ​​are all treated as 1.

[0103] This embodiment can filter the data points with the highest thermal values ​​of the total number of aneurysms based on the enhanced heat map results to obtain the target location.

[0104] Step S27: Perform local nonmaximum suppression on the enhanced heatmap result to obtain the local nonmaximum suppression result.

[0105] Step S28: Based on the local non-maximum suppression results, select the data points with the highest thermal values ​​for the total number of aneurysms to obtain the target location.

[0106] In this way, the target location is the coordinate of the data point with the highest thermal value among the total number of aneurysms mentioned above. This ensures that high-confidence candidate points are selected to obtain the target location, thereby improving the effect of subsequent segmentation of the aneurysm-bearing vessels.

[0107] Furthermore, in this embodiment, the intracranial three-dimensional magnetic resonance angiography data to be detected can be cropped based on each target location to obtain a target image block corresponding to each target location; the target image block is input into the tumor-bearing vessel segmentation model to obtain the segmentation result; wherein, the tumor-bearing vessel segmentation model is a model obtained by training an image segmentation model using tumor-bearing vessel image training samples.

[0108] Specifically, the intracranial three-dimensional magnetic resonance angiography data to be detected can be cropped according to the set size with the target location as the center point to obtain the target image block corresponding to each target location.

[0109] Furthermore, the training process of the tumor-bearing vessel segmentation model includes: acquiring training samples of tumor-bearing vessel images, wherein the label information of the training samples includes aneurysm and vessel labels; inputting the training samples of tumor-bearing vessel images into an image segmentation model to obtain prediction results; extracting the pixels of the vessel center region from the prediction results; calculating the basic segmentation loss using the prediction results and the label information, and calculating the center region pixel loss corresponding to the pixels of the vessel center region using the pixels of the vessel center region, and calculating the training loss based on the basic segmentation loss and the center region pixel loss; updating the image segmentation model using the training loss until the model converges to obtain the tumor-bearing vessel segmentation model.

[0110] In an optional implementation, the labeling information may include aneurysm and vessel labels as well as a background label, for example, aneurysm and vessel are 1, and background is 0. The vessel is the vessel carrying the aneurysm.

[0111] In this embodiment, the basic segmentation loss may include Dice loss and cross-entropy loss, i.e., the sum of Dice loss and cross-entropy loss. Pixels in the central region of the blood vessel can be extracted based on skeletonization operations, and the loss for these central region pixels can be topological constraint loss or recall loss, etc. The central region of the blood vessel is the area consisting of the blood vessel centerline and a predetermined number of adjacent pixels. This allows the model to further learn the topological structure of the blood vessel.

[0112] Furthermore, embodiments of this application may further include: performing geometric defect detection and defect repair on the segmentation result of the blood vessel topology, and generating a watertight three-dimensional model; identifying the topological endpoints of the blood vessel inlets and outlets in the watertight three-dimensional model, and generating a blood vessel centerline based on the topological endpoints; extracting end faces along the normal plane of the blood vessel centerline based on the topological endpoints; generating a target mesh labeled with boundary conditions based on the end faces and the watertight three-dimensional model; and performing computational fluid dynamics simulation based on the target mesh.

[0113] Geometric defects, such as surface holes and jagged edges, are addressed through morphological closure operations to repair anomalies and generate a watertight 3D model. The vessel centerline is extracted, and end faces are automatically truncated along the centerline normal plane at the inlet / outlet locations of the tumor-bearing vessel, ensuring the cross-section is perpendicular to the blood flow direction. Based on the labeled fluid boundaries (inlet / outlet / vessel wall), a hybrid mesh (such as a near-wall-refined tetrahedral mesh) is generated to adapt to hemodynamic calculations. Furthermore, a Newtonian fluid model and pulsating flow boundary conditions are set, and the solution is iteratively applied until the velocity and pressure field residuals converge stably.

[0114] Furthermore, a computational fluid dynamics suitability score is performed based on preset evaluation indicators, including vascular topology availability, mesh generation availability, and blood flow convergence availability. The score provided in this application is at the image level, calculated on an image-by-image basis, and can be calculated using multiple image samples, i.e., intracranial three-dimensional magnetic resonance angiography data.

[0115] Furthermore, this application provides a computational fluid dynamics-based scheme for intracranial aneurysm segmentation and evaluation, employing a two-stage segmentation framework: The first stage (aneurysm detection): A dynamic query detection network is used to locate the aneurysm center point. Candidate point locations are predicted collaboratively using heatmaps and density maps, and a dynamic candidate point selection mechanism adaptively determines the number of true positives, addressing the problem of missed detections of small aneurysms. The second stage (aneurysm-bearing vessel segmentation): Based on cropped local image patches, a topology-aware segmentation network is used. A loss function constraining the vessel centerline connectivity is introduced to force the model to maintain the integrity of the vessel topology, avoiding adhesion or breakage. An automated modeling pipeline is provided: the segmentation mask is automatically converted into a CFD model, including vessel topology inspection, geometric repair, centerline generation, cross-section cutting, boundary annotation, mesh generation, and simulation calculation. Furthermore, a CFD applicability score is provided. Define quantitative metrics to comprehensively evaluate the vascular topology availability (VTA), mesh generation availability (MGA), and blood flow convergence availability (BFA) of the segmentation results. VTA (Vascular Topology Availability): Detects the presence of geometric anomalies. MGA (Mesh Generation Availability): Verifies that the geometric model can be successfully meshed. BFA (Blood Flow Availability): Determines whether the CFD simulation has achieved stable convergence.

[0116] The system includes a dynamic candidate point selection mechanism (first stage), which adaptively determines the number of candidate points based on the number of connected regions in the density map, thus resolving the false positive interference of traditional detection methods for small aneurysms. An attention-based alternative convolutional layer can also be used. A topological constraint loss function (second stage) explicitly incorporates vessel centerline connectivity constraints into the segmentation loss, ensuring the correct anatomical connection between the carrier vessel and the aneurysm. A fully automated CFD verification pipeline achieves end-to-end automated verification from segmentation mask to flow field simulation for the first time, eliminating subjective biases introduced by manual operation. Key steps include: vessel topology inspection: automatically identifying geometric anomalies (such as holes and jagged edges); intelligent section cutting: vertically cutting the vessel end face based on the centerline; and boundary-driven mesh generation: automatically dividing the fluid mesh according to the labeled inlet / outlet boundaries. A CFD applicability score quantifies the actual CFD usability of the segmentation results, replacing traditional image metrics (such as Dice).

[0117] By introducing a two-stage segmentation framework and a CFD applicability evaluation system, the following significant technical effects were achieved: Significantly improved CFD usability of the segmentation results: Due to the introduction of vessel centerline connectivity constraints (clDice Loss) in the second-stage segmentation network, the model is forced to maintain the topological integrity of the vessels, resolving geometric errors caused by vessel adhesion / fracture in traditional methods. Indicator validation showed that the applicability score of this scheme reached 54.76%-57.45%. It overcomes the bottleneck in the detection of small aneurysms by using a dynamic candidate point selection mechanism in the first stage, combined with adaptive determination of the number of true positives based on the number of connected components in the density map, thus addressing the high false positive rate problem of traditional detection models for aneurysms <3mm. Experiments show that this scheme improves precision to 87.85% while maintaining a 92.5% recall rate, significantly reducing the amount of unnecessary computation in subsequent processing. It standardizes the CFD validation process by establishing a fully automated CFD validation pipeline, achieving end-to-end automated conversion from segmentation mask to flow field simulation for the first time. Through intelligent section cutting and boundary-driven mesh generation technology, it eliminates subjective biases in boundary conditions caused by manual operation, reducing modeling time from several hours to within 25 minutes. It establishes a clinically quantifiable evaluation system by quantitatively replacing the traditional Dice index with a CFD applicability score, directly linking segmentation evaluation with blood flow simulation convergence for the first time. This indicator integrates triple validation of vascular topology availability, mesh generation availability, and blood flow convergence availability, enabling clinical institutions to accurately screen effective segmentation results that can be directly used for surgical planning.

[0118] See Figure 3 As shown, Figure 3 This document provides a schematic diagram of intracranial blood vessels according to an embodiment of this application. (a) is a schematic diagram of the entire intracranial vascular system and local parent vessels; (b) is a schematic diagram with annotations of the actual structure of the vascular lumen; (c) is a schematic diagram without topological errors, although the Dice similarity coefficient is low (0.7648), no topological errors are found; (d) is a schematic diagram with topological errors, although the Dice similarity coefficient is high (0.9869), topological errors exist and cannot be used for computational fluid dynamics analysis. Existing methods for evaluating the segmentation results of cerebral aneurysms are limited. Currently, most medical image segmentation models mainly use indicators based on region overlap (such as the Dice coefficient) for evaluation, but these indicators are not sensitive to geometric topological anomalies (such as vascular adhesion and surface irregularities). Such anomalies often fail in CFD validation due to problems such as mesh generation failure or flow field distortion.

[0119] See Figure 4 As shown, Figure 4This application provides a dataset and a schematic diagram of the annotation process. The dataset is the dataset used in this application, defined as the IAVS dataset. Each case contains seven standardized data types: (1) whole brain MRA image, (2) aneurysm mask, (3) aneurysm-vascular mask, (4) STL model with cut-off inlet / outlet, (5) vascular centerline, (6) mesh file with boundary annotation, and (7) CFD analysis results.

[0120] See Figure 5 As shown, Figure 5 This diagram illustrates a two-stage framework for segmenting intracranial aneurysms and their carrier vessels, as provided in an embodiment of this application. The first stage utilizes a detection network for global localization of the aneurysm. After cropping candidate regions, the second stage employs a topology-aware segmentation network to segment the intracranial aneurysm and its carrier vessels, thereby reducing geometric errors. The execution flow of the two-stage segmentation framework is shown below.

[0121] Phase 1: Dynamic Detection of Aneurysm Center Point: Since the mother vessels are mostly clustered around the aneurysm and share similar image features with other vessels, accurately segmenting the aneurysm vessels (IA-Vessel) directly from the global image is very difficult. In the first phase, aneurysm annotation information is used to filter candidate image patches containing the aneurysm, thereby removing interference from background vessels and providing a more accurate segmentation basis for the subsequent segmentation network. Since the goal of the first phase is to locate image patches containing the aneurysm, boundary information is not critical. Therefore, instead of a segmentation method, a detection network is used to accomplish this task. Figure 5 As shown, the network simultaneously generates two complementary outputs: a heatmap to indicate potential aneurysm locations and a density map to estimate the number of aneurysms within an image patch. After feature extraction by the encoder, a counting head branch is introduced in the bottleneck layer. This branch consists of a 1×1×1 convolutional layer and Global Non-Maximum Suppression (Global NMS) to generate the density map. The output of the main decoder then generates a single-channel heatmap through a Sigmoid activation function.

[0122] The loss function during the training phase, namely the aforementioned comprehensive loss, is shown below.

[0123] .

[0124] The loss consists of a heatmap term (the first loss mentioned above) and a classification term (the second loss mentioned above). Because positive voxels (aneurysm centers, with a value of 1) are extremely sparse, a 3D Gaussian heatmap is used. To monitor each aneurysm center, a peak value of 1 is used, which decays radially. To mitigate the imbalance between foreground and background, a weighting scheme based on focal loss is employed: for... Voxel (positive sample): Loss = For all other voxels (negative samples): Loss = .

[0125] in, This represents the predicted heatmap values. It is a focusing factor, or a regulating factor, used to reduce the weight of easily classified positive samples; while This emphasizes the blurred negative sample region near the Gaussian boundary. The counting classification term is the aforementioned second loss. It is the standard cross-entropy loss, used to supervise discrete aneurysm number prediction. With real labels The entire loss is determined by the number of positive voxels. Normalization is used to stabilize the training process. The channel value, i.e., the number of aneurysms with the highest probability value, is the predicted number of aneurysms. In short, the first part is the heatmap loss function, based on the center point prediction loss function. The second part is the cross-entropy loss function for quantity classification, with classification values ​​ranging from 0 to 5, following the empirical assumption of the maximum number of aneurysms in each image.

[0126] During the inference phase, a sliding window prediction method aggregates the heatmap and density map into a global heatmap and a global density map, respectively, and further performs whole-brain ROI (candidate region) estimation. Candidate center points are obtained by performing an argmax operation on the density map, binarizing it, and then multiplying it with the heatmap to suppress background noise. Subsequently, Local Non-Maximum Suppression (Local NMS) with a confidence threshold is applied to further optimize the prediction results. To address the false positive problem in small object detection, a dynamic candidate point selection mechanism is adopted, where the number K of candidate points within the ROI (candidate) region (i.e., the non-zero region after the argmax operation) is adaptively determined based on the number of connected regions in the density map, allowing the model to automatically learn the true number of positive samples. Compared to traditional segmentation or object detection methods, the point representation eliminates sensitivity to changes in target size, which is particularly suitable for small aneurysms, as size fluctuations would otherwise dominate the loss function.

[0127] Phase 1: In this embodiment, the intracranial three-dimensional magnetic resonance angiography (3D MRA) data is divided into blocks and input into the detection network (i.e., the aforementioned target image detection model). The network extracts multi-scale image features through the encoder and generates two types of outputs in parallel during the decoding stage: Heatmap generation: A single-channel probability distribution map is output through the Sigmoid activation function to identify the spatial location of possible aneurysms in the image. Density map generation: After global non-maximum suppression, a predicted map of the number of aneurysms in the region is output through the Softmax activation function.

[0128] Based on the dual-map output, dynamic candidate point selection is performed: the density maps are aggregated into a global density map, connected component analysis is conducted, and the number of candidate points is adaptively determined according to the number of connected regions to avoid false positive interference caused by a fixed threshold. The global heatmap is multiplied point-by-point with the processed global density map to enhance the signal intensity of true positive regions. Local non-maximum suppression (NMS) is performed on the enhanced mapping result to extract the coordinates of high-confidence candidate points.

[0129] The number of candidate nodules is the sum of the number of nodules in all connected regions of the global density. For example... Figure 5 As shown in Stage 1, after the input image is encoded by U-Net, the bottleneck layer outputs a feature map x with shape (B, C, H, W, D). Then, a 1×1×1 convolution is used to reduce the channel dimension to the maximum number N of possible candidate aneurysms, resulting in a tensor with shape (B, N+1, H, W, D). For each channel of each sample in the batch, Global Non-Maximum Suppression (GlobalNMS) is applied: x[B, i, …] = max(x[B, i, …]), where i∈{0,…,N}, thus generating an aneurysm number probability vector. This vector is upsampled to the original image resolution to generate a local density map, which is then used for sliding window inference to generate a global density map. By taking the argmax of the channel dimension and extracting connected components from the global density map, the number of aneurysms in each connected component of the global density map can be obtained. Therefore, the number of candidate aneurysms is the sum of the number of aneurysms in all connected components of the global density map. B, N, H, W, and D represent the bitch size, maximum number of aneurysms, height, width, and depth, respectively. C represents the number of channels.

[0130] The density map is generated by 1*1*1 convolution and global nonmaximum suppression. In optional implementations, the convolution operation can be replaced by an attention module, such as a CBAM Block or an SE Block.

[0131] The second stage: Topologically-aware segmentation of the aneurysm-bearing vessel: Using the center point output from the previous stage as a reference, a local 3D image patch containing the target aneurysm and associated vessels is cropped from the original image. This image patch is input into the improved segmentation network (with nnUNet as the backbone). The network training uses a composite loss function, namely the aforementioned training loss: basic segmentation loss (Dice loss + cross-entropy loss), ensuring pixel-level accuracy; and topological constraint loss (clDice Loss), which explicitly supervises the connectivity of the vessel centerline and forces the model to maintain the rationality of the anatomical structure.

[0132] .

[0133] Among them, the above Let i be the predicted value for the i-th point. For the true value of the i-th point, the original segmentation loss consists of Dice Loss and CrossEntropy loss. Based on this, clDice Loss is added. First, a skeletonization operation is performed on the segmentation mask. To extract pixels in the central region of the blood vessel, skeletonization is achieved by a set of parameter-specific max pooling operations. After extracting the central region pixels, the Dice Loss of the central region pixels is calculated. This is an adjustment factor, which can be a preset value or a learnable parameter.

[0134] In an optional implementation: the topological loss function can be replaced with Skeleton Recall Loss, which replaces the Dice Loss, which calculates the central region pixels of the blood vessel, with the recall loss, which calculates the central region pixels of the predicted values ​​and the ground truth values. The segmentation model outputs a binarized file in nii format.

[0135] Furthermore, the CFD suitability assessment system execution process can include a fully automated modeling pipeline. The conversion from segmentation mask (i.e., segmentation results) to blood flow simulation is achieved through a standardized process: Geometric repair stage: Automatically detects geometric defects in the mask (such as surface holes, jagged edges), performs morphological closure operations to repair anomalies, and generates a watertight 3D model. Intelligent section cutting stage: Extracts the vessel centerline and automatically cuts the end face along the centerline normal plane at the inlet / outlet position of the tumor-bearing vessel, ensuring that the section is perpendicular to the blood flow direction. Boundary-driven mesh generation stage: Based on the fluid boundaries obtained by operating on the labeled fluid boundaries (inlet / outlet / vessel wall), i.e., the boundary markers (Assign boundary conditions) in the assessment system, generates a hybrid mesh adapted to hemodynamic calculations (such as a near-wall-refined tetrahedral mesh). CFD simulation verification stage: Sets the Newtonian fluid model and pulsating flow boundary conditions, iteratively solves until the velocity and pressure field residuals stabilize and converge. The previously generated mesh is the file required for this step of CFD calculation. The CFD calculation output is the velocity field, pressure field, and wall shear stress distribution of the vessel (steady-state calculation only).

[0136] CFD applicability score ( The calculation may include the following metrics.

[0137] Vascular topology availability (VTA): Detects whether there are topological errors (such as branch breaks) in the repaired model using a geometric analysis script.

[0138] Mesh generation availability (MGA): Verifies the quality of mesh cells, ensuring that no geometric errors occur during the conversion process that would interrupt subsequent operations.

[0139] Blood flow convergence availability (BFA): Determines whether a CFD simulation reaches the convergence threshold within a reasonable number of iterations.

[0140] The segmentation result is counted as a valid true positive only when all three validations pass, and the final score is calculated according to the formula. The output directly reflects the actual CFD availability of the segmentation results.

[0141] .

[0142] .

[0143] .

[0144] Where N represents the total number of samples, one sample is a raw image, i.e., intracranial 3D magnetic resonance angiography data, i represents a single sample, and y represents the true value. This indicates the number of true positive samples that can be used for CFD analysis, i.e., the number of valid true positive samples. TP, FP, and FN represent the number of true positive (correct detection of aneurysm), false positive (false detection of aneurysm in healthy cases), and false negative (failure to detect aneurysm) samples, respectively. Indicates that, This indicates, or, a CFD availability metric, specifically, , and These represent the segmentation masks. The availability of vascular topology, mesh generation, and blood flow indicates whether there are geometric topological anomalies in the blood vessels (anomalies indicate unavailability), whether geometric errors occurred during the conversion process causing subsequent operations to be interrupted (interruption indicates unavailability), and whether the generated mesh file can be successfully used for CFD analysis (unsuccessful use for CFD analysis indicates unavailability, otherwise it is available). Available is 1, unavailable is 0. The calculation of the above three indicators can be automated by scripts. This embodiment uses a sliding window to aggregate the segmentation results of image patches to obtain the complete segmentation result corresponding to a sample, thereby determining whether the sample is a true positive, false positive, or false negative. The evaluation system can be used to evaluate the applicability of the segmentation algorithm's results to CFD tasks, while CFD itself can obtain the pressure and velocity of blood in the blood vessels, thereby determining the risk of rupture of cerebral aneurysms and thus guiding clinical surgery.

[0145] See Figure 6 As shown, Figure 6 This application provides a flowchart for converting segmentation masks to CFD models. The automated and standardized conversion process from segmentation masks to CFD models realizes a complete chain process from medical images to flow field simulation. The process includes the following steps: vascular topology examination, morphological preprocessing, geometric model conversion, centerline generation, end-face cutting, mesh enhancement, surface fitting, boundary marking, mesh generation, and CFD calculation. In other words, it establishes a standardized workflow for converting medical images into computational fluid dynamics models, including the following steps.

[0146] Vascular topology examination: First, the vascular topology of the segmented intracranial aneurysms and their related vessels is screened to detect geometric defects such as abnormal adhesions, holes, depressions, and protrusions. Although these voxel-level segmentation errors do not affect traditional segmentation metrics (such as the Dice coefficient), they significantly affect the integrity of the vascular geometry and subsequently lead to flow field distortion in CFD analysis.

[0147] Segmentation result preprocessing: Morphological optimization operations were performed using 3D Slicer software, including removing stretched regions, filling small holes, and smoothing details. To eliminate discrete segmentation artifacts and ensure repeatability, a median filter with a kernel size of 1 mm was uniformly used for surface smoothing. After smoothing, the maximum connected components were extracted to eliminate isolated noisy structures. It should be noted that approximately 1% of samples may exhibit abnormal adhesion due to over-smoothing, which requires manual correction using the segmentation tools in 3D Slicer.

[0148] Transformation into a geometric model: The voxel-represented NIFTI image data is converted into a three-dimensional geometric STL model, providing a geometric basis for subsequent CFD analysis.

[0149] Generation of vessel inlet / outlet endpoints and centerlines: Based on the generated STL model, the VMTK toolkit is used to automatically identify the topological endpoints of the vessel inlets / outlets and generate the vessel centerlines accordingly. When deviations occur in the automatic detection, interactive corrections are performed using a 3D Slicer.

[0150] Inlet / outlet cross-section cutting: The ptvista library is used to cut the vessel cross-section based on the normal vector of the centerline. The cutting plane is uniformly set at the 1 / 5 distal end (when the radius of the candidate cutting point is less than 0.3 mm, it automatically retracts to the proximal position that meets the radius requirement). This method preserves the complete vascular structure while avoiding morphological distortion caused by over-cutting. Experiments show that approximately 10% of the samples cannot be automatically cut due to insufficient centerline length, requiring manual intervention using Geomagic Wrap 2021.

[0151] Mesh Enhancement: Mesh optimization was performed using Geomagic Wrap: First, non-manifold edges, self-intersecting edges, and high-refractive-index edges were repaired using Mesh Doctor, followed by mesh re-division, refinement, optimization, and enhancement. All parameters were set to software default values ​​to ensure consistent processing.

[0152] Surface geometry file fitting: The STL mesh file is reconstructed into a CAD model with accurate geometric definitions and topological relationships, i.e., a STEP format file. Based on the STL mesh file, surface patches are constructed, meshes are built, and the surface is fitted to generate a STEP file. The number of surface patches is set to 1000. At this point, less than 1% of the data may detect intersecting meshes during mesh construction, which can be manually corrected by moving the vertices of the surface patches to eliminate concave polygons. For surface patches that are too large, subdivision of the patches can be used to address this issue.

[0153] Boundary condition annotation: The STEP model is imported into ANSYS SpaceClaim for boundary condition definition, including precise annotation of the inlet, outlet, wall, and fluid regions. End faces are automatically identified using previously generated endpoint and centerline information, and the final model is saved in SCDOC format.

[0154] Mesh generation: Fluent Meshing is used to generate unstructured polyhedral meshes, and CFL number control and residual monitoring mechanisms are used to ensure mesh quality and computational stability.

[0155] CFD calculations: Blood flow field simulation was performed using an incompressible Newtonian fluid model. The Navier-Stokes equations were solved using the icoFoam solver in Open Field Operation and Manipulation (OpenFOAM) combined with the PISO algorithm to calculate the velocity field, pressure field, and wall shear stress distribution at mass flow rates ranging from 0.0010 to 0.0040 kg / s (steady-state calculations only).

[0156] Prior to this, there was no fully automated workflow for converting binary segmentation masks into computational fluid dynamics models. The alternating use of multiple industrial software programs and the tedious and repetitive nature of the process significantly increased the manpower and time costs of the annotation process. Furthermore, the subjective variability introduced by manually cutting the cross-sections of blood vessel inlets and outlets directly affected... The objectivity of the calculation.

[0157] Furthermore, during system deployment, hardware adaptation is performed: GPU-accelerated computing is supported, and the recommended GPU memory capacity is no less than the requirements for conventional deep learning training. Software integration: The segmentation module is implemented based on the PyTorch framework and is compatible with medical image processing libraries (such as MONAI); the CFD pipeline uses Python scripts to schedule open-source toolchains (such as Mesh mesh generation and OpenFOAM fluid simulation).

[0158] Implementation Results: This application improves segmentation reliability through a two-stage collaborative optimization and automated verification closed loop: dynamic candidate point selection significantly reduces the missed detection rate of small aneurysms, and topological constraint loss effectively suppresses vascular adhesion errors; it achieves a breakthrough in CFD conversion efficiency: full-process automation eliminates human operation bias, and modeling time is reduced to a fraction of that of traditional methods; and it enhances clinical decision support. The scoring objectively quantifies the simulation usability of the segmentation results, providing a quantifiable screening basis for surgical planning.

[0159] This application implements dynamic localization of aneurysm center points: based on the collaborative prediction of aneurysm location using heatmaps and density maps, a dynamic candidate point selection mechanism adaptively determines the number of true positives, avoiding missed detections of small targets and interference from false positives. Local vascular topology-aware segmentation is performed: on cropped vascular image blocks, a segmentation network combined with vascular centerline connectivity constraint loss (such as clDice loss) is used to forcibly maintain the anatomical topology of the aneurysm-bearing vessels. A fully automated CFD validation pipeline is implemented: end-to-end automated conversion from segmentation masks to CFD models is achieved, including vascular topology inspection, intelligent section cutting, boundary-driven mesh generation, and blood flow simulation convergence verification. CFD applicability is quantitatively scored, defining a CFD applicability score (…). The clinical usability of segmentation results is quantified by integrating three indicators: vascular topology availability (VTA), mesh generation availability (MGA), and blood flow convergence availability (BFA).

[0160] This system provides a dynamic candidate point selection mechanism, dynamically determining the number of candidate points based on the number of connected regions in the density map, thus addressing the high false-positive rate problem of traditional detection methods for small aneurysms. It also provides a topological constraint loss function, explicitly introducing vessel centerline connectivity constraints into the segmentation network to ensure the correct anatomical connection between the carrier vessel and the aneurysm, avoiding adhesion or breakage. Furthermore, it employs intelligent section cutting technology, vertically cutting the end face based on the vessel centerline and automatically defining CFD boundary conditions, eliminating subjective bias from manual operation. Finally, it performs CFD suitability scoring (…). This directly links segmentation assessment with the convergence of blood flow simulation, replacing traditional image metrics (such as the Dice coefficient) and providing clinically quantifiable validation of effectiveness.

[0161] The benefits include: improved CFD modeling success rate; reduced geometric errors in segmentation results due to topological constraint loss and intelligent section cutting; and an improved CFD applicability score exceeding 54%. Optimized accuracy in detecting small aneurysms: the dynamic candidate point mechanism improves detection accuracy to 87.85%, effectively reducing subsequent unnecessary computational burden. Standardized and efficient validation: the fully automated pipeline reduces modeling time from several hours to within 25 minutes, eliminating boundary condition differences caused by manual operation. Providing a basis for clinical decision-making. The indicators are directly related to the convergence of blood flow simulation, enabling clinical institutions to accurately screen effective segmentation results suitable for surgical planning.

[0162] Furthermore, a systematic evaluation experiment was conducted on the IAVS dataset to assess the proposed framework, including the first phase of intracranial aneurysm detection and evaluation, the second phase of intracranial aneurysm-vessel segmentation and evaluation, and an end-to-end segmentation comprehensive evaluation incorporating CFD applicability scoring. Existing intracranial aneurysm datasets suffer from structural deficiencies in annotation and lack applicability in computational fluid dynamics applications. To fill this gap, the IAVS dataset contains 641 3D MRA images and 587 annotations for aneurysms and aneurysm-vessels, along with CFD analysis results. This dataset is derived from three existing datasets (ADAM, INSTED, and Royal, as well as a new internally built dataset).

[0163] The data in the IAVS dataset are as follows Figure 4 As shown in the figure. For the public datasets, the original ADAM and INSTED datasets only provide aneurysm annotations. Although the Royal dataset contains aneurysm-vascular masks and STL models, some of the samples have vascular adhesion and are not suitable for CFD analysis. In contrast, the IAVS dataset contains segmentation masks and CFD analysis results suitable for CFD analysis, specifically including: 3D MRA images (1), voxel-level segmentation masks (2)-(3), geometric models (4)-(6), and CFD analysis results (7). The images were divided into: 467 cases for training and validation, 76 cases from the public dataset as Group A for internal evaluation, and 98 cases from a hospital dataset as Group B for clinical scenario evaluation.

[0164] In the first phase of training, 373 cases were used for training, and 94 cases were used for validation. In the second phase, candidate image patches cropped from cerebral aneurysm annotations were used for training the cerebral aneurysm-vessel segmentation network. Using the same segmentation method as the MRA images in the first phase, a total of 357 image patches were used for training, and 99 image patches were used for validation.

[0165] Intracranial aneurysm detection and evaluation: To address the challenge of locating small aneurysms, the proposed method was comprehensively compared and evaluated with existing methods. Specifically, three different task settings were used to locate aneurysms, including using the state-of-the-art detection model nnDetection, the segmentation model SwinUNETR, and nnUNet. The segmentation results were processed to generate the center point of the output target.

[0166] As shown in Table 1 below, the method proposed in this application demonstrates superior performance across multiple metrics. In groups A and B, it achieves precision (PR) of 0.8286 and 0.8785, accuracy (ACC) of 0.6170 and 0.7402, and F1 scores of 0.7632 and 0.8507, respectively. Although slightly lower than nnDetection in recall (RE), the innovative dynamic candidate point selection mechanism plays a crucial role. This mechanism effectively controls the false positive rate, avoiding excessive false detections, thereby reducing the computational burden and complexity of subsequent processing stages and providing a more efficient and reliable solution for locating small aneurysms. Overall, the proposed method significantly outperforms existing detection and segmentation methods, demonstrating its strong competitiveness and potential in practical applications of medical image analysis.

[0167] Table 1

[0168]

[0169] Intracranial Aneurysm - Vessel Segmentation Assessment: To evaluate the effectiveness of the proposed topology-aware segmentation framework, ablation experiments were conducted on the clDice loss in the segmentation task. In the second stage of training, to avoid error accumulation from the first stage, localization was performed using input patches based on ground truth clipping of intracranial aneurysms. As shown in Table 2, the results indicate that introducing the clDice loss significantly enhances the vessel topology preservation ability, improving clDice performance from 0.8555 to 0.8629 in group A and from 0.8538 to 0.8616 in group B.

[0170] Table 2

[0171]

[0172] CFD Applicability Assessment: To comprehensively evaluate the performance of this application's framework in CFD-based intracranial aneurysm-vessel segmentation using magnetic resonance angiography images, the localization results of the first stage were combined with the segmentation process of the second stage to achieve end-to-end segmentation. For comparison, direct end-to-end intracranial aneurysm-vessel segmentation using state-of-the-art nnUNet was used as the baseline performance, and patch pruning based on ground-value localization of intracranial aneurysms was used as the upper limit for comparison.

[0173] As shown in Table 3, the Dice coefficient of the end-to-end nnUNet segmentation is 0.1548 in group A and 0.4557 in group B. Since the number of false positives exceeds 120 while the number of true positives is less than 10, this end-to-end segmentation method is considered unsuitable for this segmentation task. As shown in Table 4, in the comparison of the two-stage framework, the method proposed in this application achieved high applicability scores of 57.45% and 54.76%, significantly outperforming other comparative methods. The mask prediction generated by the method proposed in this application is more accurately aligned with the ground truth mask, with fewer topological errors and fewer false positive predictions of background vessels.

[0174] Table 3

[0175]

[0176] Table 4

[0177]

[0178] See Figure 7 As shown, this application provides an image detection device, including:

[0179] Image segmentation module 11 is used to segment the intracranial three-dimensional magnetic resonance angiography data to be detected into image blocks to obtain the image blocks to be detected;

[0180] Image detection module 12 is used to input the image block to be detected into the target image detection model to obtain the heat map and density map corresponding to the image block to be detected; wherein, the target image detection model is trained by the aforementioned image detection model training method;

[0181] The heatmap aggregation module 13 is used to aggregate the heatmaps of each of the image blocks to be detected into a global heatmap of the intracranial three-dimensional magnetic resonance angiography data to be detected.

[0182] Density map aggregation module 14 is used to aggregate the density maps of each of the image blocks to be detected into a global density map of the intracranial three-dimensional magnetic resonance angiography data to be detected.

[0183] The quantity determination module 15 is used to perform connected component analysis based on the global density map to obtain the number of aneurysms contained in each connected component, and to calculate the total number of aneurysms based on the number of aneurysms in each connected component.

[0184] Image enhancement module 16 is used to enhance the global heatmap using the global density map to obtain a heatmap enhancement result;

[0185] The non-maximum suppression processing module 17 is used to perform local non-maximum suppression on the heat map enhancement result to obtain the local non-maximum suppression result.

[0186] The center point filtering module 18 is used to filter the data points with the highest thermal values ​​of the total number of aneurysms based on the local non-maximum suppression results to obtain the target location.

[0187] Furthermore, the device also includes:

[0188] The image cropping module is used to crop the intracranial three-dimensional magnetic resonance angiography data to be detected based on each target location to obtain a target image block corresponding to each target location;

[0189] The image segmentation module is used to input the target image block into the tumor-bearing vessel segmentation model to obtain the segmentation result; wherein, the tumor-bearing vessel segmentation model is a model obtained by training the image segmentation model using tumor-bearing vessel image training samples.

[0190] In an optional embodiment, the device may further include a training module for a tumor-bearing vessel segmentation model, configured to: acquire training samples of tumor-bearing vessel images, wherein the label information of the training samples includes aneurysm and vessel labels; input the training samples of tumor-bearing vessel images into an image segmentation model to obtain a prediction result; extract the pixels of the vessel center region from the prediction result; calculate a basic segmentation loss using the prediction result and the label information, and calculate the center region pixel loss corresponding to the pixels of the vessel center region using the pixels of the vessel center region, and calculate a training loss based on the basic segmentation loss and the center region pixel loss; update the image segmentation model using the training loss until the model converges to obtain the tumor-bearing vessel segmentation model.

[0191] The device further includes a computational fluid dynamics simulation module, used for: detecting and repairing geometric defects in the blood vessel topology of the segmentation results, and generating a watertight 3D model; identifying the topological endpoints of the blood vessel inlets and outlets in the watertight 3D model, and generating a blood vessel centerline based on the topological endpoints; extracting end faces along the normal plane of the blood vessel centerline based on the topological endpoints; generating a target mesh labeled with boundary conditions based on the end faces and the watertight 3D model; and performing computational fluid dynamics simulation based on the target mesh.

[0192] Figure 7 The description of the features in the corresponding embodiments can be found in [reference needed]. Figure 2 The relevant descriptions of the corresponding embodiments will not be repeated here.

[0193] See Figure 8As shown in the figure, this application discloses an electronic device 20, including a processor 21 and a memory 22; wherein, the memory 22 is used to store a computer program; the processor 21 is used to execute the computer program, the image detection model training method disclosed in the foregoing embodiments, and / or the image detection method.

[0194] Regarding the above-mentioned image detection model training method, and / or the specific process of the image detection method, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.

[0195] Furthermore, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, and the storage method can be temporary storage or permanent storage.

[0196] In addition, the electronic device 20 also includes a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26; wherein, the power supply 23 is used to provide operating voltage for the various hardware devices on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0197] Furthermore, embodiments of this application also disclose a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the image detection model training method disclosed in the foregoing embodiments, and / or the image detection method.

[0198] Regarding the above-mentioned image detection model training method, and / or the specific process of the image detection method, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.

[0199] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0200] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0201] The image detection model training method, image detection method, apparatus, and device provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for training an image detection model, characterized in that, include: Training samples are obtained from the training sample set. The training samples are image patches in the intracranial three-dimensional magnetic resonance angiography data. The label information of the training samples includes heat map labels and aneurysm number labels. The heat map labels represent the center point position of the aneurysm in the training sample. Each center point position corresponds to a three-dimensional Gaussian distribution with the heat value of that center point position as the peak value. The training samples are input into a preset detection network model to obtain a prediction heatmap and a prediction density map, wherein the prediction heatmap represents the center point location of the predicted aneurysm, and the prediction density map represents the number of predicted aneurysms. A first loss is calculated based on the predicted heatmap and the heatmap labels; a second loss is calculated based on the predicted density map and the aneurysm number labels; and a combined loss is calculated based on the first loss and the second loss. The parameters of the preset detection network model are updated using the comprehensive loss until the training termination condition is met. Then, the preset detection network model with the updated parameters is determined as the target image detection model.

2. The image detection model training method according to claim 1, characterized in that, The first loss is calculated based on the predicted heatmap and the heatmap labels, including: The first loss is calculated using the first loss calculation formula, based on the predicted heatmap and the heatmap labels, wherein the first loss calculation formula is: ; in, Indicates the first loss. Indicates the number of positive sample points. This indicates that the data point is a positive sample point in the training samples, and x, y, and z represent the three-dimensional coordinate axes of the coordinate system corresponding to the intracranial three-dimensional magnetic resonance angiography data. The thermal values ​​of the data points in the predicted heatmap. The heat values ​​of the data points in the heatmap labels. , It is a regulating factor.

3. The image detection model training method according to claim 1, characterized in that, The preset detection network model includes an encoder, a decoder, and a preset counting head module; Accordingly, the training samples are input into a preset detection network model to obtain a predicted heatmap and a predicted density map, including: The training samples are input into the encoding module of a preset detection network model to obtain image features; The decoder outputs the predicted heatmap based on the image features; The preset counting head module outputs the predicted density map based on the image features; The preset counting head module includes a preset convolutional layer and a preset global nonmaximum suppression operation layer, or an attention module and a preset global nonmaximum suppression operation layer.

4. An image detection method, characterized in that, include: The intracranial three-dimensional magnetic resonance angiography data to be detected is segmented into image blocks to obtain the image blocks to be detected. The image block to be detected is input into the target image detection model to obtain the heatmap and density map corresponding to the image block to be detected; wherein, the target image detection model is trained by the image detection model training method according to any one of claims 1 to 3; The heatmaps of each of the image blocks to be detected are aggregated into a global heatmap of the intracranial three-dimensional magnetic resonance angiography data to be detected. The density maps of each of the image blocks to be detected are aggregated into a global density map of the intracranial three-dimensional magnetic resonance angiography data to be detected; Based on the global density map, a connected component analysis is performed to obtain the number of aneurysms contained in each connected component, and the total number of aneurysms is calculated based on the number of aneurysms in each connected component. The global density map is used to enhance the global heatmap, resulting in an enhanced heatmap. The local nonmaximum suppression result is obtained by performing local nonmaximum suppression on the enhanced heat map result; Based on the results of the local nonmaximum suppression, the data points with the highest thermal values ​​of the total number of aneurysms are selected to obtain the target location.

5. The image detection method according to claim 4, characterized in that, Also includes: The intracranial three-dimensional magnetic resonance angiography data to be detected is cropped based on each target location to obtain a target image block corresponding to each target location; The target image block is input into the tumor-bearing vessel segmentation model to obtain the segmentation result; The tumor-bearing vessel segmentation model is a model obtained by training an image segmentation model using tumor-bearing vessel image training samples.

6. The image detection method according to claim 5, characterized in that, The training process of the tumor-bearing vessel segmentation model includes: Acquire training samples of aneurysm-bearing vascular images, wherein the label information of the training samples of aneurysm-bearing vascular images includes aneurysm and vascular labels; The training samples of the tumor-bearing blood vessel images are input into the image segmentation model to obtain the prediction results; Extract the pixels of the central region of the blood vessel from the prediction results; The basic segmentation loss is calculated using the prediction results and the label information, and the central region pixel loss corresponding to the central region pixel of the blood vessel is calculated using the central region pixel of the blood vessel. The training loss is then calculated based on the basic segmentation loss and the central region pixel loss. The image segmentation model is updated using the training loss until the model converges, resulting in a tumor-bearing vessel segmentation model.

7. The image detection method according to claim 5, characterized in that, Also includes: The segmentation results are subjected to geometric defect detection and repair of vascular topology, and a watertight three-dimensional model is generated. Identify the topological endpoints of the blood vessel inlets and outlets in the watertight 3D model, and generate the blood vessel centerline based on the topological endpoints; The end face is cut off along the normal plane of the blood vessel centerline based on the topological endpoint; A target mesh labeled with boundary conditions is generated based on the end face and the watertight 3D model. Computational fluid dynamics simulations are performed based on the target mesh.

8. An image detection device, characterized in that, include: The image segmentation module is used to segment the intracranial three-dimensional magnetic resonance angiography data to be detected into image blocks to obtain the image blocks to be detected. An image detection module is used to input the image block to be detected into a target image detection model to obtain a heatmap and a density map corresponding to the image block to be detected; wherein, the target image detection model is trained by the image detection model training method according to any one of claims 1 to 3; A heatmap aggregation module is used to aggregate the heatmaps of each of the image blocks to be detected into a global heatmap of the intracranial three-dimensional magnetic resonance angiography data to be detected. The density map aggregation module is used to aggregate the density maps of each of the image blocks to be detected into a global density map of the intracranial three-dimensional magnetic resonance angiography data to be detected. The quantity determination module is used to perform connected component analysis based on the global density map to obtain the number of aneurysms contained in each connected component, and to calculate the total number of aneurysms based on the number of aneurysms in each connected component. An image enhancement module is used to enhance the global heatmap using the global density map to obtain a heatmap enhancement result; The non-maximum suppression processing module is used to perform local non-maximum suppression on the heatmap enhancement result to obtain the local non-maximum suppression result. The center point filtering module is used to filter the data points with the highest thermal values ​​of the total number of aneurysms based on the local non-maximum suppression results, and obtain the target location.

9. An electronic device, characterized in that, Includes memory and processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program to implement the image detection model training method as described in any one of claims 1 to 3, and / or the image detection method as described in any one of claims 4 to 7.

10. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the image detection model training method as described in any one of claims 1 to 3, and / or the image detection method as described in any one of claims 4 to 7.

Citation Information

Cited By

  • Training prediction model method and device, prediction method and device, electronic device and medium

    CN122245580A