Edge Segmentation Algorithm-Based Prevention of Recurrent Laryngeal Nerve Injury in Treatment of Thyroid Nodules Using Ultrasound Images

(e study was aimed to explore the segmentation effects of different algorithms on thyroid nodule ultrasound images, so as to better protect the recurrent laryngeal nerve during thyroid surgery. Specifically, 186 patients with thyroid nodules were selected as the research objects. (e segmentation performances of the gradient vector flow (GVF) Snake, Watershed, and Snake algorithms were compared from 6 aspects of image segmentation effects, pixel accuracy (PA), Intersection over Union (IOU) value, algorithm running time, postoperative recurrent laryngeal nerve injury, intraoperative bleeding volume, and postoperative drainage volume. It was found that the average PA value (0.954) and the IOU value (0.866) of the GVF Snake algorithm were obviously higher than those of the other two algorithms. (e total incidence of recurrent laryngeal nerve injury based on the GVF Snake algorithm (4.69%) was obviously lower than that of the Snake algorithm (19.35%) and the watershed algorithm (16.13%). (e bleeding volume and postoperative drainage volume based on the GVF Snake algorithm were less versus the other two algorithms (P< 0.05). In conclusion, the GVF Snake algorithm demonstrates ideal segmentation effects, which is suggested in the treatment of thyroid nodules to better protect the recurrent laryngeal nerve.


Introduction
e thyroid gland is an important endocrine organ located just below the thyroid cartilage in the neck. e thyroid hormone produced can regulate the body's metabolism and internal calcium balance [1]. In recent years, there is an increasing number of people with thyroid diseases, with thyroid nodule being the most common one. yroid surgery is a common surgical procedure that is easy to operate [2], but there is a certain risk of complications. If not prevented or treated properly, it may have a lifelong impact on the patient [3,4]. As a common complication of thyroid surgery, recurrent laryngeal nerve injury has a reported incidence of about 0.3% to 15.4%. An underlying culprit causing the recurrent laryngeal nerve injury is capsule anatomy [5,6]. e clinical diagnosis reveals that the most likely location for recurrent laryngeal nerve injury is 2 cm before the larynx, which is adjacent to the thyroid gland, covered by Zuckerkandl nodules and surrounded by small branches of the thyroid arteries and veins and vascular fascia. In the thyroid surgery, this segment is easily affected [7]. In addition, thyroid tumor adhesion, compression of the recurrent laryngeal nerve, and secondary operations may also cause damage to the recurrent laryngeal nerve, which cannot be completely avoided in practice [8]. It is manifested as hoarseness, difficulty swallowing, and coughing when drinking water when there is an injury on a single side of the recurrent laryngeal nerve. e recurrent laryngeal nerve injury on both sides has symptoms such as dyspnea, which can endanger life in severe cases [9]. e ultrasound is extensively used in the detection of thyroid nodules due to its cheap and noninvasive characteristics and is currently the preferred imaging method for thyroid diseases [10]. e high-resolution ultrasound image enables doctors to perform the targeted treatment by determining the location of thyroid nodules and the degree of calcification, and image segmentation technology plays a key role in the treatment of thyroid nodules. However, the edge of the ultrasound image is often blurred as a result of low image resolution or different degrees of diseases [11], and speckle noise occurs due to the influence of ultrasonic echo [12]. At present, the diagnosis of thyroid nodules mainly relies on manual image segmentation by doctors, who make subjective judgments based on their experience. e judgment results are not so precise to some extent and may be a risk factor of complications [13]. e purpose of image segmentation is to make the contour line or the object surface itself consistent with the edge of the target object or the feature shape expected to be detected in the image. However, the traditional Snake algorithm is not easy to converge concave images, and the range of action is small, and it may converge to the local minimum [14]. e watershed algorithm uses the similarity of adjacent pixels on the image as a reference basis to segment the image, but due to the presence of noise or other interference factors on the real image, the watershed algorithm is likely to be oversegmented [15]. erefore, improved algorithms such as the GVF Snake algorithm essentially have the ability to process concave images, but it has not yet been confirmed in the segmentation of thyroid nodules.
Based on this, the segmentation performances of different algorithms were compared in the study to identify the most suitable one to enhance the surgical treatment of thyroid nodules, which provided a theoretical basis for the clinical treatment of thyroid nodules.

Research Subjects.
In the study, 186 patients with thyroid nodules admitted to the hospital from January 2013 to May 2020 were selected and separated into 3 groups based on different segmentation algorithms at random, with 62 in each group. Group A applied the GVF Snake algorithm (25 males, 37 females; mean age 37.44 ± 8.23 years, range 21-49). Group B adopted the Snake algorithm (23 males, 39 females; mean age 39.91 ± 8.72 years; range 23-53). Group C used a watershed algorithm (28 males, 34 females; mean age 36.48 ± 7.89 years; range 22-51). Characteristics variables included age, sex, and the surgery method. ere was no notable difference between the three groups (P > 0.05). e study has got permission from the ethics committee of the hospital, and patients and their families were informed of the study and signed the consent forms.
Inclusion criteria: (i) Patients older than 18 years; (ii) Patients with complete preoperative ultrasound examination data; (iii) Patients diagnosed with benign thyroid nodules; (iv) Patients with normal coagulation functions; (v) Patients with no other diseases of the nervous system, respiratory system, digestive system, or endocrine system.
Exclusion criteria: (i) Patients with secondary thyroid surgery; (ii) Patients with Graves disease; (iii) Patients with abnormal coagulation functions; (iv) Patients with incomplete clinical data; (v) Patients who were not suitable for this study for other reasons.

e Edge Segmentation Algorithm of yroid Nodule.
In this study, GVF Snake algorithm is used for image segmentation of thyroid nodules. Snake is a classic parameter active contour model, which simplifies the calculation method of image processing. e algorithm can be regarded as an energy function, which uniformly transforms image processing into a problem of finding the minimum energy of a functional function [16]. Snake algorithm initializes a closed contour curve near the segmented object, and the energy function is minimized so that the contour curve expands or contracts according to the established algorithm and finally stops at the target boundary. e closed curve obtained is the segmentation contour of the image [17]. e contour curve of the Snake function is In which, x(s) and y(x) are the specific coordinates of the control points on the contour curve in the image, s are the independent variables used to describe the boundary by Fourier Transform. e energy function V(s) of this contour line is as follows: (1) In which, E int (s) represents the internal energy of the contour, E image (s) represents the external energy, and E con (s) represents the conditional energy, that is, the item related to the variance.
After the energy minimization, the closed curve obtained by convergence is the target contour curve. According to the Euler formula, the necessary conditions for the minimum value of the functional function are as follows: In which, s ′ and s ″ represent the first and second differential of the equation s, and E ext (s) represents the sum of E con (s) and E image (s).
Being continuously smooth, the Snake algorithm can converge to a contour of any shape, but it is dependent on the initial contour, and it often fails to converge in the depression of the image edge [18]. en, the concept of Gradient Vector Flo (GVF) is proposed. e GVF Snake algorithm replaces the energy of some edge corners on the image with a gradient vector field. It redefines the external force, and its external force is the force derived from the edge of the image and no longer depends on the position of the initial contour of the image [19,20]. e gradient vector flow defined by the GVF Snake algorithm is V(x, y) � (u(x, y), v(x, y)), and the following function is obtained through energy minimization: In which, ∇ represents the Laplace transform, μ is a positive coefficient, μ × ∇ 2 V represents the smoothing term of V, |V − ∇f| 2 |∇f| 2 represents the data item of V. When it is far away from the edge area of the target image, the value ∇f is smaller, and the equation is mainly determined by μ × ∇ 2 V. When it is close to the edge area of the target image, the value ∇f is larger, and the equation is mainly determined by |V − ∇f| 2 |∇f| 2 . At this time, the data item promotes the active contour line to move to the boundary and the image edge segmentation is realized.
Finally, the Euler-Lagrange equation is used to solve equation (3), and a partial differential equation about V is obtained.
2.3. Denoising of the Original Ultrasound Image. Affected by equipment, environment, and other factors during the image acquisition process, some noise will inevitably appear [21].
To solve the speckle noise problem, a partial differential equation is introduced to denoise the image. μ(m, n) represents an ideal image, μ ′ (m, n) represents a noisy image, μ ″ (m, n) represents noise, and the relationship between the three can be expressed as follows: To obtain a noise-free image μ(m, n), the following partial differential equation is established: In which, Ω represents the image domain. Using Lagrange equation and gradient descent method to solve equations (6) and (7) can be obtained.
In which, t > 0, m, n ∈ Ω, λ represents the Lagrange multiplier, and the calculation equation of λ is as follows: e image denoised by equation (7) is shown in Figure 1.

e Performance Test of the GVF Snake Algorithm.
To analyze the segmentation effects of the GVF Snake algorithm, the region-based Watershed Algorithm and the contour-based Snake algorithm were introduced to compare the PA and IOU values of the three algorithms, calculated as follows: In which, M represents the image area obtained by the algorithm and N represents the area obtained by manual segmentation, that is, the real area.

e Recurrent Laryngeal Nerve Examination.
Before the thyroid surgery, the patients were tested by a laryngoscope, and there were no symptoms of vocal cord dysfunction or vocal cord paralysis so as to ensure that the recurrent laryngeal nerve injury was caused by the operation. After the operation, if the patient had a hoarse voice and the vocal cords were found to have dyskinesias by the laryngoscopy, it was defined as the recurrent laryngeal nerve injury. If it recovered within 6 months, it was defined as a one-time injury. Otherwise, it was defined as a permanent injury.

Statistics.
e data was processed by SPSS19.0. e measurement data were calculated as mean ± deviation. e SNK-q test was for comparison between groups. P < 0.05 was set as the threshold for significance.

Comparison of Segmentation Results.
Under the same number of iterations, the segmentation effects of the three algorithms were compared on initial contours with different positions and the same size, as shown in Figures 2, 3, and 4.
In this experiment, an ultrasound image of a patient with a thyroid nodule with a size of 441×358 was selected, and different segmentation methods were used for segmentation. e computer operating system was WIN10, the processor was Intel(R)Core (TM) i5-8400, 3.0GH, and the memory was 32 GB. e software version was MATLAB2014. e number of iterations was set to 700 times, the initial contour radius was 65, and the initial contour center coordinates were the coordinates of the lesion center (263.4, 205.9), the coordinates above the lesion center (263.4, 164.3), and the coordinates on the right of the lesion center (296.8, 205.9). It was evident that the position of the initial contour had different effects on the segmentation effects of different algorithms. e watershed segmentation method and the Snake algorithm segmentation method were more sensitive to the position of the initial contour. When the initial contour was offset from the center point, the segmentation performance was poor. However, the GVF Snake algorithm had more accurate segmentation results with low sensitivity to the initial contour.

Comparison of PA and IOU Values.
To further illustrate the accuracy of the GVF Snake algorithm segmentation, the PA and IOU values were introduced for comparison. A greater PA or IOU value indicated a greater overlapping degree between the segmented area and the real area. Table 1 presents the comparison results of segmentation effects.
In Table 1, ground truth represented the result of manual segmentation by the doctor, and the PA and IOU values were both defined as 1. A, B, and C represented the results of three different segmentation methods. It was evident that the Scientific Programming PA and IOU values of the GVF Snake algorithm were higher versus the other two, indicating that GVF Snake demonstrated better segmentation capabilities for thyroid nodule images than traditional segmentation methods. As a result of the influence of noise, the watershed algorithm had oversegmentation. Due to the blurred edges of thyroid nodules, it was difficult for the Snake method to accurately recognize the true contour area, and the segmentation effects were very poor. In contrast, the GVF Snake had the best segmentation performance.

Original image
Noise reduction image   Figure 5, the average running time of the GVF Snake algorithm (14.89s) was longer than the Snake algorithm (10.23s) and shorter than the watershed algorithm (19.55s) with beat segmentation effects.

Comparison of Recurrent Laryngeal Nerve Injury.
After the thyroid surgery under the guidance of different algorithms, the patient's recurrent laryngeal nerve injury status was as shown in Figures 6, 7, and 8. e average running time of groups A, B, and C were 122.45 ± 19.23 min, 118.22 ± 22.81 min, and 120.22 ± 20.81 min (P > 0.05).
Of the 62 patients in group A, postoperative recurrent laryngeal nerve injury occurred in 3 patients. After 6 months of follow-up, it was found that 2 cases had a one-time injury, with an incidence of 3.13% (2/62), and 1 case was with a permanent injury, with an incidence of 1.56% (1/62). e total incidence rate of recurrent laryngeal nerve injury in group A was 4.69% (3/62).
Of the 62 patients in group B, hoarseness was noted in 12 patients. After 6 months of follow-up, it was found that 8 cases had a one-time injury with an incidence rate of 12.9% (8/62), and 4 cases had a permanent injury with an incidence rate of 6.45% (4/62). e total incidence rate of recurrent laryngeal nerve injury in group B was 19.35% (12/62).
Among the 62 patients in group C, 10 had recurrent laryngeal nerve injury. After 6 months of follow-up, it was found that 7 cases were with one-time injury, with an incidence rate of 11.29% (7/62), and 3 case was with a permanent injury, with an incidence of 4.84% (3/62). e total incidence of recurrent laryngeal nerve injury in group C was 16.13% (10/62). ere was a notable difference between the three groups (P < 0.05). Figure 9 and 10, the average intraoperative blood loss (56.42 mL) and the average postoperative drainage (27.21 mL) of the GVF Snake algorithm were less than the watershed algorithm (85.46 mL, 47.33 mL) and the Snake algorithm (76.98 mL, 39.25 mL) (P < 0.05).

Discussion
e thyroid is a common clinical malignant tumor, especially papillary cancer. e clinical treatment of thyroid is mainly surgical resection, which is efficient. At present, basically, the clinical best treatment for thyroid nodules is not controversial, but the scope of surgical resection is on the contrary because different surgical methods cause different  Scientific Programming recurrent laryngeal nerve injuries to patients after surgery [22]. Recurrent laryngeal nerve injury is a common complication of thyroid surgery, which seriously affects patients' lifestyle and physiological functions after surgery [23], so accurate location of the lesion during thyroidectomy is very important. It was found that the average PA values of GVF Snake, Snake, and watershed algorithms were 0.954, 0.731, and 0.827, and the average IOU values were 0.866, 0.614, and 0.787, respectively, with manually segmented images taken as real images. It was evident that the PA value and IOU value of the GVF Snake algorithm were lower than the Snake and watershed algorithms (P < 0.05), indicating that the GVF Snake algorithm had higher segmentation accuracy and the segmentation contour was closer to the real contour. e image segmentation results also proved this point. is was in line with the findings of Zhang et al. (2016) [24]. After the running time of different algorithms was compared, it was found that under the same number of iterations, the average segmentation time of GVF Snake algorithm (14.89s) was shorter than that of watershed algorithm (19.55s) but longer than that of Snake algorithm (10.23s) (P < 0.05). e reason for the watershed algorithm having the longest running time may be its high sensitivity to the edges of the image, causing oversegmentation due to blurred edges and longer running time. e Snake algorithm had the shortest running time, which may be due to the undersegmentation resulting from the local minimum during the segmentation, and the segmentation effect was poor. In general, the GVF Snake algorithm was superior to the other two segmentation algorithms, and a study by China et al. [25] also reported similar results. From the perspective of the incidence of postoperative recurrent laryngeal nerve injury, the total incidence of postoperative recurrent laryngeal nerve based on the GVF Snake algorithm was 4.69%, lower than the Snake algorithm (19.35%) and the watershed algorithm (16.13%) (P < 0.05). It may be because the GVF Snake algorithm improves the segmentation accuracy, thereby reducing the recurrent laryngeal nerve injury caused by misoperation. Regarding the intraoperative bleeding volume and postoperative drainage volume, the GVF Snake algorithm's average intraoperative bleeding volume (56.42 mL) and postoperative average drainage volume (27.21 mL) were less than the watershed algorithm (85.46 mL, 47.33 mL) and the Snake algorithm (76.98 mL, 39.25 mL) (P < 0.05). is illustrated that the operation effects based on GVF Snake algorithm were better.

Conclusion
To study the segmentation effects of different algorithms on the ultrasound image of thyroid nodules, 186 patients with thyroid nodules from our hospital were selected as the research subjects, and GVF Snake, watershed algorithm, and Snake algorithm were used for image segmentation. After their performances were compared with that of manual segmentation results, the advantages of the GVF Snake algorithm were verified. e results of this research showed that the GVF snake algorithm had a better segmentation effect on thyroid nodules than the Snake algorithm and the watershed algorithm. e segmentation method based on the GVF snake algorithm can effectively reduce the incidence of recurrent laryngeal nerve injury after thyroidectomy, and the clinical operation effect is better. is study proves that the GVF Snake algorithm has a good application prospect in thyroid image segmentation and can reduce recurrent laryngeal nerve damage and assist clinicians in image segmentation of thyroid nodules. e results of this article provide a basis for the clinical treatment of thyroid nodules, and it also has a certain guiding significance for the protection of the recurrent laryngeal nerve.

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