Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

S.U.S.H.I 🍣

System Block Diagram Surface Utilization Surveillance and Hazard Identification

Goal of S.U.S.H.I 🍣

S.U.S.H.I aims to create a vision system for detecting floating surface trash with optimal accuracy, discarded objects, and similar objects that are outside the water area.

Seeing the Water (U-Net)

A U-Net built from scratch in PyTorch, trained via knowledge distillation from SAM2. Rather than using standard transfer learning, SAM2 acts as an offline teacher — its soft logits are precomputed and stored in distill.h5, with no gradient propagation through SAM2 during training. The student U-Net learns from both binary ground truth masks and the teacher's logits simultaneously:

$$\mathcal{L}_{total} = \alpha \cdot \mathcal{L}_{hard} + (1 - \alpha) \cdot \mathcal{L}_{soft}$$

$$\mathcal{L}_{hard} = \text{BCE}(\hat{y}, y) \qquad \mathcal{L}_{soft} = \text{MSE}(\hat{y}, z_{SAM2}) \qquad \alpha = 0.5$$

This guides the student toward SAM2-like boundary precision while remaining lightweight enough for edge deployment. The architecture uses 4 encoders, 1 backbone encoder, and 4 decoders with skip connections preserving fine boundary details. The final layer uses sigmoid activation to produce binary water masks. The output is used directly in Vision Fusion for object validity checks and exploration.

U-Net Architecture

Vision Fusion

Three models run in parallel:

  • YOLO Detection — trained on simulation + pool data (2 classes: goal, obstacle). Uses CSRT-tracked video annotations and mosaic augmentation. No pretrained weights.
  • Water Segmentation (U-Net) — knowledge distillation from SAM2 logits. Combines hard loss (BCE) and soft loss (MSE against teacher logits). Requires only 500–550 frames from 20 video sequences.
  • Depth EstimationDepth-Anything V2, used over stereo cameras as it outperforms depth with water reflections.Uploading Unet.png…

Vision Fusion

Multi-Field Synthesis (MFS)

MFS solves the local minima problem in classical APF by blending:

  • Local APF forces — reactive obstacle repulsion and goal attraction
  • Global wavefront flow field — computed periodically from goal cell outward
  • Clearance field — to find narrow corridors

Where an adaptive blending coefficient γ ∈ [0,1] shifts between APF and wavefront, increasing wavefront influence in narrow corridors, escaping local minima after repeated stuck steps using wavefront stagnation, and switching to APF dominance for precise final approach based on goal proximity. Dynamic repulsion scaling (β) reduces repulsive forces in traversable corridors. Oscillation is broken via angular perturbations. Hermite cubic interpolation smooths the final path.

MFS Components

MFS uses SUSHI's Vision Fusion to construct the obstacle and goal map:

MFS Vision Grid

Visual Exploration

When no explicit goal is detected, a line-of-sight inspired exploration samples the water mask for curious navigation:

  • Density map via 15×15 Gaussian kernel convolution
  • Distance transform for shore clearance
  • Multi-scale structural kernels detect narrow channels and dead-ends
  • Sector-based scoring (16 angular wedges) combining density, reactivity, and structural features
  • Three-tier fallback: global max → hierarchical grid → uniform grid

Exploration Pipeline

This allows the robot to navigate safely around obstacle-filled areas, find entrances to disconnected water regions and avoid wall collision during exploration — only through water mask sampling:

Exploration Examples

Decision Control

Behavior hierarchy (lowest to highest priority):

  1. Fuzzy Path Following — follows waypoints using 4-input triangular membership functions (distance to lookahead, heading error, cross-track error, obstacle proximity) with centroid defuzzification:

$$\mu_A(x) = \max\left(0,\ 1 - \frac{|x - c|}{a}\right)$$

  1. DWA Obstacle Avoidance — triggered by sonar or horizon depth readings, constructs a dynamic window of velocities and scores each candidate trajectory:

$$W = {(v, \omega) \mid v \in [v_{min}, v_{max}] \cap [v - a_{max}\Delta t,\ v + a_{max}\Delta t],\ \omega \in [\omega_{min}, \omega_{max}] \cap [\omega - \alpha_{max}\Delta t,\ \omega + \alpha_{max}\Delta t]}$$

$$R(v, \omega) = -w_h|\theta_{goal} - \theta_N| - w_o d_{min}^{-2} + w_s v$$

  1. Turn-in-Place — mini-DWA with $v_{min} = v_{max} = 0$, restricting motion to pure rotation when all trajectories collide or the water mask becomes unreliable near shore.

Global Trajectory