Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
関モバ_20261009.pdf
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
こむぎ
October 13, 2026
5
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
関モバ_20261009.pdf
こむぎ
October 13, 2026
More Decks by こむぎ
See All by こむぎ
WWDC現地参加のススメ
komugi
1
140
UIの観点から見るWidget実装
komugi
0
47
今日から始める!iOSエンジニア向け画像認識入門【実践編】
komugi
0
53
今日から始める!iOSエンジニア向け画像認識入門
komugi
0
88
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
Mobile First: as difficult as doing things right
swwweet
225
10k
Abbi's Birthday
coloredviolet
4
10k
Building an army of robots
kneath
307
47k
Paper Plane (Part 1)
katiecoart
PRO
2
12k
Tell your own story through comics
letsgokoyo
1
1.1k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
280
Music & Morning Musume
bryan
48
7.4k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
410
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
Transcript
オンデバイスでSNSアイコンを作りたい こむぎ
大学生の頃 大のNotionファンだった 2
社会人となり Notion好きが集まるSNSを発見 名前は覚えてない… 3
そのSNSには おしゃれなアイコンが作れるサービスがあった https://notion-avatar.app/ja 4
こうなったら 画像生成で自分好みのアイコンにしたい!! 選択式で候補が絞られる 5
iOSで画像生成 有料のAPI Image Playground Core ML Core AI • 高品質
• 無料 • 無料かつカスタム可 • 無料かつカスタム可 • 高価格 • スタイルが限定 • モデルの性能が低い • モデルの性能が高い 6
Core AIとは 使いやすくなったCore ML …のようなもの Apple Intelligenceと同様の感覚で オンデバイスAIを組み込める https://developer.apple.com/jp/videos/play/wwdc2026/324/ 7
8
実は… CoreAIで画像生成のモデルがある ここ!! https://github.com/apple/coreai-models/tree/main/models 9
学習ロードマップ まずはApple配布モデルで試してみる Pytorch(AIフレームワーク)で自作モデルを作成して変換 モデルの最適化 バグが出たら専用のデバッガーで原因を特定 https://developer.apple.com/jp/core-ai/ 10
自作モデルのメリット スタイル・性能・サイズをカスタム可能 Apple推奨は 2GB以下 ゴージャスに イラストに FLUX.2 Sana Sprint カスタム
3〜4GB 5〜GB ?GB 11
モデル変換の手順 カスタム ?GB 学習用画像 https://huggingface.co/ モデル 12
学習用画像 全て画像生成を使用(746枚) 13
モデル選定 サイズ・LoRAを加味してSD1.5に決定 Base Model 幅広い画像を生成 LoRA アイコンに特化した 追加学習データ Customized Model
幅広いアイコン生成 14
トラブル① 形が歪む・ノイズが入る 原因 対策 •LoRAによりノイズ除去能力が落ちた •画像の平滑化 •学習用画像の追加 •各画素を一番近いパレット色に変更 15
トラブル② 別の物体と誤認識してしまう 原因 対策 •モデル性能の限界 •フラットなアイコンでは難しいテーマ •輪郭を描く専用のモデルを組み込む •GoogleのMaterial Symbolsを参考に 16
最適化(Python) import torch import torch.nn as nn from torch.export import
export class OptimizedCoreAIModel(nn.Module): def __init__(self): super().__init__() # ANEのfp16計算誤差を防ぐため、nn.Linearの代わりに1x1 Conv2dを使用 self.conv1x1 = nn.Conv2d(in_channels=256, out_channels=512, kernel_size=1) def forward(self, x): # [B, C, H, W]の形状で処理 return self.conv1x1(x) model = OptimizedCoreAIModel() example_input = torch.randn(1, 256, 1, 1) # Core AIの入り口となるPyTorch標準のエクスポート exported_program = export(model, (example_input,)) 17
最適化(Script) # ターミナルで事前コンパイルを実行し、キャッシュを生成 coreai-build --model MyModel.aimodel --target ios --architecture h18p
18
モデル読み込み(Swift) import CoreAI func runCoreAIModel() async { do { //
1. モデル構成の設定 let config = AIModelConfiguration() // 2. 非同期ロード(AOTコンパイル済みなら即時に完了) let model = try await AIModel.load(contentsOf: modelURL, configuration: config) // 3. 入力データの作成(Core AI特有のNDArrayを使用) let inputNDArray = NDArray(myInputData) // 4. 非同期での推論実行 let output = try await model.prediction(from: inputNDArray) print("推論完了: \(output)") } catch { print("Core AI ロードエラー: \(error)") } } 19
結果 デバッガーの話もしたいが今回はここまで… 20
参考資料 リポジトリ 奮闘記録 リポジトリ 21