Automatic Detection of Fetal Head and Fetal Measurement on Birth Time Estimation

Fetal biometry in ultrasound (USG) is a routine activity that can be used to determine the gestational age of a baby. Accuracy is needed when measurements are made. However, the low quality of ultrasound images and manual measurement that takes a long time and give rise to many different variations of values from each doctor or sonographer. Thus the measurement results obtained are less accurate. From these problems, the development of automatic detection and measurement of the fetal head is needed. One of them is by using a learning-based system method that will carry out the training process using Haar training to get features. The training process with the Haar method uses positive image data as objects and negative images as background. Haar training data that have been obtained, then used to detect fetal head objects automatically. Detection results are then processed to separate the object from the background image, which is then carried out the segmentation process to obtain the fetal head and fetal femur. Then the segmentation method used is Integral Projection to get the fetal head circumference and Find Contour to get the fetal femur. The parameters used to determine gestational ages are biparietal diameter and femur length. Based on experiments that have been done, obtained an accuracy rate of 97.77% using the proposed method for estimating gestational age automatically. Measurements are obtained by comparing the results of the doctor's diagnosis using manual measurements on an ultrasound machine. Keywords— ultrasound; fetal biometry; learning-based; biparietal diameter; femur length; integral projection.


I. INTRODUCTION
Ultrasound examination (ultrasonography) is a routine process performed by every woman during pregnancy. Ultrasound is used to determine the condition of the fetus by displaying the limbs of the baby in a medical examination. From the images taken to be able to analyze, which later provides some initial information from the fetus in the womb. Over the age of 3 months or above, the 13th week of pregnancy is the most appropriate time where fetal biometry is performed, as it is considered at this age that fetuses are easier to measure caused members the baby's body is almost complete.
Fetal biometry alone is a measurement carried out on a fetal body member by looking at the results of an ultrasound examination. In the medical world, there are several parameters used in fetal biometry, namely rown-rum length, biparietal diameter, head circumference, femur length, and abdominal circumference [1]. Biometry is an important activity, where information from measurement results can be identified about the health of the fetus. One of the results of the measurement is knowing the gestational age to find out the check-up schedule that must be done both to the doctor and the midwife, thus that it is expected that the pregnancy is carried out becomes healthy and produces a quality baby [2].
The results of measurement and retrieval of ultrasound data will be susceptible to errors because it is very dependent on the observation of doctors or operators [3]. Thus, each annexes will have different analytical values. Calculation of gestational age based on biparietal diameter above pregnancy weeks 14 and above is quite accurate. To increase the level of accuracy, two parameters are needed for comparison. The second parameter used is femur length, which has a ratio that is quite reliable and stronger than other settings. However, in clinical practice, you able to face situations where biparietal diameter and femur length measurements are still using conventional methods that require a high level of concentration in taking measurements. The other limitation is the poor quality of ultrasound images, making it difficult to measure the fetal head and fetal femur. The ultrasound image needs to be improved being it contains noise and has unbalanced brightness that can interfere with the inspection.
Several studies have carried out image processing to eliminate noise, detect and measure the fetus; in previous research, Manyu et al. [4] proposed a new method for reducing the noise of the image. The methods used in this study are Gaussian Filters and Non-Local Filters. The researcher analyzes the differences between the two proposed methods and compares and evaluates the results. As a result, the proposed method for the process of reducing noise is better than the Gaussian Filter and Non-Local Means Filter methods.
Dong Ni et al. [5] developed a system for detecting fetal heads for measurement of fetal head circumference from ultrasonic images. Initially, the method used was the Adaboost learning method to train feature classifications such as Haar. Then they proposed to use prior knowledge and online image parameters to guide sliding windows based on head detection from ultrasound images. This research just uses the head for a parameter. Detecting and measuring the length of the fetal femur can be used on tablet devices to assist health workers during the scanning process [6]. Hough Transform is applied to the detected location of the femur to find a straight line with the highest number of sounds to measure the length of the fetal femur. The proposed automatic method shows a strong correlation and a range of comparable errors between automatic and manual femur length measurements. However, this research just still uses one parameter, and the result is not efficient because not to give valuable information about a baby. Therefore, this study proposes a method for automatically detecting fetuses and calculating biparietal diameter and femur length with integral projection [7] to determine gestational age. Thus, the proposed method can reduce errors during the segmentation process. Therefore, in the fetal ultrasound image, several organs can be seen and take measurement error.

II. MATERIALS AND METHODS
This study focuses on the detection of the fetus to measure the biparietal diameter and femur length; the measurement results are used to estimate the age of the fetus. This method consists of, detection of the fetus with the Haar Classifier method, image preprocessing, segmentation, and measurement. Fig. 1 shows the system diagram that has been developed to implement the objectives of this study.

A. Data Preparation
Ultrasound image files are obtained from the results of examinations in pregnant patients from two hospitals, Husada Utama Hospital, and the clinic belongs to Dr. Harris Armandhi Sp.OG. The system uses a total of 655 image data for fetal heads and 30 femur fetuses with gestational age between 14 weeks to 26 weeks with normal and not twins. There are 200 images of fetal heads functioned as training data, and ten other images functioned as testing data. The training data is divided into two types of images, positive and negative. The positive image is the object to be detected in this case, what is meant is the fetal head, while the negative image contains objects that are not part of the fetal head that is on the ultrasound image. Fig. 2 shows an example of some pictures of the fetal head of the Main Husada Hospital.

B. Training Sample Image
Haar is used to detecting fetal head objects; positive and negative images that have been obtained are then processed to train all images with Haar Classifier. Haar Classifier has been widely used for the job of detecting an object [8] [9]. The Haar method has advantages where computation is very fast by summarizing the number of white pixels and pixel colors [10].
Many patterns can be used on Haar methods to produce pattern features. The following patterns in Fig. 3 are commonly used to detect objects. Each pixel in an image has a value from 0-255. In the Haar pattern feature, there are black and white areas. This pattern is used to detect edges in the fetal head image, which can be illustrated in Fig. 4 Where ii (x, y) is the result of the integral image, and i (x', y') is the pixel value in the original image. The use of integral images can be easily calculated through the application of 4 array references. A cascade chain stage classifier is used to detect objects. Cascade classifier [11] is a method used to combine complex classifiers in a multilevel structure that able to increase the speed of object detection by focusing on the area of the image that has a chance. Based on Fig 5, it is assumed that the first classifier will evaluate the sub-window; if it succeeds in passing, it will go to the second classifier, the third to the nth classifier, and conclude as the object detected. However, if it cannot pass the evaluation of the classifier, it can be said that it is not the object detected.

C. Pre-processing
Poor ultrasound image quality makes segmentation difficult. Therefore, preprocessing is needed to improve the image before segmentation. In this work, the authors develop Gaussian filters, morphology operation, and Canny edge detection.

1) Gaussian Filter:
Gaussian filtering or gaussian blur [12] is one of the smooth filters to prevent false edge detection in image processing. The Gaussian filter also works to reduce speckle noise on the image. Ultrasound image has more noise than other medical images like MRI. Therefore, the image should be clean before doing edge detection. The Gaussian filter works as a low pass filter because it will decompress the high-frequency component on the image. Gaussian Filter can be obtained from multiply between the origin of pixel value with kernel value, as shown in Fig. 7. The σ symbol is a standard deviation of the distribution.
Kernel size must be increased when the standard deviation is increased to maintain the nature of the filter. The more kernel value is given, the image becomes smoother than the original. The result of using this method to the fetal head and femur image is presented in Fig. 8. 2) Morphology Operation: Morphology operation [13] is used as a tool for extracting image components that are useful in the representation and description of regional shapes. There are several types of operations on morphology, but the operations used in this study are top-hat transformations. The top hat gives results by reducing the image through a combination of opening and closing techniques. The main technique in this transformation is to eliminate objects that are not following the main object by using the structural elements in the opening and closing operations. The lighting of objects in the dark background will be improved by using this transformation. Equations in morphological operations with the top hat transformation method can be expressed in equation 4.
Structuring Element used in morphology operation here is an ellipse with a morphology size of 1. The maximum kernel used here is 10. The results of applying this method are presented in Fig. 9. After the morphology operation process, the results of the process further clarify the object of the image (fetal head and femur) to be examined. In contrast, the other objects are increasingly blurred. This result will make it easier for the next process.
3) Canny Edge Detection: in the research [14], an edge is a change in the value of the intensity of the degree of gray fast/sudden (large) in a short distance. Edge detection works by producing an outline on the object as a sign to represent the detailed form of the object in the image that has undergone a blurring process that occurs during the image acquisition process. If a point (x, y) has a high difference from neighbors, point (x, y) can be said to be the edge of the object. Fig. 10 shows the results of using the canny method that can detect edges of the fetal head and fetal femur. The steps to perform the Canny Edge Detection process are as follows: • Due to a smoothing process to the image with image convolution and Gaussian filter g(x, y). For digital image processing, zero-mean Gaussian two variables are expressed by equation 5: ( ) • To get a better result is to determine the edge direction with the equation 8 as follows: Where θ is the angle of gradient used to determine the direction of pixel comparison in the next process. • Next is applying non-maximum suppression or peak detection by only maintaining the gradient point that has the highest intensity value from the neighbors. This process is done by utilizing information on the direction of an outline on the object. • The thresholding application process is used by checking the pixel value with the upper threshold value. If the pixel count value is higher than the top threshold, then the pixel value is marked as a strong edge. Whereas if the pixel value located below the threshold value is marked as a weak edge. The equation 9 is as follows :

( )
2 min max f f T + = (9) • Finally, examine the results of the pixel values that are recognized as strong edges and weak edges obtained from the double thresholding results. If the pixel value is greater than the top threshold, then the pixel is an edge pixel. The pixel value will be ignored if the value is smaller than the lower threshold value.

4) Find Contour:
The contour is a row of points representing a curve in an image [15]. In OpenCV, the contour is displayed sequentially where each row of contour points contains information on the location of the contour points in the next sequence. The cvFindContours () function produces contours from black and white binary images. Binary images can be generated from a threshold that has an implicit angle as a boundary between positive and negative areas. This work is used to eliminate small noise in the USG image from the segmentation process that still exists after the canny edge detection process. One of the goals of using canny edge detection is to get the contour of the object. Here is the process for obtaining these contours.
• Use the Find contour method on the image data to be processed. • Change to grayscale shape in the input image.
• Gives a blur effect on the image. • Apply Canny Edge detection to the image to find outlines. • Edge will be the material to find the contour of the object • Each area indicated as a contour is calculated based on an area by giving and if > 100 contour condition will be marked. • Signs are given by drawing on areas that have an area> 100. The results of detection using a canny filter have not been able to obtain the desired contour; there is small contour in some point of noise, find contour method can select contours by calculating the area and giving a threshold value > 100. Fig. 11 shows the results of using the find contour method that can eliminate small contours that are on the contours of the fetal head and fetal femur.

D. Segmentation with Integral Projection
Integral projection is already used in previous research [16]- [18]. This method is used to get objects from the fetal head and fetal femur by finding the object's boundary on the image of the fetal head and fetal femur. The results of the previous crop object are processed with vertical and horizontal Integral projection. After obtaining the results of integral projection, then combined with the ellipse formula in equation 10. Where: There are two types of projection types; the first is a horizontal projection that works based on the x-axis. Each column in the figure will calculate the total pixel values to get the horizontal length as in equation 11: Second is a vertical projection that works based on the yaxis. Each column in the figure will calculate the total pixel values to get the length vertically as in equation 12: The ellipse equation is used after the boundary of the fetal head object is obtained, and the boundaries are used for input from the ellipse equation, which will form the fetal head object. The shape of the ellipse equation is shown in equation 13: (13) With (h, k) is the center of the ellipse, a and b are the major and minor radius. Integral projection is also used to obtain the fetal femur by using horizontal projection to determine the initial and final limits of the fetal femur. The results of the integral projection can be drawn with a red line as in Fig. 12 which is the result of the integral projection of the fetal head and fetal femur

E. Measurement Biparietal Diameter and Femur Length
Biparietal diameter is a measure of the integral fetal head projection that will be measured in diameter. In measuring biparietal diameter, the symmetrical vertical cut line located in the middle is found. The biparietal diameter itself is taken by choosing the shortest vertical line. In the ellipse approach, the calculation of the biparietal diameter gives the same assumption as calculating the diameter of the short elliptical axis as in equation 14: b Whereas for femur length, organ measurements are obtained by calculating the initial and final contours of the femur object. Euclidean Distance or the distance between the end coordinates (x, y) is a way to take femur length measurements as in equation 15: Before taking measurements on the fetal femur, scanning the image starts from the left border to the right border of the image to find the femur object that is searched. The object is found if it has an intensity that exceeds the value of 200. Then it is stored from the coordinates of the left endpoint and the right endpoint in the form of variables. Euclidean formula is used to calculate the coordinates. These two points will be connected by drawing a line to mark the length of the femur length to be measured.

III. RESULTS AND DISCUSSION
In this research, the system works by processing input images from the results of a two-dimensional ultrasound examination. The ultrasound images are then processed to measure the contours of the fetal head and fetal femur that are used to estimate the gestational age. In this section, we describe the procedure for obtaining an estimated gestational age which involves the following processes:

A. Haar Classifier
In Fig. 13 the following is the result of the detection process on the fetal head object with the Haar Cascade method on ultrasound images. The learning results are tested to find out whether the system can recognize objects detected in images other than sample training.

B. Image Processing
The results of the detection are then processed again to crop the image; this is useful for separating objects from the background in the input image, containing information generated by an ultrasound machine, and reducing the computation of the segmentation process. Cropped images are then processed using image processing involving gaussian filter, morphological operations, canny edge detection, and find contour in the preprocessing process to improve image quality and obtain contours of the fetal head and fetal femur. The results of image processing can be seen in Fig. 14 and 15.

C. Estimation Gestational Age
Integral projection is made after getting good contour results. This process is used to obtain the elliptical shape of the fetal head, which is measured to obtain the value of the biparietal diameter and also to measure the length of the femur using euclidean. To measure the head of the fetus, it is necessary to look for a major axis value, which is the longest diameter of the ellipse in a plumb line. Whereas the measurement of the femur length is carried out searching at the starting point and endpoint of the femur object, the value of the femur length is obtained from the euclidean distance formula in the form of pixels, which is then converted in units of a centimeter. Results from measurements of the fetal head and femoral length by the proposed method are proficiently visualized in Table 1.

Head Femur
After obtaining the values from the biparietal diameter and femur length measurements, the next process is to compare the proposed method with the measurement results based on the standardized table for gestational age, which can be seen in Table II. Based on Table II, gestational age can be determined by measuring the length of the biparietal diameter and femur length as parameters. Gestational age is stated in units of weeks, and biparietal diameter and femur length are expressed in units of a centimeter. In the use of standardization tables (see Table II) as in the results of parameter measurements, when the biparietal diameter reaches size 3.2, the gestational age is 16 weeks. If the length of the biparietal diameter or femur length does not reach the value in the table, the gestational age value follows the previous gestational age value. In this study, the gestational age value was calculated from the average gestational age value according to the biparietal diameter and gestational age value according to femur length. Therefore the gestational age value can be generated through the following equation 16.

_ _ 2
biparietal diamater femur length + (16) In this study, we tried to apply the system in 30 USG image data to conduct testing on the proposed method. The results of the estimated gestational age with 30 data can be seen in Fig. 16. Based on the graph contained in Fig. 16, it can be seen the difference in diagnosis between the doctor and the system that has a comparison that is not much different-the difference between only 1-2 weeks. The doctor's own diagnosis can be obtained from manual measurements on an ultrasound machine. The data used has a fetal age range in the second trimester with an age range of 15-25 weeks. This result is obtained from the average obtained from estimated births through biparietal diameter and femur length. Based on experiments that have been done, our method can provide an accuracy rate of 97.77% in estimating gestational age.

IV. CONCLUSIONS
Based on the results of research that has been done, to reduce the processing of images on the fetal head can use learning to the system with the Haar Cascade method that can determine the location of the fetal head automatically. Thus, this will speed up the segmentation process to focus more on the object being measured. After obtaining an object from the fetal head, then perform image processing to achieve the contours of the fetal head and fetal femur with the integral projection technique used to get the parameter values of bipolar diameter and femur length. This parameter is used to determine the estimated gestational age to determine the estimated birth. These two parameters are considered the most important for obtaining a high degree of accuracy in determining gestational age. Based on experiments that have been carried out on 30 data images, obtained an accuracy rate of estimated gestational age is 97.77%. The work in the future is to develop a system that can automatically detect two parameters, which will further speed up the measurement process.