skills/cv/dbscan-ensemble-fusion/SKILL.md
Fuses 3D object detections from multiple models by clustering nearby predictions with DBSCAN and taking cluster centroids.
npx skillsauth add wenmin-wu/ds-skills cv-dbscan-ensemble-fusionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When multiple detection models produce overlapping 3D point predictions, fuse them by clustering nearby detections with DBSCAN. Each cluster's centroid becomes a single fused detection. Unlike NMS which needs box IoU, DBSCAN works directly on point coordinates — ideal for particle picking, cell detection, and any centroid-based 3D detection.
from sklearn.cluster import DBSCAN
import numpy as np
def fuse_detections(all_preds, eps=10.0, min_samples=2):
"""Fuse detections from multiple models.
all_preds: list of arrays, each (N_i, 3) in (z, y, x) coords.
"""
coords = np.vstack(all_preds)
if len(coords) == 0:
return np.empty((0, 3))
clustering = DBSCAN(eps=eps, min_samples=min_samples).fit(coords)
centroids = []
for label in set(clustering.labels_):
if label == -1: # noise — include as single detections
noise_pts = coords[clustering.labels_ == label]
centroids.extend(noise_pts)
else:
cluster_pts = coords[clustering.labels_ == label]
centroids.append(cluster_pts.mean(axis=0))
return np.array(centroids)
eps = expected merge radius, min_samples = minimum agreement countdata-ai
Scaled Pinball Loss (SPL) metric for evaluating quantile forecasts, normalized by mean absolute successive differences of training data
data-ai
Walk backward through a time series and multiplicatively rescale segments when jumps exceed a fraction of the running mean to correct data collection anomalies
testing
Transform forecasting target to next/current ratio minus one so that optimizing MAE or squared error implicitly minimizes SMAPE
tools
Convert point forecasts to prediction intervals by scaling with logit-transformed quantile ratios passed through a Normal CDF