# Speckle Tracking Algorithm-Based Cardiac Color Ultrasound in Diagnosis of Patients with Atrial Fibrillation Combined with Heart Failure

Authors: Chunfeng Liao; Hui Luo; Jianqing Yang; Xianliang Wu; Min Zhao
Journal: Scientific Programming
 (2021)

---

## Abstract

The study focused on the application of speckle tracking algorithm in the segmentation of cardiac color ultrasound images of patients with atrial fibrillation combined with heart failure. First, the optical flow method and block matching method were introduced on the basis of multiphase level set algorithm. Then, the pyramid block matching method was applied to build a pyramid model from bottom to top according to each image, and thus a new segmentation algorithm of cardiac color ultrasound image was constructed. The speckle tracking algorithm based on the pyramid block matching method was applied to segment cardiac color ultrasound images of 136 patients with atrial fibrillation and heart failure and compared with the traditional diagnosis for the sensitivity, specificity, and accuracy. It was found that the curve smoothness and accuracy of the algorithm in this study were better than the traditional level set algorithm, and it made up for the shortcomings of the traditional method. The proportion of patients of class III-IV cardiac function was significantly higher than that of non-atrial fibrillation patients, and the difference was statistically significant (P<0.05); patients of classes III-IV showed better left ventricular ejection fraction (LVEF) (42.4 ± 2.8%), left ventricular end-diastolic diameter (LVED) (58.7 ± 7.4 mm), left ventricular end-systolic diameter (LVSD) (49.3 ± 5.6 mm), and left atrial inner diameter (LAD) (55.0 ± 1.4 mm) versus those of classes I-II, of whom the corresponding indexes were 58.8 ± 3.3%, 48.5 ± 5.9 mm, 33.5 ± 4.5 mm, and 45.2 ± 2.0 mm. The accuracy of diagnosis based on the algorithm of this study (93.22%) was significantly higher than that of traditional method (79.23%), and the differences were statistically significant (P<0.05). In conclusion, the algorithm in this study improves the segmentation accuracy and smoothness of the curve, which is suggested in clinic.


---

## Body

## 1. Introduction

Among cardiovascular diseases, the incidence of atrial fibrillation and heart failure is extremely high. Studies have shown that in China, the prevalence of heart failure in adults is 1.5%. Especially, the incidence of the elderly people over 70 years old is even more than 11% [1]. Statistics reveal that among more than 1,200 patients with heart failure or atrial fibrillation, 3% have both atrial fibrillation and heart failure. The two influence each other. The occurrence of atrial fibrillation will increase the chance of thrombosis in patients, and heart failure can easily induce atrial fibrillation, both of which threaten people’s health [2, 3]. Therefore, improving the accuracy in diagnosing atrial fibrillation combined with heart failure is the first priority. Ultrasound imaging has been widely used in the diagnosis of patients with suspected or known heart disease. It is a frequently used diagnostic method in cardiology [4]. Nevertheless, it is particularly important to accurately segment ultrasound images. Traditional medical image segmentation relies on the judgment of doctors, but subjective factors lead to inaccurate segmentation results [5]. Based on the 3D + T image sequence of the heart, Hodgson et al. [6] established a 3D model of the heart and calculated the strain through the motion vector of the heart.With the development of artificial intelligence, many researchers apply it to medical image recognition and segmentation, and using speckle tracking algorithm to identify and segment ultrasound images has become a new hot spot [7, 8]. Speckle tracking technology is based on high-frame two-dimensional gray-scale ultrasound images and uses the best pattern matching technology to track and identify the spatial motion of echo spots in myocardium. It marks the motion trajectory of the same position in different frames by tracking its position in the image, to calculate the angle of cardiac rotation. Orlowska et al. [9] combined contour tracking and speckle tracking. They introduced a contour model to improve the accuracy of the overall tracking, which solves the problem of discontinuity in a single method and avoids the need for complex meshing steps. Bailer et al. [10] combined the local optical flow displacement and global variation and introduced the minimum value of the energy function to control the contour, which improves the accuracy over the traditional method, but as the tracking range increases, its time redundancy also increases accordingly. In this study, based on the segmentation of the color ultrasound image of heart, the optical flow method and the block matching method were introduced, together with the pyramid block matching method, to build a new image segmentation algorithm. Then, the new algorithm was applied to diagnose 136 cases of atrial fibrillation combined with heart failure and compared with traditional algorithm for the sensitivity, specificity, and accuracy. The study was expected to provide a theoretical reference for the diagnosis of atrial fibrillation complicated with heart failure by cardiac ultrasound based on speckle tracking algorithm.


## 2. Materials and Methods

### 2.1. Research Subjects

In this study, 136 patients with atrial fibrillation and heart failure who were admitted to the hospital from May 23, 2018, to March 1, 2020, were selected as the research subjects, including 68 males and 58 females, aged 39–87 years old, with an average age of 71.30 ± 11.49. All patients were diagnosed with speckle tracking algorithm-based cardiac color ultrasound and the traditional method. The study has been approved by the medical ethics committee of hospital. The patients and their families understood the situation and signed an informed consent form.Inclusion criteria were as follows: (i) aged between 39 and 87 years; (ii) atrial fibrillation patients with obvious symptoms; (iii) patients with heart failure; and (iv) non-atrial fibrillation patients.Exclusion criteria were as follows: (i) patients with heart-related surgery in the last 1–3 months; (ii) patients allergic to anesthesia; (iii) patients allergic to arrhythmia drugs; (iv) patients with mental disorders and severe blood diseases; (v) patients with acute myocardial infarction; and (vi) patients who cannot cooperate to sign the informed consent.


### 2.2. Pyramid Block Matching-Based Speckle Tracking Algorithm

It has been proved that tracking cardiac condition by speckle is an effective tool to diagnose cardiac diseases. In order to improve the accuracy and speed of segmentation of cardiac color ultrasound, first, cardiac color ultrasound images are segmented based on a multiphase level set. Then, the optical flow method and block matching method are introduced to track the spots on the cardiac myocardial wall and improve the accuracy of segmentation. Finally, the pyramid block matching method is used to optimize the algorithm, thereby constructing a speckle tracking algorithm based on the pyramid block matching method.The multiphase level set is improved on the basis of the level set. An image is divided intom different regions. The collection is expressed as ψ=ψ1,ψ2…ψm, and its energy function is as follows [11]:(1)εφ,a,b=∫∑i=1m∫τy−xIx−byai2Gixdxdy,where Giφ is the subordinate function of each area; Ix is the function of the gray image; τ⋅ is the window function; and ai and b are the constant array and the bias field, respectively. Together with weighted length phase (L) and weighted area term (S), equation (1) constitutes the level set equation.(2)fφ,a,b=εφ,a,b+σLφ+ζSφ,where σ and ζ are the coefficients of the weighted length phase and weighted area terms. A smaller value of fφ,a,b indicates better segmentation effects. When m=2, the segmentation results are not clear, so a three-item level set is used, expressed as follows:(3)G1φ1,φ2=Hφ1Hφ2,G2φ1,φ2=Hφ11−Hφ2,G3φ1,φ2=1−Hφ1.Because the ultrasound image contains a lot of noise, it is necessary to perform binary image processing on the ultrasound image (extracting the contour area, connecting, and removing the noise). Then, the least squares method and cubic spline interpolation method are combined to fit the curve. The least squares method can be expressed as follows [12]:(4)∑n=1pXstλt=yss=1,2,…,o,where o is the number of equations; p is the number of unknowns; and λ represents the unknowns. When the curve fitting is not continuous, the cubic spline interpolation method is used, which can be expressed as(5)ux=c1x3+c2x2+c3x+c4,where c1, c2, c3, and c4 represent coefficients, and the first and second derivatives are continuous. On the basis of the segmentation, the optical flow method is used to downsample the cardiac ultrasound image. The brightness of one coordinate at time T is Kx,y,T, and the coordinate at time T+dT is x+dx,y+dy, but the brightness of these two coordinates remains unchanged.(6)Kx,y,T=Kx+dx,y+dy,T+dT.Expanding the right side of equation (6), we can get the following equation:(7)Kx+dx,y+dy,T+dT=Kx,y,T+dx∂K∂x+dy∂K∂y+dT∂K∂T+υ,where υ is the derivative term greater than the second order, and the equation below is obtained combining with equation (6).(8)dxdT∂K∂x+dydT∂K∂y+∂K∂T=0,where dx/dT=α, dy/dT=β, ∂K/∂y=Ky, and ∂K/∂T=KT, and the streamer constraint equation is obtained.(9)Kxα+Kyβ+KT=0,where α,β is the optical flow field, which is to solve the problem of aperture effect, together with the optical flow smoothing method. The square of the streamer gradient in the two directions is expressed as follows:(10)∂α∂x2+∂α∂y2,(11)∂β∂x2+∂β∂y2.Then, the minimum value of equations (10) and (11) is solved as follows:(12)min∫∫∂K∂xα+∂K∂yβ+∂K∂T2+μ∂α∂x2+∂α∂y2+∂β∂x2+∂β∂y2dxdy,where a greater value of μ indicates larger smoothness. The optical flow error can be expressed as follows:(13)∑x,y∈ϕω2xIxα+Iyβ+IT2,where ϕ is an area in the image and ω is the weight. Then, the pyramid block matching method is introduced to optimize the algorithm, and a pyramid model is built from bottom to top according to each image, which can be expressed as follows:(14)Xn−1e,f=Xn2e−1,2f−1+Xn2e−1,2f+Xn2e,2f,where Xe,f is the pixel value of the coordinate e,f and m is the number of layers of the pyramid. When performing absolute error and algorithm matching:(15)SADnX,Y=∑e=12n∑f=12nXne,f−Yne,f,where Xn is the pixel value of the original image and Yn is the pixel value of the image to be processed. Expanding equation (15), we can obtain the following equation:(16)SADnX,Y=∑e=12n∑f=12nXne,f−Yne,f≥∑e=12n∑f=12nXne,f−∑e=12n∑f=12nYne,f.Next, equation (17) is derived based on equations (14)–(16).(17)SADne,f≥∑e=12n−1∑f=12n−1Xn−1e,f−Yn−1e,f=SADn−1e,f.Expanding equation (17), we can get the following equation:(18)SADnX,Y≥SADn−1X,Y≥SADn−2X,Y≥SAD0X,Y.When performing absolute error and algorithm matching, the total calculation amount of the K-level pyramid is(19)∑k=0K3×22k−1.It is evident from equation (19) that a lower level leads to more obvious increase in the total computing capacity of the pyramid. Thus, the algorithm of this study is constructed (Figure 1).Figure 1
Schematic diagram of the algorithm in this study.


### 2.3. Simulation Experiment

Simulation Environment. The platform is MTALAB, the operating system is Windows10, and the processor is Intel(R) ore(TM) 3CPU (70 GHz), with 8 GB of storage. The size of the input image is 1280 × 960, the frame rate is 53 frame/s, the size of the parameter search window is 8, the amount of translation is 8, and the image block size is 11 based on experience. The pyramid block matching method is compared with the block matching method and the optical flow constraint block matching method, and the algorithm in this study is compared with the three-term level set algorithm for Dice coefficient, relative degree of difference (RDD), and relative degree of overlap (ROD).(20)Dice=2×P∩QP+Q,RDD=P−QP×100%,ROD=minP∩QP,P∩QQ×100%,where P is the actual result and Q is the segmentation result.


### 2.4. Examination and Diagnostic Criteria of Cardiac Color Ultrasound

The color Doppler ultrasound diagnostic instrument is used (Philips EPIQ7C color Doppler ultrasound imaging instrument), and the probe frequency is 2∼4 MHz. Under the guidance of the physician, the patient was in the left decubitus position. During the examination, the angle and position of the probe were continuously adjusted until the standard and non-standard views of the heart can be clearly displayed.Atrial fibrillation refers to the rapid and disorderly fibrillation of the atrium. For patients suffering from atrial fibrillation, the intensity of the first heart sound fluctuates from time to time, and the heart rhythm is extremely uneven. Worse still, when the ventricular rate is too fast, it is easy to cause short dwarf. Its electrocardiogram shows that the baseline and shape fluctuate irregularly, and the frequency is 340 to 600 times per minute, called F wave [13]. Atrial fibrillation is divided into paroxysmal atrial fibrillation and persistent atrial fibrillation. Paroxysmal AF usually occurs for less than 48 hours and terminates spontaneously within 7 days, converting to sinus rhythm. Its attack is more sudden, with long or short duration, and the patient will have symptoms of chest tightness and anxiety. Persistent AF usually lasts for more than seven days, and people need drugs or electric shocks if it fails to convert into sinus rhythm. Its main symptoms include palpitation, shortness of breath, and significantly increased ventricular rate.Cardiac function classification: class I: patients have heart disease, but their daily activities are not restricted, and general activities will not cause fatigue, heartbeat, dyspnea, or angina; class II: patients have slightly restricted physical activities, and they do not have consciousness when they are resting, but symptoms of fatigue, palpitations, dyspnea, or angina may occur during normal activities; class III: the physical activity is significantly restricted; and class IV: patients cannot have any physical activity. Otherwise, the condition will get worse [14].


### 2.5. Observation Indicators

The patient was observed for atrial fibrillation, cardiac function classification, and cardiac ultrasound parameters (LVEF, LVED, LVSD, and LAD). The speckle tracking algorithm based on the pyramid block matching method was compared with the traditional method for the sensitivity, specificity, and accuracy:(21)sensitivity=TPTP+FN×100%,specificity=TNTN+FN×100%,accuracy rate=TP+TNtotal×100%,where TP means true positive, TN means true negative, FP means false positive, and FN means false negative.


### 2.6. Statistical Methods

The data were processed by SPSS 22.0. Measurement data were expressed as mean ± standard deviation (x¯x ± s), and count data were expressed as percentage (%). P<0.05 was the threshold for significance.


## 2.1. Research Subjects

In this study, 136 patients with atrial fibrillation and heart failure who were admitted to the hospital from May 23, 2018, to March 1, 2020, were selected as the research subjects, including 68 males and 58 females, aged 39–87 years old, with an average age of 71.30 ± 11.49. All patients were diagnosed with speckle tracking algorithm-based cardiac color ultrasound and the traditional method. The study has been approved by the medical ethics committee of hospital. The patients and their families understood the situation and signed an informed consent form.Inclusion criteria were as follows: (i) aged between 39 and 87 years; (ii) atrial fibrillation patients with obvious symptoms; (iii) patients with heart failure; and (iv) non-atrial fibrillation patients.Exclusion criteria were as follows: (i) patients with heart-related surgery in the last 1–3 months; (ii) patients allergic to anesthesia; (iii) patients allergic to arrhythmia drugs; (iv) patients with mental disorders and severe blood diseases; (v) patients with acute myocardial infarction; and (vi) patients who cannot cooperate to sign the informed consent.


## 2.2. Pyramid Block Matching-Based Speckle Tracking Algorithm

It has been proved that tracking cardiac condition by speckle is an effective tool to diagnose cardiac diseases. In order to improve the accuracy and speed of segmentation of cardiac color ultrasound, first, cardiac color ultrasound images are segmented based on a multiphase level set. Then, the optical flow method and block matching method are introduced to track the spots on the cardiac myocardial wall and improve the accuracy of segmentation. Finally, the pyramid block matching method is used to optimize the algorithm, thereby constructing a speckle tracking algorithm based on the pyramid block matching method.The multiphase level set is improved on the basis of the level set. An image is divided intom different regions. The collection is expressed as ψ=ψ1,ψ2…ψm, and its energy function is as follows [11]:(1)εφ,a,b=∫∑i=1m∫τy−xIx−byai2Gixdxdy,where Giφ is the subordinate function of each area; Ix is the function of the gray image; τ⋅ is the window function; and ai and b are the constant array and the bias field, respectively. Together with weighted length phase (L) and weighted area term (S), equation (1) constitutes the level set equation.(2)fφ,a,b=εφ,a,b+σLφ+ζSφ,where σ and ζ are the coefficients of the weighted length phase and weighted area terms. A smaller value of fφ,a,b indicates better segmentation effects. When m=2, the segmentation results are not clear, so a three-item level set is used, expressed as follows:(3)G1φ1,φ2=Hφ1Hφ2,G2φ1,φ2=Hφ11−Hφ2,G3φ1,φ2=1−Hφ1.Because the ultrasound image contains a lot of noise, it is necessary to perform binary image processing on the ultrasound image (extracting the contour area, connecting, and removing the noise). Then, the least squares method and cubic spline interpolation method are combined to fit the curve. The least squares method can be expressed as follows [12]:(4)∑n=1pXstλt=yss=1,2,…,o,where o is the number of equations; p is the number of unknowns; and λ represents the unknowns. When the curve fitting is not continuous, the cubic spline interpolation method is used, which can be expressed as(5)ux=c1x3+c2x2+c3x+c4,where c1, c2, c3, and c4 represent coefficients, and the first and second derivatives are continuous. On the basis of the segmentation, the optical flow method is used to downsample the cardiac ultrasound image. The brightness of one coordinate at time T is Kx,y,T, and the coordinate at time T+dT is x+dx,y+dy, but the brightness of these two coordinates remains unchanged.(6)Kx,y,T=Kx+dx,y+dy,T+dT.Expanding the right side of equation (6), we can get the following equation:(7)Kx+dx,y+dy,T+dT=Kx,y,T+dx∂K∂x+dy∂K∂y+dT∂K∂T+υ,where υ is the derivative term greater than the second order, and the equation below is obtained combining with equation (6).(8)dxdT∂K∂x+dydT∂K∂y+∂K∂T=0,where dx/dT=α, dy/dT=β, ∂K/∂y=Ky, and ∂K/∂T=KT, and the streamer constraint equation is obtained.(9)Kxα+Kyβ+KT=0,where α,β is the optical flow field, which is to solve the problem of aperture effect, together with the optical flow smoothing method. The square of the streamer gradient in the two directions is expressed as follows:(10)∂α∂x2+∂α∂y2,(11)∂β∂x2+∂β∂y2.Then, the minimum value of equations (10) and (11) is solved as follows:(12)min∫∫∂K∂xα+∂K∂yβ+∂K∂T2+μ∂α∂x2+∂α∂y2+∂β∂x2+∂β∂y2dxdy,where a greater value of μ indicates larger smoothness. The optical flow error can be expressed as follows:(13)∑x,y∈ϕω2xIxα+Iyβ+IT2,where ϕ is an area in the image and ω is the weight. Then, the pyramid block matching method is introduced to optimize the algorithm, and a pyramid model is built from bottom to top according to each image, which can be expressed as follows:(14)Xn−1e,f=Xn2e−1,2f−1+Xn2e−1,2f+Xn2e,2f,where Xe,f is the pixel value of the coordinate e,f and m is the number of layers of the pyramid. When performing absolute error and algorithm matching:(15)SADnX,Y=∑e=12n∑f=12nXne,f−Yne,f,where Xn is the pixel value of the original image and Yn is the pixel value of the image to be processed. Expanding equation (15), we can obtain the following equation:(16)SADnX,Y=∑e=12n∑f=12nXne,f−Yne,f≥∑e=12n∑f=12nXne,f−∑e=12n∑f=12nYne,f.Next, equation (17) is derived based on equations (14)–(16).(17)SADne,f≥∑e=12n−1∑f=12n−1Xn−1e,f−Yn−1e,f=SADn−1e,f.Expanding equation (17), we can get the following equation:(18)SADnX,Y≥SADn−1X,Y≥SADn−2X,Y≥SAD0X,Y.When performing absolute error and algorithm matching, the total calculation amount of the K-level pyramid is(19)∑k=0K3×22k−1.It is evident from equation (19) that a lower level leads to more obvious increase in the total computing capacity of the pyramid. Thus, the algorithm of this study is constructed (Figure 1).Figure 1
Schematic diagram of the algorithm in this study.


## 2.3. Simulation Experiment

Simulation Environment. The platform is MTALAB, the operating system is Windows10, and the processor is Intel(R) ore(TM) 3CPU (70 GHz), with 8 GB of storage. The size of the input image is 1280 × 960, the frame rate is 53 frame/s, the size of the parameter search window is 8, the amount of translation is 8, and the image block size is 11 based on experience. The pyramid block matching method is compared with the block matching method and the optical flow constraint block matching method, and the algorithm in this study is compared with the three-term level set algorithm for Dice coefficient, relative degree of difference (RDD), and relative degree of overlap (ROD).(20)Dice=2×P∩QP+Q,RDD=P−QP×100%,ROD=minP∩QP,P∩QQ×100%,where P is the actual result and Q is the segmentation result.


## 2.4. Examination and Diagnostic Criteria of Cardiac Color Ultrasound

The color Doppler ultrasound diagnostic instrument is used (Philips EPIQ7C color Doppler ultrasound imaging instrument), and the probe frequency is 2∼4 MHz. Under the guidance of the physician, the patient was in the left decubitus position. During the examination, the angle and position of the probe were continuously adjusted until the standard and non-standard views of the heart can be clearly displayed.Atrial fibrillation refers to the rapid and disorderly fibrillation of the atrium. For patients suffering from atrial fibrillation, the intensity of the first heart sound fluctuates from time to time, and the heart rhythm is extremely uneven. Worse still, when the ventricular rate is too fast, it is easy to cause short dwarf. Its electrocardiogram shows that the baseline and shape fluctuate irregularly, and the frequency is 340 to 600 times per minute, called F wave [13]. Atrial fibrillation is divided into paroxysmal atrial fibrillation and persistent atrial fibrillation. Paroxysmal AF usually occurs for less than 48 hours and terminates spontaneously within 7 days, converting to sinus rhythm. Its attack is more sudden, with long or short duration, and the patient will have symptoms of chest tightness and anxiety. Persistent AF usually lasts for more than seven days, and people need drugs or electric shocks if it fails to convert into sinus rhythm. Its main symptoms include palpitation, shortness of breath, and significantly increased ventricular rate.Cardiac function classification: class I: patients have heart disease, but their daily activities are not restricted, and general activities will not cause fatigue, heartbeat, dyspnea, or angina; class II: patients have slightly restricted physical activities, and they do not have consciousness when they are resting, but symptoms of fatigue, palpitations, dyspnea, or angina may occur during normal activities; class III: the physical activity is significantly restricted; and class IV: patients cannot have any physical activity. Otherwise, the condition will get worse [14].


## 2.5. Observation Indicators

The patient was observed for atrial fibrillation, cardiac function classification, and cardiac ultrasound parameters (LVEF, LVED, LVSD, and LAD). The speckle tracking algorithm based on the pyramid block matching method was compared with the traditional method for the sensitivity, specificity, and accuracy:(21)sensitivity=TPTP+FN×100%,specificity=TNTN+FN×100%,accuracy rate=TP+TNtotal×100%,where TP means true positive, TN means true negative, FP means false positive, and FN means false negative.


## 2.6. Statistical Methods

The data were processed by SPSS 22.0. Measurement data were expressed as mean ± standard deviation (x¯x ± s), and count data were expressed as percentage (%). P<0.05 was the threshold for significance.


## 3. Results

### 3.1. Algorithm Simulation Results

Figure2 shows the results of the pyramid block matching method. It was noted that the accuracy rates of the block matching method, the optical flow constrained block matching method, and the pyramid block matching method were 94.4%, 98.2%, and 97.8%, respectively, and the running time was 149.3 s, 237.3 s, and 47.5 s, respectively. Obviously, the optical flow constrained block matching method took longer time than the block matching method, and the difference was statistically significant (P<0.05); the pyramid block matching method took less time versus the block matching method, and the difference was statistically significant (P<0.05). It suggested that the optical flow constrained block matching method improved the accuracy compared with the block matching method but greatly reduced the operation speed of the algorithm, and that the pyramid block matching method increased the running speed of the algorithm by more than 3 times while ensuring the accuracy.Figure 2
The results of the pyramid block matching method (1: block matching method; 2: optical flow constrained block matching method; 3: pyramid block matching method). Note:∗ indicated that the difference was statistically significant compared to the block matching method (P<0.05).Figure3 shows Dice, ROD, and RDD of different algorithms. It was noted that Dice (0.917 ± 0.054) of the algorithm proposed in this study was significantly higher than that (0.766 ± 0.067) of the three-term level set algorithm, and that its ROD (0.897 ± 0.031) was significantly higher than that (0.732 ± 0.069) of the three-term level set algorithm, and the difference was statistically significant (P<0.05). Nevertheless, its RDD (0.047 ± 0.016) was lower than that of the three-term level set algorithm (0.112 ± 0.034), but the difference was not statistically significant (P>0.05). It showed that each evaluation index of the algorithm proposed in this study was better than the three-item level set algorithm, indicating better segmentation effects versus the three-item level set algorithm.Figure 3
Comparison of Dice, ROD, and RDD. Note:∗ meant that the algorithm was statistically different from the three-item level set (P<0.05).


### 3.2. Comparison of Segmentation Effects

Figure4 shows the segmentation effects of different algorithms. It was noted that the left ventricle was missing when the traditional method was used, while the segmented image by the algorithm in this study was close to the manually segmented image, and the smoothness of the segmentation curve was better than that of the traditional level set algorithm, which made up for the shortcomings of traditional level set algorithm and improved the accuracy.Figure 4
Comparison of the segmentation effects of different methods: (a) the original image; (b) the manual segmentation results; (c) the segmentation result of the traditional level set algorithm; (d) the segmentation result of the algorithm in this study.
(a)(b)(c)(d)


### 3.3. Types of Atrial Fibrillation and Cardiac Function Classification

Figure5 shows the types of atrial fibrillation. It was noted that the patients with atrial fibrillation accounted for 63.9% (87 cases), of which the patients with paroxysmal atrial fibrillation accounted for 38.2% (52 cases) and the patients with persistent atrial fibrillation accounted for 25.7% (35 cases), and the non-atrial fibrillation patients accounted for 36.1% (49 cases).Figure 5
Types of atrial fibrillation.Figure6 shows the cardiac function classification results of all patients. It was noted that patients with class I accounted for 4.4% (6 cases), of which patients with atrial fibrillation accounted for 2.9% (4/136) and patients with non-atrial fibrillation accounted for 1.5% (2/136); patients with class II accounted for 11.8% (16 cases), of which atrial fibrillation patients accounted for 8.8% (12/136) and non-atrial fibrillation patients accounted for 2.9% (4/136); patients with class III accounted for 52.2% (71 cases), of which atrial fibrillation patients accounted for 30.9% (42/136) and non-atrial fibrillation patients accounted for 21.3% (29/136); and patients with class IV accounted for 31.6% (43 cases), of which atrial fibrillation patients accounted for 21.3% (29/136) and non-atrial fibrillation patients accounted for 10.3% (14/136). The proportion of patients of classes III and IV was significantly higher than the proportion of non-atrial fibrillation patients, and the difference was statistically significant (P<0.05).Figure 6
Cardiac function classification of all patients. Note:∗ indicated that the difference was statistically significant compared to non-atrial fibrillation (P<0.05).


### 3.4. Comparison of Cardiac Ultrasound Parameters

Figure7 shows the left ventricular ejection fraction (LVEF). It was noted that the LVEF of patients of classes I-II was 58.8 ± 3.3%, and that of classes III-IV was 42.4 ± 2.8%. Obviously, the LVEF of patients of classes III-IV was significantly lower than that of patients of classes I-II, and the difference was statistically significant (P<0.05).Figure 7
Comparison of LVEF. Note:∗ indicated that the difference was statistically significant compared to patients of classes I-II (P<0.05).Figure8 shows the left ventricular end-diastolic diameter (LVED) and left ventricular end-systolic diameter (LVSD). It was noted that the LVED and LVSD of patients of classes I-II were 48.5 ± 5.9 mm and 33.5 ± 4.5 mm, respectively. The LVED and LVSD of patients of classes III-IV were 58.7 ± 7.4 mm and 49.3 ± 5.6 mm, respectively. Obviously, the LVED and LVSD of patients of classes III-IV were significantly higher than those of patients of classes I-II, and the difference was statistically significant (P<0.05).Figure 8
Comparison of LVED and LVSD. Note:∗ indicated that the difference was statistically significant compared to patients of classes I-II (P<0.05).Figure9 shows the left atrial inner diameter (LAD) results. It was noted that the LAD of patients of classes I-II was 45.2 ± 2.0 mm, and the LAD of patients of classes III-IV was 55.0 ± 1.4 mm. Obviously, the LAD of classes III-IV patients was significantly lower than that of patients of classes I-II, and the difference was statistically significant (P<0.05).Figure 9
Comparison of the LAD. Note:∗ indicated that the difference was statistically significant compared to patients of classes I-II (P<0.05).


### 3.5. Diagnosis of Heart Failure

Figure10 shows the sensitivity, specificity, and accuracy of the two methods of diagnosis. It was noted that the sensitivity of the speckle tracking algorithm based on the pyramid block matching method was 98.13%, the specificity was 90.32%, and the accuracy was 93.22%; for the traditional method, the sensitivity was 89.31%, the specificity was 80.74%, and the accuracy was 79.23%. Obviously, the diagnostic accuracy of the speckle tracking algorithm based on pyramid block matching method was significantly higher than that of the traditional method, and the differences were statistically significant (P<0.05).Figure 10
Comparison of the sensitivity, specificity, and accuracy of the two diagnosis methods: (a) traditional diagnosis; (b) the speckle tracking based on pyramid block matching method. Note:∗ indicated a statistically significant difference in diagnosis compared with the traditional method (P<0.05).


## 3.1. Algorithm Simulation Results

Figure2 shows the results of the pyramid block matching method. It was noted that the accuracy rates of the block matching method, the optical flow constrained block matching method, and the pyramid block matching method were 94.4%, 98.2%, and 97.8%, respectively, and the running time was 149.3 s, 237.3 s, and 47.5 s, respectively. Obviously, the optical flow constrained block matching method took longer time than the block matching method, and the difference was statistically significant (P<0.05); the pyramid block matching method took less time versus the block matching method, and the difference was statistically significant (P<0.05). It suggested that the optical flow constrained block matching method improved the accuracy compared with the block matching method but greatly reduced the operation speed of the algorithm, and that the pyramid block matching method increased the running speed of the algorithm by more than 3 times while ensuring the accuracy.Figure 2
The results of the pyramid block matching method (1: block matching method; 2: optical flow constrained block matching method; 3: pyramid block matching method). Note:∗ indicated that the difference was statistically significant compared to the block matching method (P<0.05).Figure3 shows Dice, ROD, and RDD of different algorithms. It was noted that Dice (0.917 ± 0.054) of the algorithm proposed in this study was significantly higher than that (0.766 ± 0.067) of the three-term level set algorithm, and that its ROD (0.897 ± 0.031) was significantly higher than that (0.732 ± 0.069) of the three-term level set algorithm, and the difference was statistically significant (P<0.05). Nevertheless, its RDD (0.047 ± 0.016) was lower than that of the three-term level set algorithm (0.112 ± 0.034), but the difference was not statistically significant (P>0.05). It showed that each evaluation index of the algorithm proposed in this study was better than the three-item level set algorithm, indicating better segmentation effects versus the three-item level set algorithm.Figure 3
Comparison of Dice, ROD, and RDD. Note:∗ meant that the algorithm was statistically different from the three-item level set (P<0.05).


## 3.2. Comparison of Segmentation Effects

Figure4 shows the segmentation effects of different algorithms. It was noted that the left ventricle was missing when the traditional method was used, while the segmented image by the algorithm in this study was close to the manually segmented image, and the smoothness of the segmentation curve was better than that of the traditional level set algorithm, which made up for the shortcomings of traditional level set algorithm and improved the accuracy.Figure 4
Comparison of the segmentation effects of different methods: (a) the original image; (b) the manual segmentation results; (c) the segmentation result of the traditional level set algorithm; (d) the segmentation result of the algorithm in this study.
(a)(b)(c)(d)


## 3.3. Types of Atrial Fibrillation and Cardiac Function Classification

Figure5 shows the types of atrial fibrillation. It was noted that the patients with atrial fibrillation accounted for 63.9% (87 cases), of which the patients with paroxysmal atrial fibrillation accounted for 38.2% (52 cases) and the patients with persistent atrial fibrillation accounted for 25.7% (35 cases), and the non-atrial fibrillation patients accounted for 36.1% (49 cases).Figure 5
Types of atrial fibrillation.Figure6 shows the cardiac function classification results of all patients. It was noted that patients with class I accounted for 4.4% (6 cases), of which patients with atrial fibrillation accounted for 2.9% (4/136) and patients with non-atrial fibrillation accounted for 1.5% (2/136); patients with class II accounted for 11.8% (16 cases), of which atrial fibrillation patients accounted for 8.8% (12/136) and non-atrial fibrillation patients accounted for 2.9% (4/136); patients with class III accounted for 52.2% (71 cases), of which atrial fibrillation patients accounted for 30.9% (42/136) and non-atrial fibrillation patients accounted for 21.3% (29/136); and patients with class IV accounted for 31.6% (43 cases), of which atrial fibrillation patients accounted for 21.3% (29/136) and non-atrial fibrillation patients accounted for 10.3% (14/136). The proportion of patients of classes III and IV was significantly higher than the proportion of non-atrial fibrillation patients, and the difference was statistically significant (P<0.05).Figure 6
Cardiac function classification of all patients. Note:∗ indicated that the difference was statistically significant compared to non-atrial fibrillation (P<0.05).


## 3.4. Comparison of Cardiac Ultrasound Parameters

Figure7 shows the left ventricular ejection fraction (LVEF). It was noted that the LVEF of patients of classes I-II was 58.8 ± 3.3%, and that of classes III-IV was 42.4 ± 2.8%. Obviously, the LVEF of patients of classes III-IV was significantly lower than that of patients of classes I-II, and the difference was statistically significant (P<0.05).Figure 7
Comparison of LVEF. Note:∗ indicated that the difference was statistically significant compared to patients of classes I-II (P<0.05).Figure8 shows the left ventricular end-diastolic diameter (LVED) and left ventricular end-systolic diameter (LVSD). It was noted that the LVED and LVSD of patients of classes I-II were 48.5 ± 5.9 mm and 33.5 ± 4.5 mm, respectively. The LVED and LVSD of patients of classes III-IV were 58.7 ± 7.4 mm and 49.3 ± 5.6 mm, respectively. Obviously, the LVED and LVSD of patients of classes III-IV were significantly higher than those of patients of classes I-II, and the difference was statistically significant (P<0.05).Figure 8
Comparison of LVED and LVSD. Note:∗ indicated that the difference was statistically significant compared to patients of classes I-II (P<0.05).Figure9 shows the left atrial inner diameter (LAD) results. It was noted that the LAD of patients of classes I-II was 45.2 ± 2.0 mm, and the LAD of patients of classes III-IV was 55.0 ± 1.4 mm. Obviously, the LAD of classes III-IV patients was significantly lower than that of patients of classes I-II, and the difference was statistically significant (P<0.05).Figure 9
Comparison of the LAD. Note:∗ indicated that the difference was statistically significant compared to patients of classes I-II (P<0.05).


## 3.5. Diagnosis of Heart Failure

Figure10 shows the sensitivity, specificity, and accuracy of the two methods of diagnosis. It was noted that the sensitivity of the speckle tracking algorithm based on the pyramid block matching method was 98.13%, the specificity was 90.32%, and the accuracy was 93.22%; for the traditional method, the sensitivity was 89.31%, the specificity was 80.74%, and the accuracy was 79.23%. Obviously, the diagnostic accuracy of the speckle tracking algorithm based on pyramid block matching method was significantly higher than that of the traditional method, and the differences were statistically significant (P<0.05).Figure 10
Comparison of the sensitivity, specificity, and accuracy of the two diagnosis methods: (a) traditional diagnosis; (b) the speckle tracking based on pyramid block matching method. Note:∗ indicated a statistically significant difference in diagnosis compared with the traditional method (P<0.05).


## 4. Discussion

In recent years, the incidence of heart failure has been increasing year by year. It is approximately 1.5% among adults, and that in the elderly people over 70 years old is even exceeding 11% [15]. Studies have proved that patients with atrial fibrillation are often accompanied by different degrees of heart failure. Therefore, the accurate diagnosis of atrial fibrillation combined with heart failure is helpful for the rapid recovery of patients’ postoperative functions [16]. Cardiac ultrasound diagnosis plays an important role in the diagnosis of atrial fibrillation combined with heart failure. To improve the accuracy and speed of image segmentation, artificial intelligence-based cardiac ultrasound image segmentation has emerged [17]. In this study, based on the segmentation of the color ultrasound image of heart, the optical flow method and the block matching method were introduced, together with the pyramid block matching method, to build a new image segmentation algorithm. Then, the new algorithm was applied to diagnose 136 cases of atrial fibrillation combined with heart failure and compared with traditional algorithm for the sensitivity, specificity, and accuracy. The results showed that the pyramid block matching method increased the running speed by more than 3 times while ensuring the accuracy rate and that Dice (0.917 ± 0.054) and ROD (0.897 ± 0.031) of the algorithm in the study were significantly higher than Dice (0.766 ± 0.067) and ROD (0.732 ± 0.069) of the three-term level set algorithm, and the difference was statistically significant (P<0.05); the segmented image by the algorithm in this study was close to the manually segmented image, and the smoothness of the curve was better than the traditional level set algorithm, which made up for the shortcomings of the traditional level set algorithm segmentation and improved the accuracy of the segmentation.Next, the speckle tracking algorithm based on pyramid block matching method was applied to segment the cardiac color ultrasound images of 136 patients with atrial fibrillation combined with heart failure, and it was compared with the traditional method for the sensitivity, specificity, and accuracy. The results showed that patients with class III accounted for 52.2% (71 cases), of which atrial fibrillation patients accounted for 30.9% (42/136) and non-atrial fibrillation patients accounted for 21.3% (29/136); patients with class IV accounted for 31.6% (43 cases), of which atrial fibrillation patients accounted for 21.3% (29/136) and non-atrial fibrillation patients accounted for 10.3% (14/136), consistent with the results of Bohm et al. [18], indicating that AF and heart failure could influence each other. AF could aggravate heart failure, and heart failure can also lead to AF, and more severe heart failure indicates a higher risk of AF. LVEF, LVED, LVSD, and LAD of patients with cardiac function grades III-IV were better than those in patients with cardiac function grades I-II, and the diagnosis accuracy of the proposed algorithm was significantly higher than that of traditional diagnosis, with statistical significance (P<0.05). This was in line with the findings of Kuck et al. [19] that the enlargement of left atrial diameter was associated with the occurrence of heart failure, and the incidence of AF would increase accordingly, and that when the left atrial diameter increased by 4 mm, the risk of AF was 1.74. The diagnosis accuracy of speckle tracking based on pyramid block matching method was significantly higher than that of traditional method (P<0.05), indicating that color Doppler ECG based on the algorithm can improve the accuracy of diagnosis for patients with atrial fibrillation complicated with heart failure.


## 5. Conclusion

In this study, based on the segmentation of the color ultrasound image of heart, the optical flow method and the block matching method were introduced, together with the pyramid block matching method, to build a new image segmentation algorithm. Then, the new algorithm was applied to diagnose 136 cases of atrial fibrillation combined with heart failure and compared with traditional algorithm for the sensitivity, specificity, and accuracy. The results showed that each segmentation index based on the proposed algorithm was better than the traditional level set algorithm, and the smoothness of segmentation curve was also better. It made up for the shortcomings of the traditional level set algorithm and improved the accuracy of segmentation. In addition, the cardiac color ultrasound based on the algorithm can play a better role in the diagnosis of cardiac abnormalities and cardiac function classification. The disadvantages of this study are that the study samples are small and the study is single-centered, so the applicability of the results is limited. In conclusion, cardiac color ultrasound based on the algorithm presented in this study can improve the diagnostic accuracy of patients with AF complicated by heart failure. The results of this study can provide a theoretical reference for future clinical diagnostic studies, and it is expected to expand the sample size in the future to conduct further exploration in this direction.



---

*Source: 8457008-2021-11-12.xml*