Histogram of Oriented Gradients (HOG1D)
- Histogram of Oriented Gradients (HOG1D) is a method for extracting shape-based features from 1D signals by computing gradient orientations and forming histograms.
- It operates through sequential steps—gradient computation, orientation mapping, binning with triangular interpolation, and block-wise L2 normalization—ensuring robust feature representation.
- The descriptor effectively integrates with alignment techniques like ShapeDTW, enhancing sequence matching in applications such as borehole imaging under complex texture and scaling challenges.
The Histogram of Oriented Gradients for One-Dimensional Signals (HOG-1D) is a feature extraction method designed to characterize local shape patterns in real-valued 1D data. Unlike traditional HOG descriptors applied to multidimensional (e.g., image, video) domains, HOG-1D operates on sequences such as logging traces or time series, providing orientation-sensitive, block-normalized vector representations that facilitate downstream tasks such as sequence alignment. In recent applications, notably within borehole image depth-matching workflows, HOG-1D has been integrated as a primary component of the shape descriptor combined with raw signal values, yielding robust results in scenarios presenting complex textures, depth shifts, and localized scaling perturbations (Li et al., 1 Dec 2025).
1. Mathematical Framework of HOG-1D
HOG-1D consists of four sequential operations: gradient computation, orientation mapping, histogram bin quantization, and block-wise normalization.
1.1 Gradient Computation
Given a signal :
- For interior samples ():
- Edge handling: ,
This derivative approximation (centered difference) emphasizes local changes and is applied without pre-filtering, exploiting the inherent high-pass characteristics.
1.2 Orientation Encoding
The gradient is transformed into a pseudo-angle: This embedding preserves sign and relative magnitude over a bounded interval.
1.3 Orientation Binning and Voting
The angular range is partitioned into bins (with ):
- Bin centers: ,
- For each sample , votes are distributed to adjacent bins using triangular interpolation:
- Bin value:
1.4 Cell Histograms
The signal is divided into contiguous cells, each of CellSize samples (CellSize = 60):
- Cell histogram for bin :
1.5 Block Normalization
Adjacent cells are grouped into overlapping blocks of BlockSize (BlockSize = 2, stride = 1 cell):
- Concatenated vector:
- L2-normalization: ,
The feature representation for the entire 1D trace is the vertical concatenation of normalized block vectors.
2. Implementation Workflow
The following sequence implements HOG-1D feature extraction:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
Input: 1D signal x[1..n], CellSize=60, NumBins=K=10, BlockSize=2, ε=1e-6 Output: HOG1D feature vector Φ 1. // Gradient for i = 2 to n-1: g[i] = x[i+1] - x[i-1] g[1] = x[2] - x[1] g[n] = x[n] - x[n-1] 2. // Orientation for i = 1 to n: θ[i] = arctan(g[i]) 3. // Bin centers Δθ = π / K for k = 1 to K: θ_k = -π/2 + (k-0.5)*Δθ 4. // Cell histograms NumCells = floor(n / CellSize) for c = 1 to NumCells: H[c][1..K] = 0 for i in cell c: for k = 1 to K: d = |θ[i] - θ_k| w = max(0, 1 - d/Δθ) H[c][k] += w * |g[i]| 5. // Block normalization Φ = [] for c = 1 to NumCells-BlockSize+1: v = [ H[c][1..K]; H[c+1][1..K] ] norm = sqrt(sum(v.^2) + ε^2) v̂ = v / norm append v̂ to Φ return Φ |
3. Experimental Parameterization
In the cited OBM depth-matching method, parameters are fixed as follows (Li et al., 1 Dec 2025):
| Parameter | Setting | Purpose |
|---|---|---|
| CellSize | 60 samples | Local region for histogramming |
| NumBins (K) | 10 | Discretization of gradient orientations |
| BlockSize | 2 cells | Normalization scope; overlapping blocks |
| ε | Regularization for L2-normalization |
Signals are typically windowed by 10–30 ft prior to HOG-1D extraction.
4. Signal Preprocessing and Practical Details
Edge samples are treated with one-sided difference operators. No additional smoothing or prefiltering is applied, leveraging the inherent high-pass nature of discrete differencing. The histogram voting procedure employs linear (triangular) interpolation, ensuring that orientation votes are distributed proportionally around bin centers. Overlapping blocks (stride = 1 cell) increase feature robustness against alignment artifacts at cell boundaries and improve morphological sensitivity under local texture variation.
5. Integration with ShapeDTW and Sequence Alignment
The HOG-1D descriptor is incorporated into the Shape Dynamic Time Warping (ShapeDTW) workflow as follows (Li et al., 1 Dec 2025):
- For each sample , a local subsequence of radius is passed through HOG-1D to produce
- The full feature at sample concatenates the HOG-1D descriptor with the raw values:
- The Euclidean distance between such descriptors defines the pairwise shape-sensitive cost matrix for DTW.
This integration yields morphologically robust depth alignment in multi-pad borehole imaging, particularly effective under shifts, scaling, and complex geological textures.
6. Applicability, Limitations, and Extensions
The described HOG-1D process is suitable for any one-dimensional signal where orientation dynamics are informative for downstream similarity, alignment, or classification tasks. The framework allows flexible extension by concatenating HOG-1D features with other descriptors tailored to domain-specific patterns (e.g., geological stratigraphy, fault boundaries), offering modularity in descriptor construction (Li et al., 1 Dec 2025). No explicit detrending or smoothing is applied; improvements may result from incorporating such steps where noise dominates. This suggests that for signals with significant low-frequency bias or high-amplitude outliers, further preprocessing could enhance both the interpretability and discriminative capacity of the resulting feature vectors. A plausible implication is that HOG-1D, in conjunction with ShapeDTW, can serve as a general-purpose morphological alignment tool across 1D domains beyond borehole imaging, provided parameters are adapted to the signal’s scale and dynamics.