Identification of tea plantation areas using Google cloud based random forest and deep learning

thumbnail.default.alt
Tarih
2020-06-15
Yazarlar
Özen, Berkay
Süreli Yayın başlığı
Süreli Yayın ISSN
Cilt Başlığı
Yayınevi
Institute of Science And Technology
Fen Bilimleri Enstitüsü
Özet
With the increasing population, food has become the most important parameter that determines international relations. Agricultural areas, which are the source of livelihood of the farmer, turn into urban areas with increasing population and face the danger of decrease with the pressure of construction. In addition to population growth, climate change threatens sustainable agriculture. Turkey is located in the areas affected by climate change. Moreover, as a result of the wrong and unconscious agricultural field management, increasing population and industrialization seen in recent years, the danger is much higher. If this condition continues, the environmental problems facing Turkey, will reach much more serious. Change of agricultural land, and these changes can not be managed correctly, it is just one of the most important issues in Turkey but all over the world in recent years. In this case, considering the spatial and temporal features, satellite images become a unique tool for monitoring the change in agricultural areas. Monitoring with satellite images allows analysis of agricultural activities of all sizes (from farm scale to basin scale), taking into account differences in environmental conditions, and even variations in the field. In this study, the livelihoods of more than 1 million people in Turkey, which ranks fifth in worldwide production of black tea plantation monitoring is investigated using remote sensing technologies. The main aim of the thesis is to identify the cultivated tea plantations with a satellite image obtained at time t. Although experience has been gained in monitoring of agricultural lands with satellite images, there is not much study on the detection of tea plantations. The main reason for this is tea plants has very similar spectral reflections with other agricultural products in the Eastern Black Sea region, where it grows. This classification problem is tried to be solved by advanced machine learning methods. However, especially deep learning methods require hardware with high computing power. In addition, the difficulty is further increased when the size of remote sensing images is added. Google has offered researchers the opportunity to solve these challenges with cloud computing. GEE is a cloud system that contains satellite data in petabyte scale and users can process this data using the JavaScript and Python programing languages. It makes possible to process satellite images without downloading and by using parallel calculation method using Google infrastructure. In addition, GEE can connect with Google's other cloud services (Drive, Cloud Storage) and the TensorFlow open source library for machine and deep learning can easily read and process data on it. In line with these developments, the thesis aims to evaluate the prediction of tea fields by using GEE and other services and the future role of GEE in this sense. As a method, both machine learning and deep learning were evaluated. For the Eastern Black Sea region, the study area, there is only access to satellite images that are free of charge via GEE. For this reason, Sentinel-2 data in GEE with the best spatial resolution was preferred for the study. Training and test data are needed for both mentioned classification methods. For this reason, binary annotated data previously created from high resolution orthophoto images were used as the ground truth data of the study area. These data were transferred to the cloud after they were converted to the appropriate format and then used. A total of 10 thousand points were selected from these location accuracy data and labeled via GEE. Afterwards, 50\% of these data were randomly allocated for training and 50\% for testing and exported to the cloud. Random Forest (RF) classification algorithm was chosen as machine learning. First, the best model evaluation for RF was made and the result was determined as 500 trees and 1 split in each tree. Vegetation Indices (VI) have been taken as additional features since tea fields in the study area will be difficult to classify using only spectral features in RF. These indices are Normalized Difference Vegetation Index (NDVI), Enhanced Vegetation Index (EVI, EVI2), Infrared Percentage Vegetation Index (IPVI), Chlorophyll Vegetation Index (CVI), Soil Adjusted Vegetation Index (SAVI). In addition to the spectral properties, the texture properties of the tea plants that were monitored were used to increase the performance of the RF classification method with the Gray Level Co-occurrence Matrix (GLCM). 3 different matrix has been selected for this, 3x3, 5x5, 7x7. RF algorithm was prepared in GEE environment by using the training points data set previously prepared with these parameters, and then output results were obtained in GEE environment. According to the data obtained, when using RF classification using only spectral bands (DN), overall accuracy was achieved at 74.45%. Similarly, when using DN + indices, the result did not change and 74.46% overall accuracy was obtained. In addition, when GLMC values are added to these data, it has been observed that the accuracy is increased for both DN and DN + Indices data. This increase was accomplished by all GLCM matrices. However, the highest accuracy value was achieved with Indices, DN, and GLCM created with a 5x5 matrix and has an accuracy rate of 76.43%. Also, as a result of this classification, the feature ranking was obtained and when this ranking was examined, it was observed that the Green band was the highest. Due to the prevalence of green in the region, the change in values in the reflection will affect the result of the classification. On the other hand, U-NET artificial neural network was used for the deep learning method and Colab application was used together with GEE. Then, the same training and test data generated randomly for the RF algorithm were used. In the following processes, region of interest obtained from the satellite image and training / test data were transferred to the Drive environment in tfrecord format and the data structure was determined by re-reading in the colab environment. As an additional feature, the previously specified indices are also added to the data. The best parameters are determined for the most suitable model after some tests. As a result of this parameter selection, the number of epoch is 150, the number of steps per epoch is 20, the number of batch is 20, the learning rate is 0.001 and Adam Optimizer is chosen as an optimizer. The Tensor Process Unit (TPU) provided by Colab for faster reading and processing of tfrecord data has been identified as the working environment. The model created with these parameters was trained and the model tested as a result of the training provided a high accuracy of 94.69%. The biggest reason for this is the U-NET architecture, which can provide success even with low resolution and a small amount of training data. Especially designed for the segmentation of biomedical images, this network architecture is quite successful in classifying partially low resolution images such as Sentinel-2. Research has revealed that the colab and GEE cloud infrastructure used in deep learning has greatly accelerated the training and prediction processes and revealed that it has great potential for operational studies. As high resolution satellite images, which ar
Artan nüfus ile birlikte gıda uluslararası ilişkileri belirleyen en önemli parametre haline gelmiştir. Çiftçinin geçim kaynağı olan tarım alanları, artan nüfus ile barınma alanlarına dönüşmekte, yapılaşmanın baskısı ile azalma tehlikesi ile karşı karşıyadır. Nüfus artışına ek olarak, iklim değişikliği de sürdürülebilir tarımı tehdit etmektedir. Türkiye bulunduğu konum sebebiyle iklim değişikliğinden etkilenen bölgede yer almaktadır. Ayrıca son yıllarda görülen yanlış ve bilinçsiz tarım alan yönetimi, artan nüfus ve sanayileşme sonucunda artık tehlike çok daha büyüktür. Bu durum devam ettiği takdirde Türkiye'yi bekleyen çevresel sorunlar çok daha ciddi boyutlara ulaşacaktır. Tarım alanlarının değişimi ve bu değişimlerin doğru bir şekilde yönetilememesi son yıllarda sadece Türkiye'de değil tüm dünyadaki en önemli konulardan biridir. Bu durumda konumsal ve zamansal özellikleri düşünüldüğünde, uydu görüntüleri tarım alanlardaki değişimin izlenmesinde benzersiz bir araç olmaktadır. Uydu görüntüleri ile izleme, her ölçekteki tarımsal faaliyetin (çiftlik ölçeğinden havza ölçeğine), toprak/çevre koşullarındaki farklılıkları hatta tarla içindeki değişkenlikleri de göz önüne alarak analiz edilmesine olanak sağlamaktadır. Bu çalışmada, dünya üretiminde beşinci sırada yer aldığımız ve Türkiye'de 1 milyondan fazla kişinin geçim kaynağı olan siyah çay arazilerinin izlenmesi araştırılmıştır. Tezin temel amacı, $t$ anında elde edilen bir uydu görüntüsü ile ekili çay arsalarının tespitidir. Uydu görüntüleri ile tarım arazilerinin izlenmesinde deneyim kazanılmasına rağmen, çay tarlalarının tespiti ile ilgili çok fazla çalışma bulunmamaktadır. Bunun başlıca nedeni, çay bitkisinin yetiştiği bölge olan Doğu Karadeniz'deki diğer tarım ürünleri ile çok benzer spektral yansıtımının olmasıdır. Bu sınıflandırma problemi ileri seviye makine öğrenme yöntemleri ile giderilmeye çalışılmaktadır. Ancak özellikle derin öğrenme yöntemleri yüksek hesaplama gücü olan bilgisayarlara ihtiyaç duymaktadır. Bunun yanında uzaktan algılama görüntülerinin boyutu eklenince zorluk daha da artmaktadır. Google, bu zorlukları bulut bilişim ile çözme olanağını araştırmacılara sunmuştur. Google Earth Engine (GEE) petabyte boyutlarında uydu verilerini içinde barındıran ve kullanıcıların JavaScript ve Python programlama dillerini kullanarak bu verileri işleyebileceği bir bulut sistemdir. Google altyapısını kullanarak paralel hesaplama yöntemiyle uydu görüntülerini çok hızlı bir şekilde ve indirmeden işlenmesini mümkün kılmaktadır. Bunun yanı sıra Google'ın diğer bulut servisleri (Drive, Cloud Storage) ile bağlantı kurabilmektedir. Aynı zamanda yine Google tarafından geliştirilen ve makine öğrenmesi ve derin öğrenme için kullanılan TensorFlow açık kaynak kütüphanesi kolaylıkla GEE üzerindeki verileri okuyup işleyebilmektedir. Bu gelişmeler doğrultusunda, tez, GEE ve diğer servisleri kullanarak çay alanlarının tahmini ve bu anlamda GEE'nin gelecekteki rolünü değerlendirmeyi hedeflemektedir. Yöntem olarak hem makine öğrenmesi hem de derin öğrenme değerlendirilmiştir. Çalışma bölgesi olan Doğu Karadeniz için GEE üzerinden sadece ücretsiz olan uydu görüntülerine erişim bulunmaktadır. Bu sebeple GEE içinde bulunan ve en iyi mekansal çözünürlüğe sahip olan Sentinel-2 verileri çalışma için tercih edilmiştir. Bahsi geçen her iki sınıflandırma yöntemi için de eğitim ve test verilerine ihtiyaç duyulmaktadır. Bu sebeple çalışma alanına ait yer gerçeği verileri için yüksek çözünürlüklü ortofoto görüntülerinden oluşturulmuş olan ikili etiket verileri kullanılmıştır. Bu veriler uygun formata getirildikten sonra bulut ortamına aktarılmış ve sonrasında kullanılmıştır. Bu yer doğruluğu verileri içerisinden toplamda 10 bin nokta rastgele olacak çekilde GEE üzerinden seçilmiş ve etiketlenmiştir. Sonrasında bu verilerin %50'si eğitim %50'si, de test için rastgele olarak ayrılmıştır. Her iki sınıflandırma için daha adil bir karşılaştırma yapılması amacıyla seçilen bu rastgele noktalar bulut ortama kaydedilmiştir. Makine öğrenmesi olarak Random Forest (RF) sınıflandırma algoritması seçilmiştir. İlk olarak RF ile sadece spectral bandlar kullanarak en iyi model bulunması amacı ile farklı parametreler ile model değerlendirilmesi yapılmıştır. Bu değerlendirme sonucu en iyi model 500 ağaç ve her ağaçta 2 düğüm noktası olacak şekilde belirlenmiştir. Çalışma alanının RF kullanarak sadece spektral özelliklerle ayırt etmesi zor olacağından ötürü Vejetasyon İndisleri (VI) ek özellik olarak alınmıştır. Sentinel-2 uydu görüntülerinden hesaplanabilen Normalized Difference Vegetation Index (NDVI), Enhanced Vegetation Index (EVI, EVI2), Infrared Percentage Vegetation Index (IPVI), Chlorophyll Vegetation Index (CVI) ve Soil Adjusted Vegetation Index (SAVI) vejetasyon indisleri sınıflandırma işleminde kullanılmıştır. Spektral özelliklere ek olarak izlenen çay arsalarının doku özellikleri Gri Seviye Birlikte Oluşma Matrisi (GLCM) ile RF sınıflandırma yönteminin başarımını arttırmak amacıyla kullanılmıştır. Belirlenen bu parametrelerle daha önceden hazırlanan eğitim verisi nokta seti kullanılarak RF algoritması GEE ortamında hazırlandı ve sonra yine GEE ortamında çıktı sonuçları elde edildi. Elde edilen verilere göre RF ile sadece spektral bandlar kullanarak sınıflandırma yapıldığında %72.88 genel doğruluğa erişebilmektedir. Benzer şekilde spektral bandlar + indisler kullanıldığında da sonuç değişmemekete ve %73.71 genel doğruluk elde edilmiştir. Bunun yanı sıra, bu verilere GLMC değerleri eklendiğinde, hem RGBNir hem de RGBNir + İndis verileri için doğruluğun arttığı gözlemlenmiştir. Bu artış bütün GLCM matrisleri tarafında gerçekleştirilmiştir. Ancak en yüksek doğruluk değeri 5x5 matris ile oluşturulan GLCM, İndisler ve RGBNir ile oluşturulan veri ile gerçekleştirilmiştir ve 76.43% doğruluk oranına sahiptir. Aynı zamanda bu sınıflandırma sonucu özellik sıralaması çıkarılmıştır ve bu sıralama incelendiğinde Yeşil bandının en yüksek olduğu gözlemlenmiştir. Bölgedeki yeşilin hakimliği sebebi ile yansıtımdaki değerlerin değişimi sınıflandırma sonucunu etkileyecek niteliktedir. Öte yandan, derin öğrenme yöntemi için yapay sinir ağı kullanılmış olup bu yöntem için GEE ile beraber Colab uygulaması kullanılmıştır. Colab, web ortamında ve yine Google altyapısını kullanarak Python programlama dili kod yazmanızı sağlayan bir Google servisidir. İlk etapta burada gerekli bağlantılar (GEE ve Drive) yapılıp kullanılacak olan kütüphaneler eklenmiştir. Sonrasında RF algoritması için ratgale oluşturulan aynı eğitim ve test verisi kullanılmıştır. Sonraki süreçlerde TensorFlow kullanılacağından ve bu kütüphane tfrecord dosya formatını çok daha efektif kullanabildiğinden çalışma alanı uydu görüntüsü ve eğitim/test verileri bu formatta Drive ortamına aktarılmıştır. Aktarılan veriler tekrar colab ortamında okunmuş ve veri yapısı belirlenmiştir. Veri yapısı belirlendikten sonra ek özellik olarak daha önce belirtilen indisler burada da kullanılarak veriye işlenmiştir. Veriler hazır hale getirildikten sonra model oluşturma işlemi başlamış ve en uygun model için en iyi parametreler belirlenmiştir. Bu parametre seçimi sonucu epoch sayısı 150, epoch başı adım sayısı 20, parça sayısı 20, öğrenme oranı 0.001 ve optimize olarak da Adam Optimizer seçilmiştir. Bunun yanı sıra tfrecord verilerinin daha hızlı okunması ve işlenmesi açısından Colab'in sağlamış olduğu Central Process Unit (CPU) ve Graphic Process Unit (GPU) haricinde Tensor Process Unit (TPU) çalışma ortamı olarak belirlenmiştir. Bu parametreler ile oluşturulan model eğitilmiştir ve eğitim sonucu test edilen model %94.69 oranında yüksek bir doğruluk sağlamıştır. Bunun en büyük sebebi düşük çözünürlük ve az sayıda eğitim verisiyle bile başarım sağlayabilen U-NET mimarisidir. Özellikle biyomedikal görüntülerin segmentasyonu için tasarlanan bu ağ mimarisi Sentinel-2 gibi kısmen düşük çözünürlüğe sahip görüntülerin sınıflandırılmasında oldukça başarılıdır. Yapılan araştırma, derin öğrenmede kullanılan colab ve GEE bulut altyapısının eğitim ve tahmin süreçlerini oldukça hızlandırmış ve operasyonel çalışmalar için büyük bir potansiyele sahip olduğunu ortaya çıkarmıştır. Ücretsiz erişilebilinen yüksek çözünürlüklü uydu görüntüleri artıkça, bu tez çalışmasında önerilen yöntemin, izlenen çay arazileri hakkında çok kısa sürede fikir verebileceği ve güncel kadastral bilgi sağlayacağı ön görülmüştür.
Açıklama
Thesis (M.Sc.) -- İstanbul Technical University, Institute of Science and Technology, 2020
Tez (Yüksek Lisans)-- İstanbul Teknik Üniversitesi, Fen Bilimleri Enstitüsü, 2020
Anahtar kelimeler
Cloud computing ,Random forests, Remote sensing , Artificial neural networks, Bulut bilişim , Rastgele ormanlar , Uzaktan algılama , Yapay sinir ağları
Alıntı