Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

时间:2024-04-08 08:26:21

Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

Everyday the web is used to share and store millions of pictures, enabling one to explore the world, research new topics of interest, or even share a vacation with friends and family. However, many of these images are either limited by the resolution of the device used to take the picture, or purposely degraded in order to accommodate the constraints of cell phones, tablets, or the networks to which they are connected. With the ubiquity of high-resolution displays for home and mobile devices, the demand for high-quality versions of low-resolution images, quickly viewable and shareable from a wide variety of devices, has never been greater.With “RAISR: Rapid and Accurate Image Super-Resolution”, we introduce a technique that incorporates machine learning in order to produce high-quality versions of low-resolution images. RAISR produces results that are comparable to or better than the currently available super-resolution methods, and does so roughly 10 to 100 times faster, allowing it to be run on a typical mobile device in real-time. Furthermore, our technique is able to avoid recreating the aliasing artifacts that may exist in the lower resolution image.Upsampling, the process of producing an image of larger size with significantly more pixels and higher image quality from a low quality image, has been around for quite a while. Well-known approaches to upsampling are linear methods which fill in new pixel values using simple, and fixed, combinations of the nearby existing pixel values. These methods are fast because they are fixed linear filters (a constant convolution kernel applied uniformly across the image). But what makes these upsampling methods fast, also makes them ineffective in bringing out vivid details in the higher resolution results. As you can see in the example below, the upsampled image looks blurry – one would hesitate to call it enhanced.

Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍
Left: Low-res original, Right: simple (bicubic) upsampled version (2x). Image Credit:Masa Ushioda/Seapics/Solent News
With RAISR, we instead use machine learning and train on pairs of images, one low quality, one high, to find filters that, when applied to selectively to each pixel of the low-res image, will recreate details that are of comparable quality to the original. RAISR can be trained in two ways. The first is the "direct" method, where filters are learned directly from low and high-resolution image pairs. The other method involves first applying a computationally cheap upsampler to the low resolution image (as in the figure above) and then learning the filters from the upsampled and high resolution image pairs. While the direct method is computationally faster, the 2nd method allows for non-integer scale factors and better leveraging of hardware-based upsampling.For either method, RAISR filters are trained according toedge features found in small patches of images, - brightness/color gradients, flat/textured regions, etc. - characterized bydirection (the angle of an edge), strength (sharp edges have a greater strength) andcoherence (a measure of how directional the edge is). Below is a set of RAISR filters, learned from a database of 10,000 high and low resolution image pairs (where the low-res images were first upsampled). The training process takes about an hour.
Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍
Collection of learned 11x11 filters for 3x super-resolution. Filters can be learned for a range of super-resolution factors, including fractional ones. Note that as the angle of the edge changes, we see the angle of the filter rotate as well. Similarly, as the strength increases, the sharpness of the filters increases, and the anisotropy of the filter increases with rising coherence.
From left to right, we see that the learned filters correspond selectively to the direction of the underlying edge that is being reconstructed. For example, the filter in the middle of the bottom row is most appropriate for a strong horizontal edge (gradient angle of 90 degrees) with a high degree of coherence (a straight, rather than a curved, edge). If this same horizontal edge is low-contrast, then a different filter is selected such one in the top row.In practice, at run-time RAISR selects and applies the most relevant filter from the list of learned filters to each pixel neighborhood in the low-resolution image. When these filters are applied to the lower quality image, they recreate details that are of comparable quality to the original high resolution, and offer a significant improvement to linear, bicubic, orLanczos interpolation methods.
Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍
Top: RAISR algorithm at run-time, applied to a cheap upscaler’s output.Bottom: Low-res original (left), bicubic upsampler 2x (middle), RAISR output (right)
Some examples of RAISR in action can be seen below:
Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍
Top: Original, Bottom: RAISR super-resolved 2x.Original image from Andrzej Dragan
Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍
Left: Original, Right: RAISR super-resolved 3x. Image courtesy ofMarc Levoy
One of the more complex aspects of super-resolution is getting rid ofaliasing artifacts such asMoire patterns andjaggies that arise when high frequency content is rendered in lower resolution (as is the case when images are purposefully degraded). Depending on the shape of the underlying features, these artifacts can be varied and hard to undo.
Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍
Example of aliasing artifacts seen on the lower right (Image source)
Linear methods simply can not recover the underlying structure, but RAISR can. Below is an example where the aliased spatial frequencies are apparent under the numbers 3 and 5 in the low-resolution original on the left, while the RAISR image on the right recovered the original structure. Another important advantage of the filter learning approach used by RAISR is that we can specialize it to remove noise, or compression artifacts unique to individual compression algorithms (such as JPEG) as part of the training process. By providing it with examples of such artifacts, RAISR can learn to undo other effects besides resolution enhancement, having them “baked” inside the resulting filters.
Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍
Left: Low res original, with strong aliasing. Right: RAISR output, removing aliasing.
Super-resolution technology, using one or many frames, has come a long way. Today, the use of machine learning, in tandem with decades of advances in imaging technology, has enabled progress in image processing that yields many potential benefits. For example, in addition to improving digital “pinch to zoom” on your phone, one could capture, save, or transmit images at lower resolution and super-resolve on demand without any visible degradation in quality, all while utilizing less of mobile data and storage plans. To learn more about the details of our research and a comparison to other current architectures, check outour paper, which will appear soon in theIEEE Transactions on Computational Imaging.

  每天都有数以百万计的图片在网络上被分享、储存,用户借此探索世界,研究感兴趣的话题,或者与朋友家人分享假期照片。问题是,大量的图片要嘛被照相设备的像素所限制,要嘛在手机、平板或网络限制下被人为压缩,降低了画质。

  如今高分辨率显示屏幕正在家庭和移动设备上普及,因此,把低分辨率图片转化为高清晰版本,并可在多种设备上查看和分享,正在成为一项巨大的需求。日前,Google 推出了一项新技术 RAISR,其全称是“Rapid and Accurate Image Super-Resolution”,意为“快速、精确的超分辨率技术”。

  RAISR 这项技术能利用机器学习,把低分辨率图片转为高分辨率图片。它的效果能达到甚至超过现在的超分辨率解决方案,同时速度提升大约 10 至 100 倍,且能够在普通的移动设备上运行。而且,Google 的技术可以避免产生混叠效应(aliasing artifacts)。

  之前已经具有透过升采样方式,把低分辨率图片重建为尺寸更大、像素更多、更高画质图片的技术。最广为人知的升采样方式是线性方法,即透过把已知的像素值进行简单、固定的组合,以添加新的像素值。因为使用固定的线性过滤器(一个恒定卷积核对整个图片的无差别处理),该方法速度很快。但是它对于重建高清作品里生动的细节有些力不从心。正如下面这张图片,升采样的图片看起来很模糊,很难称得上画质提升。

  Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

  ▲ 左为原始图片;右为升采样处理后图片。

  对于 RAISR,Google 另辟蹊径得采用机器学习,用一对低分辨率、高分辨率图片训练该程序,以找出能选择性应用于低分辨率图片中每个像素的过滤器,这样能生成媲美原始图片的细节。目前有两种训练 RAISR 的方法:

  • 第一种是“直接”方式,过滤器在成对高、低分辨率图片中直接学习。
  • 第二种方法需要先对低分辨率图片应用低功耗的的升采样,然后在升采样图片和高分辨率图片的组合中学习过滤器。
  • “直接”方式处理起来更快,但第二种方法照顾到了非整数范围的因素,并且更好地利用硬件性能。

  无论是哪种方式,RAISR 的过滤器都是根据图像的边缘特征训练的:亮度和色彩梯度、平实和纹理区域等。这又受到方向(direction,边缘角度)、强度(strength,更锐利的边缘强度更高)和黏性(coherence,一项量化边缘方向性的指标)的影响。以下是一组 RAISR 过滤器,从一万对高、低分辨率图片中学习得到(低分辨率图片经过升采样)。该训练过程耗费约 1 小时。

  Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

  注:3 倍超分辨率学习,获得的 11×11 过滤器集合。过滤器可以从多种超分辨率因素中学习获得,包括部分超分辨率。注意当图中边缘角度变化时,过滤器角度也跟着旋转。相似的,当强度提高时,过滤器的锐利度也跟着提高;黏性提高时,过滤器的非均相性(anisotropy)也提高。

  从左至右,学习得到的过滤器与处理后的边缘方向有选择性的呼应。举例来说,最底一行中间的过滤器最适合强水平边缘(90 度梯度角),并具有高黏性(直线的而非弯曲的边缘)。如果这个水平边缘是低对比度的,那么如同图中最上一行,另一个过滤器就被选择。

  实际使用中,RAISR 会在已经学习到的过滤器列表中选择最合适的过滤器, 应用于低分辨率图片的每一个像素周围。当这些过滤器被应用于更低画质的图像时,它们会重建出相当于原始分辨率的细节,这大幅优于线性、双三(bicubic)、兰索斯(Lancos)解析方式。

  Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

  ▲ RAISR 演算法运行图式下:原始图像(左),2 倍双三解析(中),RAISR 效果(右)。

  一些运用 RAISR 进行图片增强的范例:

  Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

  ▲ 上:原始图片,下:RAISR 2 倍超分辨率效果。

  Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

  ▲ 左:原始图片,右:RAISR 3 倍超分辨率效果。

  超分辨率技术更复杂的地方在于如何避免混叠效应,例如龟纹(Moire patterns)和高频率内容在低分辨率下渲染产生的锯齿(对图像人为降级的情形)。这些混叠效应的产物会因对应部分的形状不同而变化,并且很难消除。

  Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

  ▲ 左:正常图像;右:右下角有龟纹(混叠效应)的图像。

  线性方法很难恢复图像结构,但是 RAISR 可以。下面是一个例子,左边是低分辨率的原始图片,左 3 和左 5 有很明显的空间频率混淆(aliased spatial frequencies),而右侧的 RAISR 图像恢复了其原始结构。RAISR 的过滤器学习方法还有一项重要的优点:用户可以把消除噪音以及各类压缩演算法的产物做为训练的一部分。当 RAISR 被提供相应的范例后, 它可以在图片锐化之外学会消除这些效果,并把这些功能加入过滤器。

  Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

  ▲ 左:有强混叠效应的原始图片;右:RAISR 处理后效果。

  超分辨率技术利用不同的方法已经有了不少进展。如今,透过把机器学习与多年来不断发展的成像技术相结合,图像处理技术有了长足的进步,并带来许多好处。举例来说,除了放大手机上的图片,用户还可以在低分辨率和超高清下捕捉、储存、传输图像,使用更少的移动网络数据和储存空间,而且不会产生肉眼能观察到的画质降低。

  小结:自从乔布斯 2010 年在 iPhone 4s 上推出“视网膜屏幕”概念之后,数码产品市场开启了一场超高清显示革命。如今,家用显示器逐步走向 4K,各大手机厂商也竞相推出 2K 旗舰机。但 2K、4K 内容的缺乏一直是困扰行业发展的痛点。之前的超分辨率技术受成本、硬件限制,主要应用于专业领域,未能大范围普及。

  此次 Google RAISR 大幅降低了图像增强的时间成本和硬件要求,有望实现超分辨率技术在消费领域的应用,把充斥网络的低画质图片转化为高清图片,大幅提高视觉效果和用户体验。雷锋网十分期待将来 RAISR 在移动设备的应用,例如把消费者手机拍摄的照片转化为媲美单反画质的高清美图。

  (本文由 雷锋网授权转载;首图来源:Flickr/Carlos LunaCC BY 2.0)


下面是对该论文的摘要介绍:

  • 论文:RAISR:快速且准确的图像超分辨率(RAISR: Rapid and Accurate Image Super Resolution)

  Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

给定一张图像,我们希望能得到一张其对应的更大尺寸、有显著更多像素、更高图像质量的版本。这个问题通常被称为单图像超像素问题(Single Image Super-Resolution (SISR) problem)。其思路是:使用足够多的训练数据(对应的低分辨率和高分辨率图像对),我们就可以训练出一组过滤器(filter,即一种映射),当我们将其应用于一张非训练集的图像时,它就能产生一张该图像的更高分辨率的版本,其中的学习(learning)部分最好应选择低复杂度(low complexity)的。在我们提出的方法中,运行时间(run-time)比目前可用的最佳竞争方法快 1 到 2 个数量级,同时我们的方法还能得到可与当前最佳结果媲美甚至更好的结果。

一个与上述问题紧密相关的主题是图像锐化(image sharpening)和对比度增强(contrast enhancement),即通过增强基本的细节(一个大范围的频率)来提升模糊图像的视觉质量。我们的方法还额外包含了一种极其有效的用来生成比输入模糊图像显著更加锐利的图像的方式,且不需要引入晕圈(halo)和噪声放大(noise amplification)。我们还阐释了:除了单纯的兴趣之外,这种有效的锐化算法还可被用作一种预处理步骤,可用于产生带有内置锐化和对比度增强效果的更有效的放大过滤器(upscaling filter)。



Google 又玩黑科技,用机器学习帮你节省 75% 流量

在最专业的图片处理软件 Photoshop 中,当你导出图片时,有一个叫“存储为网页所用格式”的选项,它清楚地列出了你可以保存的图片品质,以及图片在不同带宽下的加载时间。

这是因为在网络上,图片的品质和加载速度是特别需要平衡的。更清晰,品质更好的图片往往有更大的尺寸,但它会让加载速度变慢,消耗更多流量。对网站开发者来说,这意味着更高的成本,当然,对我们来说,这意味着更高的流量费。

在更小的尺寸内提供更高的品质,是图片压缩领域恒久的课题。Google 就一直致力于此,2010 年,它就推出了一种叫 WebP 的新图片格式,相比 JEPG,可以在相同的品质内把把图片大小减少 40%。

现在,Google 要用新的机器学习技术,让这一步走得更远。

1 月 11 日,Google+ 团队在其官方博客介绍了一种叫 RAISR(Rapid and Accurate Image Super Resolution)的新技术,它使用机器学习方法,训练系统分析同一张图片的高质量版本和低质量版本,找出高质量版本更好的原因,再在低质量版本模拟出高质量版本图片的效果。

和这个过程类似的是对图片的锐化和增强对比度的操作,即通过放大底层细节,来改善模糊图片的质量。但是,锐化同时增加图像的噪点,让图片看起来有很多小颗粒,经常使用 Photoshop 处理照片的同学应该深有体会。Google 表示,自己使用的方法可以在不增加噪点和颗粒的情况下改善图片清晰度。

Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

在 Photoshop 中对一张图片多次应用锐化后,图片中会出现大量噪点

在 RAISR 的论文中,作者表示,使用这种方法,运行时间比目前最好的图片压缩方法快一到两个数量级,同时,它产生的图片效果和最好的办法相当,甚至更好。

现在,这个系统已经可以用于训练库之外的图片,也就是说,当系统遇到一张从未见过的图片时,也能按照同样的方法,用更小的尺寸模拟出高质量图片。

2016 年 11 月,RAISR 被引入了 Google+ 中,最理想的状况下,它可以节省 75% 的流量。

Google 超分辨率技术 RAISR:模糊图片瞬间变清晰,运算速度快十倍

现在,RAISR 技术仅在 Android 设备用户访问 Google+ 时启用。即便如此,Google 说,现在每周也有超过 10 亿张图片用了这项技术,帮助用户节省了约 1/3 的流量。很快,它也被用于更多的 Google 产品。


转自: https://blog.csdn.net/real_myth/article/details/54583412