A processing-in-pixel-in-memory paradigm for resource-constrained TinyML applications

Gourav Datta, Souvik Kundu, Zihan Yin, Ravi Teja Lakkireddy, Joe Mathai, Ajey P. Jacob, Peter A. Beerel, Akhilesh Jaiswal

Abstract

As computer vision moves toward the extreme edge, the energy and bandwidth costs of transferring high-resolution raw data from sensors to processors have become a primary bottleneck. This paper presents P$^2$M (Processing-in-Pixel-in-Memory), a hardware-software co-design that embeds the initial layers of a Convolutional Neural Network (CNN) directly within a standard CMOS pixel array. By leveraging transistor widths as weights and re-purposing peripheral circuits for activation functions, P$^2$M achieves a 21× reduction in data bandwidth and an 11× improvement in energy efficiency for TinyML tasks like person detection, while maintaining high accuracy on real-world datasets.

1. Introduction: The "Data Tax" in Edge Vision

Modern computer vision systems are increasingly deployed on resource-constrained devices, a field known as TinyML. However, these systems face a significant "data tax." In traditional architectures, high-resolution sensors capture analog signals that must be digitized and moved across a data bus to a separate processor (CPU, GPU, or NPU). This movement creates three critical bottlenecks:

  1. Energy Consumption: Data movement often consumes more power than the actual computation.
  2. Bandwidth Constraints: Streaming millions of pixels per frame limits the achievable frame rate and increases latency.
  3. Security Risks: Transmitting raw, unencrypted images makes them vulnerable to interception.

While "near-sensor" or "in-sensor" processing (placing logic at the edge of the array) mitigates some issues, they still require the full digitization of every pixel. P$^2$M addresses this by performing computation inside the pixel array using standard, foundry-ready CMOS technology, eliminating the need to stream raw data entirely.

2. The P2M Architecture: In-Pixel Computation

The P$^2$M paradigm shifts the first few layers of a CNN into the analog domain of the image sensor. This is achieved through three primary circuit innovations:

2.1 Weight-Embedded Pixels

Unlike standard 3-transistor pixels, P$^2$M utilizes pixels where additional transistors are sized such that their physical widths represent the "weights" of a neural network. Multiplication occurs naturally as the photodiode current (the input) is modulated by the transistor's driving strength (the weight).

2.2 Analog Accumulation

The summation part of the convolution operation is performed directly on the column lines of the sensor array. By aggregating the outputs of multiple weight-embedded pixels in the analog domain, the system avoids the energy-intensive process of digitizing individual pixel values before summation.

2.3 Re-purposing Peripheral Circuits

Standard digital cameras include Correlated Double Sampling (CDS) circuits and Analog-to-Digital Converters (ADCs). P$^2$M re-programs these components to perform Batch Normalization (BN) and ReLU activation. By adjusting ADC timing and utilizing its inherent clipping behavior, the system implements non-linear functions essentially for "free" during the digitization of the final feature maps.

3. Hardware-Software Co-Design

Standard CNN architectures, such as MobileNetV2, are not naturally optimized for the physical constraints of a pixel array. To bridge this gap, the authors employed an algorithm-circuit co-design approach. The model was optimized using larger strides and a reduced number of channels in the first layer to align with the physical layout of the sensor. This ensures that the hardware remains efficient and manufacturable without significantly compromising the model's predictive power.

4. Experimental Evaluation

4.1 Dataset: Visual Wake Words (VWW)

The researchers evaluated P$^2$M using the Visual Wake Words dataset. Unlike simpler benchmarks like MNIST, VWW represents a realistic TinyML use case: determining if a person is present in a high-resolution frame to "wake up" a larger system. This provides a rigorous test of the system's ability to handle complex, real-world visual data.

4.2 Key Results

The P$^2$M-optimized MobileNetV2 achieved an accuracy of 89.90% on the VWW task, a minimal drop from the 91.37% baseline. However, the efficiency gains were substantial:

  • Bandwidth: Data transfer requirements were reduced by 21×.
  • Energy Efficiency: The Energy-Delay Product (EDP) improved by 11× compared to near-sensor baselines.
  • Memory Footprint: Peak RAM requirements dropped from 7.53 MB to 0.30 MB, making the system compatible with ultra-low-power microcontrollers.

5. Discussion and Limitations

A primary advantage of P$^2$M is its "foundry-first" philosophy; it uses standard 22nm FD-SOI CMOS processes rather than exotic materials. However, certain limitations remain. In the current design, weights are hardcoded into the transistor geometry during manufacturing, meaning the first layer cannot be updated via software. Additionally, analog computing is susceptible to noise and manufacturing variations, though simulations suggest the model is robust to these effects.

6. Conclusion

P$^2$M demonstrates that significant efficiency gains in TinyML can be achieved by rethinking the boundary between sensing and computing. By moving the heaviest data-processing tasks into the pixel array itself, P$^2$M paves the way for always-on, privacy-preserving, and ultra-low-power computer vision systems.

Summary updated

BibTeX
@inproceedings{datta2022processing,
  author = {Gourav Datta and Souvik Kundu and Zihan Yin and Ravi Teja Lakkireddy and Joe Mathai and Ajey P. Jacob and Peter A. Beerel and Akhilesh Jaiswal},
  title = {{A processing-in-pixel-in-memory paradigm for resource-constrained TinyML applications}},
  booktitle = {Scientific},
  year = {2022},
  doi = {10.1038/s41598-022-17934-1},
}
Figure