k-Multisection Neuron Coverage (KMNC)
- k-Multisection Neuron Coverage (KMNC) is a testing metric that partitions each neuron's activation range into k equal sections to assess test input diversity.
- It computes coverage by profiling neuron activations to determine bounds and then mapping test inputs to the corresponding activation sections.
- KMNC helps identify under-tested activation ranges and guides parameter selection, while its effectiveness depends on accurate profiling and appropriate k values.
k-Multisection Neuron Coverage (kMNC) is a structural testing metric designed to quantify how thoroughly a test suite exercises the internal activation space of a deep neural network (DNN). Unlike plain neuron coverage, which measures whether a neuron is ever activated, kMNC evaluates how extensively test inputs explore the range of activations for each neuron by partitioning that range into discrete sections and tracking coverage of each. This metric is applicable to the hidden layers of feed-forward DNNs and provides a more fine-grained view of test adequacy (Usman et al., 2022).
1. Formal Definition
Let denote the total number of neurons across all hidden layers of a DNN (excluding input and output layers by convention). For each neuron , a profiling set (often the training set) is used to empirically determine the closed activation interval , where
This interval is divided into equal-length sections per neuron. For to , the th section for neuron is defined as
0
with the last section typically closed on the right. For a given test input 1, section 2 is covered if 3.
2. Computation Procedure
The computation of kMNC proceeds in the following steps:
- Profiling activations: For each neuron 4, collect 5 and 6 using the profiling set.
- Sectioning per neuron: Compute 7 sections 8 for each neuron.
- Initialization: Set up a Boolean table 9 for each neuron-section pair.
- Test coverage evaluation: For each test input 0 in the test suite 1 and for each neuron 2:
- Compute the activation 3.
- Compute the bin index:
4
(clamped to 5). 3. Mark 6.
- Aggregating coverage: After all test inputs, count the number of 7 entries in the 8 matrix.
3. Metric Formula
The overall kMNC score is computed as: 9 where
0
Here, 1 is the neuron count (in hidden layers), 2 is the number of sections per neuron, 3 is the 4-th activation interval of neuron 5, and 6 is the test set. The metric thus represents the fraction of all neuron-section pairs that are exercised by at least one test input (Usman et al., 2022).
4. Illustrative Example
Consider a scenario with two neurons (7) each divided into 8 sections:
- Profiling yields: 9; 0.
- Each section has width 1 for both neurons.
| Neuron | Section 1 | Section 2 | Section 3 | Section 4 | |--------|----------------|--------------|--------------|-------------| | 1 | [0,2) | [2,4) | [4,6) | [6,8] | | 2 | [2,4) | [4,6) | [6,8) | [8,10] |
Suppose test suite 2 produces the following activations:
- 3: 4 (bin 1), 5 (bin 2)
- 6: 7 (bin 3), 8 (bin 4)
- 9: 0 (bin 4), 1 (bin 1)
Coverage summary:
- Neuron 1: bins 1, 3, 4 covered
- Neuron 2: bins 1, 2, 4 covered
Out of 2 bins, 3 are covered, yielding 4 (Usman et al., 2022).
5. Advantages and Limitations
Benefits
- More fine-grained than plain neuron coverage, enabling detection of test-set inadequacy that broad coverage metrics may miss.
- Explicitly measures the extent to which the test suite exercises the full activation range of each neuron.
- Can identify “dead” sections of activation range even when a neuron is sometimes activated.
- Straightforward to implement and scales well to large networks (Usman et al., 2022).
Limitations
- Strong dependence on quality profiling: if 5 is misestimated, section boundaries may become uninformative.
- Purely structural—does not account for semantic relationships or clusters in the input space.
- Sensitivity to parameter 6: small 7 leads to coarse, easily saturated coverage; large 8 may result in bins that are rarely or never covered without a very large test suite.
- Does not account for interactions or dependencies between neurons; it only analyzes 1-D activation axes (Usman et al., 2022).
6. Parameter Selection and Practical Guidance
Practical guidance for selecting 9 includes:
- For typical convolutional architectures, an initial 0 balances resolution with tractability.
- If kMNC rapidly saturates, increasing 1 may reveal additional inadequacies in the test set.
- If coverage remains low across many tests, consider reducing 2.
- Monitoring the slope of kMNC as new tests are added can inform about diminishing returns in test adequacy.
In operational use, kMNC is often computed alongside other neuron-level and decision-structure coverage criteria, such as top-3 neuron coverage, neuron boundary coverage, and MC/DC variants. Combining these criteria supports comprehensive test generation and test-suite minimization (Usman et al., 2022).