OCTOPAS

Oil spill Cleanup Through An Optimized Pragmatic Automated System

An Autonomous Oil Spill Cleanup & Analysis System

View Technical Details

Project Overview

The Problem

Marine oil spills are an environmental catastrophe, with over 15,000 tonnes of crude oil spilled annually. Traditional cleanup methods are slow, manually intensive, and often inefficient, struggling to adapt to the dynamic nature of a spill. A faster, more intelligent solution is critically needed to mitigate ecological damage.

The Solution

OCTOPAS (Optimized Cleanup Technology for Oceanic Pollution and Spills) is a two-part system designed to revolutionize oil spill response. It combines a physical autonomous surface vessel (ASV) with a sophisticated computer vision software brain to identify, map, and coordinate cleanup with maximum efficiency.

Technical Deep Dive: How It Works

01

Image Acquisition & Pre-Processing

The system begins with an aerial image of the spill, typically from a drone. This image is scaled and converted to the HSV color space to make the oil more distinct from the water, regardless of lighting conditions.

02

AI-Powered Oil Segmentation

This is the core of the analysis. I used K-Means clustering, an unsupervised machine learning algorithm from the scikit-learn library, to automatically segment the image into distinct clusters—typically "oil" and "water." This method is robust and adaptable to different types of oil and water conditions.

03

Boundary & Perimeter Calculation

Once the oil is identified, OpenCV's contour detection algorithms trace the precise boundaries of each oil patch. A convex hull is then calculated for each patch and for the entire spill area to determine the most efficient path for a containment boom.

Python / OpenCV / Scikit-learn
class oilSpillImage:
    def findOil(self, img, number=2):
        # Convert image to HSV and normalize
        img = cv.cvtColor(img, cv.COLOR_BGR2HSV) / 255
        h, w, c = img.shape
        img2 = img.reshape(h * w, c)

        # Quantize to N colors using K-Means clustering
        kmeans_cluster = cluster.KMeans(n_clusters=number)
        kmeans_cluster.fit(img2)
        cluster_centers = kmeans_cluster.cluster_centers_
        cluster_labels = kmeans_cluster.labels_

        # Reshape image back to original dimensions with reduced colors
        img3 = cluster_centers[cluster_labels].reshape(h, w, c) * 255
        return img3.astype('uint8')

    def makePerimeters(self, real_img, reduced_img, areaReq=1000):
        gray = cv.cvtColor(reduced_img, cv.COLOR_BGR2GRAY)
        _, binary = cv.threshold(gray, 90, 255, cv.THRESH_BINARY)

        # Find the precise boundaries of the oil patches
        contours, _ = cv.findContours(binary, cv.RETR_EXTERNAL, cv.CHAIN_APPROX_SIMPLE)

        oil_contours = []
        for contour in contours:
            if cv.contourArea(contour) > areaReq:
                oil_contours.append(contour)

        # Create a single, unified hull around all detected spills
        all_points = np.vstack(oil_contours)
        unified_hull = cv.convexHull(all_points)

        cv.drawContours(real_img, [unified_hull], -1, (165, 255, 0), 4) # Draw containment boom path
        return real_img, contours

Results & Impact

220%
Efficiency Improvement
95%+
Detection Accuracy
Autonomous
Operation

The OCTOPAS system demonstrated a 220% improvement in cleanup efficiency over conventional manual methods in simulated environments. The AI-powered analysis provides a rapid, data-driven approach that significantly reduces response time and optimizes resource deployment.

View Full Publication