Deep learning has shown incredible capabilities in many areas (medical, vision, etc.), but how does it compare to well known autoregressive models in financial time series and how Online Learning can improve the results.

Image for post
Image for post
Image by Author.

Introduction

In my last story into this subject (available here), I’ve shown (step by step) how to implement in python a ARIMA+GARCH model to forecast the returns of the S&P500 index and compared its results to a well known R package (rugarch).


Make use of a completely functional ARIMA+GARCH python implementation and test it over different markets using a simple framework for visualization and comparisons.

Image for post
Image for post
Image by author.

Introduction

When it comes to financial Time Series (TS) modelling, autoregressive models (models that makes use of previous values to forecast the future) such as ARMA, ARIMA or GARCH and its various variants are usually the preferred ones to explain the foundations of TS modelling. However, practical application of these techniques in real trading strategies and it’s comparison to naïve strategies (like Buy and Hold) are not that common. Moreover, it’s not easy to find a ready to use implementation that could be easily replicated for other markets, assets, etc. Some of the codes that I had run into have failures…


Enjoy an easy-to-use unsupervised water detection algorithm for Sentinel 2 and Landsat 8 images that uses a multi-dimensional clustering coupled with naïve bayes classifier for improved performance.

Image for post
Image for post
Figure 1. Example of water mask extracted from a Camargue scene in France. Image by author.

This story is divided in two parts: Methodology and the waterdetect package. In the methodology, the main concepts of the algorithm are given, in order to provide the reader a better understanding of the package and how to tune it. The second part is a tutorial on the waterdetect package with sample codes to run it.

Methodology

Introduction

The use of deep learning techniques for remote sensing applications has been increasing in recent years. The recently published review paper “Object Detection and Image Segmentation with Deep Learning on Earth Observation Data: A Review-Part I: Evolution and Recent Trends” (Hoeser and Kuenzer 2020)[1]…


Improve the performance of your deep learning algorithms with multispectral image augmentations and Fastai v2

Image for post
Image for post
Figure 1: Augmentations applied to a Landsat 8 patch and its corresponding cloud mask. Image by Author.

We know that image augmentation is a key factor for computer vision tasks. It helps the algorithm to avoid overfitting, as well as it limits the need for huge training datasets [1]. Most deep learning frameworks have a vision module that implements augmentation “out-of-the-box”, as it is the case of Keras, PyTorch and Fastai libraries. The problem starts to rise when we need to feed the model with images that don’t match the 3-channel standard (RGB). That’s the case of most remote sensing applications (ex. Figure 1) and a number of other areas.


Enjoy sate-of-the art results in your Earth Observation tasks with simple coding and the Fastai’s deep learning API.

Image for post
Image for post
Water pixels segmentation example in Jirau reservoir (Brazil), using U-Net architecture and Fastai-v2.

Fastai is an open source deep learning library that adds higher level functionalities to PyTorch and makes it easier to achieve state-of-the-art results with little coding.


Image for post
Image for post
Figure — Example of patch creation for image segmentation of water bodies.

Introduction

In some previous stories (here, here and here) we’ve used PyTorch and Fast.ai library to segment clouds in satellite images, using as reference a public dataset (Kaggle’s 38-Cloud: Cloud Segmentation in Satellite Images). However, there are cases when we need to prepare our own dataset from the beginning, and that can be time-consuming without the proper tools.


Image for post
Image for post
Figure 1. Example of unsupervised agglomerative clustering for water detection in satellite images. Lake Qaraoun (Lebanon).

Introduction

The clustering analysis is one type of unsupervised technique used to identify (i.e. group) similar samples in a multi-dimensional data space. In the context of remote sensing data, it is largely used for pixel classification, where the multi-dimensional space represents the pixel reflectances in n different wavelengths (sensor bands) or any other combination.


Image for post
Image for post
Cloud segmentation: RGB image (left), ground truth (middle) and our model predictions (right).

In my previous story (here), I showed how to create a multi-channel dataset for satellite images from scratch, without using the torchvision module.

The Model

My different model architectures can be used for a pixel-level segmentation of images. The 2019 Guide to Semantic Segmentation is a good guide for many of them, showing the main…


Image for post
Image for post
Cloud Segmentation

In my last Medium story (here) I proposed an approach using the high level API Fast.ai to detect cloud contours in satellite images. Detecting object contours (i.e. all the pixels belonging to the same object) is called semantic segmentation. The dataset that was used for the task is the 38-Cloud: Cloud Segmentation in Satellite Image, from Kaggle.


Image for post
Image for post
Photo by Asael Peña on Unsplash

Neural nets can be both, threatening and "passionate" at the same time. The more you learn and the more you go deep into it, you unleashes its power and a whole bunch of new ideas and applications come to our minds. Environmental applications are amongst those subjects that attracts more attention daily and remote sensing is one powerful tool for researchers, students and policy makers to understand environmental processes.

Maurício Cordeiro

Doctorate student @ Université Paul Sabatier (Toulouse). Water Resources Specialist at the Brazilian National Water Agency.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store