Follicle Detection for Polycystic Ovary Syndrome by using Image Processing Methods

version of this paper was presented at 9th International Conference on Advanced Technologies (ICAT'20), 10-12 August 2020, Istanbul, Turkey with the title of “Follicle Detection in Polycystic Ovary Syndrome with Image Processing Methods”.


Introduction
Ovaries of women are divided into two groups as normal ovary and polycystic ovary according to their structural features [1]. Egg-containing cysts occur regularly every month in normal ovaries. These cysts are called follicles and they are removed from the body every month with a normal menstrual cycle. If these cysts are not removed from the body within the normal cycle, they can grow into functional cysts.Functional cysts are sacs filled with water and disappear spontaneously within 1-3 months. During the ovulation period of women, if the follicle that needs to be ruptured every month cannot develop and if it remains in the ovarian tissue, these cysts that accumulate over time cause polycystic ovarian structure.
Polycystic Ovary Syndrome (PCOS) is seen in approximately 6-10% of women during the reproductive period [2]. It occurs as a result of a hormonal disorder in women of reproductive age with various symptoms [3]. PCOS has three main symptoms according to Rotterdam criteria. The first is a menstrual irregularity, secondly, excessive male hormone increase in women, and the third is the polycystic ovarian structure detected by ultrasound imaging. Women with these symptoms are thought to have Polycystic Ovary Syndrome, but the diagnosis is decided by examining ultrasound images and blood test results.
Accurate and early diagnosis is very important for polycystic ovary syndrome. Because PCOS can cause many diseases such as insulin resistance, diabetes, obesity, uterine cancer, heart diseases.Early diagnosis and treatment should be initiated to prevent other diseases. In fact, PCOS is an inherited disease and cysts cannot be eliminated. However, with correct diagnosis and treatment, symptoms can be minimized.
Ultrasonography, which is also used in the diagnosis of PCOS, is a medical imaging method that allows the inner parts of the body to be seen through sound waves with a frequency of 2-15 Mhz. Two-dimensional images in black/white and gray color are produced in ultrasound devices.
Normal and polycystic ovarian ultrasound images are quite different from each other. Patients with PCOS usually have 10-12 cysts in their ovaries. Having more than 10 cysts in the ultrasound image is a sufficient number for diagnosis. The number of follicles is determined by the doctor's ultrasound examination. Determining the follicle by manual measurement by physicians is both laborious and time-consuming. For this reason, various image processing methods are used to determine characteristics such as the number, structure, and size of follicles in order to save the doctor's time and reduce workload.
There are some studies on follicle detection in the literature. Purnama et al. [4] designed an application to classify patients with polycystic ovary syndrome and performed feature extraction with Gabor wavelets. Three different classification algorithms were compared using normal and polycystic ovarian images. In the classification, Neural Network Learning (LVQ) method, K-NN, and Support Vector Machine (SVM) were used. As a result, the most accurate classification results were obtained with SVM.
Hiremath and Tegnoor [5] used Gaussian Filtering and Contourlet Transform in the pre-processing stage for denoising ultrasound images of the ovaries and compared the results with the physician's decision. As a result, they expressed that the Contourlet Transform method gives better results.
Wisesty and Mutiah [6] obtained various features by applying the Gabor Wavelet method to ultrasound images. In addition, the Support Vector Machine (SVM) was used for PCOS classification. In their study, using the features obtained from Gabor Wavelet, the kernel function giving the highest accuracy was determined.
Rao and Kumar [7] proposed an adaptive k-mean clustering algorithm for segmentation of the ultrasound image. As a result of the study, it was found that the normal clustering method gives more accurate results than the adaptive clustering method.
Nazarudin et al. [8] gathered the methods used in image segmentation and made a performance evaluation.
Lawrence et al. [9] used various segmentation methods and stated that the Region Growing algorithm has the highest follicle recognition accuracy of 78%. They performed three different methods for classification: Linear Discriminant Classifier (LDC), k-Nearest Neighbor (k-NN), and Support Vector Machine (SVM). As a result, they stated that the LDC gives the highest classification accuracy.
In this study, follicles were determined by applying different image processing techniques to ultrasound images and a preliminary study of a system that would be useful in diagnosing physicians was carried out. For this purpose, low contrast and noisy ultrasound images were enhanced at the pre-processing stage using two different methods.
For the first method, four different filtering techniques were used in the preprocessing stage and morphological processes were applied to the filtered images. Then histogram thresholding and adaptive thresholding results were compared.
For the second method, Gaussian Filter and Wavelet Transform were performed in the pre-processing stage and morphological processes were applied to the filtered image. Then, six different clusters were obtainedby using k-means clustering. Follicles were segmented by using the Canny Edge Detection algorithm for both methods. The accuracy of all methods was compared using the False Acceptance Rate (FAR) and the False Rejection Rate (FRR).

Material and Methods
A typical object detection algorithm [4] used in defective product detection or classification is as in Figure 1. In this study, follicles in the ovaries were determined by using some of these procedures shown in Figure  1.These are pre-processing and segmentation. After this preliminary study, it is aimed to classify the PCOS disease by including the feature extraction and classification stages in this study.

Ultrasound Image
Ultrasonography is used as a powerful tool in the diagnosis of PCOS. The ultrasound image used in this study was obtained from [1] and is shown in Figure 2. . An Ultrasound Image [1] As seen in Figure 2, the polycystic ovary causes a special pattern in the ultrasound images in which many small cysts come together.

Pre-processing
Ultrasound images contain a lot of noise and interference. These images need to be pre-processed to eliminate these noises. By using pre-processing applications, the insignificant details in the image are eliminated and the necessary regions are made clear. In this study, two different methods are used for the preprocessing of the ovarian ultrasound image.

The first method used in this study
For the first method applied in this study, different filtering and contrast enhancement techniques were applied to the digital image, and the results were compared to each other. The flow diagram of the first method is shown in Figure 3. The most important step in the preprocessing stage is image denoising. In this study, four filtering methods as Median Filter, Average Filter, Gaussian Filter, and Wiener Filter were selected. After denoising, thresholding techniques were applied to the image that was converted to the gray level for the contrast enhancement.Histogram thresholding was used to compensate for contrast inequalities in the filtered image.For this purpose, the foreground darkening was applied. In addition, adaptive thresholding was applied to the filtered image and the results are shown in Tables 1  and 2. In the next step which is called binarization, the opposite of the image was created to label the follicles and the black parts were turned into white and the white parts were turned into black. Thus, the follicles have become white and clear.
Morphology methods were used after binarization to sharpen the images and delete unnecessary objects. For this purpose, first of all, a value was determined according to the average size of the cysts. Then, erosion and expansion processes were applied to the image, respectively.  In Figure 5, morphological processes were applied to the image, where adaptive thresholding was applied after the Gaussian filter and follicles in the ovary were observed more clearly. All processes were combined in a Matlab GUI and follicle numbers were calculated after segmentation as shown in Figure 6.

The second method used in this study
For the second method applied for this study, Gaussian Filter and Wavelet Transform were used to reduce noise. Then, various morphological procedures were applied to the new image obtained by k-means clustering. The flow diagram of the second method is shown in Figure 7. Wavelet Transform is used to decompose signals and images by dividing them into subbands. Ultrasound images are too noisy and the Wavelet Transform provides smoothness to the image by denoising. L * a * b color space transform was applied to the ultrasound image used in this study before applying the Wavelet Transform. L represents the brightness level of the image, a is its location in the red-green layer, and b is its location in the blue-yellow layer [11].
In this study, the single-level discrete-2D Wavelet Transform was applied to the brightness level (L) to enhance the ultrasound image. Approximation coefficients, horizontal detail coefficients, vertical detail coefficients, diagonal detail coefficients obtained by Wavelet Transform are shown in Figure 8. Clustering algorithms are used to group data with similar characteristics in a data set. k-means is one of the commonly used clustering algorithms. In this study, the k-means clustering algorithm was used to determine follicles by dividing the data into subsets. The value of k in k-means refers to the number of clusters. After the k value is determined, random k center points are selected in the algorithm. The distance between each data and randomly determined center points is calculated and the data is assigned to a cluster according to the closest center point. Then, a center point is selected again for each cluster, and the clustering process is performed according to the new center points. This process continues until the system is stable.
In this study, clustering was applied to the ultrasound image by selecting the "k value" as six. Then, morphological processes were applied to the clustered image. Figure 9 shows six clusters obtained as a result of kmeans clustering on the ovarian ultrasound image. After clustering, the hole filling process was applied to the image to include the details inside the Holes. With this procedure, it is aimed to facilitate follicle detection.
With the morphological procedures applied for the second method, unnecessary parts of the image were removed and the follicles became clear. For this purpose, first erosion and then expansion processes were applied. Figure 10 shows the images after Gaussian Filter, kmeans clustering, hole filling, and morphological procedures are applied to the digital image for the second method. Finally, the ultrasound image was segmented for both two methods. At this stage, it is aimed to distinguish the objects in the image from the background using the Canny Edge Detection algorithm. Using this algorithm, the edges of the follicles were detected and labeled and the number of labels was shown on the application. Figure 11 shows the follicles obtained by adaptive thresholding and canny edge detection for the first method.  Figure 12 shows the follicles detected for the second method. The results obtained for both methods are shown in tables by using False Acceptance Rate (FAR) and False Rejection Rate (FRR). In Table 1, Histogram Equalization was used after filtering for the 1st method. In this method, the best result was obtained by using the Wiener Filter. In Table 2, adaptive thresholding was applied after filtering for the 1st method. In this method, the best results were obtained by using the Median Filter and Gaussian Filter. If Table 1 and Table 2 are compared by looking at the correct numbers, it is seen that Adaptive thresholding gives better results.
After applying the Gaussian Filter and Wavelet transform to the ovarian ultrasound image, Table 3 was created for the second method in which k-means clustering was performed. The most accurate result for this method has been obtained using the Gaussian Filter.

Conclusion
In this preliminary study, we used two different methods for follicle detection in polycystic ovary syndrome. Looking at Table 1 and Table 2 in the first method, we saw that the use of Wiener filter and Gaussian Filter gives the most accurate results. It is thought that these filters can be preferred in follicle detection studies due to the correct number of follicles. When comparing Histogram equalization and adaptive thresholding for method 1, we found that the results from adaptive thresholding were more accurate and we concluded that Adaptive thresholding provides a better contrast setting. With adaptive thresholding, the blackness of the non-follicle outer part is balanced and the follicles become more prominent. Looking at Table3 for the second method, it is seen that the Gaussian filter gives more accurate results. Therefore, it is thought that the noise in the image is better filtered according to the Wavelet transform. In the next step of our study, we aim to extract features from the follicles of ovarian and classify PCOS disease using more ultrasound images.