top of page

Create Your First Project

Start adding your projects to your portfolio. Click on "Manage Projects" to get started

Pb-lite: Multi-Scale Probabilistic Boundary Detection

Project type

University course project

Date

January 2026

Location

Worcester, MA

Tech stack: Python, NumPy, OpenCV, scikit-learn (KMeans), Matplotlib, BSDS500 Dataset
A from-scratch implementation of a simplified probability-of-boundary (pb-lite) edge detection algorithm that significantly outperforms classical Canny and Sobel baselines by reasoning about texture, brightness, and color discontinuities across multiple scales and orientations. Built every component from raw NumPy — three custom filter banks, texton/brightness/color clustering, half-disc gradient masks, and the χ² histogram-distance computation — and validated qualitatively against human annotations from the Berkeley Segmentation Dataset (BSDS500).
Highlights

Implemented three custom filter banks from scratch (no built-in filters):

Oriented Derivative-of-Gaussian (DoG) filters across multiple scales and orientations.
Leung-Malik (LM) filter banks — both LMS and LML variants — totaling 48 filters per bank including first/second derivatives of Gaussians at 6 orientations × 3 scales, 8 Laplacian-of-Gaussian filters, and 4 isotropic Gaussians.
Gabor filters modeled on the human visual system (Gaussian envelope × sinusoidal carrier) at multiple frequencies and orientations.


Built a texton map T by stacking responses from all filter banks into a per-pixel feature vector and clustering into K = 64 textons via K-means — effectively performing vector quantization on the filter-response space.
Built brightness (B) and color (C) maps by K-means clustering grayscale and RGB pixel values into 16 clusters each.
Implemented half-disc gradient masks at multiple scales and orientations to compute texture (Tg), brightness (Bg), and color (Cg) gradients via a fast χ² histogram-distance trick: instead of looping over pixel neighborhoods, used per-bin convolutions with paired left/right half-disc masks to aggregate histograms via filtering — yielding the full gradient tensor across all scales and orientations efficiently.
Combined feature gradients with classical Canny and Sobel baselines via the pb-lite fusion equation:
PbEdges=Tg+Bg+Cg3⊙(w1⋅cannyPb+w2⋅sobelPb)\text{PbEdges} = \frac{T_g + B_g + C_g}{3} \odot \left(w_1 \cdot \text{cannyPb} + w_2 \cdot \text{sobelPb}\right)PbEdges=3Tg​+Bg​+Cg​​⊙(w1​⋅cannyPb+w2​⋅sobelPb)
yielding a per-pixel boundary probability that suppresses false positives in textured regions where Canny and Sobel typically over-fire.

Good things take time

bottom of page