{'fraction_non_alphanumeric': 0.03228290161139526, 'fraction_numerical': 0.02172358796678216, 'mean_word_length': 4.454109178164367, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An error correction scheme for improved air-tissue boundary in real-time MRI video for speech production

The best performance in Air-tissue boundary (ATB) segmentation of real-time Magnetic Resonance Imaging (rtMRI) videos in speech production is known to be achieved by a 3-dimensional convolutional neural network (3D-CNN) model. However, the evaluation of this model, as well as other ATB segmentation techniques reported in the literature, is done using Dynamic Time Warping (DTW) distance between the entire original and predicted contours. Such an evaluation measure may not capture local errors in the predicted contour. Careful analysis of predicted contours reveals errors in regions like the velum part of contour1 (ATB comprising of upper lip, hard palate, and velum) and tongue base section of contour2 (ATB covering jawline, lower lip, tongue base, and epiglottis), which are not captured in a global evaluation metric like DTW distance. In this work, we automatically detect such errors and propose a correction scheme for the same. We also propose two new evaluation metrics for ATB segmentation separately in contour1 and contour2 to explicitly capture two types of errors in these contours. The proposed detection and correction strategies result in an improvement of these two evaluation metrics by 61.8% and 61.4% for contour1 and by 67.8% and 28.4% for contour2. Traditional DTW distance, on the other hand, improves by 44.6% for contour1 and 4.0% for contour2.


INTRODUCTION
Real-time Magnetic Resonance Imaging (rtMRI) is a tool used exhaustively in speech science and linguistics to understand the speech production process in depth across languages and health conditions [1]. rtMRI has two advantages over other methods like X-ray [2], Electromagnetic articulography [3] and Ultrasound [4] -it is safe and non-invasive, and it captures a complete picture of the vocal tract including pharyngeal structures [5]. A common step before using these rtMRI videos is obtaining the Air-Tissue Boundary (ATB) segmentation in every frame. Many works have used ATBs for different applications like text-to-speech synthesis [6], speaker verification [7], visual augmentation for synthesized articulatory videos [8], and analysis of vocal tract movement [9,10]. The accurate estimation of ATBs of the upper airway of the vocal tract is also essential for many other speech processing applications [11,12]. Hence, it is necessary to have an accurate and proper ATB segmentation in every frame of the rtMRI videos.
Many works in the past have addressed the problem of ATB segmentation in rtMRI frames using several supervised [13,14] and unsupervised approaches [15]. Although the supervised algorithms have been shown to provide accurate ATBs in the seen subject condition, a major challenge is that there is high variability in the mor-phology of different subjects and it is difficult to generalize ATBs in unseen subject conditions. The best performance in ATB segmentation is observed in the work by Renuka et al. [14], where the authors tackle this problem by using a 3-dimensional deep convolutional neural network (3D-CNN) for ATB segmentation. Although the temporal continuity criterion of 3D-CNN ensures that the ATBs do not vary drastically in successive frames of a rtMRI video, in the event that there is an error in one frame, it also propagates to surrounding frames.   Figure 1 illustrates the three manually annotated contours, con-tour1 (C1), contour2 (C2) and contour3 (C3) in an rtMRI frame. We have observed that errors in contour1 can be categorized into two classes as shown in Figure 2 (e and f) -incomplete contours (where velum (VEL) portion is missing) and frame errors where the entire C1 has defects. For contour2, we again observe two types of errors: error in the tongue base (TB) region which is illustrated in Figure 2 (g), where TB dip is not predicted properly and frame error, where entire frame is wrongly predicted (Figure 2 (h)). The TB dip errors occur mainly because of the low number of pixels with low intensity present in the dip region. In cases like these, a global measure like overall DTW distance between annotation and prediction, which has been used as an evaluation metric in previous works, does not reflect which region has what kind of error. So it is essential to conduct a region specific analysis and define evaluation metrics that focus on defects in particular regions like VEL or TB.
We have analyzed the different types of errors in the ATBs in a set of 100 videos in a subjective manner. We have proposed methods to detect and correct each of these errors. Detection methods for C1 and C2 are based on positions of VEL and TB points respectively; and correction methods focus on improving the quality of contour in the region surrounding these points. Post correction, we have developed region specific metrics for the evaluation of the quality of ATB. In order to evaluate the accuracy of the predicted C2 in the region around TB, the Euclidean distance (denoted by ETB) between annotated and predicted TBs, and regional DTW distance in the TB dip area (TBrDTW) are proposed as metrics. For C1, as the problem most often lies in the VEL region, we propose Euclidean distance (denoted by EVEL) between model predicted and ground truth VEL points, and regional DTW distance in the VEL section (VELrDTW) as the evaluation metrics. It is seen that using regional metrics helps in identifying specific problems in frames which might not be possible using global measures like DTW distance which evaluate the entire contour as a whole. For C1, after correction, the average EVEL reduces from 8.10 to 3.09 pixels, and the mean VELrDTW across frames goes down from 4.12 to 1.59 pixels. Overall DTW distance also decreases from 2.04 to 1.13 pixels. For the case of C2, overall DTW distance goes down slightly (2.05 to 1.98 pixels) postcorrection, but ETB reduces substantially from 11.31 to 3.64 pixels and TBrDTW from 4.26 to 3.05 pixels.
For this work, 3D-CNN is trained on 90 videos (9 videos from each of the 10 subjects) using the model described in [14] and the ATBs are predicted on a set of 100 videos (10 videos from each subject) not seen in training. There are 33 unique sentences in this randomly chosen list of 100 videos. For these 100 videos (6738 frames), the ATBs are manually annotated using a MATLAB Graphical User Interface [18]. The manual annotation is done for three ATBs -contour1 (C1), contour2 (C2), and contour3 (C3), as well as five points that indicate upper lip (UL), lower lip (LL), tongue base (TB), velum (VEL) and glottis begin (GLTB) as illustrated in Figure  1. C1 is a closed contour that starts from UL, goes through the hard palate till VEL and goes around the fixed nasal tract. C2 is a closed contour that covers the jawline, LL, tongue blade and extends below the epiglottis. The C3 contour marks the pharyngeal wall.

ERROR ANALYSIS
A graphical user interface using MATLAB is developed to observe both annotation and prediction in each frame. If prediction deviates a lot in any region from the annotation, the frame is declared erroneous and the contour where error is observed is noted (C1 or C2). Predicted C3 is not found to have any observable defects. The observations are then cross-checked by an unbiased viewer. Erroneous frames selected based on subjective criteria are considered as ground truth for error classification.
In Figure 3, for each video for all subjects, two line-plots are constructed. The vertical axis shows the video (sentence) ID and horizontal axis shows frame index. The first line plot illustrates correct frames in blue and C1 errors in red. The second line plot shows correct in blue and C2 error frames in green. It is observed that C2 (especially near TB) errors occur repeatedly throughout the video. C1 errors, on the other hand, are mostly observed at the end of videos. This may be due to the end frame padding done in 3D-CNN model during prediction.

Contour 1
In a frame, if the VEL part of the contour is not predicted properly or there is noticeable deviation of entire contour from annotated contour or C1 is incomplete, then the frame is declared to have C1 error. As per the subjective analysis illustrated in Figure 3, 207 frames (3.07 %) have C1 error. In both types of C1 error illustrated in Figure  2, the VEL point is found to be incorrect. Analysis of these frames also shows that over all subjects, mean ± standard deviation (std) DTW distance between annotated C1 and predicted C1 for the frames declared erroneous subjectively is 2.15 ± 1.48 pixels compared to 1.11 ± 0.18 pixels for frames declared correct (Figure 4 (a)). But the range of DTW distance of the erroneous and correct frames overlap.
(a) (b) Fig. 4. DTW distance analysis plots for C1 (a) and C2 (b) over all frames, where red bubbles represent erroneous frames and blue are correct ones

Contour 2
The subjective analysis shows that in about 325 frames (4.82 %), the predicted contour2 has shapes very different from expected shape (frame error) or has very low number of points. Moreover, in about 65.73 % of the frames, the TB dip region is not predicted properly.
The DTW distance analysis shown in Figure 4 (b) for C2 illustrates that erroneous and correct frames have highly overlapping range of DTW distance values. Mean ± std DTW distance for erroneous frames is 3.61 ± 3.49 pixels and for correct frames is 1.92 ± 1.89 pixels. There is high variability in the global DTW distance value and it does not reflect C2, especially TB dip, errors.

IMPROVED ATB USING PROPOSED ERROR CORRECTION
The proposed evaluation metric, error detection and correction methods undertaken in this work are summarized in Table 1. The methods are explained in detail in the following subsections.

Experimental Setup
The experiments are carried out in a 4 fold cross-validation set-up where, in each fold, 3 randomly chosen subjects are taken for validation and the rest of the 7 subjects for test. The results are reported on the test set. We predict the VEL point by finding the dip in the row index of the contour in the region around velum in C1 and also find the TB in C2 by locating the dip in the region between LL and uppermost point on tongue. 4.1.1. Evaluation metric F-score [19] is used as an evaluation metric for error detection methods because of data imbalance in the set of videos considered, where only 3.07% frames have C1 errors. For error correction of C1, VELrDTW distance is computed around the VEL region, taking 30% of total number of points of C1 from the pharyngeal wall end. TBrDTW for C2 is found by calculating the DTW distance between annotated and predicted C2 in the region between LL and uppermost point on the tongue. Further, for C1, the Euclidean distance between predicted and ground truth VEL position (EVEL) is used for assessment. Similarly for C2, the Euclidean distance between the predicted and ground truth TB position (ETB) is also used as an evaluation metric. These metrics capture region specific errors observed during analysis. Additionally, global DTW is reported for both contours.

Error Detection
We propose different methods of error detection for C1 based on relative position of VEL point. Similarly, error detection is done for C2 on the basis of position of TB and number of points. The hyperparameters used by the methods in each fold are selected based on F-score achieved on validation set.

Deviation from mean velum
For each video, Euclidean distance between velum point in a frame and mean velum point across the video is used as a measure to detect erroneous frame. This method is based on the observation in Figure 3 that the C1 errors occur at the end of videos in most cases and are limited in number in a video. The variation in velum point coordinates across the rest of the video is low. Any frame with a significantly large distance between velum point and the mean velum point is likely to have a C1 error. A threshold is applied on this distance to classify the frame as erroneous. The thresholds selected based on validation data are 3.5, 4, 4, 4 pixels for four folds. F-score of 0.86 (± 0.01) is achieved on the test set.

Deviation of velum from pharyngeal wall
If a video has many C1 errors then the mean velum can be affected by a cluster of erroneous velum points and can itself be wrong. Hence, instead of using mean velum point as reference, in this method we use the nearest point on C3 from the velum. This nearest point is found out and fixed for each subject from the manual annotations used while training the 3D-CNN model. We threshold the distance between this nearest point on C3 and predicted VEL to detect erroneous frames. The thresholds selected based on validation data are 8,8,8,7.5 pixels for four folds. This method achieves an F-score of 0.85 (± 0.02) on the test set.

Combined
In this method a frame is declared erroneous if it satisfies either one of the two aforementioned error criteria. The combined method achieves an F-score of 0.86 (± 0.02) on the test set.

Number of points
For the small number of frames (4.82%) where the predictions are very poor, it is observed that number of points in the predicted C2 is low. So, we find the average number of points in C2 over all videos in validation set and threshold the number of points at 65% of it to find erroneous frames. This method of thresholding gives a detection F-score of 0.941 (± 0.02) on test set. 4.2.2.2 LL to TB slope TB error occurs when the groove between the lower lip and tongue is not predicted in C2. In such cases, the slope of the line joining TB and lower lip is observed to be low. We threshold this slope to detect the erroneous frames. The thresholds (0.7, 0.7, 0.8, 1) are selected based on validation data for each of the four folds. Using this method, an F-score of 0.85 (± 0.02) is achieved on the test set.

LL to TB distance
When a TB error is observed, it is seen that the distance from the lower lip to TB is short. A threshold on this distance is selected based on F-score achieved on validation data and any frame with distance higher than it are declared erroneous. The thresholds selected are 8, 7, 10, and 10 pixels for four folds. The F-score on the test set is 0.88 (± 0.02) for this method. The distance thresholding performs better than slope.

Combined
In this method a frame is declared erroneous if it satisfies either one of the three aforementioned error criteria. F-score of 0.90 (± 0.02) is achieved on the test set.

Error Correction
The error correction methods proposed for contour 1 and contour 2 are detailed in the following subsection.

Contour 1
For all erroneous frames detected using the combined method mentioned in section 4.2.1.3, C1 is generated by linear interpolation using neighbouring frame's contours as the frame to frame variance is low because of temporal continuity. In case of the incomplete C1 errors, it is observed through section wise DTW distance analysis that the part of the predicted contour is actually correct and the rest is missing. So, for them, we find the end point of original contour on interpolated one and append the rest of the interpolated contour to the existing contour so that the upper lip part of existing C1 is not affected by interpolation. For the frame errors, the interpolated contour is taken completely.
The EVEL decreases by 61.8% after correction as shown in Table 2, whereas VELrDTW improves by 61.4% for these frames. We also observe that for all frames, the DTW distance over entire C1 improves by 44.6% after correction, which is not as significant as the change in VELrDTW. An example of a frame with incomplete C1 error before and after correction is illustrated in Figure 5 (b) and (c) respectively.

Contour 2
For all frame errors detected in section 4.2.2.1, we generate the entire contour by linear interpolation using neighbouring frame contours. Next, these frames along with the erroneous frames detected in section 4.2.2.4 are considered for C2 TB correction. To correct C2 near TB, we first correct the position of TB. The TB is observed to be within a 15 × 20 patch of the frame in the low intensity air cavity region between lip and tongue. We apply Ostu thresholding [20] to this 15 × 20 patch in the rtMRI video frame to find darker pixels that lie within C2. The result of Ostu thresholding is a binary image, where class-1 corresponds to tissue and class-0 is for the air cavity. The lowest point in the class-0 region of the binary image within C2 is selected and marked as corrected TB. Next, we adjust C2 in the vicinity of the 3D-CNN predicted TB location by warping the existing contour. We find the shift in TB point from prediction to correction and map the shift of the neighbouring points accordingly in a gradient based fashion to find corrected C2 in TB dip region.
The evaluation metrics -ETB and TBrDTW, improve by 67.8% and 28.4%, respectively, after correction as shown in Table 2. The global DTW distance, on the other hand, does not show any significant improvement. A frame with C2 TB error is shown before and after correction in Figure 5 (e) and (f) respectively.

CONCLUSION
In this work, we propose an error correction scheme for improving predicted air tissue boundaries (ATBs) in real time MRI video. Careful analysis reveals different types of errors present in the results of 3D-CNN model like VEL or TB region defects. Automatic methods are proposed to detect and correct such observed errors. Further, region specific metrics are proposed for evaluation of the quality of the predicted and corrected contours. The proposed methods show observable refinement in air tissue boundaries, which is reflected in the improvement in proposed metrics. In our future work, we will explore Active Appearance Models (AAM) [21] for correction of regional errors like TB or VEL. Further, we will try to explore robust neural network approaches using region specific loss functions, which target specific problems in particular contour regions. We will also investigate the performance of these corrected ATBs in different applications as mentioned in [6,7,9,10].