Drawing with GoogLeNet

Drawing with GoogLeNet

In my previous post, I showed how you can use deep neural networks to generate image examples of the classes it’s been trained to classify. Since we’ve already started using deep neural networks in ways they were never intended to be used, let’s abuse them some more.

 

There’s nothing constraining us to generate image examples of one class at a time. Let’s see what happens if we try to generate two class visualizations close to each other, such as for instance a gorilla and a french horn

Gorilla playing the french hornGorilla playing an odd-looking french horn

Well, it kind of looks like a gorilla playing the french horn. Or let’s try dressing up a gibbon via “mixing” the gibbon class with some of the clothing classes:

Gibbon in a ponchoGibbon in a labcoatA gibbon in a poncho (left) and an ET-looking gibbon in a labcoat (right)

Or what about making some scenic nature drawings, such as some foxes underneath an erupting volcano:

Foxes beneath an erupting volcanoFoxes beneath an erupting volcano

Or a ballpoint pen drawing a castle:

Pen drawing a castleA vague ballpoint pen drawing a castle

These mixes of classes kind of work out, though it should be noted that these are the best selections from a number of mixes I tried. It’s also tempting to create mixes of animal classes to generate some new kind of monster breeds, but most of the time this doesn’t work so well. Here’s some I tried though, a mix of a scotch terrier and a tarantula, and a mix of a bee and a gibbon:

Terrier/TarantulaBee/GibbonA slightly spidery looking scotch terrier (left) and a slightly gibbon-looking bee (right)

Another fun thing we can do when generatinge images is to do the gradient ascent randomly along paths instead of on a single point. This of course takes a bit longer time, but it allows us to “draw” with the output, such as for instance drawing a mountain range of alps:

Alps

or a line of jellyfish:

Jellyfish

or a circle of junco birds:

Circle of birds

If we try to fill a larger region with visualizations of a class, we can also apply clipping masks, i.e. forcing the pixels to zero in some pattern during gradient ascent. So we can for instance use letters as clipping masks and try to create the alphabet with animals:

An A of apesAn A of apesA B of bearsA B of bearsA C of cobrasAnd a C of cobras

Alright, that’s enough abuse of our deep neural network for today. I’ve just scratched the surface here, but there are several fun ways to use deep neural networks for creative visual work with a bit of experimentation (and lots of patience). I’m going to put the ipython notebooks I used to make these examples in the deepdraw repository as soon as I’ve cleaned up the code, so stay tuned via twitter.

posted @   菜鸡一枚  阅读(287)  评论(0编辑  收藏  举报
编辑推荐:
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 写一个简单的SQL生成工具
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
点击右上角即可分享
微信分享提示