Accelerate AI Applications with Neural Network Compression Framework NNCF OpenVINO
AI Upscaling, also known as Image Upscaling or Super-Resolution, employs Deep Neural Networks to upscale image resolution. Popular AI upscaling uses include restoring 1990s and 2000s lower-resolution photos and movies. AI upscaling can convert 360p or lower images to 1080p or 4K without compromising clarity.
This article shows how to run a popular AI Upscaling model on Intel’s AI Boost Neural Processing Unit (NPU) in the Intel AI PC (powered by Intel Core Ultra processor). CPU, GPU, and NPU in a 3D performance hybrid architecture with high-bandwidth memory and cache accelerate AI on the PC in Intel Core Ultra processor. To enable Intel AI Upscaling model to operate efficiently on the Intel AI PC, it will employ the Neural Network Compression Framework (NNCF) for weight compression and the Intel Distribution of OpenVINO toolkit.
AI Upscaling Model
The Blind Super-Resolution Generative Adversarial Network, or BSRGAN, is the AI Upscaling model that will be employed. Enhanced Super-Resolution Generative Adversarial Network (ESRGAN) and BSRGAN share the same design. A Generative Adversarial Network (GAN) structure is used by both BSRGAN and ESRGAN to enable the generator to produce more representative upscaled images that match the ground truth. In contrast to ESRGAN, BSRGAN is trained on synthetic photos that can depict various types of image deterioration, or, to put it another way, the causes of the noise, blurring, and other issues that make lower resolution photographs generally of lower quality. As a result, BSRGAN can more broadly apply to real-world scenarios where various degradations occur.
OpenVINO toolkit and NNCF
OpenVINO, an open-source deep learning toolkit, can deploy deep learning models quickly using hardware optimisations. PyTorch, TensorFlow, ONNX, and other models can be translated to OpenVINO’s IR. format. OpenVINO then does deep learning inference effectively using this IR and the hardware accelerators that are available.
A deep learning framework called the Neural Network Compression Framework (NNCF) makes it simple for users to incorporate training-aware and post-training deep learning compression methods (such quantisation techniques) into their deep learning models. Among other model formats, it supports PyTorch and OpenVINO models.
AI PC
With a central processing unit (CPU), graphic processing unit (GPU), and neural processing unit (NPU), AI PCs are the next generation of personal computers that allow for power-efficient AI acceleration and local handling of AI activities. For quick and effective AI experiences, AI PCs with Intel Core Ultra CPUs can strike a balance between power and performance. The AI PC can effectively carry out a range of AI tasks with NPUs, which are specialised hardware made for AI capabilities.
Code Sample
The AI PC Notebooks GitHub Repository has this code sample. Here, an image and video optimised for Intel’s AI Boost NPU are AI-upscaled using the BSRGAN model with OpenVINO and NNCF.
The code sample implements the subsequent steps:
PyTorch to OpenVINO model conversion:The BSRGAN model can be loaded and then converted to the OpenVINO format. They must supply an explicit input shape for the BSRGAN model because OpenVINO only allows static forms for the NPU at this time. OpenVINO will allow dynamic forms for the NPU in upcoming releases.
ov_model = ov.convert_model(
cpu_model,
input=[1, 3, width, height],
example_input=torch.randn(1, 3, width, height),
)
Compress model weights: Data-free 4-bit symmetric quantisation is applied to the BSRGAN model using the NNCF framework. The 32-bit floating point weights are mapped into a 4-bit range using this data-free quantisation, which nevertheless permits a fixed zero-point.
Compressed_model = compress_weights(ov_model, mode=CompressWeightsMode.INT4_SYM)
Put the OpenVINO model together: Use NPU to run the OpenVINO compiler.
core = ov.Core()
compiled_model = core.compile_model(compressed_model, device_name=”NPU”)
Visualize Upscaled Image: Plotly will be used in the code example to generate an interactive visualisation that shows both the original image and the AI-upscaled image from the CPU and NPU.
Visualise CPU and NPU performance: The code sample will use Plotly to provide an interactive visualisation that shows the performance improvements the NPU makes over the CPU.

Execute AI Upscaling model on video: It can execute the AI Upscaling model on a video in a performant manner by utilising OpenVINO’s asynchronous inference queue. This processes about five frames per second.
Take a look at the code sample above. The output of the code example demonstrates how original and upscaled photos and videos differ, as well as how the model performs better when executed on an NPU as opposed to a CPU.
What Comes Next
The performance of many AI upscaling approaches has frequently been limited to discrete GPUs. But because to the Intel AI Boost NPU in the new AI PC, AI Upscaling can now operate well on standard laptops. Improve your speed, productivity, privacy, and security for a variety of AI jobs, like draughting emails, writing original content, managing schedules, improving reporting, and using Intel AI PCs to automatically summarise meetings with thorough notes.
To assist you in planning, developing, implementing, and scaling your AI solutions, it also encourage you to review and integrate Intel’s other AI/ML Framework optimisations and tools into your AI workflow. Additionally, you can learn about the unified, open, standards-based oneAPI programming model that serves as the cornerstone of Intel’s AI Software Portfolio.