# Edge Detection Algorithm-Based Lung Ultrasound in Evaluation of Efficacy of High-Flow Oxygen Therapy on Critical Lung Injury

Authors: Wei Lu; Bin Xie; Zhaolei Ding
Journal: Computational and Mathematical Methods in Medicine
 (2022)

---

## Abstract

The study focused on the therapeutic effects of high-flow oxygen therapy on patients with critical lung injury using edge detection-based ultrasound images. Firstly, the traditional Canny edge detection algorithm was improved, and the optimal threshold was obtained by optimizing the median filter and combining Otsu algorithm and threshold iteration method. Then, the optimized algorithm was compared with the traditional Canny edge detection algorithm and applied to process the lung ultrasound images of 120 cases of critical lung injury, to compare the efficacy of high-flow oxygen therapy and the traditional oxygen therapy. It was found that the peak signal-to-noise ratio (PSNR) (20.34~31.3), edge intensity value (17.89~27.34), and edge detection effect of the improved Canny algorithm were better than the traditional Canny algorithm (15.2~28.61, 9.44~18.56). The failure rate of extubation (4.1%), reintubation rate (0.8%), comfort (2.38±0.15 points), dry humidity score (1.07±0.21 points), antibiotic use (7.41±0.74 days), and hospital stay (8.66±1.02 days) in the experimental group were significantly lower than the corresponding indexes in the control group (11.7%, 5%, 4.25±0.26 minutes, 4.94±0.78 minutes, 19.29±1.7 days, and 27.49±2.22 days), and the difference was statistically significant (P<0.05). In the experimental group, within 48 hours after extubation, the respiratory rate (RR), heart rate (HR), arterial partial pressure of carbon dioxide (PaCO2), and HCO3- were significantly lower than those of the control group; and the values of transcutaneous oxygen saturation (SpO2), mean arterial pressure (MAP), arterial partial pressure of oxygen (PaO2), and pH were significantly higher than the control group, and the difference was statistically significant (P<0.05). In conclusion, the algorithm in this study is superior to the traditional Canny algorithm, and the high-flow oxygen therapy can reduce the failure rate of extubation, strengthen patient comfort, improve the degree of gas humidification, stabilize the respiratory function and circulatory system, and shorten the time of antibiotic use and hospital stay.


---

## Body

## 1. Introduction

The rapid assessment, early diagnosis, and timely intervention of critically ill patients are important and challenging, because it requires doctors to be not only experienced but also skilled [1, 2]. When the condition of the critically ill patient is controlled, the spontaneous breathing test (SBT) is performed. If the patient is able to breathe normally by himself, the ventilator can be evacuated. During the extubation, in case of failure, it is necessary to monitor the patient’s vital signs. However, there is a high-risk period of acute respiratory distress syndrome (ARDS) after SBT and extubation [3].With the development of imaging technology, ultrasound imaging technology has been widely used in the diagnosis of critically ill patients, and lung ultrasound plays an important role in the diagnosis and treatment of critical lung injury [4]. Lung ultrasound can effectively determine the degree of pulmonary edema to assess the degree of lung injury, and the ultrasound score is a semiquantitative assessment technology of lung injury [5, 6]. Yasukawa and Minami [7] used the anterior chest four-zone method to assess extravascular lung water in critically ill patients and found that the method can improve the accuracy of the diagnosis of dyspnea. Lung ultrasound can help doctors to determine the cause of ARDS after extubation, so as to formulate a proper treatment plan after extubation. However, within 48 hours after extubation, the traditional treatment of mask oxygen supply or nasal catheter oxygen supply has certain limitations in practical applications [8, 9]. The high-flow oxygen therapy technology can not only improve the oxygenation function of patients to prevent ARDS after extubation but also effectively improve the comfort of patients. It is an ideal ventilation treatment method [10].As an image processing technology, edge detection is a hotspot, and it needs to be optimized in response to the complexity of medical images and the increasing amount of information contained [11, 12]. Compared with the classic edge detection algorithm, the improved Prewitt algorithm proposed by Sengupta et al. [13] greatly shortens the image processing time. On the basis of the gradient operator, Dash et al. [14] used Gaussian filtering to smooth the image, and then, the Laplacian gradient edge detector was used to detect the edge of the image. The algorithm exhibited better peak signal-to-noise ratio and the mean square error versus the traditional algorithm, greatly improving the quality of the image.In this study, firstly, the traditional Canny edge detection algorithm was improved, and the optimal threshold was obtained by optimizing the median filter and combining Otsu algorithm and threshold iteration method. Then, the optimized algorithm was compared with the traditional Canny edge detection algorithm and then applied to process the lung ultrasound images of 120 cases of critical lung injury, to compare the efficacy of high-flow oxygen therapy and the traditional oxygen therapy, which isexpected to provide a theoretical reference for future clinical work.


## 2. Materials and Methods

### 2.1. Research Subjects and Instruments

In this study, 120 patients with critical lung injury admitted to the hospital from January 23, 2018, to March 1, 2020, were selected as the research subjects, including 68 males and 52 females, aged 39-87 years old, with an average age of57.30±11.49. They were randomly divided into the control group (60 cases) and the observation group (60 cases). The study has been approved by ethics committee of hospital, and the patients and their families understood the situation of the study and signed an informed consent form.The inclusion criteria were as follows: (I) patients whose condition was under control and whose vital indicators showed that the ventilator can be removed; (II) patients in the intensive care unit (ICU) who had received mechanical ventilation by tracheal intubation for more than 48 hours; (III) patients who did not have surgery scheduled for the next 48 hours; (IV) patients who passed the SBT; (V) patients who no longer needed to take vasoactive drugs; and (VI) patients with lung ultrasoundscoreLUS≥15.The exclusion criteria were as follows: (I) patients not meeting the age requirements; (II) patients whose trachea was incised during surgery; (III) patients with a too large injury area; (IV) patients with chronic respiratory diseases or who are pregnant; (V) patients who did not pass the SBT; and (VI) patients who cannot cooperate to sign the informed consent.


### 2.2. Edge Detection Algorithm Based on Canny

Traditionally, the Gaussian function is used for smoothing.(1)Aa,b=Ga,b∗Fa,b,Ga,b=12πσ2exp−a2+b22σ2,where Aa,b is the processed image, Ga,b is the smoothing factor, and σ is the variance.Then, the amplitude and direction of the pixels are calculated.(2)Fxi,j=Ai,j+1−Ai,j+Ai+1,j+1−Ai+1,j2,Fyi,j=Ai,j−Ai+1,j+Ai,j+1−Ai+1,j+12,where Fxi,j and Fyi,j are the partial derivative along the x and y directions, respectively. The amplitude mi,j and direction ni,j of any pixel are expressed as follows:
(3)mi,j=Fx2i,j+Fy2i,j,ni,j=arctanFxi,jFyi,j.The nonmaximum suppression is expressed as follows:(4)Bi,j=NMSni,j,ςi,jb2−4ac,where Bi,j is the suppressed image and ςi,j is the sector where the gradient direction is located. Next, the double threshold method is used for detection and edge connection. The process is shown in Figure 1.Figure 1
The flow chart of the traditional Canny edge detection algorithm.The traditional Canny operator has shortcomings. In practice, due to the difference in image size, illumination intensity, and transmission mode, the edge information is blurred or weakened. In response to these problems, the algorithm needs to be optimized.In this study, the fast median filtering is selected to optimize the Canny edge detection algorithm. The algorithm uses row sorting, column sorting, and diagonal sorting to find the median value, as shown in Figure2:Figure 2
Schematic diagram of fast median filtering.The Otsu algorithm and threshold iteration method are used to calculate the optimal threshold. Suppose the gray level of the original image is1,2,⋯,l, mi is the number of pixels with gray values i, and then, the number of all pixels is expressed as follows:
(5)M=m1+m2+⋯+mi.The probability ofmi is as follows:
(6)Pi=miM,∑i=1lPi=1.The thresholdt divides the pixels into two categories with the gray levels of 1,2,⋯,t and t+1,t+2,⋯,l, respectively. The proportions of the two are expressed as follows:
(7)ω1=∑i=1tPi,ω2=∑i=t+1lPi=1−ω1.The average of the gray values of all pixels is expressed as follows:(8)X1=∑i=1tiPiω1,X2=∑i=t+1liPiω2,X=X1ω1+X2ω2.The variances of the two types of pixels are expressed as follows:(9)σ12=∑i=1ti−X1Piω1,σ22=∑i=t+1li−X2Piω2.The between-class variance is expressed as follows:(10)σb2=ω1ω2X1−X22.The between-class variance of the two types of pixels is expressed as follows:(11)σw2=ω1σ12+ω2σ22.The total variance is expressed as follows:(12)σt2=ω1σ12+ω2σ22.A greater difference between the two types of pixels leads to a greaterσb2, a smaller probability of the target pixel being misclassified, and better image segmentation effects, so when σb2 takes the maximum value, the optimal threshold is t∗. The optimized algorithm is shown in Figure 3.Figure 3
The flow chart of the improved Canny algorithm.


### 2.3. Experimental Environment

In order to verify the superiority of the algorithm in this research, the selected hardware environment is CPU Intel (R) Core (TM) i7-6700HQ; the main frequency is 2.70 GHz; the software environment operating system is Windows 10, and the programming environment is MATLAB 2014a. The input image is a grayscale image with a size of510×510, and the experiments are carried out under the environment of noise intensity of 0, 0.02, 0.15, 0.2, and 0.3, respectively. The experimental results of the traditional Canny edge detection algorithm are compared with the results of the improved Canny edge detection algorithm. The edge detection results are evaluated factoring into PSNR and image edge intensity.


### 2.4. Lung Ultrasound Examination

First, the patient’s lung was divided into 12 areas according to the anatomical landmarks: the front upper, lower front, upper side, lower side, upper back, and lower back of the both left and right sides. Then, an ultrasound machine was used with a convex probe with a frequency of 3-4 MHz for ultrasound evaluation along the intercostal space of each area (Table1 and Figure 4), and the ultrasound score was recorded [15]. An experienced physician evaluated the ultrasound images of all patients who had successfully passed the spontaneous breathing test (SBT).Table 1
Ultrasound score.
Ultrasound signsScoreNormal lung ultrasound image or a small amount of B-line0Increased heterogeneous B-line or focal fusion B-line1Diffuse B-line increase or fusion B-line combined with a small amount of lung consolidation under the pleural line2Lung consolidation, atelectasis, pleural effusion3Figure 4
Schematic diagram of lung ultrasound signs ((a) line A; (b) line B).
(a)(b)


### 2.5. Treatment Methods

When the condition of the patient was under control, the optimization treatment was carried out: (I) the effusion was drained from the patient’s chest or abdominal cavity; (II) the patient was infused with nutrient solution to maintain electrolyte balance; (III) the patient’s blood pressure and blood sugar were maintained at a stable level; (IV) to drain the sputum in time; (V) using antibiotics for anti-infective treatment; and (VI) pathogen detection was required if anti-infective effects were not ideal.After extubation, the patients in the control group accepted the traditional oxygen therapy. According to the needs of the patients, oxygen was given through a mask or a nasal catheter, and the amount of oxygen can be adjusted. When the patient has the following conditions, it is regarded as a failure of extubation: (I) the patient had hypercapnia; (II) the patient’s breathing rate was greater than 30 breaths/min, and there was apnea; (III) the main bronchus was blocked; (IV) the patient’s hemodynamics was unstable; (V) the function of the patient’s nervous system was unstable; and (VI) the transcutaneous oxygen saturation was above 90% when the oxygen flow was more than 10 L/min.After extubation, patients in the experimental group accepted the high-flow oxygen therapy. The parameters were set as follows: oxygen flow rate was 55 L/min; and oxygen temperature was 37°C. When the patient’s breathing rate was less than 25 breaths/min after 48 hours and the percutaneous oxygen saturation was greater than or equal to 92%, high-flow oxygen therapy can be stopped.


### 2.6. Observation Indicators

The two groups were compared for general information, including age, gender, sequential organ failure score (SOFA), clinical lung infection score (CPIS), and LUS; the failure of extubation; various vital indicators during treatment after extubation, including RR, SpO2, HR, and MAP; arterial blood gas results, including pH, HCO3-, PaO2, and PaCO2; and prognosis one month after extubation, including the duration of antibiotic use and the length of hospital stay.


### 2.7. Statistical Methods

Data was processed by SPSS 22.0 version statistical software. Measurement data were expressed asmean±standarddeviation (x¯±s), and count data were expressed as percentage (%). Differences with P<0.05 were statistically significant.


## 2.1. Research Subjects and Instruments

In this study, 120 patients with critical lung injury admitted to the hospital from January 23, 2018, to March 1, 2020, were selected as the research subjects, including 68 males and 52 females, aged 39-87 years old, with an average age of57.30±11.49. They were randomly divided into the control group (60 cases) and the observation group (60 cases). The study has been approved by ethics committee of hospital, and the patients and their families understood the situation of the study and signed an informed consent form.The inclusion criteria were as follows: (I) patients whose condition was under control and whose vital indicators showed that the ventilator can be removed; (II) patients in the intensive care unit (ICU) who had received mechanical ventilation by tracheal intubation for more than 48 hours; (III) patients who did not have surgery scheduled for the next 48 hours; (IV) patients who passed the SBT; (V) patients who no longer needed to take vasoactive drugs; and (VI) patients with lung ultrasoundscoreLUS≥15.The exclusion criteria were as follows: (I) patients not meeting the age requirements; (II) patients whose trachea was incised during surgery; (III) patients with a too large injury area; (IV) patients with chronic respiratory diseases or who are pregnant; (V) patients who did not pass the SBT; and (VI) patients who cannot cooperate to sign the informed consent.


## 2.2. Edge Detection Algorithm Based on Canny

Traditionally, the Gaussian function is used for smoothing.(1)Aa,b=Ga,b∗Fa,b,Ga,b=12πσ2exp−a2+b22σ2,where Aa,b is the processed image, Ga,b is the smoothing factor, and σ is the variance.Then, the amplitude and direction of the pixels are calculated.(2)Fxi,j=Ai,j+1−Ai,j+Ai+1,j+1−Ai+1,j2,Fyi,j=Ai,j−Ai+1,j+Ai,j+1−Ai+1,j+12,where Fxi,j and Fyi,j are the partial derivative along the x and y directions, respectively. The amplitude mi,j and direction ni,j of any pixel are expressed as follows:
(3)mi,j=Fx2i,j+Fy2i,j,ni,j=arctanFxi,jFyi,j.The nonmaximum suppression is expressed as follows:(4)Bi,j=NMSni,j,ςi,jb2−4ac,where Bi,j is the suppressed image and ςi,j is the sector where the gradient direction is located. Next, the double threshold method is used for detection and edge connection. The process is shown in Figure 1.Figure 1
The flow chart of the traditional Canny edge detection algorithm.The traditional Canny operator has shortcomings. In practice, due to the difference in image size, illumination intensity, and transmission mode, the edge information is blurred or weakened. In response to these problems, the algorithm needs to be optimized.In this study, the fast median filtering is selected to optimize the Canny edge detection algorithm. The algorithm uses row sorting, column sorting, and diagonal sorting to find the median value, as shown in Figure2:Figure 2
Schematic diagram of fast median filtering.The Otsu algorithm and threshold iteration method are used to calculate the optimal threshold. Suppose the gray level of the original image is1,2,⋯,l, mi is the number of pixels with gray values i, and then, the number of all pixels is expressed as follows:
(5)M=m1+m2+⋯+mi.The probability ofmi is as follows:
(6)Pi=miM,∑i=1lPi=1.The thresholdt divides the pixels into two categories with the gray levels of 1,2,⋯,t and t+1,t+2,⋯,l, respectively. The proportions of the two are expressed as follows:
(7)ω1=∑i=1tPi,ω2=∑i=t+1lPi=1−ω1.The average of the gray values of all pixels is expressed as follows:(8)X1=∑i=1tiPiω1,X2=∑i=t+1liPiω2,X=X1ω1+X2ω2.The variances of the two types of pixels are expressed as follows:(9)σ12=∑i=1ti−X1Piω1,σ22=∑i=t+1li−X2Piω2.The between-class variance is expressed as follows:(10)σb2=ω1ω2X1−X22.The between-class variance of the two types of pixels is expressed as follows:(11)σw2=ω1σ12+ω2σ22.The total variance is expressed as follows:(12)σt2=ω1σ12+ω2σ22.A greater difference between the two types of pixels leads to a greaterσb2, a smaller probability of the target pixel being misclassified, and better image segmentation effects, so when σb2 takes the maximum value, the optimal threshold is t∗. The optimized algorithm is shown in Figure 3.Figure 3
The flow chart of the improved Canny algorithm.


## 2.3. Experimental Environment

In order to verify the superiority of the algorithm in this research, the selected hardware environment is CPU Intel (R) Core (TM) i7-6700HQ; the main frequency is 2.70 GHz; the software environment operating system is Windows 10, and the programming environment is MATLAB 2014a. The input image is a grayscale image with a size of510×510, and the experiments are carried out under the environment of noise intensity of 0, 0.02, 0.15, 0.2, and 0.3, respectively. The experimental results of the traditional Canny edge detection algorithm are compared with the results of the improved Canny edge detection algorithm. The edge detection results are evaluated factoring into PSNR and image edge intensity.


## 2.4. Lung Ultrasound Examination

First, the patient’s lung was divided into 12 areas according to the anatomical landmarks: the front upper, lower front, upper side, lower side, upper back, and lower back of the both left and right sides. Then, an ultrasound machine was used with a convex probe with a frequency of 3-4 MHz for ultrasound evaluation along the intercostal space of each area (Table1 and Figure 4), and the ultrasound score was recorded [15]. An experienced physician evaluated the ultrasound images of all patients who had successfully passed the spontaneous breathing test (SBT).Table 1
Ultrasound score.
Ultrasound signsScoreNormal lung ultrasound image or a small amount of B-line0Increased heterogeneous B-line or focal fusion B-line1Diffuse B-line increase or fusion B-line combined with a small amount of lung consolidation under the pleural line2Lung consolidation, atelectasis, pleural effusion3Figure 4
Schematic diagram of lung ultrasound signs ((a) line A; (b) line B).
(a)(b)


## 2.5. Treatment Methods

When the condition of the patient was under control, the optimization treatment was carried out: (I) the effusion was drained from the patient’s chest or abdominal cavity; (II) the patient was infused with nutrient solution to maintain electrolyte balance; (III) the patient’s blood pressure and blood sugar were maintained at a stable level; (IV) to drain the sputum in time; (V) using antibiotics for anti-infective treatment; and (VI) pathogen detection was required if anti-infective effects were not ideal.After extubation, the patients in the control group accepted the traditional oxygen therapy. According to the needs of the patients, oxygen was given through a mask or a nasal catheter, and the amount of oxygen can be adjusted. When the patient has the following conditions, it is regarded as a failure of extubation: (I) the patient had hypercapnia; (II) the patient’s breathing rate was greater than 30 breaths/min, and there was apnea; (III) the main bronchus was blocked; (IV) the patient’s hemodynamics was unstable; (V) the function of the patient’s nervous system was unstable; and (VI) the transcutaneous oxygen saturation was above 90% when the oxygen flow was more than 10 L/min.After extubation, patients in the experimental group accepted the high-flow oxygen therapy. The parameters were set as follows: oxygen flow rate was 55 L/min; and oxygen temperature was 37°C. When the patient’s breathing rate was less than 25 breaths/min after 48 hours and the percutaneous oxygen saturation was greater than or equal to 92%, high-flow oxygen therapy can be stopped.


## 2.6. Observation Indicators

The two groups were compared for general information, including age, gender, sequential organ failure score (SOFA), clinical lung infection score (CPIS), and LUS; the failure of extubation; various vital indicators during treatment after extubation, including RR, SpO2, HR, and MAP; arterial blood gas results, including pH, HCO3-, PaO2, and PaCO2; and prognosis one month after extubation, including the duration of antibiotic use and the length of hospital stay.


## 2.7. Statistical Methods

Data was processed by SPSS 22.0 version statistical software. Measurement data were expressed asmean±standarddeviation (x¯±s), and count data were expressed as percentage (%). Differences with P<0.05 were statistically significant.


## 3. Results

### 3.1. Algorithm Simulation Results

Figure5 showed the PSNR values of the two algorithms under different noises. When the noise intensity was 0, 0.02, 0.15, 0.2, and 0.3, the PSNR values of the traditional Canny edge detection algorithm were 28.61, 25.13, 21.3, 17.29, and 15.2, respectively, and the PSNR values of the improved Canny edge detection algorithm were 31.3, 28.4, 26.3, 21.87, and 20.34, respectively. With the increase of noise intensity, the PSNR values of the two algorithms both showed a downward trend, but the PSNR value of the improved Canny edge detection algorithm was always significantly greater than that of the traditional Canny edge detection algorithm, and the difference was statistically significant (P<0.05).Figure 5
The PSNR values of the two algorithms under different noises. Note:∗ indicated that it is statistically significant compared to the traditional Canny edge detection algorithm (P<0.05).Figure6 shows the image edge intensity values of the two algorithms under different noises. When the noise intensity was 0, 0.02, 0.15, 0.2, and 0.3, the image edge intensity values of the traditional Canny edge detection algorithm were 18.56, 15.22, 11.56, 10.7, and 9.44, respectively, and the image edge intensity values of the improved Canny edge detection algorithm were 27.34, 24.36, 21.43, 18.48, and 17.89, respectively. With the increase of noise intensity, the image edge intensity values of the two algorithms both showed a downward trend, but the edge intensity values of the improved Canny edge detection algorithm were significantly larger than those of the traditional Canny edge detection algorithm, and the difference was statistically significant (P<0.05).Figure 6
Image edge intensity values of the two algorithms under different noises. Note:∗ indicated that it is statistically significant compared to the traditional Canny edge detection algorithm (P<0.05).


### 3.2. Comparison of the Performance of the Two Algorithms

Figure7 shows the performance of the two edge detection algorithms. In the image processed by the traditional Canny edge detection algorithm, there existed a lot of redundant details, while in the image processed by the improved Canny edge detection algorithm, there were very few false edges, and the edge information was relatively complete and clear.Figure 7
Comparison of the performance of the two algorithms. (a) Shows the original image; (b) shows the image processed by the traditional Canny edge detection algorithm; (c) shows the image processed by the improved Canny edge detection algorithm.
(a)(b)(c)


### 3.3. A Patient’s Lung Ultrasound Image before and after Treatment

Figure8 shows a patient’s lung ultrasound image before and after treatment. The patient was a male aged 58 years old. Before treatment (a), the ultrasound image showed diffuse B-line and there were obvious signs of pulmonary edema; that is, much water had accumulated in both lungs. After treatment (b), the diffuse B-line was reduced, B7-line was visible, and the pulmonary edema has been significantly improved.Figure 8
A patient’s lung ultrasound image before and after treatment: (a) before treatment; (b) after treatment.
(a)(b)


### 3.4. Comparison of General Information of the Two Groups of Patients

Figure9 shows the age and gender of the two groups of patients. The average ages of the control group and the experimental group were 53.56±8.11 years old and 54.25±9.34 years old, respectively. There were 28 and 31 male patients in the control and in the experimental group; there were 32 males and 29 females. There was no significant difference in age and gender between the two groups (P>0.05).Figure 9
Comparison of the age and gender of the two groups of patients.Figure10 shows the SOFA, CPIS, and LUS between the two groups. The SOFA scores of the control group and the experimental group were 10.46±2.21 points and 10.76±3.14 points, respectively; the CPIS were 4.65±0.22 points and 4.73±0.42 points; and the LUS were 16.01±3.31 points and 16.35±2.52 points, respectively. Obviously, the differences in SOFA, CPIS, and LUS between the two groups were not statistically significant (P>0.05).Figure 10
Comparison of SOFA, CPIS, and LUS between the two groups of patients.Figure11 shows the disease composition of the two groups of patients. It was noted that the control group had 17 cases of pancreatitis, 10 cases of lung infection, 14 cases of cerebrovascular disease, 6 cases of gastrointestinal hemorrhage, 3 cases of gynecology and obstetrics diseases, and 10 cases other diseases. In the experimental group, there were 18 cases of pancreatitis, 8 cases of lung infection, 15 cases of cerebrovascular disease, 4 cases of gastrointestinal hemorrhage, 3 cases of gynecology and obstetrics diseases, and 12 cases of other diseases. There was no statistically significant difference in disease composition between the two groups (P>0.05).Figure 11
Disease composition of the two groups of patients.


### 3.5. Comparison of Extubation Failure Rate, Comfort, and Dry Humidity Scores between the Two Groups

Figure12 showed the extubation failure rates of the two groups of patients. It was noted that the failure rates in the control group and the experimental group were 11.7% (14 cases) and 4.1% (5 cases), respectively, and the reintubation rates in the control group and the experimental group were 5% (6 cases) and 0.8% (1 case), respectively. There was no death in the control group and the experimental group. Obviously, the failure rate and reintubation rate in the experimental group were significantly lower than those in the control group, and the difference was statistically significant (P<0.05). There was no statistically significant difference in the proportion of deaths between the two groups (P>0.05).Figure 12
Extubation results in the two groups. Note:∗ indicated significant differences compared with the control group.Figure13 showed the comfort and dry humidity scores between the two groups. It was noted that the comfort scores of the control group and the experimental group were 4.25±0.26 points and 2.38±0.15 points, respectively, and the dry humidity scores were 4.94±0.78 points and 1.07±0.21 points, respectively. The comfort scores and dry humidity scores of the experimental group were lower than those of the control group, and the difference was statistically significant (P<0.05).Figure 13
Comparison of comfort and dry humidity scores between the two groups. Note:∗ indicated that the difference was statistically significant compared to the control group (P<0.05).


### 3.6. Comparison of Various Vital Indicators and Arterial Blood Gas Results during Treatment after Extubation in the Two Groups

Figure14 showed the average values of RR and SpO2 between the two groups. It was noted that at 4 h, 12 h, 32 h, and 48 h after extubation, the average RR of the experimental group was significantly lower than that of the control group, and the difference was statistically significant (P<0.05). At 4 h, 12 h, 32 h, and 48 h after extubation, the average value of SpO2 in the experimental group was significantly higher than that in the control group, and the difference was statistically significant (P<0.05).Figure 14
Comparison of the average values of RR and SpO2 between the two groups of patients.Figure15 showed the average values of HR and MAP between the two groups of patients. It was noted that at 4 h, 12 h, 32 h, and 48 h after extubation, the average HR of the experimental group was significantly lower than that of the control group, and the difference was statistically significant (P<0.05). At 4 h, 12 h, 32 h, and 48 h after extubation, the average MAP of the experimental group was significantly higher than that of the control group, and the difference was statistically significant (P<0.05).Figure 15
Comparison of the average values of HR and MAP between the two groups of patients.Figure16 showed the average values of PaO2 and PaCO2 between the two groups of patients. It was noted that at 4 h, 12 h, 32 h, and 48 h after extubation, the average value of PaO2 in the experimental group was significantly greater than that in the control group, and the difference was statistically significant (P<0.05). At 4 h, 12 h, 32 h, and 48 h after extubation, the average value of PaCO2 in the experimental group was significantly lower than that in the control group, and the difference was statistically significant (P<0.05).Figure 16
Comparison of the average values of PaO2 and PaCO2 between the two groups of patients.Figure17 shows the comparison of the average values of pH and HCO3- between the two groups of patients. It was noted that at 4 h, 12 h, 32 h, and 48 h after extubation, the average pH value of the experimental group was significantly greater than that of the control group, and the difference was statistically significant (P<0.05). At 4 h, 12 h, 32 h, and 48 h after extubation, the average value of HCO3- in the experimental group was significantly lower than that in the control group, and the difference was statistically significant (P<0.05).Figure 17
Comparison of the average values of pH and HCO3- between the two groups.


### 3.7. The Prognosis of the Two Groups of Patients One Month after Extubation

Figure18 shows the antibiotic use time between the two groups of patients. It was noted that the patients in the control group used antibiotics for 19.29±1.7 days, and the patients in the experimental group patients used antibiotics for 7.41±0.74 days. The time of using antibiotics in the experimental group was significantly shorter than that in the control group, and the difference was statistically significant (P<0.05).Figure 18
The antibiotic use time between the two groups of patients.Figure19 shows the hospital stays between the two groups. It was noted that the hospital stay of the control group was 27.49±2.22 days, and the hospital stay of the experimental group was 8.66±1.02 days. The hospital stay of the experimental group was significantly shorter than that in the control group, and the difference was statistically significant (P<0.05).Figure 19
The hospital stays between the two groups.


## 3.1. Algorithm Simulation Results

Figure5 showed the PSNR values of the two algorithms under different noises. When the noise intensity was 0, 0.02, 0.15, 0.2, and 0.3, the PSNR values of the traditional Canny edge detection algorithm were 28.61, 25.13, 21.3, 17.29, and 15.2, respectively, and the PSNR values of the improved Canny edge detection algorithm were 31.3, 28.4, 26.3, 21.87, and 20.34, respectively. With the increase of noise intensity, the PSNR values of the two algorithms both showed a downward trend, but the PSNR value of the improved Canny edge detection algorithm was always significantly greater than that of the traditional Canny edge detection algorithm, and the difference was statistically significant (P<0.05).Figure 5
The PSNR values of the two algorithms under different noises. Note:∗ indicated that it is statistically significant compared to the traditional Canny edge detection algorithm (P<0.05).Figure6 shows the image edge intensity values of the two algorithms under different noises. When the noise intensity was 0, 0.02, 0.15, 0.2, and 0.3, the image edge intensity values of the traditional Canny edge detection algorithm were 18.56, 15.22, 11.56, 10.7, and 9.44, respectively, and the image edge intensity values of the improved Canny edge detection algorithm were 27.34, 24.36, 21.43, 18.48, and 17.89, respectively. With the increase of noise intensity, the image edge intensity values of the two algorithms both showed a downward trend, but the edge intensity values of the improved Canny edge detection algorithm were significantly larger than those of the traditional Canny edge detection algorithm, and the difference was statistically significant (P<0.05).Figure 6
Image edge intensity values of the two algorithms under different noises. Note:∗ indicated that it is statistically significant compared to the traditional Canny edge detection algorithm (P<0.05).


## 3.2. Comparison of the Performance of the Two Algorithms

Figure7 shows the performance of the two edge detection algorithms. In the image processed by the traditional Canny edge detection algorithm, there existed a lot of redundant details, while in the image processed by the improved Canny edge detection algorithm, there were very few false edges, and the edge information was relatively complete and clear.Figure 7
Comparison of the performance of the two algorithms. (a) Shows the original image; (b) shows the image processed by the traditional Canny edge detection algorithm; (c) shows the image processed by the improved Canny edge detection algorithm.
(a)(b)(c)


## 3.3. A Patient’s Lung Ultrasound Image before and after Treatment

Figure8 shows a patient’s lung ultrasound image before and after treatment. The patient was a male aged 58 years old. Before treatment (a), the ultrasound image showed diffuse B-line and there were obvious signs of pulmonary edema; that is, much water had accumulated in both lungs. After treatment (b), the diffuse B-line was reduced, B7-line was visible, and the pulmonary edema has been significantly improved.Figure 8
A patient’s lung ultrasound image before and after treatment: (a) before treatment; (b) after treatment.
(a)(b)


## 3.4. Comparison of General Information of the Two Groups of Patients

Figure9 shows the age and gender of the two groups of patients. The average ages of the control group and the experimental group were 53.56±8.11 years old and 54.25±9.34 years old, respectively. There were 28 and 31 male patients in the control and in the experimental group; there were 32 males and 29 females. There was no significant difference in age and gender between the two groups (P>0.05).Figure 9
Comparison of the age and gender of the two groups of patients.Figure10 shows the SOFA, CPIS, and LUS between the two groups. The SOFA scores of the control group and the experimental group were 10.46±2.21 points and 10.76±3.14 points, respectively; the CPIS were 4.65±0.22 points and 4.73±0.42 points; and the LUS were 16.01±3.31 points and 16.35±2.52 points, respectively. Obviously, the differences in SOFA, CPIS, and LUS between the two groups were not statistically significant (P>0.05).Figure 10
Comparison of SOFA, CPIS, and LUS between the two groups of patients.Figure11 shows the disease composition of the two groups of patients. It was noted that the control group had 17 cases of pancreatitis, 10 cases of lung infection, 14 cases of cerebrovascular disease, 6 cases of gastrointestinal hemorrhage, 3 cases of gynecology and obstetrics diseases, and 10 cases other diseases. In the experimental group, there were 18 cases of pancreatitis, 8 cases of lung infection, 15 cases of cerebrovascular disease, 4 cases of gastrointestinal hemorrhage, 3 cases of gynecology and obstetrics diseases, and 12 cases of other diseases. There was no statistically significant difference in disease composition between the two groups (P>0.05).Figure 11
Disease composition of the two groups of patients.


## 3.5. Comparison of Extubation Failure Rate, Comfort, and Dry Humidity Scores between the Two Groups

Figure12 showed the extubation failure rates of the two groups of patients. It was noted that the failure rates in the control group and the experimental group were 11.7% (14 cases) and 4.1% (5 cases), respectively, and the reintubation rates in the control group and the experimental group were 5% (6 cases) and 0.8% (1 case), respectively. There was no death in the control group and the experimental group. Obviously, the failure rate and reintubation rate in the experimental group were significantly lower than those in the control group, and the difference was statistically significant (P<0.05). There was no statistically significant difference in the proportion of deaths between the two groups (P>0.05).Figure 12
Extubation results in the two groups. Note:∗ indicated significant differences compared with the control group.Figure13 showed the comfort and dry humidity scores between the two groups. It was noted that the comfort scores of the control group and the experimental group were 4.25±0.26 points and 2.38±0.15 points, respectively, and the dry humidity scores were 4.94±0.78 points and 1.07±0.21 points, respectively. The comfort scores and dry humidity scores of the experimental group were lower than those of the control group, and the difference was statistically significant (P<0.05).Figure 13
Comparison of comfort and dry humidity scores between the two groups. Note:∗ indicated that the difference was statistically significant compared to the control group (P<0.05).


## 3.6. Comparison of Various Vital Indicators and Arterial Blood Gas Results during Treatment after Extubation in the Two Groups

Figure14 showed the average values of RR and SpO2 between the two groups. It was noted that at 4 h, 12 h, 32 h, and 48 h after extubation, the average RR of the experimental group was significantly lower than that of the control group, and the difference was statistically significant (P<0.05). At 4 h, 12 h, 32 h, and 48 h after extubation, the average value of SpO2 in the experimental group was significantly higher than that in the control group, and the difference was statistically significant (P<0.05).Figure 14
Comparison of the average values of RR and SpO2 between the two groups of patients.Figure15 showed the average values of HR and MAP between the two groups of patients. It was noted that at 4 h, 12 h, 32 h, and 48 h after extubation, the average HR of the experimental group was significantly lower than that of the control group, and the difference was statistically significant (P<0.05). At 4 h, 12 h, 32 h, and 48 h after extubation, the average MAP of the experimental group was significantly higher than that of the control group, and the difference was statistically significant (P<0.05).Figure 15
Comparison of the average values of HR and MAP between the two groups of patients.Figure16 showed the average values of PaO2 and PaCO2 between the two groups of patients. It was noted that at 4 h, 12 h, 32 h, and 48 h after extubation, the average value of PaO2 in the experimental group was significantly greater than that in the control group, and the difference was statistically significant (P<0.05). At 4 h, 12 h, 32 h, and 48 h after extubation, the average value of PaCO2 in the experimental group was significantly lower than that in the control group, and the difference was statistically significant (P<0.05).Figure 16
Comparison of the average values of PaO2 and PaCO2 between the two groups of patients.Figure17 shows the comparison of the average values of pH and HCO3- between the two groups of patients. It was noted that at 4 h, 12 h, 32 h, and 48 h after extubation, the average pH value of the experimental group was significantly greater than that of the control group, and the difference was statistically significant (P<0.05). At 4 h, 12 h, 32 h, and 48 h after extubation, the average value of HCO3- in the experimental group was significantly lower than that in the control group, and the difference was statistically significant (P<0.05).Figure 17
Comparison of the average values of pH and HCO3- between the two groups.


## 3.7. The Prognosis of the Two Groups of Patients One Month after Extubation

Figure18 shows the antibiotic use time between the two groups of patients. It was noted that the patients in the control group used antibiotics for 19.29±1.7 days, and the patients in the experimental group patients used antibiotics for 7.41±0.74 days. The time of using antibiotics in the experimental group was significantly shorter than that in the control group, and the difference was statistically significant (P<0.05).Figure 18
The antibiotic use time between the two groups of patients.Figure19 shows the hospital stays between the two groups. It was noted that the hospital stay of the control group was 27.49±2.22 days, and the hospital stay of the experimental group was 8.66±1.02 days. The hospital stay of the experimental group was significantly shorter than that in the control group, and the difference was statistically significant (P<0.05).Figure 19
The hospital stays between the two groups.


## 4. Discussion

When the condition of the critically ill patient is under control, the ventilator can be removed, but unsuitable extubation time can easily lead to lung injury in the patient, so it is particularly important to control the extubation time [16]. Lung ultrasound can assist doctors in determining the cause of ARDS after extubation [17]. The quality requirements for lung ultrasound images are extremely high, and the edge detection algorithm for noise reduction of lung ultrasound images then comes into being [18]. In the study, the traditional Canny edge detection algorithm was optimized first and then compared with the traditional Canny edge detection algorithm. The results showed that when the noise intensity was 0, 0.02, 0.15, 0.2, and 0.3, with the increase of noise intensity, the PSNR value and edge intensity value of the two algorithms showed a downward trend, but the PSNR value (31.3, 28.4, 26.3, 21.87, and 20.34) and edge intensity values (27.34, 24.36, 21.43, 18.48, and 17.89) of the optimized Canny algorithm were always significantly higher than the PSNR value (28.61, 25.13, 21.3, 17.29, and 15.2) and edge intensity values (18.56, 15.22, 11.56, 10.7, and 9.44) of the traditional Canny algorithm, and the difference was statistically significant (P<0.05).Next, the edge detection algorithm based on Canny was applied to process lung ultrasound images of 120 patients with critical lung injury, to compare the curative effects of the high-flow oxygen therapy and the traditional oxygen therapy. It was found that there was no death in both the control group and the experimental group. The failure rate of extubation (4.1%) and reintubation rate (0.8%) in the experimental group were significantly lower than the failure rate (11.7%) and reintubation rate (5%) in the control group, and the difference was statistically significant (P<0.05). The comfort level (2.38±0.15 points) and dry humidity score (1.07±0.21 points) of the experimental group were significantly lower than the comfort level (4.25±0.26 points) and dry humidity score (4.94±0.78 points) in the control group, and there were statistically significant differences (P<0.05). This was consistent with the results of Roca et al. [19], showing that the high-flow oxygen therapy can reduce the failure rate of extubation, strengthen patient comfort, and improve gas humidification.At 4 h, 12 h, 32 h, and 48 h after extubation, the average values of RR, HR, PaCO2, and HCO3- of the experimental group were significantly lower than those of the control group, and the difference was statistically significant (P<0.05). The average values of SpO2, MAP, PaO2, and pH of the experimental group were significantly higher than those of the control group, and the difference was statistically significant (P<0.05). The use time of antibiotics (7.41±0.74 days) and hospital stay (8.66±1.02 days) in the experimental group were significantly shorter than the use time of antibiotics (19.29±1.7 days) and hospital stay (27.49±2.22 days) in the control group, and the difference was statistically significant (P<0.05). Goh et al. took 145 patients as research subjects and found that during the treatment of High-Flow Nasal Cannula (HFNC), the failure of HFNC had a low correlation with ROX index (the ratio of pulse oxygen saturation/FIO2 to respiratory rate) and ROX-HR index (the ratio of ROX index to HR (beats/min)) recorded at 1 to 48 hours. This was precisely similar to our study [20], where lung ultrasound combined with high-flow oxygen therapy based on an edge detection algorithm stabilized respiratory function and the circulatory system and shortened the duration of antibiotic administration and hospital stay. The results of this study were almost consistent with the initial expectation, but there are some shortcomings. The sample size is small, which will reduce the power of the study. In the follow-up, an expanded sample size is necessary to strengthen the findings of the study.


## 5. Conclusion

In the study, the traditional Canny edge detection algorithm was optimized first by improving the median filter and incorporating the Otsu algorithm and the threshold iteration method to obtain the best threshold. Then, the optimized algorithm was compared with the traditional Canny edge detection algorithm and then applied to process the lung ultrasound images of 120 cases of critical lung injury, to compare the efficacy of high-flow oxygen therapy and the traditional oxygen therapy. The results showed that the ultrasound image based on the algorithm in this study had better results than the traditional Canny algorithm. Further, high-flow oxygen therapy can reduce the failure rate of extubation, strengthen patient comfort, improve the degree of gas humidification, stabilize the respiratory function and circulatory system, and shorten the antibiotic use time and hospital stay. However, some limitations in the study should be noted. The sample size is small, which will reduce the power of the study. In the follow-up, an expanded sample size is necessary to strengthen the findings of the study.



---

*Source: 3604012-2022-01-25.xml*