C.W.K.
Stream
Lesson 07 of 07 · published

실전 — 이미지 + metadata 모델

~8 min · functional

Level 0Keras 도제
0 XP0/97 lessons0/20 achievements
0/120 XP to next level120 XP to go0% complete

실전 multi-input 시나리오: 영화 포스터 (image) + 장르 / 평점 / 출연진 (structured) 으로 흥행 점수 예측. 두 갈래로 처리: image 는 CNN backbone, metadata 는 Dense + Embedding. concat 한 후 head 가 회귀 예측.

구조: img_input = Input(shape=(224,224,3)); meta_input = Input(shape=(N,)); img_feat = backbone(img_input); meta_feat = Dense(32)(meta_input); x = concatenate([img_feat, meta_feat]); output = Dense(1)(x); model = keras.Model([img_input, meta_input], output).

Code

# Image branch
image_input = keras.Input(shape=(64, 64, 3), name="image")
x = layers.Conv2D(32, 3, activation="relu")(image_input)
x = layers.MaxPooling2D(2)(x)
x = layers.Conv2D(64, 3, activation="relu")(x)
x = layers.GlobalAveragePooling2D()(x)
image_features = layers.Dense(64, activation="relu")(x)

# Metadata branch
meta_input = keras.Input(shape=(10,), name="metadata")
meta_features = layers.Dense(32, activation="relu")(meta_input)

# Merge and predict
combined = layers.concatenate([image_features, meta_features])
x = layers.Dense(64, activation="relu")(combined)
x = layers.Dropout(0.3)(x)
output = layers.Dense(5, activation="softmax")(x)

model = keras.Model(
    inputs=[image_input, meta_input],
    outputs=output,
)

External links

Exercise

image+metadata regressor 짜. image branch 는 작은 CNN (Conv 3 + Dense 1). synthetic data 로 학습. end-to-end 학습 확인 (5 epoch 동안 loss 감소).

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.