Lens AI Profiler Cpp
|
Lensai profiler Cpp is a C++ library designed for AI model observability and data sampling in real-time, specifically focused on edge devices. The goal of lens AI is to Manage, debug, and retrain AI models at the edge efficiently. Lens AI Cpp profiler includes three libraries: libimageprofiler.so
, libimagesampler.so
, and libmodelprofiler.so
. The current version of LensAI is focussed towards Vision but soon will support the other data types.
During the model training process, It is important to profile the base line metrics, so that later they can be used for the drift and error approximation. use the lensai_profiler_python : github library to profile the training data. This step is crucial for establishing baseline profiles for data and model performance.
During model deployment, integrate this Lensai C++ profiling code. This integration profiles athe real-time data and model metrics during inference, enabling continuous monitoring. It also samples the data that the model is most uncertain about using multiple sampling techniques.
Use the LensAI Server to monitor data and model drift by comparing profiles from the training phase and real-time data obtained during inference. github Detailed instructions and implementation examples are available in the examples directory.
The data structures used by Lens AI operate with a fixed amount of memory, making them ideal for applications with memory constraints or long-running processes where memory usage must remain predictable and bounded.
Unlike classical histograms that might require more memory as more data is processed or as data complexity increases (e.g., higher resolution, multiple channels), these sketches maintain a consistent memory footprint, ensuring efficient scalability.
Lens AI's data structures provide quantifiable error bounds for their approximations. This allows control over the trade-off between memory usage and accuracy, ensuring reliable results within acceptable error margins.
These data structures dynamically adjust to the data distribution, providing better accuracy for varying data, unlike classical histograms that might become less accurate if the data distribution changes significantly.
Lens AI leverages KLL sketches for highly efficient quantile queries, essential for understanding data distributions and for various statistical analyses. Classical histograms require additional processing to derive quantiles, which can be computationally expensive and less accurate.
The datastructures allow for efficient computation of a wide range of statistical summaries, making them suitable for complex data analysis tasks beyond simple frequency counts.
KLL datastructures are designed for incremental updates, making them highly efficient for streaming data scenarios. Each insertion has an amortized logarithmic time complexity, which is manageable even for high-throughput data streams.
In streaming data applications, the sketches handle data incrementally without the need to reprocess entire datasets, unlike classical methods that might require recalculating histograms from scratch when new data arrives.
In practice, these sketches offer high accuracy for quantile estimation with significantly less memory usage than exact methods, making them a practical choice for many real-world applications.
In scenarios involving high-resolution images or multiple channels (e.g., RGB), the sketches manage the complexity efficiently, avoiding the pitfalls of multidimensional histograms which can be cumbersome and memory-intensive.
The sketches automatically adjust to the range and distribution of incoming data, reducing the need for manual tuning of bin ranges and resolutions, often required in classical histograms.
Using a single, unified data structure for summarizing distributions simplifies data management and processing pipelines, reducing complexity and potential for errors.
The sketches are designed for distributed computing environments where data may be processed across multiple nodes or systems. They can be merged efficiently across nodes to provide a unified view of the data distribution, enabling scalable processing of large datasets.
Please find the product roadmap and next planned releases [here]()
Before you begin, ensure you have met the following requirements:
You can download and install prebuilt packages for various platforms:
Debian: Download Lensai-v1.0.0-linux.tar.gz Raspian: Download Lensai-v1.0.0-linux.tar.gz
Installation Instructions
For Linux: tar -xzf Lensai-v1.0.0-linux.tar.gz sudo cp -r Lensai /usr/local/
Please refer the examples directory for the detailed implementation examples.
Refer to the examples in the example folder
Refer to the documentation
Looking for the more contributors with Love.
Apache 2
Apache Datasketches
vsnm. tej@ gmail .com