Landscape-wav

風景から生成されるユニークな音を聴いてインスピレーションを得る

AIによって風景画像に含まれるオブジェクトの色や輪郭をオーディオスペクトログラムの形に見立てて、音を生成するウェブアプリを開発。 風景画像を入力すると、スペクトログラム画像とオーディオが生成されてmp4ファイルとして出力される。

https://landscape-wav.fly.dev

example

森の画像を入力し、percussionモードで生成

花畑の画像を入力し、harmonicモードで生成

波の画像を入力し、alternativeモードで生成

story

いつもと違う場所を訪れて新しい風景を経験することは、自分の感性を磨くことや、新しいひらめきを創出することに繋がる。 本プロジェクトは、遠出の機会が減ってしまった近年においても「風景」を人々のクリエイティビティを拡張させるソースと捉え、 たとえ実際に訪れることができなくても風景画像からユニークな経験を得られるようなツールを制作することを目指した。

implementation

2種類のGANを使用

1.

森林、花畑、川や海の波の画像群と、その特徴に類似するドラム、ピアノ、ギターの音源のスペクトログラム* 画像群 をペアにしたデータセットを作成してCycleGAN** の学習を行い、 任意の風景画像からフェイクのスペクトログラム画像を生成する学習モデルを構築。

2.

生成されるスペクトログラムはビットマップ画像であり、数値的データを取得することが困難なため、スペクトログラム画像から数値的データを推論するpix2pix** の学習モデルを構築。 (実在する音源をスペクトログラムに変換して得られるローデータと、それをビットマップ画像にしたをペアにしたデータセットを使用。)

3.

入力画像からフェイクのスペクトログラム画像を生成 → スペクトログラム画像をデコードしてスペクトログラムのローデータを生成 → ローデータをオーディオデータに逆変換 というフローのシステムを実装。

* Pythonパッケージ librosaのライブラリを使用して変換。
** ソースコード CycleGAN and pix2pix in PyTorchを参照。

function

画像の特徴抽出の傾向が異なるAIの学習モデルを3種類構築し、ウェブアプリではそれぞれ percussion / harmonic / alternative モードに割り振って実装し、画像入力に合わせて選択できるようになっている。
percussionモードは、森林の樹木のように垂直方向に伸びる直線的なオブジェクトを特に抽出する傾向がある。 harmonicモードは、花畑のようにカラフルなオブジェクトを特に抽出する傾向がある。 alternativeモードは、海の波のように水平方向に広がるオブジェクトを特に抽出する傾向がある。

結果として出力される動画は、入力画像が左端から徐々に生成されたスペクトログラム画像に切り替わっていき、スペクトログラムの出現位置に同期して生成音が再生される直観的なデザインにした。
ウェブアプリに使われている背景写真は、フリー画像サイトから"nature background"などをキーワードに取得したデータをランダムに表示するようにしており、ページをロードする度に新しい風景に出会えるようになっている。

Landscape-wav

Get inspired by listening to unique sounds generated from the landscape

We have developed a web application that uses AI to generate sounds by likening the colors and outlines of objects in a landscape image as the shape of an audio spectrogram. By user inputting a landscape image in the application, the spectrogram image and audio are generated and output as an mp4 file.

https://landscape-wav.fly.dev

example

Generated from a image of forest in percussion-mode

Generated from a image of flower garden in harmonic-mode

Generated from a image of sea wave in alternative-mode

story

Visiting unusual places and experiencing new landscapes can lead to the improvement of one's sensitivity and the creation of new inspirations. This project aimed to create a tool that allows people to gain unique experiences from landscape images even if they cannot actually visit them, by considering "landscape" as a source to expand people's creativity even in recent years with fewer opportunities to go away from home.

implementation

Two types of GANs used

1.

We created a dataset consisting of a set of landscape images of a forest / flower garden / sea waves paired with a set of spectrogram* images of drum / piano / guitar sounds similar to the features of the landscape images, then trained CycleGAN** with it. A trained model to generate fake spectrogram images from arbitrary landscape images were built.

2.

Since the generated spectrograms are bitmap images and it is difficult to obtain numerical data, we built a trained model of pix2pix** that infers numerical data from spectrogram images. (The data set consists of pairs of raw spectrogram data from real sound sources and bitmap images of the spectrograms.)

3.

The system implements the following flow: Generate a fake spectrogram image from the input image → Decode the spectrogram image to generate the raw spectrogram data → Inverse convert the raw data to audio data.

* Converted by using the library of librosa, the Python package.
** Source code : CycleGAN and pix2pix in PyTorch

function

Three types of trained models with different tendencies of image feature extraction have been built and implemented in the web application by assigning each to percussion / harmonic / alternative mode, which can be selected according to the image input.
The percussion-mode tends to extract especially linear objects that extend vertically, such as trees in a forest. The harmonic-mode tends to extract especially colorful objects, such as a flower garden. The alternative-mode tends to extract especially objects that are spread horizontally, such as ocean waves.

The resulting output video has an intuitive design in which the input image gradually switches to the generated spectrogram image from the left end, and the generated sound is played in sync with the position of the spectrogram appearance.
The background photos used in the web application are randomly displayed from data obtained from free image sites using the keyword "nature background," so that users can encounter new landscapes every time they load the page.

< back