GPU-Accelerated Tensor Operations for CKKS-Based CNN Inference on Homomorphically Encrypted Data
This paper presents a GPU-accelerated framework that integrates the TenSEAL library with a custom CUDA backend for the Troy CKKS library, enabling efficient, tensor-level encrypted CNN inference on compact and edge devices that significantly outperforms both high-end CPU servers and operation-level GPU baselines.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In the digital age, the promise of artificial intelligence often comes with a hidden cost: the need to hand over private data to a server to be processed. Whether it is a medical record, a financial transaction, or a personal photograph, the current standard requires decrypting information to make sense of it, leaving it vulnerable in the process. Homomorphic encryption offers a way out of this dilemma. It is a mathematical method that allows a computer to perform calculations on data that remains locked in a scrambled state. The computer can add, multiply, and analyze the encrypted numbers without ever seeing the original values, returning a result that, when unlocked, is mathematically identical to what would have been produced from the raw data. This technology holds the potential to revolutionize privacy, but for years, it has been too slow for practical use. The calculations required to keep data encrypted while working on it are so computationally heavy that they can take hours or even days to process a single image, rendering the technology useless for real-time applications like recognizing faces or diagnosing diseases.
A team of researchers from Spain and Portugal has now developed a new approach that brings this slow, theoretical technology into the realm of the practical, specifically for analyzing images using artificial intelligence. They focused on a specific type of encryption called CKKS, which is designed to handle the approximate numbers used in image recognition, and they built a system to run these calculations on graphics processing units, or GPUs. These are the powerful chips found in computers and smartphones that are designed to handle massive amounts of data simultaneously. The researchers did not simply speed up the existing code; they fundamentally rethought how the computer organizes the work. Instead of treating the encrypted data as a long chain of individual, sequential steps, they designed a system that processes entire layers of an image analysis network all at once. By doing this, they created a bridge between high-level software instructions and the raw speed of modern hardware, allowing complex image recognition tasks to be performed on encrypted data in a fraction of the time previously thought possible.
The core of their work involves a method called layer-level execution. In a typical artificial intelligence network that analyzes images, the data passes through a series of stages, or layers. Some of these layers look for edges and shapes, others group similar pixels together, and others combine information to make a final decision. In previous attempts to run these networks on encrypted data, the computer would have to stop after every single mathematical operation, reorganize the data, and then start the next step. This constant stopping and starting created a massive bottleneck. The new system, which integrates with a popular software framework called TenSEAL, allows the computer to execute an entire layer of the network in one continuous burst. It treats the encrypted image not as a series of isolated numbers, but as a large, organized block that can be manipulated in parallel. This is similar to how a librarian might sort a single book versus sorting an entire shelf of books at once; the new method allows the computer to sort the whole shelf simultaneously, rather than handling each book one by one.
To test this idea, the researchers built a set of specialized instructions, known as kernels, that tell the graphics card exactly how to handle these large blocks of encrypted data. They tested their system on two different types of hardware: a compact, high-performance server chip and a smaller, energy-efficient chip designed for edge devices like advanced drones or autonomous vehicles. They compared the performance of their new method against two benchmarks: a standard, powerful server with ninety-six processor cores, and an older version of their own software that ran on the same graphics card but used the slower, step-by-step approach. The results were striking. When processing the complex mathematical operations required for image recognition, the new system on the compact server chip was up to seven and a half times faster than the massive ninety-six-core server. When compared to the older, step-by-step method running on the same graphics card, the new system was up to two hundred and fifty-eight times faster for certain types of calculations.
The researchers did not stop at measuring raw speed; they also verified that the new system produced accurate results. They ran two different image recognition models, one designed to identify handwritten digits and another for classifying small objects, through their encrypted system. They compared the final answers from the encrypted processing against the answers from processing the same images without encryption. The difference was negligible. The encrypted system made the same correct predictions as the unencrypted one, with only tiny, mathematically expected variations in the numbers that did not affect the final outcome. This confirmed that the speed gains did not come at the cost of accuracy or reliability. The system successfully preserved the privacy of the data while delivering the same high-quality results as traditional methods.
One of the most significant findings of the study is that this level of performance is achievable even on compact and edge devices. For a long time, the high cost of homomorphic encryption meant it could only be run on massive, power-hungry data centers. The researchers demonstrated that their optimized approach allows these privacy-preserving calculations to run efficiently on smaller, more portable hardware. This opens the door for applications where data never needs to leave the device it was created on. A medical device could analyze a patient's scan locally without ever sending the raw image to a cloud server, or a smart camera could recognize a face without transmitting the visual data to a central database. The study proves that the computational barrier is no longer an insurmountable wall, but a hurdle that can be cleared with the right architectural design.
While the new system offers dramatic improvements, the researchers noted that not every part of the process benefits equally from this approach. The most complex operations, which involve re-organizing the encrypted data to prepare it for the next step, still consume a significant amount of time. In these specific cases, the advantage of the new method over the older graphics card approach was less pronounced, though still substantial. This suggests that while the layer-level strategy is a major leap forward, there is still room for further refinement in how the most difficult parts of the calculation are handled. The researchers plan to explore different ways of mapping these complex tasks to the hardware in the future, aiming to squeeze out even more efficiency.
The work represents a tangible step toward a future where privacy and performance are not mutually exclusive. By redesigning how encrypted data moves through a computer, the team has shown that it is possible to run sophisticated artificial intelligence on locked data without sacrificing speed. The results indicate that the era of practical, privacy-preserving machine learning is no longer a distant theoretical possibility, but a reality that can be deployed on the hardware we already have. The ability to process images securely and quickly on compact devices suggests that the next generation of secure applications will be able to operate independently, keeping sensitive information safe while still delivering the intelligent insights that modern users expect.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.