Fetal examination using ultrasound technology is a safe and evidence-based procedure in pregnancy care in high income countries    . The ultrasound examinations are performed by formally trained operators during pregnancy to calculate gestational age (GA), estimate date of delivery (EDD) and track fetal growth   . In this process, several fetal parameters which correlate to the development of the fetus are measured. These include the biparietal diameter (BPD)  , femur length (FL)  , abdominal circumference (AC)  and mean abdominal diameter (MAD)  . These parameters are subsequently used as input values in pregnancy charts to determine the development of the fetus    .
Fetal measurement using ultrasound is dependent on the experience of the observer and therefore prone to human errors such as intra- and inter-observer variances  . In order to make the fetal measurement process more user-friend- ly and accurate, different research groups have proposed various automatic and semi-automatic measurement techniques  -  . While most of these techniques are applicable to BPD and FL measurements, only a few of them are relevant for abdominal measurements. Wang et al. (2014)  and Yu et al. (2008)  presented two semi-automatic methods for measuring AC. In their approaches, a region of interest (ROI) in the image is manually defined by an ultrasound operator. In contrast, Carneiro et al. (2008)  proposed a fully automatic approach for segmenting and measuring the fetal abdominal section. This approach requires a huge data set of expert annotated ultrasound images, which are used to train a classifier that will subsequently perform the measurement of new cases.
It has been demonstrated that the adoption of ultrasound in low- and middle-income countries (LMIC) will be beneficial in reducing fetal and neonatal mortality rates  . In order to facilitate the adoption of ultrasound technology in LMIC, our research team is developing a portable, affordable and robust ultrasound machine with a simplified user interface that is implemented on a tablet device (the Umoja scanner) (Figure 1)  . This device is aimed to be used
Figure 1. The Umoja ultrasound scanner prototype. (a) A midwife measuring the mean abdominal diameter (MAD); (b) A screenshot of the user interface (UI) of the Umoja scanner. The yellow line with red circles represents the measurement calipers. The arrows depict the typical landmarks present in the abdominal cross-section.
by trained ultrasound operators and midwives trained, or undergoing training, in ultrasound in LMIC. As a follow-up of our prior work   on automatizing BPD, FL and fetal abdominal measurements, the aim of this study is to develop a fully automatic method for detecting and measuring the fetal abdominal section in a B-mode ultrasound image, and for measuring the MAD or AC. The method is designed to be run on a low cost, easy-to-use portable ultrasound machine suited for use in LMIC. A secondary aim is to investigate whether a semi-automatic mode of manual identification of the location of the abdomen in the ultrasound image could further improve the overall success rate of the method.
2. Materials and Methods
The research data set contained 401 brightness mode (B-mode) ultrasound images with the correct cross-section of the fetal abdomen. The images were randomly selected from a database comprising data collected during routine ultrasound examinations at the National Center for Fetal Medicine, St. Olavs University Hospital, Norway, by midwives formally trained in ultrasound. Prior to the ultrasound scan, informed consent to use their images for additional analysis was obtained from the pregnant mothers. The research was approved by the local ethics committee (No. 2016/1173). The GA range of the fetuses was 14 to 41 weeks. Five different ultrasound machines were used during the image acquisition: Voluson E8 (GE Medical Systems, Zipf, Austria), Voluson E6 (GE Medical Systems, Zipf, Austria), Voluson 730 (GE Medical Systems, Zipf, Austria), Acuson Antares Premium Edition (Siemens Medical Solutions, Mountain View, CA, USA), and HI VISION Preirus EUB-8500 (Hitachi Medical Corporation, Tokyo, Japan).
The midwives measured MAD manually from the 401 images, which were considered as reference MAD measurements and compared against the MAD measurements automatically calculated by the proposed method. To derive the MAD, the mean of two perpendicular diameters―anterior posterior abdominal diameter (APAD) and abdominal transversal diameter (ATD)―was calculated. The measuring plane for MAD, as described by Eik-Nes et al. (1982)  , was orthogonally adjusted to the long axis of the fetus and passed through the entrance of the umbilical vein in the portal sinus. On commercial systems in different countries, AC is derived by aligning a circle to the fetal abdomen, but the calculation of AC still is based on the mean of two diameters perpendicular to each other. Thus the reference AC was computed from the reference MAD measurements by Equation (1)  and compared with the corresponding automatic AC measurements:
The descriptive statistics of the data set, based on the midwives’ measurements, are presented in Table 1.
From the research data set, 91 images were randomly selected and used to develop the automatic measurement method. The remaining 310 images were se-
Table 1. Descriptive statistics of research data set consists of 401 B-mode images.
Figure 2. Automatic fetal abdomen measurement flowchart.
lected to be used to validate the performance of the developed method. These images were stratified according to the GA of the fetuses to apply and validate the method separately for different gestational ages. There were 249 images where the fetal GA was between 14 and 30 weeks (MAD between 25 and 82 mm) and 61 images with GA between 30 and 41 weeks (MAD between 82 and 123 mm) in the validation set.
2.1. Technical Description
The automatic method consisted of two steps: fetal abdominal detection and fetal abdominal measurement. These steps are described in the following subsections. A flowchart of our method is presented in Figure 2.
2.2. Fetal Abdominal Detection
In the first step, the open source computer vision (OpenCV) version 2.4.9 library (Itseez, San Francisco, CA, USA) (http://opencv.org) was used to locate the fetal abdomen in a B-mode image through image processing. At the beginning, a region of interest (ROI) was automatically selected from the upper-middle part of the image (Figure 3(a)). The height and width of the ROI are equal to half of the height and width of the B-mode image. The mean value of the pixel intensity was calculated from the ROI to estimate the overall gain level of the image. A 3-by-3 kernel was used for Gaussian smoothing to remove noise from the image. Next, the edges between bright and dark regions in the image were identified by the Canny edge detector  . The upper threshold of the edge detector was set to 1.3* mean pixel intensity and the lower threshold was set to half of the upper threshold. The Cartesian coordinates of the edge pixels were recorded and the first-order Sobel derivative was used to calculate the image gradient along the X and Y axes  . Next, the circle Hough transform (CHT)  was used to detect the circular fetal abdomen using two different radii ranges. A small radius range between 12.5 and 41 mm was used in case of a 14 to 30-week-old fetus, whereas a large radius range between 41 and 69 mm was used in the case of a 30 to 41- week-old fetus. In CHT (Figure 3(b)), an edge pixel (the black circle) was assumed to be located on the abdominal boundary (the boundary of white circle)
Figure 3. Detection of fetal abdomen. (a) Region of interest (ROI) for intensity estimation; (b) Circle Hough transform (CHT) principle. The numbers of votes in the CHT accumulator are shown for each of the pixels situated along the gradient direction; (c) The center pixel is selected as the pixel with the highest number of votes from multiple edge pixels in the CHT accumulator; (d) White circle depicts the detection result that is used for initializing the active contour.
and its local gradient direction was considered. The coordinates of a new group of pixels―situated within the small or large radius range along the local gradient direction―were registered in a Hough accumulator plane. Each of the pixels in the new group received a vote from its corresponding edge pixel in the accumulator. As more edge pixels were considered, the number of votes for the pixel located at the center of the abdomen increased gradually (Figure 3(c)). The pixel with the highest number of votes in the accumulator was chosen as the center and its best supported distance from all other edge pixels was used as the radius to draw a circle that located the fetal abdomen (Figure 3(d)).
2.3. Fetal Abdominal Measurement
In the second step, the real-time contour tracking library (RCTL) (GE Vingmed Ultrasound, Horten, Norway)  was used to initialize a circular active contour model at the location of the fetal abdomen (Figure 4(a)). The RCTL is a cross- platform, closed-source commercial library. The approach proposed by Orderud (2010)  was employed, in which a Kalman-based tracker was used. The measurement vector for the Kalman filter was a set of edge detectors perpendicular to the model and equally spread along the contour, whereas the state vector consisted of a set of 12 control points defining the shape of a non-uniform rational basis spline (NURBS) curve depicting the abdomen. Along the circumference, 75 equally spread edge detection locations were defined.
As can be seen in Figure 4(a), the edge profile type may change significantly along the abdomen wall. None of the standard edge detectors would be able to locate the correct contour of the abdomen along its entire circumference.
Figure 4. Deformable active contour model adjustment by real-time contour tracking library (RCTL). (a) The initial state of the model at the location of the detected fetal abdomen; (b) The result of using only peak edge detection; (c) The result of using only step edge detection; (d) The result of using only spline edge fitting; (e) The final state of the model after 10 iterations when all three edge detectors are combined.
Therefore, a set of three edge detectors were fitted automatically at each position, the edge quality computed by each of them was measured as the absolute difference between the high and low plateaus in the edge profile and the best one was chosen as the edge location for the given position and passed along to the Kalman filter. The three edge detectors were: peak (Figure 4(b)), step (Figure 4(c)) and spline (Figure 4(d)). Assuming an edge profile of K samples in the image I, the edge detectors returning the edge location index can be defined as follows:
for the peak edge having a peak profile of samples (considered as 25% of the edge profile samples in our case). The step edge is defined as:
And finally, the spline step edge location was found by fitting a second degree polynomial to the edge intensity profile as defined in Dikici et al.  . For the step detectors, the edge quality was considered as the absolute difference between the two plateaus along the profile separated by the edge location:
whereas for the peak edge, the quality was computed as the absolute difference between the peak plateau and the left and right valleys for a given peak width samples:
After 10 automatic iterations, the model was considered to be converged along the abdominal boundary (Figure 4(e)). The mean of the converged model’s major and minor axes was considered as MAD. The AC was calculated using Equation (1).
For the cases where the fetal abdominal detection failed, it was tested to what extent the active contour model fitting could be completed semi-automatically, by indicating the correct position of the abdomen in the image using a touch gesture at the center of the fetal abdomen.
In the validation set, it was possible to measure MAD or AC in 273 out of 310 images (88.1%) by using the automatic method. The most common patterns of measurement failures and manual correction of measurement overestimation are shown in Figure 5. The success rates for the different ultrasound machines
Figure 5. Examples of failed cases for the automatic method. (a) A false detection of fetal abdomen due to the presence of another circular artifact; (b) Incorrect detection of fetal abdomen due to insufficient abdominal edge information; (c) Abdominal transversal diameter (ATD) measurement overestimation proposed by the automatic method; (d) Manual correction of the overestimation by an ultrasound user.
Table 2. Success rates of automatic method in cases of different ultrasound machines used in validation set.
are presented in Table 2. The correlation between the reference measurements and automatic measurements is shown in Figure 6. The Pearson correlation coefficient (r) was calculated using Equation (6).
where A and B are random variables, N is the number of observations, and are the mean and standard deviation of A, and and are the mean and standard deviation of B, respectively. The correlation coefficient was 0.95 and the regression line was y = x + 2. The intraclass correlation coefficient (ICC) between reference and automatic measurements was 0.976 (95% confidence interval (CI); 0.969 - 0.981). The mean errors and error ranges with 95% CI for MAD and AC are presented in millimeter (mm) and percentage scales in Table 3. The mean error (%) and error range with 95% CI (%) are similar for both MAD and AC since AC is proportional to MAD with the factor π (Equation (1)).
Figure 6. The correlation plot between reference and automatic MAD measurements in the validation set.
Table 3. Comparison between manual and automatic MAD and AC measurements in validation set (CI = confidence interval).
Figure 7. The error versus reference plots between reference and automatic measurements in validation set. (a) MAD (GA between 14 - 30 weeks); (b) MAD (GA between 30 - 41 weeks).
In the remaining 37 images where the automatic method did not succeed, 24 failures could be corrected in the semi-automatic mode, where the user manually identified the center of the abdomen (Figure 8). The addition of the semi-au- tomatic mode improved the overall success rate to 95.8%.
The Umoja scanner prototype was used to test the implementation of the automatic method. This scanner prototype visualized the ultrasound data on a Samsung P600 tablet (Samsung Electronics, Suwon, South Korea) streamed from a Vivid q ultrasound scanner (GE Medical Systems, Tirat Carmel, Israel). The mean execution time ± SD of the automatic method for all the images in the validation set on a Nexus 5X (LG Electronics, Seoul, South Korea) mobile device was 0.40 ± 0.09 s; on a Nexus 10 (Samsung Electronics, Suwon, South Korea) low performance tablet device, 0.30 ± 0.10 s; on a Samsung P600 (Samsung Electronics, Suwon, South Korea) high performance tablet device, 0.27 ± 0.07 s.
In this study, a technique for automatic detection and measurement of the fetal abdomen on a portable ultrasound device with limited hardware configuration was developed. The measurement success rate was 88.1%.The high ICC (0.976) implied strong agreement and low variability between reference and automatic measurements. Furthermore, a relatively stronger correlation between reference
Table 4. Abdominal circumference (AC) measurement comparison between the developed method and another automatic state-of-the-art method (r = correlation coefficient, CI = confidence interval, *derived from the available data).
Figure 8. Four situations where the automatic method failed and an accurate segmentation was achieved semi-automatically by indicating the correct location of the abdomen in the ultrasound image.
and automatic measurements was observed for the fetuses between 14 and 30 weeks of GA than the fetuses between 30 and 41 weeks of GA (Figure 6).
For most cases, it was possible to detect the fetal abdomen with an inner shadow using the CHT. The method was unsuccessful in 11.9% of the cases due to the presence of bright circular structures other than the abdomen (Figure 5(a)) and insufficient abdominal edge information (Figure 5(b)). In these cases, the manual adjustment (Figure 5(c) & Figure 5(d)) and the semi-automatic (Figure 8) features proved useful in correcting the measurement errors. By using the automatic and semi-automatic mode together, the measurement success rate could be improved up to 95.8%. High variance and error rates were observed for the fetuses with GA between 30 and 41 weeks (Figure 6) (Figure 7(b)). The main reasons were the presence of a large non-echogenic fetal stomach, ultrasound shadow within the abdomen, absence of complete abdominal boundary and the attachment of the abdomen to placenta or other artifacts present in B-mode images. In contrast, the 14 to 30-week-old fetuses had distinct, clear abdominal edges, causing strong correlation (Figure 6) and low error rates within this GA range (Table 3) (Figure 7(a)).
The lack of standardization of acquisition settings causes inter-observer errors (i.e. observers may obtain different results on the same still-image) for the manual measurements  . Health care workers trained in various parts of the world may not use the same zoom and gain settings. Gain standardization among operators is difficult and inexperienced users will not spend a lot of time adjusting the gain. A method that can compensate for such gain differences automatically is therefore valuable. In our automatic method, lower or higher gain setting was compensated for during the post image processing steps to ensure consistent MAD or AC measurements. Initially, the image gain was estimated from the ROI located at the upper-middle part of the ultrasound image. In the later steps, the image processing parameters were adjusted on the basis of this gain estimation to produce consistent abdominal measurements.
In addition, ultrasound images acquired from different ultrasound machines have different image quality. Therefore, the research data set was prepared with the images acquired from five different ultrasound machines from three different vendors. Images from the newer machines from the same vendor had higher success rates than those of the older machines (Table 2). This is assumed to be because of the better image quality offered by the newer machines.
The CHT implementation in OpenCV uses a faster 2D accumulator instead of a computationally expensive 3D accumulator  . The average execution time of the method was longer on the mobile phone device than on the tablet devices. The execution time tends to decrease with the processing power of the same device category.
The results of the method were comparable to the results of the method proposed by Carneiro et al. (2008)  which was implemented on a computer equipped with 2.4 GHz CPU and 2 GB RAM (Table 4). To our knowledge, Carneiro’s method is the only other fully automatic abdomen measurement technique presented in the literature. Even when tested on portable devices, our method was able to perform faster with a lower mean error than that of the method of Carneiro. In addition, our method does not require a big data set of images for training a classifier that the Carneiro method requires. The error ranges of these automatic methods differ greatly from the manual inter-observer variability (−21.7 to 23.7 mm) reported by Perni et al. (2004)  , which was calculated from 122 abdominal images acquired with a Acuson 128 XP (Acuson Inc., Mountain View, CA, USA) ultrasound machine.
During an ultrasound scan in late pregnancy, the contour of a fetal abdominal cross section is often changed from circular to an elliptic-like shape due to a larger fetus and a decrease in the amount of amniotic fluid as the pregnancy advances. By fitting a deformable active contour model via RCTL and by using three different types of edge detectors to determine the correct abdominal edge, it was possible to measure MAD or AC even in images containing a deformed fetal abdomen.
Popular fetal dating formulas   can also be used with the method to derive GA and EDD from AC measurement. One of the dating formulas  ―which requires MAD or AC along with BPD or FL measurement to estimate fetal growth―was implemented on the Umoja scanner. Finally, the Open CV and RCTL libraries used to develop the method are cross-platform libraries. Therefore, with few changes, it is possible to use this method in different ultrasound machines.
This paper presents an automatic method for segmenting the fetal abdomen which is suitable to be implemented on portable, low-cost ultrasound machines to measure MAD or AC. The results of the proposed automatic method were more precise for the 14 to 30-week-old fetuses than for 30 to 41-week-old fetuses. The method showed a number of improvements in results when compared to the other fully automatic state-of-the-art method  . Additionally, the semi-automatic mode allows the user to correct the measurement errors before final approval of results. Therefore, the method has the potential to be a useful tool during fetal examination on portable and conventional ultrasound machines in LMIC.
The research was a part of “Umoja―ultrasound for midwives in rural areas” project which was funded by Central Norway Regional Authority (Helse Midt- Norge RHF). We thank Nancy Lea Eik-Nes for valuable comments to improve the manuscript.