---
title: 'HCRF: Hierarchical Containment Redundancy Filter'
url: https://www.emergentmind.com/topics/hierarchical-containment-redundancy-filter-hcrf
type: topic
---

# HCRF: Hierarchical Containment Redundancy Filter

Hierarchical Containment Redundancy Filter (HCRF) denotes a hierarchy-aware redundancy elimination mechanism based on containment relations. In "SGAD: Semantic and Geometric-aware Descriptor for Local Feature Matching" [2508.02278], HCRF is introduced explicitly as a post-matching, geometry-based pruning step for overlapping image areas. In the consolidated descriptions associated with "R2D2: Reducing Redundancy and Duplication in Data Lakes" [2312.13427], "Neural Network Compression via Effective Filter Analysis and Hierarchical Pruning" [2206.03596], and "A New Hierarchical Redundancy Eliminated Tree Augmented Naive Bayes Classifier for Coping with Gene Ontology-based Features" [1607.01690], the same label is used as a mapping onto containment-aware redundancy reduction in data lakes, CNN compression, and ontology-structured feature selection. This suggests a common technical pattern: construct a containment hierarchy, apply pruning rules that preserve representative structure, and reduce duplicated downstream computation or duplicated predictive signal.

## 1. Cross-domain scope and defining pattern

Across the cited literature, HCRF is either an explicit module or an interpretive name for a family of hierarchy-aware filters. The common structure is containment-driven pruning rather than flat suppression. Instead of treating candidates as unrelated items scored independently, these methods encode parent–child or superset–subset relations and then retain a subset that is intended to be non-redundant with respect to subsequent computation or decision-making.

| Domain | Contained entities | Core selection principle |
|---|---|---|
| Local feature matching | Nested image areas or masks | Keep parent or children via coverage |
| Data lakes | Schema-contained and content-contained tables | Progressive pruning from schema to content |
| CNN compression | Weights, filters, layers, blocks | Prune under spectral redundancy and guards |
| GO-based TAN | Ancestor–descendant ontology features | Suppress same-valued redundant terms |

In the image-matching setting, containment is geometric and is defined on masks and their overlaps. In data lakes, containment is relational, first at schema level and then at row-content level. In CNN compression, the hierarchy is architectural, with pruning allocated across filters, layers, and blocks. In GO-based classification, containment follows the ontology DAG and the true-path rule. A recurring distinction is that HCRF-style methods are not equivalent to flat non-maximum suppression or to exhaustive pairwise verification; they exploit hierarchical structure directly.

A terminological caution is necessary. The exact name "Hierarchical Containment Redundancy Filter" is introduced in SGAD, whereas the descriptions of R2D2, EFA plus hierarchical pruning, and HRE-TAN explicitly state that the original papers do not use that name and are being mapped to it conceptually [2508.02278].

## 2. Geometry-based HCRF in area-to-point local feature matching

In SGAD, HCRF is motivated by redundancy in area-based local feature matching. Images are segmented into many regions, for example by SAM, and descriptor matching can correctly align multi-level nested areas such as a large parent region and its children. Without a redundancy filter, downstream point matching methods such as LoFTR, DKM, and ROMA run independently in each matched area, duplicating computation over highly overlapping spatial extents. The stated effects are repeated processing of the same pixels, increasing RANSAC or robust estimation costs and potentially amplifying spurious local matches; fragmenting the context available to a point matcher; and preserving overlapping crops that are not the most representative ones for downstream matching [2508.02278].

The formalism begins with areas \(R=\{r_i\}\), binary masks \(M_i \subseteq \mathbb{Z}^2\), bounding boxes \(B_i\), and area measure \(|r_i|=|M_i|\). After descriptor matching, SGAD produces a probability matrix \(P_{pr} \in \mathbb{R}^{m \times n}\). The matched set is
\[
M=\{(i,j)\mid (i,j)\in MNN(P_{pr}),\; P_{pr}(i,j)\ge \lambda_{pr}\}.
\]
Overlap magnitude is \(|A \cap B|\), while
\[
IoU(A,B)=\frac{|A\cap B|}{|A\cup B|}
\]
is used in supervision to build ground truth but not in HCRF decisions.

The containment predicate is soft and defined relative to the child:
\[
C(R_c,R_p)\coloneqq \frac{|R_p\cap R_c|}{|R_c|}.
\]
Then \(R_p\) contains \(R_c\) iff \(C(R_c,R_p)\ge \delta_{contain}\). The coverage rule compares a parent to the union of its children:
\[
Cover(R_p)\coloneqq \frac{\left|\bigcup_{c\in C(p)}R_c\right|}{|R_p|}.
\]
If \(Cover(R_p)<\delta_{cover}\), the parent is kept; otherwise the children are kept. The paper reports that \(\delta_{contain}\in(0,1)\) controls tolerance, with \(0.85\)–\(0.9\) working well empirically, and that \(\delta_{cover}\in(0,1)\) controls when fine-grained children explain most of their parent, with \(0.4\)–\(0.5\) working well empirically.

HCRF builds a directed containment graph \(G=(V,E)\) on one image’s area set, with an edge \(R_p \to R_c\) iff \(R_p\) contains \(R_c\). This yields a hierarchy or partial order whose roots are areas not contained by any other area. Because containment is defined relative to the child, edges point from larger overlapping regions to smaller ones likely embedded within them. The implementation notes that ties or ambiguities can occur if two areas mutually satisfy containment; deterministic tie-breaking, such as preferring larger \(|R|\) as parent or resolving by area index, keeps the graph acyclic. The resulting forest captures nested structure such as large rooms, subregions, and small objects.

The filtering algorithm has four stated steps. First, construct \(G\) using \(\delta_{contain}\), with \(O(m^2)\) pairwise mask overlaps and optional bounding-box pre-checks or spatial indices. Second, find roots and traverse each tree via DFS. Third, at each parent node, compute \(Cover(R_p)\) and either keep the parent and prune its children or prefer the children and prune the parent. Fourth, apply the resulting keep or prune decisions to \(M\) by removing any match \((i,j)\) whose source index \(i\) is pruned. The complexity is \(O(m^2)\) for graph construction, linear \(O(|V|+|E|)\) for DFS traversal, and \(O(|M|)\) for match pruning; with bounding-box filtering and spatial indexing, graph construction is near \(O(m\log m)\) in practice for sparse overlap patterns.

Within the SGAD pipeline, HCRF is executed after area matching: segmentation, area descriptors, dual-softmax plus MNN, HCRF, and then point matching within selected areas. This placement is justified in the paper by two considerations: it keeps upstream descriptor matching fast, and it avoids pre-filtering that could prematurely discard regions needed to form valid matches. HCRF is geometry-only, does not require the classification and ranking supervision used to train SGAD, and uses no score combination \(s'_i\).

The comparison to standard NMS is explicit. Standard NMS operates flatly on boxes with a single score and suppresses lower-score boxes with IoU above a threshold. HCRF instead builds a hierarchy and makes parent-versus-children decisions via the coverage rule. The listed advantages are preserving semantically coherent representatives while removing redundant overlaps, and handling multi-level nesting where flat NMS would either oversuppress children or keep conflicting overlaps. The listed disadvantages are residual overlap when masks are noisy or only partially contained, and possible recall loss if \(\delta_{cover}\) is too aggressive when true matches are only reliably found in large parents.

Empirically, the paper reports a sensitivity study on 300 pairs with best AUC@5° pose gains of \(+6.79\) on MegaDepth at \((\delta_{cover}=0.4,\delta_{contain}=0.9)\) and \(+7.65\) on ScanNet at \((\delta_{cover}=0.4,\delta_{contain}=0.85)\). The parameter ranges Coverage \(=[0.4\text{–}0.5]\) and Overlap \(=[0.85\text{–}0.9]\) are reported as robust across datasets. SGAD reduces runtime by \(60\times\) relative to MESA, \(0.82\)s versus \(60.23\)s. For MegaDepth, SGAD+LoFTR runs in \(0.82\)s versus \(60.23\)s for MESA+LoFTR and \(1.84\)s for DMESA+LoFTR; for ScanNet, \(0.67\)s versus \(33.44\)s and \(1.38\)s respectively. The abstract further states that SGAD+LoFTR reduces runtime compared to DKM while achieving higher accuracy, \(0.82\)s versus \(1.51\)s and \(65.98\) versus \(61.11\), and that SGAD+ROMA delivers \(+7.39\%\) AUC@5\(^\circ\) in indoor pose estimation.

## 3. HCRF as hierarchical containment pruning in data lakes

In the consolidated description tied to R2D2, HCRF formalizes table-level containment and provides a three-stage hierarchical pruning workflow with theoretical guarantees, followed by a cost-aware optimization for deleting redundant datasets under latency constraints [2312.13427]. The data model treats each dataset as a table with schema \(S\) and row set \(R(T)\). For two tables \(A\) and \(B\), a schema mapping or projection \(\pi:S_A \to S_B\) aligns columns. Schema containment requires \(S_A \subseteq S_B\), and content containment requires
\[
R(A)\subseteq R(B)_\pi.
\]
The containment fraction is
\[
CM(A,B)=\frac{|A\cap B|}{|A|},
\]
with exact containment defined by \(CM(A,B)=1\), and approximate containment by \(CM(A,B)\ge \tau\).

Stage 1 is Schema Graph Builder (SGB). Schemas are flattened into dot-qualified tokens, sorted by size, organized into overlapping clusters, and used to build a superset of all schema-level containment edges. The guarantee is stated as 100% recall at schema level: no true containment edge is missed. The theorem says that if there is a true containment edge \(B \to A\) with \(S_A \subseteq S_B\), then both will appear together in at least one cluster and the edge will be found. The complexity is
\[
O(N\log N)+O(K(N-K))+\sum_i O(|K_i|^2).
\]

Stage 2 is Statistical min–max pruning (MMP). For each candidate edge, min and max are computed over common numeric columns. If \(A \subseteq B\), then for every aligned numeric column \(c\),
\[
\min(A.c)\ge \min(B.c), \qquad \max(A.c)\le \max(B.c).
\]
Violations imply non-containment, so edges can be pruned without false negatives. The stage has \(O(E_1)\) checks and is described as metadata-driven and fast.

Stage 3 is Content-Level Pruning (CLP). For edge \(x \to y\), the method samples up to \(s\) columns from the common schema and up to \(t\) rows from \(y\), then performs a left-anti join of sampled rows against \(x\). If any sampled row in \(y\) is missing in \(x\), the edge is pruned. For exact containment, \(\tau=1\); approximate containment is discussed as future work. The PAC-style sampling bound states that if \(CM(D_2,D_1)\le 1-\epsilon\), then with \(n_s\) uniform random samples,
\[
P(\text{prune}) \ge 1-(1-\epsilon)^{n_s},
\]
and to achieve \(P(\text{prune})\ge 1-\delta\),
\[
n_s \ge \frac{\ln(1/\delta)}{\ln(1/(1-\epsilon))}.
\]
The example given is \(\epsilon=0.1\), \(\delta=0.05\), which yields \(n_s \ge 29\).

The empirical reductions are stated explicitly. For Customer 1, incorrect edges drop from \(6657\) after SGB to \(3414\) after MMP and to \(110\) after CLP, while \(278\) correct edges are retained throughout. For Customer 2, incorrect edges drop from \(1192\) to \(600\) to \(315\), with \(31\) correct edges retained. For Customer 3, incorrect edges drop from \(1769\) to \(421\) to \(272\), with \(21\) correct edges retained. The end-to-end runtime is approximately 5 hours at TB scale, for example Customer 1 total \(\sim 5.24\) hrs and Customer 2 \(\sim 4.89\) hrs.

The pipeline culminates in an optimization over retained datasets \(x_i\) and reconstruction edges \(y_e\). The objective is
\[
\min \sum_i x_i (C_s + C_m f_i)S_i + \sum_i \sum_{e=(u,i)} A_i C_e y_e
\]
subject to reconstructibility and latency constraints, including \(y_{(u,i)} \le x_u\), \(x_i + \sum_{e=(u,i)} y_e \ge 1\), and \(y_{(u,i)} \le 1-x_i\). The description gives an ILP for general graphs and an \(O(N)\) dynamic program, Dyn-Lin, for line graphs. On enterprise data, the optimization recommended deleting 19 datasets for Customer 1 and 12 for Customer 2, with expected GDPR row scan savings of \(5.3\)M per month and \(0.2\)M per month respectively.

The positioning relative to alternatives is also explicit. Naive pairwise containment checks are described as intractable at TB–PB scale. Joinability or unionability baselines such as Bharadwaj et al., JOSIE, LCJoin, SANTOS, and Starmie target different tasks, may lose tuple-level semantics, may require expensive indices or scans, and may fail when tables have different numbers of columns or when containment is across projections. In this mapped usage, HCRF denotes progressive pruning from schema to metadata to content, with soundness in early stages and cost-aware action at the end.

## 4. HCRF as redundancy estimation and hierarchical pruning in CNN compression

In the network-compression setting, the cited paper states that it does not use the name HCRF; its method is called Effective Filter Analysis (EFA) followed by a hierarchical pruning algorithm. The consolidated description maps HCRF to this EFA plus hierarchical pruning pipeline [2206.03596]. Redundancy is estimated from a gradient matrix. For layer \(l\), the weights are flattened to a kernel matrix \(W_l^{flat} \in \mathbb{R}^{c_{out}^l \times d_l}\), and the gradient matrix is
\[
G_l=\frac{\partial E}{\partial W_l^{flat}} \in \mathbb{R}^{c_{out}^l \times d_l}.
\]
A first-order Taylor screening sets gradients to zero when the estimated first-order influence
\[
T(X^i,Y^i,w)=|E(X^i,Y^i,W \mid w=0)-E(X^i,Y^i,W)| \approx \left|\frac{\partial E}{\partial w}(0-w)\right|
\]
is near zero.

Redundancy is then quantified through the singular spectrum of \(G_l\). With
\[
G_l = U_l \Sigma_l V_l^T,
\]
the retained energy after the top \(k\) singular values is
\[
E_k^l = \sum_{i=1}^k (\sigma_i^l)^2, \qquad E_{tot}^l = \sum_{i=1}^{n_l} (\sigma_i^l)^2.
\]
Given a target \(\gamma \in (0,1)\), \(k_l\) is the smallest integer satisfying
\[
\frac{E_k^l}{E_{tot}^l} \ge \gamma.
\]
Layer redundancy is
\[
R_l(\gamma)=1-\frac{k_l}{c_{out}^l},
\]
and global redundancy is
\[
R_{global}(\gamma)=\frac{\sum_l (c_{out}^l-k_l)}{\sum_l c_{out}^l}.
\]

The mathematical interpretation is second-order. With a quadratic Taylor approximation near a trained optimum, the pruning error is
\[
PE_l(\Delta W_l)=\frac{1}{2}\Delta W_l^T H_l \Delta W_l.
\]
The spectral-tail proposition states that if pruning removes the subspace spanned by directions beyond \(k_l\), then
\[
\Delta PE_l \le \frac{1}{2}\sum_{i=k_l+1}^{n_l}\lambda_i^l \langle \Delta W_l, u_i^l \rangle^2 \le \frac{1}{2}\lambda_{tail}^l \|\Delta W_l\|^2.
\]
Under the energy threshold \(\gamma\), this yields
\[
\Delta PE_l \le \frac{1}{2}(1-\gamma)C_l.
\]
The accumulated output-error bound is
\[
\widetilde{\epsilon}_{L-1} \le \sum_{k=1}^{L-2}\left(\prod_{l=k+1}^{L-1}\|\widehat{W}_l\|_F\right)\sqrt{\Delta PE_k} + \sqrt{\Delta PE_{L-1}}.
\]

The hierarchy is defined as weights, filters, channels and layers, and blocks. Per-filter selection uses entropy
\[
H_f^l = -\sum_{j=1}^{m} p_j \log p_j,
\]
with \(m=1000\) histogram bins. Lower entropy indicates more concentrated and less informative weights. Cross-layer redundancy uses
\[
CE(L-1,L) = -\sum_{j=1}^{m} p_j^{L}\log p_j^{L-1}.
\]
Lower cross-entropy indicates statistical similarity and potential redundancy across adjacent layers. The pruning budget is constrained by guards such as \(k_l \ge k_{min}\) and \(c_{out}^l (1-r_l) \ge c_{min}\), with empirical settings such as \(c_{min}=5\) filters.

The algorithm is one-shot hierarchical pruning followed by retraining. The tested energy-retention values are \(\gamma \in \{0.99,0.95,0.90\}\) for CIFAR-10 and \(\gamma=0.99\) for ImageNet. The reported post-pruning retraining schedules are: for CIFAR-10, SGD, initial learning rate \(0.1\), batch \(128\), weight decay \(5\times 10^{-4}\), momentum \(0.9\), 160 epochs, and learning-rate decay by \(\times 0.1\) at epochs 80 and 120; for ImageNet, 4 GPUs, batch 256, weight decay \(10^{-4}\), momentum \(0.9\), 100 epochs, learning-rate decay every 30 epochs, and dropout increased from \(0.5\) to \(0.8\) in pruned VGG fully-connected layers.

The empirical results reported in the description are detailed. On CIFAR-10, VGG-A baseline Top-1 is \(93.69\%\), while VGG-A pruned\(_{0.95}\) achieves \(93.49\%\) with 788 filters, \(81.34\%\) filters pruned, \(0.78\)M parameters with \(94.69\%\) pruned, and \(125.84\)M FLOPs with \(59.92\%\) pruned. ResNet56 baseline Top-1 is \(93.73\%\); pruned\(_{0.99}\) achieves \(93.46\%\) with \(48.24\%\) parameter pruning and \(23.81\%\) FLOPs pruning; pruned\(_{0.95}\) reaches \(92.34\%\) at \(71.76\%\) parameter pruning; pruned\(_{0.9}\) reaches \(91.92\%\) at \(80\%\) parameter pruning. On ImageNet, VGG16-bn pruned\(_{0.99}\) achieves Top-1 \(71.62\%\) with \(72.78\%\) parameters pruned and \(32.39\%\) FLOPs pruned; VGG19-bn pruned\(_{0.99}\) achieves \(71.78\%\) with \(79.75\%\) parameters pruned and \(56.93\%\) FLOPs pruned; ResNet50 pruned\(_{0.99}\) achieves Top-1 \(73.21\%\), Top-5 \(91.11\%\), \(52.76\%\) parameter pruning, and \(58.14\%\) FLOPs pruning.

In this mapped usage, HCRF refers to a containment-aware pruning regime whose purpose is not geometric overlap removal but safe distribution of pruning across nested architectural levels. The description emphasizes guards against over-pruning, spectrum-tail control through \(\gamma\), and cross-layer containment decisions rather than flat thresholding alone.

## 5. HCRF as ontology-aware redundancy elimination in GO-based TAN

The paper on HRE-TAN likewise does not use the name HCRF, but the consolidated description maps its hierarchical redundancy elimination mechanism to that notion [1607.01690]. The underlying structure is the Gene Ontology (GO) DAG \(G=(V,E)\), where edges encode relations such as is\_a and part\_of. The true-path rule implies that if a gene is annotated with a specific child term, it is also annotated with all ancestor terms. With binary features \(X_v \in \{0,1\}\), for any ancestor–descendant pair \((a,d)\),
\[
X_d(s)=1 \Rightarrow X_a(s)=1, \qquad X_a(s)=0 \Rightarrow X_d(s)=0.
\]

Containment redundancy is defined at the instance level: two hierarchically related features are redundant for an instance \(s\) if they share the same value. Formally,
\[
Redundant(a,d;s) \Leftrightarrow [a \in Anc(d) \vee d \in Anc(a)] \wedge [X_a(s)=X_d(s)].
\]
A dataset-level information criterion is also given in the description: if \(I(X_a;C\mid X_d)\le \epsilon\), then \(X_a\) is redundant given \(X_d\) for predicting the class, or symmetrically for \(I(X_d;C\mid X_a)\le \epsilon\).

The TAN model factorization is
\[
P(C,X_1,\ldots,X_n)=P(C)\prod_{i=1}^{n} P(X_i \mid C, Pa(X_i)),
\]
with edge weights
\[
w_{ij}=I(X_i;X_j \mid C),
\]
and conditional mutual information defined as
\[
I(X;Y \mid C)=\sum_{x,y,c} p(x,y,c)\log \frac{p(x,y \mid c)}{p(x \mid c)p(y \mid c)}.
\]

HRE-TAN integrates redundancy elimination during TAN tree construction and does so lazily per test instance. Edges are sorted in descending conditional mutual information. For each test instance \(s\), an undirected acyclic graph (UDAG) is built incrementally. An edge \(E(x_i,x_j)\) is added only if it is available, \(x_i\) and \(x_j\) are non-hierarchically redundant in the current instance, and adding it does not create a cycle. After an edge is added, all edges incident to ancestors or descendants that have the same value as the included endpoint are marked unavailable. The description states that this implicitly keeps the node whose edge enters the UDAG earliest, because earlier edges have higher conditional mutual information.

The classifier is then applied only to the selected non-redundant subset \(X'\):
\[
P(C,X') = P(C)\prod_{X_i \in X'} P(X_i \mid C, Pa(X_i)),
\]
and prediction uses
\[
\hat{y} = \arg\max_c \hat{P}(C=c)\prod_{i\in X'} \hat{P}(X_i=x_i \mid C=c, Pa(X_i)=p_i).
\]

The reported evaluation covers 28 datasets formed from 4 model organisms and 7 GO feature sets, with 10-fold cross-validation and geometric mean
\[
GMean = \sqrt{Sensitivity \times Specificity}.
\]
HRE-TAN achieved higher GMean on 18 of 28 datasets, TAN on 8 of 28, and 2 ties. A two-tailed Wilcoxon signed-rank test showed that HRE-TAN significantly outperformed TAN at \(\alpha = 0.05\). With respect to class imbalance, the degree of imbalance \(D\) ranged from \(0.234\) to \(0.856\), and the correlation between GMean and \(D\) was \(-0.479\) for HRE-TAN versus \(-0.801\) for TAN, which the paper interprets as improved robustness.

The listed limitations are over-pruning risk when same-valued ancestor and descendant terms may still carry complementary information, and excessive pruning in highly sparse annotations where equal-value redundancy for value 0 is common. Suggested mitigations in the description include information thresholding, validation-driven selection, and path-aware exceptions. A terminological clarification is explicit: here HCRF refers to hierarchical containment redundancy filtering, not Hidden Conditional Random Fields.

## 6. Comparative properties, misconceptions, and limitations

The most direct commonality across these usages is hierarchical rather than flat redundancy elimination. In SGAD, HCRF is contrasted explicitly with standard NMS, which ignores parent–child nesting and union coverage. In R2D2, it is contrasted with naive pairwise containment checks and with joinability or unionability systems that lose tuple-level semantics or require expensive scans. In the CNN and GO settings, the mapped HCRF mechanisms likewise introduce hierarchical guards or ontology-aware suppression to avoid failure modes associated with flat criteria.

A second commonality is asymmetric containment. SGAD defines containment relative to the child area via \(|R_p \cap R_c|/|R_c|\). R2D2 defines containment of a table \(A\) in a larger table \(B\) through schema projection and row inclusion. HRE-TAN uses the GO true-path implication, where specific descendants imply ancestors. The CNN case is structurally different, but the mapped hierarchy still imposes containment-style constraints across weights, filters, layers, and blocks. This suggests that HCRF is better understood as a structural pruning pattern rather than a single domain-independent formula.

The limitations are domain-specific but similar in spirit. In SGAD, noisy masks or partial overlaps can leave residual redundancy, and aggressive \(\delta_{cover}\) can hurt recall. In R2D2, transformations beyond projections are out of scope, exact schema containment is assumed as a necessary condition, and Spark sampling without indexes may still scan larger partitions. In CNN compression, highly sensitive narrow layers or critical residual paths can degrade under aggressive pruning, especially when the spectral gap is small. In HRE-TAN, same-value suppression may remove useful complementary information, and sparse annotations can make value-0 redundancy overly aggressive.

A common misconception is that HCRF names a single standardized algorithm across the literature. The cited materials do not support that interpretation. The name is explicit in SGAD, while the descriptions of R2D2, EFA plus hierarchical pruning, and HRE-TAN state that those original papers use different names and are only being mapped conceptually to HCRF [2508.02278]. Another misconception arises from acronym collision: in ontology and graphical-model literature, HCRF can also denote Hidden Conditional Random Fields, but that is explicitly not the intended meaning in the GO-based redundancy-elimination context [1607.01690].

Taken together, the cited works define a technically coherent family of containment-aware redundancy filters. Their concrete realizations differ in objects, containment predicates, theoretical guarantees, and optimization criteria, but each uses hierarchy to replace duplicated computation or duplicated evidence with a smaller representative set, while preserving task-relevant structure.

Source: https://www.emergentmind.com/topics/hierarchical-containment-redundancy-filter-hcrf