Skip to main content
Back

FCA Framework Turns Neural Network Hidden Layers Into Human-Readable Rules

A neuro-symbolic framework turns a network's last hidden layer into a formal concept lattice, enabling global explanations, architecture comparisons, and rule extraction.

Pro

  • New framework conceptual views gives global, post-hoc explanations of neural networks using Formal Concept Analysis.
  • Turns the last hidden layer into a pseudo-metric space; 1-NN surrogates reach 0.999 fidelity on ResNet152V2.
  • Gromov-Wasserstein distance on the class view produces meaningful architecture clusters, unaffected by neuron permutations.
  • Symbolic view enables decision-tree surrogates and subgroup-discovery rules linking neurons to human-readable features.
  • Tanh activations with threshold zero strongly recommended; ReLU breaks the binary scaling and yields poor symbolic classification.
  • Code and trained models available on GitHub; does not yet cover Transformers or regression.

Understanding what a neural network has actually learned is still one of the hardest problems in the field. Saliency maps and attention heatmaps can hint at why a single prediction happened, but they say almost nothing about the model as a whole. A new paper proposes a different approach: convert the last hidden layer into an algebraic structure that can be read, compared across architectures, and mined for human readable rules.

The framework, called conceptual views, is built on Formal Concept Analysis (FCA), a branch of applied lattice theory that turns binary object-attribute tables into hierarchies of concepts. The authors introduce two complementary representations: a many-valued conceptual view that captures the real-valued activation and weight structure as a pair of matrices, and a symbolic conceptual view that discretizes this structure via conceptual scaling, yielding a binary relational representation. Code and trained models are on GitHub.

Why global explanations are hard

Local methods such as saliency maps or activation highlighting work for flat data like images, but they are less applicable to high-dimensional or complex data where human visual inspection is infeasible. Global approaches, by contrast, are inherently more challenging and therefore less explored. Concept Bottleneck Models attack the problem by baking interpretable concepts into the architecture itself, but that means retraining or heavily modifying a network. The conceptual views approach is post hoc: it analyzes whatever network you already have.

The core object is the last hidden layer. Each input becomes a row of neuron activations (the object view), and each output class becomes a row of weights connecting it to those neurons (the class view). Stack them together and you get a shared vector space where images and labels live side by side, which lets you classify by nearest neighbor and compare architectures with a distance metric.

How it works

The pipeline has three stages:

  1. Many-valued view. Build the two matrices (activations and output weights) and treat them as a pseudo-metric space over inputs and classes.
  2. Symbolic view. Apply dichotomic scaling: pick thresholds and turn each real value into a pair of binary attributes ("neuron j fires" vs "neuron j does not fire").
  3. Reasoning. Feed the resulting formal context into FCA to build a concept lattice, then run symbolic tools like subgroup discovery on top.

For comparing two networks, the authors use the Gromov-Wasserstein distance, which solves an optimization problem that seeks isometric mappings of the pseudo-metric spaces of two neural networks into a common third space. Unlike Centered Kernel Alignment, this measure is invariant to neuron permutations, which matters when the two networks have entirely different internal orderings.

The numbers

The evaluation covers all twenty-four TensorFlow ImageNet models, with the object view computed on the 100k image ILSVRC test set, plus controlled Fruits-360 experiments. Some highlights:

  • The many-valued view achieves high fidelity across the majority of models, with MobileNetV1 the notable exception, attributed to its compact architecture and aggressive dimensionality reduction. Euclidean distance is consistently superior to cosine similarity, with particularly large gaps for ResNet models.
  • 1-NN surrogates hit 0.999 fidelity on ResNet152V2 and 0.985 on EfficientNetB7 using Euclidean distance in the view space.
  • Classes are uniquely represented in the symbolic view (class separation equals 1.0), but direct 1-NN classification on the binary vectors yields very poor performance for ReLU-based models, while Swish-based models achieve mediocre to good results that improve for larger architectures.
  • On Fruits-360 with Tanh, symbolic-view decision trees hit fidelity above 0.93, even though decision trees on the raw many-valued view essentially failed.

The activation function matters more than you think

One of the more practically useful findings is a sharp recommendation about activations. A ReLU neuron only takes positive values, which makes it hard to define a reasonable threshold for the negated attribute, so dichotomic scaling produces meaningless "neuron did not fire" columns. Tanh, being symmetric around zero, gives a clean 50/50 split and stable rule extraction. If you plan to run this analysis on your own model, Tanh in the last hidden layer with a threshold of zero is the recommended setup.

From neurons to rules

The end goal is not just a surrogate classifier but abductive learning: mapping individual neurons to human vocabulary. The authors pair the symbolic view with background knowledge (shapes, colors, and Wikipedia taxonomy for fruits) and run subgroup discovery via pysubgroup to find propositional rules. Example outputs: fruits that are not brown, not stained, not orange, and not star-shaped activate a specific negated neuron; and a combination of three inactive neurons predicts "orange" with confidence around 0.54. The concept lattice also exposes structural failure modes, such as IncV3 being unable to distinguish Cherry from Plum, or EffB0 collapsing Apple Red and Pink Lady.

What it is not good for

The limitations are laid out honestly. The current formalization assumes feed-forward networks with a well-defined last hidden layer, and adapting it to recurrent or attention-based architectures like Transformers would require a substantial extension. The class view also requires multiple output neurons, so regression settings remain unexplored. Concept lattices grow exponentially with the number of attributes, which does not stop computation but does prevent direct visual inspection past small neuron counts. And the quality of any human-comprehensible rule is bounded by the quality of the background ontology you plug in.

For anyone working on model auditing, transfer learning selection, or neuro-symbolic pipelines, the practical takeaway is that a lot of interpretability infrastructure from the FCA world, decades of it, is suddenly applicable to modern CNNs with a fairly small amount of glue code, provided the network was trained with symmetric activations.