Myocardial infarction magnetic resonance intelligent detection method based on neural network
Through clustering and grayscale mean analysis, the artifact areas in the nuclear magnetic resonance image are identified and enhanced processing is performed, which solves the problem of difficult artifact removal in the prior art and improves the accuracy of myocardial infarction detection.
Patent Information
- Application Number
- CN202411885865.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-25
AI Technical Summary
The existing neural network-based intelligent detection method for myocardial infarction magnetic resonance detection is difficult to remove artifacts due to patient movement, which affects the accuracy of the detection.
The heart region is obtained by clustering the nuclear magnetic resonance images, and the initial artifact region is identified based on the grayscale mean and gradient values. The final artifact region is further determined through neighboring grayscale changes and shape characteristics, and these regions are enhanced to reduce artifact interference.
It effectively removes artifacts around the myocardium, improves the quality of the MRI image, makes the myocardial infarction area more obvious, and improves the accuracy of neural network detection.
Smart Images

Figure CN119887646A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a magnetic resonance intelligent detection method for myocardial infarction based on a neural network. Background Art
[0002] Myocardial infarction is a disease that often occurs in the elderly. If it is not discovered in time, it will threaten the patient's life safety. The neural network-based magnetic resonance intelligent detection method for myocardial infarction combines medical image analysis and deep learning technology to improve the accurate identification of myocardial infarction.
[0003] When the existing method is performing a test, due to the patient's slight movement during the test through the MRI instrument, artifacts are present around the MRI image of the heart, and the artifact area may be generated by the non-myocardial area, making it difficult to determine the final artifact area. The final artifact area is the artifact area generated around the myocardium, and the final artifact area in the MRI image cannot be better denoised and enhanced, making it impossible for the neural network-based myocardial infarction MRI intelligent detection to accurately identify the myocardial infarction area. Summary of the invention
[0004] To solve the above problems, the present invention provides a magnetic resonance intelligent detection method for myocardial infarction based on a neural network.
[0005] The magnetic resonance intelligent detection method of myocardial infarction based on neural network of the present invention adopts the following technical scheme:
[0006] An embodiment of the present invention provides a magnetic resonance intelligent detection method for myocardial infarction based on a neural network, the method comprising the following steps:
[0007] Obtaining an MRI image of the patient's heart;
[0008] Clustering the pixels in the nuclear magnetic resonance image to obtain three clusters; obtaining a heart region according to the grayscale values of the pixels in the clusters; obtaining all the block regions in the heart region, and obtaining a number of initial artifact regions according to two clusters whose grayscale means are closest to the grayscale means of the block regions and the gradient values of the pixels in the block regions;
[0009] According to the gray value change of the neighborhood of the initial artifact region, the possibility of each initial artifact region being formed by the non-myocardial region is obtained; through the region corresponding to the cluster in the nuclear magnetic resonance image, a number of myocardial connected domains are obtained, and according to the distance difference between the initial artifact region and the myocardial connected domain and the heart region, the shape characteristics of the initial artifact region, and the possibility of the initial artifact region being formed by the non-myocardial region, a number of final artifact regions of the nuclear magnetic resonance image are obtained;
[0010] Acquire enhancement parameters when enhancing the nuclear magnetic resonance image; enhance the final artifact area in the nuclear magnetic resonance image according to the enhancement parameters to obtain an enhanced nuclear magnetic resonance image; acquire several other enhanced nuclear magnetic resonance images and train the neural network model, input the enhanced nuclear magnetic resonance images into the trained neural network model, and output a myocardial infarction labeled image.
[0011] Furthermore, the specific method of obtaining the three clusters is as follows:
[0012] K-means clustering was performed on the MRI images, and the distance metric used was the absolute value of the difference in grayscale values between pixels in the MRI images, resulting in three clusters.
[0013] Furthermore, the specific method of obtaining the heart region is as follows:
[0014] The grayscale mean of all pixels in each of the three clusters is obtained. For the cluster with the grayscale mean in the middle, the connected domain with the largest area in the cluster is taken as the heart region.
[0015] Furthermore, for all the block regions in the heart region, a number of initial artifact regions are obtained according to two clusters whose grayscale means are closest to the grayscale means of the block regions and the gradient values of the pixels in the block regions, including the following specific steps:
[0016] Perform Canny edge detection on the heart region of the MRI image to obtain several connected domains surrounded by the edges in the heart region as the block regions in the heart region;
[0017] Obtain two clusters whose grayscale means are closest to the grayscale mean of all pixels in the block area, obtain the accumulated gradient values of all pixels in the block area, obtain the difference between the grayscale mean of all pixels in the block area and the grayscale mean of all pixels in the two clusters, record it as the first difference, record the ratio of the accumulated gradient value to the first difference as the possibility of the block area as the initial artifact area, and take the block area whose possibility of being the initial artifact area is greater than a preset threshold as the initial artifact area.
[0018] Furthermore, the possibility of each initial artifact region being formed by a non-myocardial region is obtained according to the change in the grayscale value of the neighborhood of the initial artifact region, and the specific steps include the following:
[0019] Obtain fluctuations in average grayscale values of several layers of pixel points outside a target initial artifact region, wherein the target initial artifact region is any initial artifact region, obtain the initial artifact region corresponding to the minimum fluctuation value of average grayscale values of several layers of pixel points outside all initial artifact regions, record the difference between the fluctuation in average grayscale values of several layers of pixel points outside the target initial artifact region and the minimum fluctuation value as a first difference; record the difference between the average grayscale values of several layers of pixel points outside the target initial artifact region and half of the average grayscale values of several layers of pixel points outside the initial artifact region corresponding to the minimum fluctuation value as a second difference; merge the first difference with the second difference to obtain the possibility that the target initial artifact region is formed by a non-myocardial region, the first difference is directly proportional to the possibility that the target initial artifact region is formed by a non-myocardial region, and the second difference is inversely proportional to the possibility that the target initial artifact region is formed by a non-myocardial region.
[0020] Furthermore, the specific method of obtaining a plurality of myocardial connectivity domains is as follows:
[0021] The grayscale mean of all pixels in each of the three clusters is obtained, and the connected domains corresponding to the two clusters with the largest grayscale mean in the magnetic resonance image are obtained, and both are recorded as the myocardial connected domains.
[0022] Furthermore, the several final artifact regions of the nuclear magnetic resonance image include the following specific steps:
[0023] Any connected myocardial domain is recorded as the target myocardial connected domain; the difference between the distance between the central pixel point of the initial artifact area and the central pixel point of the heart area and the distance between the target myocardial connected domain and the central pixel point of the heart area is recorded as the third difference; the aspect ratio of the minimum circumscribed rectangle of the initial artifact area is obtained to obtain the possibility that the initial artifact area is formed by the non-myocardial area; the third difference, the aspect ratio, and the possibility that the initial artifact area is formed by the non-myocardial area are merged to obtain the possibility that the initial artifact area is formed by the myocardial area, the third difference and the possibility that the initial artifact area is formed by the non-myocardial area are inversely proportional to the possibility that the initial artifact area is formed by the myocardial area, and the final artifact area of the magnetic resonance image is obtained according to the size of the possibility that the initial artifact area is formed by the myocardial area.
[0024] Furthermore, the specific method for obtaining the final artifact area is as follows:
[0025] The initial artifact region whose possibility of being formed by the myocardial region is greater than a preset threshold is taken as the final artifact region of the nuclear magnetic resonance image.
[0026] Furthermore, the specific method for obtaining the enhancement parameters when enhancing the nuclear magnetic resonance image is as follows:
[0027] Any final artifact region is recorded as the target final artifact region;
[0028]
[0029] Where D' is the possibility that the target final artifact area is formed by the myocardial area, arctan () is the inverse tangent function, and the specific method for obtaining p1 is as follows: the grayscale mean of all pixels in each cluster among the three clusters is obtained, and the grayscale mean in the middle is recorded as p1; the specific method for obtaining p2 is as follows: the grayscale mean of all pixels in each cluster among the three clusters is obtained, and the maximum value of the grayscale mean is recorded as p2; θ is the enhancement parameter for Fourier transform image enhancement of nuclear magnetic resonance images.
[0030] Furthermore, the specific method for obtaining the myocardial infarction annotated image is as follows:
[0031] Acquire a number of other enhanced nuclear magnetic resonance images, and use all other enhanced nuclear magnetic resonance images as data sets for a neural network model; the neural network model is specifically a U-Net network;
[0032] The myocardial infarction area in each enhanced MRI image in the data set is manually labeled. The labeling method is: the gray value of the pixel in the myocardial infarction area is labeled as 1, and the gray value of the pixel not in the myocardial infarction area is labeled as 1, and several labeled MRI images are obtained. All enhanced MRI images in the data set and the corresponding labeled MRI images are used as training sets.
[0033] The neural network model is trained using the training set, and the loss function is the Dice loss function, to obtain the trained neural network model;
[0034] The enhanced MRI image is input into the trained neural network model, and the myocardial infarction labeled image is output.
[0035] The technical solution of the present invention has the following beneficial effects: after obtaining the nuclear magnetic resonance image of the patient's heart, the present invention obtains the heart region through a clustering operation, obtains several initial artifact regions through two clusters whose grayscale means are closest to the grayscale means of the block region and the gradient values of the pixel points in the block region, the initial artifact region is the artifact region obtained preliminarily, which may be formed by the non-myocardial region, in order to obtain the artifact region generated around the myocardium, and then obtain an image with the artifact generated around the myocardium removed, that is, an enhanced nuclear magnetic resonance image, and obtains several final artifact regions of the nuclear magnetic resonance image through the distance difference between the initial artifact region and the myocardial connected domain from the heart region, the shape characteristics of the initial artifact region, and the possibility that the initial artifact region is formed by the non-myocardial region. The final artifact region is the artifact generated by the myocardial region, which reduces the interference of the artifact generated by the non-myocardial region, so that after the enhancement processing, a better quality nuclear magnetic resonance image is obtained, and the myocardial infarction region is more obvious, and finally the enhanced nuclear magnetic resonance image to be analyzed is input into the trained neural network model, and the myocardial infarction labeled image is output, thereby improving the accuracy of myocardial infarction detection and recognition based on the neural network. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A flowchart of the steps of a magnetic resonance intelligent detection method for myocardial infarction based on a neural network provided by one embodiment of the present invention;
[0038] Figure 2 A flowchart of obtaining a myocardial infarction labeled image provided by an embodiment of the present invention;
[0039] Figure 3 A schematic diagram of an initial nuclear magnetic resonance image of a heart region provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation, structure, features and effects of the magnetic resonance intelligent detection method for myocardial infarction based on a neural network proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0041] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0042] The specific scheme of the magnetic resonance intelligent detection method for myocardial infarction based on neural network provided by the present invention is described in detail below with reference to the accompanying drawings.
[0043] See also Figure 1 and Figure 2 , which shows a flowchart of the steps of a magnetic resonance intelligent detection method for myocardial infarction based on a neural network and a flowchart of obtaining a myocardial infarction labeled image provided by an embodiment of the present invention, the method comprising the following steps:
[0044] Step S001: Acquire a nuclear magnetic resonance image of the patient's heart.
[0045] It should be noted that the main purpose of this embodiment is to obtain the final artifact area in the magnetic resonance image of the patient's heart, the final artifact area is the artifact area generated around the myocardium, and enhance and denoise the final artifact area in the magnetic resonance image to reduce the artifact interference generated around the myocardium, and obtain a myocardial infarction labeled image through a neural network; before starting the analysis, first obtain the required magnetic resonance image.
[0046] Specifically, obtaining a nuclear magnetic resonance image of the patient's heart includes the following steps:
[0047] First, an initial MRI image of the patient's heart is acquired using an MRI machine.
[0048] Secondly, the initial nuclear magnetic resonance image is subjected to delayed enhancement processing to obtain a nuclear magnetic resonance image.
[0049] Specifically, an initial nuclear magnetic resonance image of the patient's heart is obtained by using a nuclear magnetic resonance apparatus.
[0050] Please note that Figure 3 , Figure 3 Schematic diagram of the initial nuclear magnetic resonance image of the heart in this embodiment, the initial nuclear magnetic resonance image of the heart includes the heart area, the normal myocardial area, the myocardial infarction area, the artifact area, and the background area. It can be seen from the analysis of the image that the spherical area is the heart area, the surrounding edge area is the myocardial area, the area with high grayscale value on the edge is the myocardial infarction area, the area with low grayscale value is the normal myocardial area, the grayscale value distribution of the artifact area is between the grayscale value of the myocardial infarction area and the normal myocardial area, and the artifact area is caused by the movement of the patient.
[0051] It should be noted that since the initial MRI images are relatively blurry, they need to be enhanced to improve their clarity and quality.
[0052] Furthermore, the initial nuclear magnetic resonance image is subjected to delayed enhancement processing to obtain a nuclear magnetic resonance image.
[0053] It should be noted that the delayed enhancement processing of the initial MRI image is aimed at enhancing the details of the initial MRI image and improving the clarity and quality of the image. The delayed enhancement processing of the initial MRI image to obtain the processed image is an existing method and will not be repeated in this embodiment.
[0054] At this point, a magnetic resonance image is obtained.
[0055] Step S002, clustering the pixels in the nuclear magnetic resonance image to obtain three clusters; obtaining the heart area through the grayscale values of the pixels in the clusters; obtaining all the block areas within the heart area, and obtaining several initial artifact areas based on the two clusters whose grayscale means are closest to the grayscale means of the block areas and the gradient values of the pixels in the block areas.
[0056] It should be noted that, since the grayscale values of different regions in the MRI image are relatively similar, the image is clustered and initially divided into regions to facilitate better subsequent analysis.
[0057] Specifically, the pixels in the MRI image are clustered to obtain three clusters, as follows:
[0058] K-means clustering is performed on the magnetic resonance image, and the distance measurement uses the absolute value of the difference in grayscale values between pixels in the magnetic resonance image to obtain three clusters. It should be noted that since the grayscale values of the heart area, artifact area and other areas are similar, the K value of K-means clustering in this embodiment is preset to 3, that is, three clusters are obtained.
[0059] It should be noted that this embodiment mainly analyzes the artifacts produced by the myocardium around the heart area. The myocardium wraps the heart, so it is necessary to first determine the approximate heart area. Since the grayscale value of the heart area is moderate and the area is large, the heart area is determined by the grayscale value size of the above cluster.
[0060] Specifically, the heart area is obtained through the grayscale value of the pixel points in the cluster, as follows:
[0061] The grayscale mean of all pixels in each of the three clusters is obtained. For the cluster with the grayscale mean in the middle, the connected domain with the largest area in the cluster is taken as the heart region.
[0062] It should be noted that the delayed enhancement processing of the initial MRI image obtains an MRI image containing multiple small regional blocks, and the above-mentioned acquired heart area also contains several small regional blocks, namely, subsequent block areas. Since the grayscale value distribution of the artifact area is between the grayscale values of the myocardial infarction area and the normal myocardial area, and the higher grayscale value of the myocardial infarction area corresponds to the cluster with a large grayscale mean, and the lower grayscale value of the normal myocardial area corresponds to the cluster with a grayscale mean in the middle, therefore, if the grayscale mean of the block area is close to the average grayscale value of the cluster with a large grayscale mean and the cluster with a grayscale mean in the middle, and the larger the gradient of the block area, the greater the possibility that the block area is the initial artifact area.
[0063] Preferably, all the block regions in the heart region are obtained, and several initial artifact regions are obtained according to the two clusters whose grayscale means are closest to the grayscale means of the block regions and the gradient values of the pixels in the block regions, as follows:
[0064] Canny edge detection is performed on the heart region of the nuclear magnetic resonance image to obtain several connected domains surrounded by the edges in the heart region as the block regions in the heart region.
[0065] Obtain two clusters whose grayscale means are closest to the grayscale mean of all pixels in the block area, obtain the accumulated gradient values of all pixels in the block area, obtain the difference between the grayscale mean of all pixels in the block area and the grayscale mean of all pixels in the two clusters, record it as the first difference, record the ratio of the accumulated gradient value to the first difference as the possibility of the block area as the initial artifact area, and take the block area whose possibility of being the initial artifact area is greater than a preset threshold as the initial artifact area.
[0066] As a specific example, the specific method for obtaining the possibility of the block area being the initial artifact area is as follows:
[0067] Any segmented area within the heart region is recorded as the target segmented area.
[0068]
[0069] Wherein, s is the cumulative value of the gradient values of all pixels in the target block area. It should be noted that, in this embodiment, the gradient values of the pixels in the image are obtained by the Sobel operator, and then the cumulative value of the gradient values is obtained. This is a specific existing method and will not be repeated in this embodiment. p is the grayscale mean of all pixels in the target block area. The specific method for obtaining p1 is as follows: the grayscale mean of all pixels in each of the three clusters is obtained, and the grayscale mean in the middle is recorded as p1; the specific method for obtaining p2 is as follows: the grayscale mean of all pixels in each of the three clusters is obtained, and the maximum value of the grayscale mean is recorded as p2; || is the absolute value, and R is the possibility of the target block area as the initial artifact area.
[0070] It should be noted that the larger the s is, the larger the gradient of the pixels in the target block area is, and the greater the possibility that the target block area is the initial artifact area; The smaller it is, the closer the grayscale mean of the target block area is to the average grayscale value of the cluster with a large grayscale mean and the cluster with a middle grayscale mean, and the more likely the target block area is to be the initial artifact area. In order to simplify the description of this embodiment, the above formula model does not handle the case where the denominator is 0. When the denominator is 0, adding 1 to both the numerator and the denominator can avoid the situation where the denominator is 0 and the implementation is impossible.
[0071] A first threshold is preset. This embodiment is described with the first threshold being 0.7. If the possibility of the target block area being the initial artifact area is greater than 0.7 after normalization, the target block area is regarded as an initial artifact area. Otherwise, it is not regarded as an initial artifact area. It should be noted that this embodiment normalizes the possibility of the block area being the initial artifact area through a linear normalization function, which is a specific existing method and will not be described in detail in this embodiment.
[0072] So far, several initial artifact regions are obtained.
[0073] Step S003, according to the change of gray value of the neighborhood of the initial artifact area, the possibility of each initial artifact area being formed by the non-myocardial area is obtained; through the area corresponding to the cluster in the nuclear magnetic resonance image, a number of myocardial connected domains are obtained, and according to the difference in distance between the initial artifact area and the myocardial connected domain and the heart area, the shape characteristics of the initial artifact area, and the possibility that the initial artifact area is formed by the non-myocardial area, a number of final artifact areas of the nuclear magnetic resonance image are obtained.
[0074] It should be noted that since clustering cannot completely distinguish different regions, there are some other regions in the block region, and the above-obtained regions are initial artifact regions. The initial artifact region may be an artifact formed by a non-myocardial region or a myocardial region. The myocardial region includes a myocardial infarction region and a normal myocardial region. If the initial artifact region is an artifact formed by a non-myocardial region, these initial artifact regions will have an impact on subsequent further image enhancement. This embodiment is mainly for magnetic resonance detection of myocardial infarction. The artifacts formed by the non-myocardial region have little impact on the detection. Therefore, it is necessary to reduce the impact of the artifacts formed by the non-myocardial region. Through analysis, it can be obtained that some basic features of these regions are similar to the initial artifact region, but the neighborhood average grayscale values of these regions are greatly different. If the initial artifact region is an artifact formed by a non-myocardial region, the neighborhood of the initial artifact region often presents the characteristics of high grayscale value on one side and low grayscale value on the other side. The neighborhood average grayscale value fluctuates greatly, and the initial artifact region with the smallest neighborhood average grayscale value fluctuation is surrounded by pixels with higher grayscale values. If the average grayscale value around the neighborhood of the initial artifact region is close to half of the average grayscale value around the initial artifact region with the smallest fluctuation, the initial artifact region is more likely to be formed by a non-myocardial region.
[0075] Preferably, the possibility that each initial artifact region is formed by a non-myocardial region is obtained according to the change in the grayscale value of the neighborhood of the initial artifact region, as follows:
[0076] Obtain fluctuations in average grayscale values of several layers of pixel points outside a target initial artifact region, wherein the target initial artifact region is any initial artifact region, obtain the initial artifact region corresponding to the minimum fluctuation value of average grayscale values of several layers of pixel points outside all initial artifact regions, record the difference between the fluctuation in average grayscale values of several layers of pixel points outside the target initial artifact region and the minimum fluctuation value as a first difference; record the difference between the average grayscale values of several layers of pixel points outside the target initial artifact region and half of the average grayscale values of several layers of pixel points outside the initial artifact region corresponding to the minimum fluctuation value as a second difference; merge the first difference with the second difference to obtain the possibility that the target initial artifact region is formed by a non-myocardial region, the first difference is directly proportional to the possibility that the target initial artifact region is formed by a non-myocardial region, and the second difference is inversely proportional to the possibility that the target initial artifact region is formed by a non-myocardial region.
[0077] As a specific example, a specific method for obtaining the possibility that the initial artifact region is formed by a non-myocardial region is as follows:
[0078] Any initial artifact region is recorded as the target initial artifact region.
[0079]
[0080] In the formula, v and v min The specific method for obtaining is as follows: obtain the TH1 layer of pixel points outside the target initial artifact area, TH1 is a preset first value, and this embodiment is described with the first value of 3, obtain the grayscale mean of each layer of pixel points outside the target initial artifact area, and record the variance of the grayscale mean of the TH1 layer of pixel points outside the target initial artifact area as v; record the minimum value of the variance of the grayscale mean of all TH1 layer pixel points outside the initial artifact area as v min ; p3 is the grayscale mean of all pixels in the TH1 layer outside the target initial artifact area, and p4 is v min The grayscale mean of all pixels in the TH1 layer outside the corresponding initial artifact area, || is the absolute value, and K is the possibility that the target initial artifact area is formed by the non-myocardial area.
[0081] It should be noted that vv min The larger it is, the greater the dispersion of the grayscale mean values of pixels in different layers around the target initial artifact area, and the greater the possibility that the target initial artifact area is formed by the non-myocardial area. The smaller the value is, the closer the average gray value around the neighborhood of the target initial artifact region is to half of the average gray value around the initial artifact region with the smallest fluctuation, and the more likely the target initial artifact region is formed by a non-myocardial region. In order to simplify the description in this embodiment, the above formula model does not handle the case where the denominator is 0. When the denominator is 0, adding 1 to both the numerator and the denominator can avoid the situation where the denominator is 0 and the implementation is impossible.
[0082] It should be noted that the above analysis has analyzed the possibility that the initial artifact area is formed by the non-myocardial area. Next, the initial artifact area is analyzed as an artifact formed by the myocardial area. The heart area as a whole appears similar to a circle, and the central area of the heart area also has a grayscale value distribution between the grayscale values of the myocardial infarction area and the normal myocardial area, which is relatively close to the artifact area. Therefore, it is necessary to distinguish the central area of the heart from the artifact area. By analyzing the distance between the artifacts generated by the myocardial area and the myocardial area, if the distance between the initial artifact area and the center of the heart area is close to the distance between the myocardial area and the center of the heart area, then the initial artifact area is formed by the myocardial area. At the same time, if the initial artifact area is an artifact formed by the myocardial area, it will generally appear as an arc-shaped strip. Therefore, the aspect ratio of the lowest circumscribed rectangle of the initial artifact area can be analyzed to quantify the characteristics of the arc-shaped strip. The larger the aspect ratio, the greater the possibility that the initial artifact area is formed by the myocardial area. The above analysis shows the possibility that the initial artifact area is formed by the non-myocardial area. Combined with this feature, if the possibility that the initial artifact area is formed by the non-myocardial area is smaller, the aspect ratio is larger, and the distance between the initial artifact area and the center of the cardiac area is close to the distance between the myocardial area and the center of the cardiac area, then the possibility that the initial artifact area is formed by the myocardial area is greater.
[0083] Preferably, several myocardial connectivity domains are obtained through the regions corresponding to the clusters in the nuclear magnetic resonance image, and several final artifact regions of the nuclear magnetic resonance image are obtained according to the distance difference between the initial artifact region and the myocardial connectivity domain and the heart region, the shape characteristics of the initial artifact region, and the possibility that the initial artifact region is formed by the non-myocardial region, as follows:
[0084] The grayscale mean of all pixels in each cluster of the three clusters is obtained, and the connected domains corresponding to the two clusters with the largest grayscale mean in the magnetic resonance image are obtained, and are all recorded as myocardial connected domains. Any myocardial connected domain is recorded as the target myocardial connected domain; the difference between the distance between the central pixel of the initial artifact area and the central pixel of the heart area and the distance between the target myocardial connected domain and the central pixel of the heart area is recorded as the third difference; the aspect ratio of the minimum circumscribed rectangle of the initial artifact area is obtained, and the possibility that the initial artifact area is formed by the non-myocardial area is obtained; the third difference, the aspect ratio, and the possibility that the initial artifact area is formed by the non-myocardial area are merged to obtain the possibility that the initial artifact area is formed by the myocardial area, and the third difference and the possibility that the initial artifact area is formed by the non-myocardial area are inversely proportional to the possibility that the initial artifact area is formed by the myocardial area. The initial artifact area whose possibility of the initial artifact area being formed by the myocardial area is greater than a preset threshold is used as the final artifact area of the magnetic resonance image.
[0085] As a specific example, a specific method for obtaining the possibility that the initial artifact region is formed by the myocardial region is as follows:
[0086] The grayscale mean of all pixels in each cluster is obtained in the three clusters, and the connected domains corresponding to the two clusters with the largest grayscale mean in the nuclear magnetic resonance image are obtained, and are all recorded as myocardial connected domains. It should be noted that since the area with high grayscale value is the myocardial infarction area, the area with low grayscale value is the normal myocardial area, and the background area is black with the smallest grayscale value, the connected domains corresponding to the two clusters with the largest grayscale mean in the nuclear magnetic resonance image are selected and recorded as the myocardial connected domain, that is, the myocardial area.
[0087] Any myocardial connected domain is recorded as the target myocardial connected domain.
[0088]
[0089] Wherein, h1 is the Euclidean distance between the central pixel of the target initial artifact area and the central pixel of the heart area. It should be noted that obtaining the central pixel of a region is an existing method and will not be repeated in this embodiment; h2 is the Euclidean distance between the central pixel of the target myocardial connected domain and the central pixel of the heart area, || is the absolute value, L is the length of the minimum bounding rectangle of the target initial artifact area, W is the width of the minimum bounding rectangle of the target initial artifact area, it should be noted that in this embodiment, the length of the minimum bounding rectangle of the target initial artifact area is larger than the width; K is the possibility that the target initial artifact area is formed by the non-myocardial area, Sigmoid() is a Sigmoid function used for normalization, and D is the possibility that the target initial artifact area is formed by the myocardial area.
[0090] It should be noted that the smaller |h1-h2| is, the closer the distance between the target initial artifact region and the center of the heart region is to the distance between the myocardial region and the center of the heart region, and the greater the possibility that the target initial artifact region is formed by the myocardial region; The larger the value is, the more obvious the arc-shaped strip-like feature of the target initial artifact area is, and the greater the possibility that the target initial artifact area is formed by the myocardial area. The larger it is, the less likely the target initial artifact area is formed by the non-myocardial area. It can also reflect from a certain angle that the target initial artifact area is formed by the myocardial area. In order to simplify the description in this embodiment, the above formula model does not handle the case where the denominator is 0. If the denominator is 0, adding 1 to both the numerator and the denominator during the specific implementation can avoid the situation where the denominator is 0 and cannot be implemented.
[0091] It should be noted that the above-obtained possibility that each initial artifact region is formed by the myocardial region can be compared with a preset threshold value to obtain several final artifact regions of the nuclear magnetic resonance image.
[0092] A second threshold is preset, and this embodiment is described with the second threshold being 0.8. If the possibility that the initial artifact region is formed by the myocardial region is greater than the second threshold, the initial artifact region is used as a final artifact region of the nuclear magnetic resonance image, otherwise, it is not used as a final artifact region of the nuclear magnetic resonance image. It should be noted that the final artifact region can be considered as an artifact formed by the myocardial region.
[0093] At this point, several final artifact regions of the magnetic resonance image are obtained.
[0094] Step S004, obtaining enhancement parameters for enhancing the nuclear magnetic resonance image; enhancing the final artifact area in the nuclear magnetic resonance image according to the enhancement parameters to obtain an enhanced nuclear magnetic resonance image; obtaining several other enhanced nuclear magnetic resonance images and training the neural network model, inputting the enhanced nuclear magnetic resonance images into the trained neural network model, and outputting a myocardial infarction labeled image.
[0095] It should be noted that, in the above, several final artifact regions of the nuclear magnetic resonance image are obtained. By denoising the final artifact region in the nuclear magnetic resonance image, the final artifact region in the image is eliminated to obtain a clearer nuclear magnetic resonance image. The image enhancement method in this embodiment uses Fourier transform image enhancement. For better denoising, it is first necessary to determine the enhancement parameters of Fourier transform image enhancement. The greater the possibility that the final artifact region is formed by the myocardial region, it means that the gray value distribution of the final artifact region is between the gray values of the myocardial infarction region and the normal myocardial region, that is, the average gray value of the final artifact region is closer to the average gray value of the myocardial infarction region and the normal myocardial region. Therefore, the average gray value of the myocardial infarction region and the normal myocardial region is used as the benchmark enhancement parameter, and the benchmark enhancement parameter is adjusted according to the possibility that the final artifact region is formed by the myocardial region. If the possibility that the final artifact region is formed by the myocardial region is the maximum value, the benchmark enhancement parameter is directly used as the enhancement parameter, otherwise the benchmark enhancement parameter is reduced, so that the determined enhancement parameter can better denoise the final artifact region in the nuclear magnetic resonance image.
[0096] Specifically, the enhancement parameters for enhancing the nuclear magnetic resonance image are obtained as follows:
[0097] Any final artifact region is recorded as the target final artifact region.
[0098]
[0099] Where D' is the possibility that the target final artifact area is formed by the myocardial area, arctan () is the inverse tangent function, and the specific method for obtaining p1 is as follows: the grayscale mean of all pixels in each cluster among the three clusters is obtained, and the grayscale mean in the middle is recorded as p1; the specific method for obtaining p2 is as follows: the grayscale mean of all pixels in each cluster among the three clusters is obtained, and the maximum value of the grayscale mean is recorded as p2; θ is the enhancement parameter for Fourier transform image enhancement of nuclear magnetic resonance images.
[0100] It should be noted that the larger D' is, the closer the enhancement parameter θ should be to the baseline enhancement parameter So subtract Ensure that the baseline enhancement parameters are used as enhancement parameters, otherwise, reduce the baseline enhancement parameters So that the determined enhancement parameters can better denoise the final artifact area in the magnetic resonance image.
[0101] Furthermore, the final artifact region in the nuclear magnetic resonance image is enhanced according to the enhancement parameters to obtain an enhanced nuclear magnetic resonance image, as follows:
[0102] Performing Fourier transform image enhancement on the final artifact region in the nuclear magnetic resonance image according to the enhancement parameters to obtain an enhanced nuclear magnetic resonance image. It should be noted that performing Fourier transform image enhancement on the final artifact region in the nuclear magnetic resonance image according to the enhancement parameters to obtain an enhanced nuclear magnetic resonance image is an existing method and will not be described in detail in this embodiment.
[0103] It should be noted that the enhanced MRI images obtained above have better quality. The neural network model is trained by acquiring several enhanced MRI images, and then the myocardial infarction labeled images are acquired based on the trained neural network model, thereby completing the magnetic resonance imaging detection method for myocardial infarction based on the neural network.
[0104] Specifically, several other enhanced MRI images are obtained and the neural network model is trained. The enhanced MRI images are input into the trained neural network model, and the myocardial infarction labeled images are output, as follows:
[0105] Acquire several other enhanced MRI images, and use all other enhanced MRI images as data sets for the neural network model; in this embodiment, the neural network model is specifically a U-Net network, and other models may be used in other embodiments, which are not limited in this embodiment.
[0106] The myocardial infarction area in each enhanced MRI image in the dataset was manually labeled. The labeling method was as follows: the grayscale value of the pixel in the myocardial infarction area was labeled as 1, and the grayscale value of the pixel not in the myocardial infarction area was labeled as 1, and several labeled MRI images were obtained. All the enhanced MRI images in the dataset and the corresponding labeled MRI images were used as the training set.
[0107] The neural network model is trained using the training set, and the loss function is the Dice loss function, to obtain a trained neural network model. It should be noted that the specific training process is well known and will not be described in detail in this embodiment.
[0108] The enhanced MRI image to be analyzed is input into the trained neural network model, and the myocardial infarction labeled image is output.
[0109] At this point, through the above steps, the magnetic resonance intelligent detection method for myocardial infarction based on neural network is completed.
[0110] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A magnetic resonance intelligent detection method for myocardial infarction based on a neural network, characterized in that: The method comprises the following steps: Obtaining an MRI image of the patient's heart; Clustering the pixels in the nuclear magnetic resonance image to obtain three clusters; obtaining a heart region according to the grayscale values of the pixels in the clusters; obtaining all the block regions in the heart region, and obtaining a number of initial artifact regions according to two clusters whose grayscale means are closest to the grayscale means of the block regions and the gradient values of the pixels in the block regions; According to the gray value change of the neighborhood of the initial artifact region, the possibility of each initial artifact region being formed by the non-myocardial region is obtained; through the region corresponding to the cluster in the nuclear magnetic resonance image, a number of myocardial connected domains are obtained, and according to the distance difference between the initial artifact region and the myocardial connected domain and the heart region, the shape characteristics of the initial artifact region, and the possibility of the initial artifact region being formed by the non-myocardial region, a number of final artifact regions of the nuclear magnetic resonance image are obtained; Acquire enhancement parameters when enhancing the nuclear magnetic resonance image; enhance the final artifact area in the nuclear magnetic resonance image according to the enhancement parameters to obtain an enhanced nuclear magnetic resonance image; acquire several other enhanced nuclear magnetic resonance images and train the neural network model, input the enhanced nuclear magnetic resonance images into the trained neural network model, and output a myocardial infarction labeled image.
2. The magnetic resonance intelligent detection method for myocardial infarction based on neural network according to claim 1 is characterized in that: The specific methods for obtaining the three clusters are as follows: K-means clustering was performed on the MRI images, and the distance metric used was the absolute value of the difference in grayscale values between pixels in the MRI images, resulting in three clusters.
3. The magnetic resonance intelligent detection method for myocardial infarction based on neural network according to claim 1 is characterized in that: The specific method for obtaining the heart region is as follows: The grayscale mean of all pixels in each of the three clusters is obtained. For the cluster with the grayscale mean in the middle, the connected domain with the largest area in the cluster is taken as the heart region.
4. The magnetic resonance intelligent detection method for myocardial infarction based on neural network according to claim 1 is characterized in that: For all the block regions in the heart region, a number of initial artifact regions are obtained according to two clusters whose grayscale means are closest to the grayscale means of the block regions and the gradient values of the pixels in the block regions, including the following specific steps: Perform Canny edge detection on the heart region of the MRI image to obtain several connected domains surrounded by the edges in the heart region as the block regions in the heart region; Obtain two clusters whose grayscale means are closest to the grayscale mean of all pixels in the block area, obtain the accumulated gradient values of all pixels in the block area, obtain the difference between the grayscale mean of all pixels in the block area and the grayscale mean of all pixels in the two clusters, record it as the first difference, record the ratio of the accumulated gradient value to the first difference as the possibility of the block area as the initial artifact area, and take the block area whose possibility of being the initial artifact area is greater than a preset threshold as the initial artifact area.
5. The magnetic resonance intelligent detection method for myocardial infarction based on neural network according to claim 1 is characterized in that: The method of obtaining the possibility that each initial artifact region is formed by a non-myocardial region according to the change of the grayscale value of the neighborhood of the initial artifact region includes the following specific steps: Obtain fluctuations in average grayscale values of several layers of pixel points outside a target initial artifact region, wherein the target initial artifact region is any initial artifact region, obtain an initial artifact region corresponding to a minimum fluctuation value of average grayscale values of several layers of pixel points outside all initial artifact regions, and record a difference between the fluctuation of average grayscale values of several layers of pixel points outside the target initial artifact region and the minimum fluctuation value as a first difference; The difference between the average grayscale value of several layers of pixel points outside the target initial artifact area and half of the average grayscale value of several layers of pixel points outside the initial artifact area corresponding to the minimum fluctuation value is recorded as the second difference; the first difference and the second difference are merged to obtain the possibility that the target initial artifact area is formed by the non-myocardial area, the first difference is directly proportional to the possibility that the target initial artifact area is formed by the non-myocardial area, and the second difference is inversely proportional to the possibility that the target initial artifact area is formed by the non-myocardial area.
6. The magnetic resonance intelligent detection method for myocardial infarction based on neural network according to claim 1 is characterized in that: The specific method of obtaining a plurality of myocardial connectivity domains is as follows: The grayscale mean of all pixels in each of the three clusters is obtained, and the connected domains corresponding to the two clusters with the largest grayscale mean in the magnetic resonance image are obtained, and both are recorded as the myocardial connected domains.
7. The magnetic resonance intelligent detection method for myocardial infarction based on neural network according to claim 1 is characterized in that: The several final artifact areas of the nuclear magnetic resonance image include the following specific steps: Record any connected domain of myocardium as the target connected domain of myocardium; record the difference between the distance between the central pixel point of the initial artifact area and the central pixel point of the heart area and the distance between the target connected domain of myocardium and the central pixel point of the heart area as the third difference; obtain the aspect ratio of the minimum circumscribed rectangle of the initial artifact area, and obtain the possibility that the initial artifact area is formed by the non-myocardial area; The third difference, the aspect ratio, and the possibility that the initial artifact area is formed by the non-myocardial area are merged to obtain the possibility that the initial artifact area is formed by the myocardial area. The third difference and the possibility that the initial artifact area is formed by the non-myocardial area are inversely proportional to the possibility that the initial artifact area is formed by the myocardial area. The final artifact area of the magnetic resonance image is obtained according to the size of the possibility that the initial artifact area is formed by the myocardial area.
8. The magnetic resonance intelligent detection method for myocardial infarction based on neural network according to claim 7 is characterized in that: The specific method for obtaining the final artifact area is as follows: The initial artifact region whose possibility of being formed by the myocardial region is greater than a preset threshold is taken as the final artifact region of the nuclear magnetic resonance image.
9. The magnetic resonance intelligent detection method for myocardial infarction based on neural network according to claim 8, characterized in that: The specific method for obtaining the enhancement parameters when enhancing the nuclear magnetic resonance image is as follows: Any final artifact region is recorded as the target final artifact region; Where D' is the possibility that the target final artifact area is formed by the myocardial area, arctan () is the inverse tangent function, and the specific method for obtaining p1 is as follows: the grayscale mean of all pixels in each cluster among the three clusters is obtained, and the grayscale mean in the middle is recorded as p1; the specific method for obtaining p2 is as follows: the grayscale mean of all pixels in each cluster among the three clusters is obtained, and the maximum value of the grayscale mean is recorded as p2; θ is the enhancement parameter for Fourier transform image enhancement of nuclear magnetic resonance images.
10. The method for intelligent magnetic resonance detection of myocardial infarction based on neural network according to claim 1, characterized in that: The specific method for obtaining the myocardial infarction labeled image is as follows: Acquire a number of other enhanced nuclear magnetic resonance images, and use all other enhanced nuclear magnetic resonance images as data sets for a neural network model; the neural network model is specifically a U-Net network; The myocardial infarction area in each enhanced MRI image in the data set is manually labeled. The labeling method is: the gray value of the pixel in the myocardial infarction area is labeled as 1, and the gray value of the pixel not in the myocardial infarction area is labeled as 1, and several labeled MRI images are obtained. All enhanced MRI images in the data set and the corresponding labeled MRI images are used as training sets. The neural network model is trained using the training set, and the loss function is the Dice loss function, to obtain the trained neural network model; The enhanced MRI image is input into the trained neural network model, and the myocardial infarction labeled image is output.