diff --git a/drafts/ja/3_3_kscnet.md b/drafts/ja/3_3_kscnet.md index 96afacf..a912505 100644 --- a/drafts/ja/3_3_kscnet.md +++ b/drafts/ja/3_3_kscnet.md @@ -110,23 +110,27 @@ $(0.8, 0.02, 0.18)$ とした. 各エポックの終了時に,検証データにおけるマスクを持つフレームの 平均Dice係数 $S_{\mathrm{Dice}}$ を算出し, -これに基づいて次のエポックの重みを以下のとおり更新した -($\lambda = 0.1$,閾値0.8). +これに基づいて次のエポックの重みを更新した(Figure 2). +ここで $\lambda = 0.1$,閾値は0.8とした. + +【Figure 2】Pseudocode of updating weights at the end of each epoch. ``` -# 各エポック終了時の重み更新 -S = S_Dice # 検証データの平均Dice(マスクありフレーム) -if S <= 0.8: - w_Dice = 1 - S - w_BCE = lambda * S # lambda = 0.1 - w_Focal = S - w_BCE -else: - w_Dice = 0 # セグメンテーションの教師を無効化 - w_BCE = lambda - w_Focal = 1 - lambda +Input: S_Dice(検証データの平均Dice,マスクありフレーム),λ = 0.1,閾値 = 0.8 +Output: 次エポックの (ω_Dice, ω_BCE, ω_Focal) + +if S_Dice ≤ 0.8 then + ω_Dice ← 1 − S_Dice + ω_BCE ← λ · S_Dice + ω_Focal ← S_Dice − ω_BCE +else + ω_Dice ← 0 # セグメンテーションの教師を無効化 + ω_BCE ← λ + ω_Focal ← 1 − λ +end if ``` -すなわち,$S_{\mathrm{Dice}}$ が閾値以下のエポックでは, +Figure 2に示すとおり,$S_{\mathrm{Dice}}$ が閾値以下のエポックでは, $S_{\mathrm{Dice}}$ が低いほどDice項の重みを大きくし, セグメンテーションの学習を優先する. $S_{\mathrm{Dice}}$ が閾値を超えたエポックでは, diff --git a/sections/3_method.tex b/sections/3_method.tex index f4c0c8c..39a50af 100644 --- a/sections/3_method.tex +++ b/sections/3_method.tex @@ -306,23 +306,37 @@ were set to $(0.8, 0.02, 0.18)$. At the end of each epoch, the mean Dice coefficient $S_{\mathrm{Dice}}$ over masked frames in the validation data was computed, -and the weights for the next epoch were updated accordingly as follows -($\lambda = 0.1$, threshold $0.8$). +and the weights for the next epoch were updated accordingly +(Figure~\ref{fig:weight_update}). +Here, $\lambda = 0.1$ and the threshold was set to $0.8$. -\begin{lstlisting} -# Weight update at the end of each epoch -S = S_Dice # mean validation Dice (masked frames only) -if S <= 0.8: - w_Dice = 1 - S - w_BCE = lambda * S # lambda = 0.1 - w_Focal = S - w_BCE -else: - w_Dice = 0 # disable segmentation supervision - w_BCE = lambda - w_Focal = 1 - lambda +\begin{figure}[H] +\centering +\begin{minipage}{0.8\textwidth} +\begin{lstlisting}[mathescape] +Input: $S_{\mathrm{Dice}}$ (mean validation Dice over masked frames), + $\lambda = 0.1$, threshold $= 0.8$ +Output: $(\omega_{\mathrm{Dice}}, \omega_{\mathrm{BCE}}, + \omega_{\mathrm{Focal}})$ for the next epoch + +if $S_{\mathrm{Dice}} \le 0.8$ then + $\omega_{\mathrm{Dice}} \leftarrow 1 - S_{\mathrm{Dice}}$ + $\omega_{\mathrm{BCE}} \leftarrow \lambda \cdot S_{\mathrm{Dice}}$ + $\omega_{\mathrm{Focal}} \leftarrow S_{\mathrm{Dice}} + - \omega_{\mathrm{BCE}}$ +else + $\omega_{\mathrm{Dice}} \leftarrow 0$ # disable segmentation supervision + $\omega_{\mathrm{BCE}} \leftarrow \lambda$ + $\omega_{\mathrm{Focal}} \leftarrow 1 - \lambda$ +end if \end{lstlisting} +\end{minipage} +\caption{Pseudocode of updating weights at the end of each epoch. +\label{fig:weight_update}} +\end{figure} -That is, in epochs where $S_{\mathrm{Dice}}$ is at or below the threshold, +As shown in Figure~\ref{fig:weight_update}, +in epochs where $S_{\mathrm{Dice}}$ is at or below the threshold, a lower $S_{\mathrm{Dice}}$ results in a larger weight on the Dice term, prioritizing segmentation learning. In epochs where $S_{\mathrm{Dice}}$ exceeds the threshold,