# ConceptVAE: Self-Supervised Fine-Grained Concept Disentanglement from 2D Echocardiographies
## 5 Quantitative Model Analysis
### Near-OOD Detection  
To assess the proposed model's capability to detect OOD samples, we employed a test set comprising only parasternal long-axis (PLAX) views. Unlike the test set from Section 5.1, which includes only apical and short-axis acquisitions, this set is considered OOD because, although it contains echocardiographies, the views are different. The aim of this analysis is to determine whether the latent space features can differentiate between the two data distributions (i.e., apical and SAX versus PLAX views). Most OOD methods are designed to work with supervised classification models (e.g., [44; 45]), thus requiring explicit labeling either for in-domain classes or for flagging outlier samples. One method that does not require any labels and allows for fast log-likelihood evaluation with respect to the underlying data distribution is Normalising Flows (NFs). To this end, linear NFs [46] were fitted solely on the frozen embeddings of in-distribution data (i.e., apical and SAX views) for both the proposed and baseline models. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Kernel** & **Concept Only** & **Style Only** & **Concept \& Style** \\ \hline \multirow{4}{*}{**Concept**} & \(1\times 1\) & 0.5876 & 0.6641 & **0.4853** \\ \cline{2-5}  & \(3\times 3\) & 0.2268 & 0.4238 & **0.1741** \\ \cline{2-5}  & \(5\times 5\) & 0.1311 & 0.2586 & **0.1087** \\ \cline{2-5}  & \(7\times 7\) & 0.1013 & 0.1825 & **0.0938** \\ \cline{2-5}  & \(9\times 9\) & 0.0903 & 0.1520 & **0.0900** \\ \hline \multirow{4}{*}{**Concept**} & \(1\times 1\) & 0.6958 & 0.6942 & **0.6790** \\ \cline{2-5}  & \(3\times 3\) & 0.5413 & 0.5205 & **0.4655** \\ \cline{2-5}  & \(5\times 5\) & 0.3665 & 0.3504 & **0.2901** \\ \cline{2-5}  & \(7\times 7\) & 0.2465 & 0.2405 & **0.2016** \\ \cline{2-5}  & \(9\times 9\) & 0.1876 & 0.1990 & **0.1715** \\ \hline
**Vicreg** & \(1\times 1\) & & 0.187 & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Dice loss on the semantic segmentation test set when using \(x_{concept}\) only, \(x_{style}\) only, or \(x_{concept}\) along with \(x_{style}\). For each row, the lowest Dice losses are marked with bold. The NF took the form of Equation (6), where \(x\) represents an input derived from the latent space, \(y\) is the transformed variable, and \(A,b\) are trainable parameters. \[y =Ax+b\] \[\ln p(x) =\ln p_{prior}(y)+\ln|\det A| \tag{6}\] \[p_{prior}(y) =\mathcal{N}(y|\mathbf{0},I)\]  
For ConceptVAE, \(x\) is formed by concatenating a \(5\times 5\) window of concept probabilities, excluding the style component. For the baseline model, \(x\) is the feature embedding of a single location from the latent space feature grid. For all spatial locations corresponding to ultrasound cones within the latent space grid, and for all training data, the region descriptors \(x\) were extracted and fed into the NF to maximize \(\ln p(x)\) for in-distribution data. The same training data as in Section 5.2 was used to fit the NFs (i.e., only apical and SAX views). After the NFs converged, an image-level score was computed for each test sample by averaging the \(\ln p(x)\) scores for all grid locations pertaining to the ultrasound cone. Two sets of image-level scores were computed, one for in-distribution apical and SAX views and one for OOD PLAX views. ROC curves were used to assess the score separability between the two sets using ConceptVAE and the Vicreg baseline (Figure 6). ConceptVAE has an area-under-curve of 0.753, being 10% larger than the baseline (with 0.655). In contrast to the proposed ConceptVAE, the baseline model had access to PLAX data during its development (as we used a vast collection of many echocardiography types to pretrain the baseline model, following common practices for classical self-supervized pretraining regarding dataset sizes and variability, therefore the PLAX view is not OOD for the baseline model. Also, the contrastive objective used for developing the baseline model should promote feature clustering w.r.t. data sub-groups (e.g., anatomical views).