Project for the Benefit of the National Hydrocarbons Company SONATRACH Algeria.
# Oil-Spill-Detection-Using-Machine-Learning
Project for the Benefit of the National Hydrocarbons Company SONATRACH Algeria.
## Introduction
Only 10% of oil spills come from natural sources such as seabed leaks. Pollution caused intentionally by transport vessels is far more widespread. Radar images from Synthetic Aperture Radar (SAR) mounted on satellites, offer the possibility of monitoring coastal waters.
*Fragment of a SAR image - The oil sheath is the elongated dark region visible in the top right of the image but The dark areas in the middle of the image and bottom left are similarities -*
This project is a machine learning model dedicated to the detection of oil slicks from satellite images.
## DATA SET
A standard imbalanced dataset was introduced in the Research Article. The dataset consists of satellite images of the ocean, some of which contain an oil spill, while others do not.
The images were divided into sections and processed using computer vision algorithms to generate a feature vector describing the content of each image section or patch.
## Data pre-processing
- The initial dataset was provided with features (columns) visually deemed irrelevant to learning performance. These columns include the patch number (first column) and column 22, containing a single unique value, which was removed because columns with only one observation or value are generally ineffective for modeling and are termed zero-variance predictors (as their variance would be null if measured).
Furthermore, the dataset columns were separated into input and output variables. Column 49, which holds class labels (presence or absence of a spill), was encoded to represent classes 0 and 1.
```Python
def charger_dataset(filename):
# loads the dataset as a numpy array
data = read_csv(filename, header=None)
# delete unused columns
data.drop(22, axis=1, inplace=True)
data.drop(0, axis=1, inplace=True)
# retrieve the numpy array
data = data.values
# Divided into input and output el …