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

,e 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 flowmethod and blockmatchingmethod were introduced on the basis of multiphase level set algorithm. ,en, 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. ,e 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.,e proportion of patients of class IIIIV 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.4mm), left ventricular end-systolic diameter (LVSD) (49.3± 5.6mm), and left atrial inner diameter (LAD) (55.0± 1.4mm) versus those of classes I-II, of whom the corresponding indexes were 58.8± 3.3%, 48.5± 5.9mm, 33.5± 4.5mm, and 45.2± 2.0mm. ,e 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.


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. e two influence each other. e 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]. erefore, 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.
ey 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. en, 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. e 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.

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 algorithmbased cardiac color ultrasound and the traditional method. e study has been approved by the medical ethics committee of hospital. e 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) nonatrial fibrillation patients.
Exclusion criteria were as follows: (i) patients with heartrelated 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.

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. en, 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.
e multiphase level set is improved on the basis of the level set. An image is divided into m different regions. e collection is expressed as ψ � ψ 1 , ψ 2 . . . ψ m , and its energy function is as follows [11]: where G i (φ) is the subordinate function of each area; I(x) is the function of the gray image; τ(·) is the window function; and a i 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.
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: 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). en, the least squares method and cubic spline interpolation method are combined to fit the curve. e least squares method can be expressed as follows [12]: 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 where c 1 , c 2 , c 3 , and c 4 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. e brightness of one coordinate at time T is K(x, y, T), and the coordinate at time 2 Scientific Programming T + dT is (x + dx, y + dy), but the brightness of these two coordinates remains unchanged.
Expanding the right side of equation (6), we can get the following equation: where υ is the derivative term greater than the second order, and the equation below is obtained combining with equation (6).
where (α, β) is the optical flow field, which is to solve the problem of aperture effect, together with the optical flow smoothing method. e square of the streamer gradient in the two directions is expressed as follows: en, the minimum value of equations (10) and (11) is solved as follows: where a greater value of μ indicates larger smoothness. e optical flow error can be expressed as follows: where ϕ is an area in the image and ω is the weight. en, 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: where X(e, 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: where X n is the pixel value of the original image and Y n is the pixel value of the image to be processed. Expanding equation (15), we can obtain the following equation: Next, equation (17) is derived based on equations (14)- (16).

Scientific Programming
Expanding equation (17), we can get the following equation: When performing absolute error and algorithm matching, the total calculation amount of the K-level pyramid is It is evident from equation (19) that a lower level leads to more obvious increase in the total computing capacity of the pyramid. us, the algorithm of this study is constructed ( Figure 1).

Simulation Experiment
Simulation Environment. e platform is MTALAB, the operating system is Windows10, and the processor is Intel(R) ore(TM) 3CPU (70 GHz), with 8 GB of storage. e 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. e 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).
where P is the actual result and Q is the segmentation result.

Examination and Diagnostic Criteria of Cardiac Color
Ultrasound. e 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].

Observation Indicators.
e patient was observed for atrial fibrillation, cardiac function classification, and cardiac ultrasound parameters (LVEF, LVED, LVSD, and LAD). e speckle tracking algorithm based on the pyramid block matching method was compared with the traditional method for the sensitivity, specificity, and accuracy: where TP means true positive, TN means true negative, FP means false positive, and FN means false negative.

Statistical
Methods. e data were processed by SPSS 22.0. Measurement data were expressed as mean ± standard deviation (xx ± s), and count data were expressed as percentage (%). P < 0.05 was the threshold for significance. Figure 2 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 3 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 4 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.

Types of Atrial Fibrillation and Cardiac Function
Classification. Figure 5 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).  Scientific Programming Figure 6 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 nonatrial fibrillation patients accounted for 10.3% (14/136). e 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 7 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 8 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. e 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 9 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).

Diagnosis of Heart
Failure. Figure 10 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).

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. erefore, 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. en, 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.
e 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.
e 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 nonatrial 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).
is 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. e 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.

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. en, 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. e 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. e 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. e 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.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.