0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Mii的な模式顔からのi2iで架空人物の顔多様性を上げたい

0
Last updated at Posted at 2026-08-06

はじめに

前回、同じデモグラフィックの架空科学者をプロンプトだけで描き分けましたが、ArcFace埋め込みの平均距離(InsightFace buffalo_1) による多様性スコアは最大 0.706 でした。

そこで今回は、PILで顔幅、顎、目の大きさ・間隔などを変えた「Mii的な模式顔」を作り、gpt-image-1.5 の images.edit で肖像に変換してみました。

ArcFace の平均距離は prompt-only を超えませんでした。一方、input_fidelity="high" では目視できる骨格差が残りました。 生成の品質と、評価指標のどちらにも課題があるように感じました。

方針

検証条件は前回と揃えます。

  • デモグラフィック固定: 日本人女性 / 55歳 / 1920年代(近代前期)
  • 枚数: 8枚
  • 画像生成: gpt-image-1.5(images.edit, quality=low, 1024x1024)
  • 評価: InsightFace buffalo_l のArcFace顔埋め込みによる batch_diversity_score(1 − 平均ペアワイズコサイン類似度)

比較対象は次の2つです。

基準 batch_diversity_score
prompt-only 最良(前回の試行9) 0.706
実在顔ベースライン(同国籍・同年代の日本人女性著名人10名) 0.963

実験1: パラメトリック模式顔 → i2i

模式顔の合成

PILで、顔幅、顔長、顎、目、眉、鼻、口を計13軸で変えた線画を作りました。

模式顔8種

i2i でリアル化

模式顔を images.edit に入力し、次のようなプロンプトで変換します。

Transform this schematic facial-proportion diagram into a realistic portrait
of a 55-year-old Japanese woman scientist from the early 20th century.
STRICTLY PRESERVE the facial geometry shown in the diagram: the exact face
outline shape and width-to-height ratio, the eye size and spacing, ...
The diagram defines this person's unique bone structure - do not average it
toward a typical face.

結果

模式顔からの変換結果

スコアは 0.436 で、prompt-only(0.706)を下回りました。ただし、入力の骨格特徴はある程度維持されているようにも思われ、別人ぽさは今回のほうが上なのでは、とも思いました。

実験2: input_fidelity="high" を付ける

images.edit には入力画像への忠実度を上げる input_fidelity パラメータがあります。これを high にして同じ8枚を変換し直しました。

input_fidelity=highでの変換結果

スコアは 0.544 まで改善しました。prompt-only 未満ですが、輪郭、顎、目の大きさ・間隔の違いは default より明瞭です。一方で、線画のアニメ的な特徴も一部に混ざりました。

実験3: 実在顔をシードにする

線画と写真の差が原因かを調べるため、埋め込み距離が遠い実在顔8枚を選び、「骨格だけを継承した別人」への変換も試しました。

上段がシード、下段が出力です。

実在顔シードのbefore/after

実験1,2と比べ同一人物感が増したように思われます。出力とシードのコサイン類似度はほぼ0のため、シードとの類似性がほとんど消失して、平均顔が生成されている印象です。
一方で、実験1よりもスコア上は多様性が高いという評価であり、やはり、評価指標が良くないようにも思われます。

指標
batch_diversity_score 0.458
出力とシードの平均コサイン類似度 -0.001

結果まとめ

方式 batch_diversity_score 解釈
prompt-only 最良(前回) 0.706 参考値(髪型・表情などの差も含む)
模式顔 i2i 0.436 目標未達(弱い幾何転写は目視できる)
模式顔 i2i + input_fidelity=high 0.544 ArcFaceでは基準未満/目視では幾何差が明瞭(要再評価)
実在顔シード i2i + input_fidelity=high 0.458 目標未達(シードとの同一人物性は無相関)
実在顔ベースライン 0.963 参考値(撮影条件が異なる)

考察

全実験で ArcFace スコアは prompt-only 未満でした。ただし、実験1や実験2では骨格の違いは目視でき、同一人物らしくなさ、は意図通り生成できているようにも見えます。
ArcFace平均距離ではうまく評価できませんでしたが、この方向性は有望にも思うので、適切な評価の方法と合わせて、もう少し検討してみたいです。

付録: 実験の再現

実験スクリプトとデータはリポジトリの以下にあります。

  • 模式顔合成 + i2i: docs/qiita/mii_i2i_diversity/scripts/mii_experiment.py(13軸パラメトリック線画→images.edit)
  • 実在顔シード選定 + i2i: docs/qiita/mii_i2i_diversity/scripts/seed_i2i_experiment.py(埋め込み貪欲法で非類似8枚選定)
  • 多様性評価: evaluate_portraits_embeddings.py(InsightFace buffalo_l)
  • 各実験の評価JSON: docs/qiita/mii_i2i_diversity/eval_*.json

コストは3実験合計で約 $0.6(images.edit low品質 24回)でした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?