SurGrID: Controllable Sur gical Simulation via Scene Gr aph to I mage D iffusion Yannik Frisch, Ssharvien Kumar Sivakumar, Çağhan Köksal, Elsa Böhm, Felix Wagner, Adrian Gericke, Ghazal Ghazaei, Anirban Mukhopadhyay Abstract Purpose: Surgical simulation offers a promising addition to conventional surgical training. However, available simulation tools lack photorealism and rely on hard-coded behaviour. Denoising Diffusion Models are a promising alternative for high-fidelity image synthesis, but existing state-of-the-art conditioning methods fall short in providing precise control or interactivity over the generated scenes. Methods: We introduce SurGrID, a Scene Graph to Image Diffusion Model, allowing for controllable surgical scene synthesis by leveraging Scene Graphs. These graphs encode a surgical scene’s components’ spatial and semantic information, which are then translated into an intermediate representation using our novel pre-training step that explicitly captures local and global information. Results: Our proposed method improves the fidelity of generated images and their coherence with the graph input over the state-of-the-art. Further, we demonstrate the simulation’s realism and controllability in a user assessment study involving clinical experts. Conclusion: Scene Graphs can be effectively used for precise and interactive conditioning of Denoising Diffusion Models for simulating surgical scenes, enabling high fidelity and interactive control over the generated content. keywords Controllable Surgical Simulation, Scene Graph, Denoising Diffusion Models † † equal-contributors: These authors contributed equally to this work. † † equal-contributors: These authors contributed equally to this work. 1 Introduction The conventional methodology for training novice surgeons follows the Halstedian apprenticeship model, in which trainees are deemed competent after completing a minimum number of surgical procedures under supervision Lee et al. (2020) . Nevertheless, the Halstedian approach raises ethical concerns over using patients for training and has been associated with increased complication rates and poor outcomes Kwong et al. (2014) . However, when paired with simulation-based training, it offers a promising way to overcome regulatory and ethical complexities while establishing a safe and controlled environment where novice surgeons can refine their skills without the potentially severe consequences of real-world failures. It has also been shown that surgeons who have received simulation-based training demonstrate higher overall performance and make fewer errors during their initial surgeries than those who only received conventional training Thomsen et al. (2017) . In addition to using phantom or cadaver specimens for training simulation, numerous studies have shown the effectiveness of virtual reality simulators for training Staropoli et al. (2018) ; Thomsen et al. (2017) . However, these tools are computer graphics-based, with manually defined rules for rendering logic. Therefore, new surgery techniques and edge cases must be manually programmed, but still fall short in replicating the complexity and variability of human anatomy and the subtle nuances of real-life surgical procedures Iliash et al. (2024) . Recent works propose using Denoising Diffusion Models (DDMs) for photorealistic interactive simulation to address it. However, these methods either rely on text prompts to guide generation Cho et al. (2024) , which offers limited spatial control, or use mask prompts Iliash et al. (2024) , which are not easily interactable and require continuous mask adjustments. Recognizing this gap, we propose SurGrID, a compact yet interpretable and precise conditioning of DDMs with Scene Graphs (SGs). SurGrID is trained on surgical videos of actual patients and synthesises new surgical scenes with high controllability and excellent fidelity. At the core of our method lies the adoption of SG representations as compact and human-readable encodings of surgical scenes Holm et al. (2023) ; Murali et al. (2023) ; Köksal et al. (2024) . The hierarchical and relational nature of SGs makes them an ideal candidate for simulating dynamic and interactive surgical environments. We encode precise spatial information, such as the size and position of the anatomies and tools, into the node features of SGs obtained from a surgical scene, allowing fine-tuned control over the synthesis, as shown in Figure 1 . To synthesise images that accurately reflect the SG, we must acquire an intermediate representation that can align between the SG and images Yang et al. (2022) ; Mishra and Subramanyam (2024) . To this end, we propose pre-training a graph encoder on the (image, segmentation, graph) triplet that captures local and global information from the surgical scene. We focus on predicting fine-grained details of the anatomy and tools for local information by masking them randomly and reconstructing masked regions based on the SG input. We employ a discriminative approach to learn global information, which captures the layout and interaction between anatomy and tools. This approach enforces the encoder to cluster representations of compliant SGs and masks in the latent space. We then leverage the obtained graph embeddings for conditionally training a DDM Ho et al. (2020) to synthesise realistic surgical images while allowing precise control over the generated content through graph conditioning. The ability to generate diverse and realistic images from such structured representations holds immense potential for surgical simulation, offering a novel avenue for creating varied and high-fidelity surgical scenes. To the best of our knowledge, this manuscript is the first to propose SG to image diffusion for precisely controllable surgical simulation. Contributions • We show that SGs can encode surgical scenes in a human-readable format. We propose a novel pre-training step that encodes global and local information from (image, mask, SG) triplets. The learned embeddings are employed to condition graph to image diffusion for high-quality and precisely controllable surgical simulation. • We evaluate our generative approach on scenes from cataract surgeries using quantitative fidelity and diversity measurements, followed by an extensive user study involving clinical experts. Figure 1: Concept of SurGrID. SurGrID conditions image synthesis on Scene Graphs (SGs) for precise control over the anatomy/tool type, size, and position. In the bottom left, SurGrID generates a new image spatially identical to the original image using only the ground-truth SG. This demonstrates that SGs can effectively encode a surgical scene’s spatial and semantic information. On the right, we interactively modify the SG to control anatomy/tool position (top) and type (bottom). 2 Related Work Simulation by generative models typically conditions the synthesis on simple inputs such as class labels Müller-Franzes et al. (2023) ; Frisch et al. (2023) , reference images Kim and Ye (2022) ; Fuchs et al. () or text queries Allmendinger et al. (2024) . However, none of these techniques provides a highly controllable and precise conditioning mechanism suitable for complex, high-risk scenarios such as surgical simulation. We postulate that Scene Graph conditioning can serve as an accurate conditioning mechanism. Translating SG representations into realistic images has gained interest within the computer vision community. To achieve this task, Johnson et al. Johnson et al. (2018) use the intermediate representation of a scene layout , which they predict from input SGs and translate into an image using a Cascaded Refinement Network. With the rise of Denoising Diffusion Models Ho et al. (2020) ; Dhariwal and Nichol (2021) ; Rombach et al. (2022) as a competing generative method, Yang et al. Yang et al. (2022) have laid foundational principles for SG to image synthesis with diffusion models, utilizing Masked Contrastive Pre-Training to obtain graph embeddings for conditioning. SceneGenie Farshad et al. (2023) guides the denoising process through information from CLIP embeddings Radford et al. (2021) for input text queries together with scene layout and segmentation mask predictions from the text query. R3CD Liu and Liu (2024) introduces SG-Transformers to improve the global and local information in graph embeddings and uses a contrastive loss to improve relation-aware synthesis. Mishra et al. Mishra and Subramanyam (2024) introduce adversarial pre-training of a graph encoder, aligning graph embeddings with CLIP image embeddings Radford et al. (2021) and removing the need for an intermediate scene layout representation. These methods operate under the assumption that the image embeddings corresponding to a particular SG will be distant from those associated with entirely different SGs . However, this assumption falls short in surgical simulation, rendering these approaches ineffective when applied directly. For instance, neighbouring frames in a surgical video may depict different tools and have distinct SGs. Yet, they occupy a similar position in the image embedding space due to similarly looking anatomy. As a result, frames from the same video tend to cluster together in the image embedding space. However, we would like frames with similar surgical tools and positions to be close in the embedding space, regardless of the video they come from. The existing methods further don’t address the need for precise control over positioning and sizing, which is essential for surgical simulation. 3 Method This section presents our approach for translating Scene Graphs into intermediate representations that capture both local and global information. Subsequently, we outline the conditional diffusion model used for SG to image generation. 3.1 Pre-Training Scene Graph Encoder We leverage a surgical segmentation dataset \mathcal{D} consisting of (image, mask) pairs (x,m)\in\mathcal{D} to extract SGs from ground-truth segmentation masks . Details on this conversion can be found in Supplementary Section 6 . The approaches in subsequent sections can seamlessly be included in datasets with already available SGs. For the graph encoder E_{G} , we employ a series of stacked Graph Neural Network (GNN) layers Wu et al. (2020) to process the input graph \mathcal{G}=(\mathcal{V},\mathcal{E}) . Each GNN layer updates node representations by aggregating information from their neighbours, effectively capturing local graph topologies: h_{v}^{(l+1)}=\text{GNN}^{(l)}(h_{v}^{(l)},\bigoplus_{u\in\mathcal{N}(v)}h_{u}^{(l)}) (1) where h_{v}^{(l)} is the feature vector of node v at layer l,N(v) represents the neighbours of v , and \bigoplus denotes a differentiable, permutation-invariant aggregation function, such as sum, mean, or max. The final node representations are aggregated through mean pooling to form a graph-level latent representation z_{G} . We propose pre-training two distinct graph encoders, as visualised in Figure 2 : E_{G}^{loc} , which focuses on capturing local information, hence embedding fine-grained details of the anatomy and surgical tools. E_{G}^{glob} concentrates on retaining global information, focusing on the overall structural alignment based on compositions and interactions within the surgical scene. The overall pre-training occurs in the latent space, where embeddings for the image, z_{x} , and segmentation masks, z_{m} , are obtained using a VQ-GAN model Esser et al. (2020) . These models are trained separately and referred to as E_{m} and E_{x} in Figure 2 . Supplementary Section 7 analyses and motivates the pre-training mechanisms using t-SNE visualisations of the embedding spaces. For the local information , we randomly select a class from an image x ’s paired mask and apply rectangular masking of that class’s bounding box in the image. Both the full image x and the masked image x^{r} are encoded as z_{x}=E_{x}(x) and z_{x}^{r}=E_{x}(x^{r}) . To train E_{G}^{loc} , the task is framed as predicting z_{x} based on the available z_{x}^{r} and it’s corresponding SG representation z_{G}^{loc}=E_{G}^{loc}(\mathcal{G}) . The graph encoder is trained in conjunction with a transformer-based decoder, d_{\theta} , to minimize the reconstruction loss: \mathcal{L}_{\text{local}}=\mathbb{E}_{(x,\mathcal{G})\sim D}\left\|z_{x}-d_{\theta}\left(z_{x}^{r},z_{G}^{loc}\right)\right\|_{2}^{2} (2) Figure 2: SurGrID Workflow for Pre-training Graph Encoders To capture local and global information, we pre-train two separate graph encoders composed of stacked GNN layers (top centre). E_{G}^{\text{loc}} is trained to encode local information by randomly masking objects in the image and predicting the masked area using the SG (bottom). E_{G}^{\text{glob}} is trained to encode global information by aligning the graph embedding space with the segmentation mask embedding space (right). To capture the global information of the surgical scene, we train E_{G}^{glob} by aligning its graph embeddings, z_{G}^{glob}=E_{G}^{glob}(\mathcal{G}) , with the segmentation mask embeddings, z_{m} , inspired by CLIP’s training approach Radford et al. (2021) . This alignment must not be performed in the image embedding space, as neighbouring frames with different tools in a surgical video often share a large portion of the anatomical features, causing them to cluster in the embedding space. Our goal, however, is to ensure that frames featuring the same tool, even across different videos and possibly different textural features, are grouped in the embedding space. To achieve this, we include segmentation mask embeddings, as they capture high-level information about the overall scene layout and are a more detailed representation of the SG. This enables them to accurately represent the SG in the embedding space, bringing similar SGs closer together. For training, we employ a contrastive loss: \mathcal{L}_{\text{global}}=\mathbb{E}_{(\mathcal{G},m^{+},\{{m_{i}}^{-}\}^{k}_{i=1})\sim D}\left[-\log\frac{\exp\left(z_{G}\cdot z_{m^{+}}\right)}{\exp\left(z_{G}\cdot z_{m^{+}}\right)+\sum_{i}\exp\left(z_{G}\cdot z_{{m_{i}}^{-}}\right)}\right] (3) where m^{+} represents the compliant segmentation mask to \mathcal{G} , while {m_{i}}^{-} are the negative targets, which do not comply with \mathcal{G} and are randomly sampled from \mathcal{D} . 3.2 SG-Conditioned Denoising Diffusion Model For image synthesis, we combine the standard diffusion model setup outlined in DDM Ho et al. (2020) with Classifier-Free Guidance (CFG) Ho and Salimans (2022) . The conditioning c=concat(z_{G}^{loc},z_{G}^{glob}) is derived by fusing the embeddings from the two graph encoders E_{G}^{loc},E_{G}^{glob} . We then train a parameterised denoising model \epsilon_{\theta} to approximate denoising steps p(x_{t-1}|x_{t},c) by minimising: \mathcal{L}_{\text{DDM}}=\mathbb{E}_{t,x_{0},\epsilon}\left[\left\|\epsilon-\epsilon_{\theta}(x_{t},t,c)\right\|^{2}\right] (4) where x_{t}=\sqrt{\bar{\alpha}_{t}}x_{0}+\sqrt{1-\bar{\alpha}_{t}}\epsilon,\ \epsilon\sim\mathcal{N}(0,I) , and \bar{\alpha}_{t} is the variance schedule of the diffusion process. By then sampling z_{T} from a Gaussian distribution p(z_{T})\sim\mathcal{N}(0,I) , we can synthesise new samples by iteratively applying the denoising network. CFG substitutes the predicted noise \epsilon_{\theta}(z_{t},t,c) at each diffusion time-step t as: \epsilon^{\prime}_{\theta}(x_{t},t,c):=(1+\omega)\epsilon_{\theta}(x_{t},t,c)-\omega\epsilon_{\theta}(x_{t},t) (5) where \omega is a scaling parameter, which we empirically set to 2.0, and \epsilon_{\theta}(x_{t},t) is trained by randomly dropping the conditioning with probability 0.2. 4 Experiments and Results This section outlines our experimental setup and provides quantitative and qualitative evaluations of the high-quality surgical samples generated from Scene Graphs. We conclude with a visual assessment user study involving clinical experts. 4.1 Setup and Datasets We evaluate our approach on the CaDIS dataset Grammatikopoulou et al. (2021) , a semantic segmentation dataset for cataract surgery videos. Cataract surgery is one of the most frequently performed procedures worldwide Allen and Vasavada (2006) , where clouded lenses are removed and replaced with artificial ones. The dataset captures 4670 frames from 25 videos which are at least 0.3s apart. They have a resolution of 960\times 540 pixels. In setting II, as defined in CaDIS Grammatikopoulou et al. (2021) , the dataset includes segmentation masks for 17 classes divided into four anatomical labels, ten tool labels, and three miscellaneous labels. We split the examples based on the 25 available videos, allocating 19 for training, 3 for validation, and 3 for testing, resulting in 3550, 534, and 586 (image, mask, graph) triplets, respectively. Our model was trained on an NVIDIA RTX 4090 GPU with an image size of 128\times 128 . The SG representations, model weights and code to reproduce our results will be provided at https://github.com/MECLabTUDA/SurGrID upon acceptance. 4.2 Quantitative Image Analysis To evaluate the objective image quality of generated samples, we synthesise examples from ground-truth SGs and assess the FID and KID scores Bińkowski et al. (2018) against the same amount of real samples. Further, we evaluate the diversity of generated samples using the LPIPS diversity metric Zhang et al. (2018) . To also assess how effectively the synthesised images adhere to the conditioning provided by the SG, we employ the Mask R-CNN model He et al. (2017) pre-trained on CaDIS Grammatikopoulou et al. (2021) for object detection, which predicts bounding boxes (BBs) along with class labels. This process essentially reverses the workflow by converting images back into SGs. By assessing the BBs with the IoU metric (at a 50% threshold) and evaluating the predicted object classes using the F1 score (at 50% IoU threshold), we can assess the accuracy of the synthesised anatomies and tools, along with their corresponding positions and sizes. As an additional baseline, we deploy a Latent Diffusion Model (LDM) Rombach et al. (2022) conditioned on CLIP embeddings Radford et al. (2021) of NLP strings. These strings resemble a combination of triplets, which we construct from spatial relations such as ”left of,” ”right of,” ”above,” ”below,” ”inside,” and ”surrounding”. The strings are then embedded using the CLIP text encoder, and the LDM is conditionally trained on the resulting embeddings and otherwise analogously to the other methods. Table 1: Quantiative Fidelity and Diversity Results. Method FID ( \downarrow ) KID ( \downarrow ) LPIPS ( \uparrow ) BB IoU @0.5 ( \uparrow ) F1 @0.5 ( \uparrow ) Real Image - - 0.599 0.636 0.585 Sg2Im Johnson et al. (2018) 94.9 0.096 0.416 0.305 0.197 LDM Rombach et al. (2022) (CLIP-cond.) 38.6 0.033 0.455 0.310 0.169 SGDiff Yang et al. (2022) ( \omega=2.0 ) 42.0 0.033 0.449 0.372 0.224 SurGrID ( \omega=2.0 ) 26.6 0.019 0.456 0.549 0.424 As presented in Table 1 , our method not only surpasses the baselines regarding FID and KID scores, reflecting improved image quality but also adheres more closely to the conditioning criteria, as shown by the higher BB IoU and F1 scores. 4.3 Ablation Studies We present ablation scores for our method trained exclusively on embeddings containing either only global or local information in the top part of Table 2 . Combining both embeddings significantly improves the method’s performance, highlighting the necessity to include both types of information in the generative process. The bottom part of Table 2 additionally displays ablation results on the guidance scale \omega . Table 2: Guidance Scale and Embedding Pre-Training Ablation. Method FID ( \downarrow ) KID ( \downarrow ) LPIPS ( \uparrow ) BB IoU @0.5 ( \uparrow ) F1 @0.5 ( \uparrow ) Real Image - - 0.599 0.636 0.585 SurGrID (Local only) 93.2 0.083 0.313 0.247 0.169 SurGrID (Global only) 120.2 0.111 0.536 0.199 0.128 SurGrID ( \omega=2.0 ) 26.6 0.019 0.456 0.549 0.424 SGDiff Yang et al. (2022) ( \omega=1.0 ) 41.7 0.033 0.449 0.368 0.225 SGDiff Yang et al. (2022) ( \omega=2.0 ) 42.0 0.033 0.449 0.372 0.224 SGDiff Yang et al. (2022) ( \omega=3.0 ) 42.1 0.034 0.449 0.368 0.223 SGDiff Yang et al. (2022) ( \omega=4.0 ) 43.0 0.036 0.448 0.366 0.222 SGDiff Yang et al. (2022) ( \omega=5.0 ) 42.2 0.033 0.449 0.367 0.222 SurGrID ( \omega=1.0 ) 26.1 0.019 0.455 0.551 0.423 SurGrID ( \omega=2.0 ) 26.6 0.019 0.456 0.549 0.424 SurGrID ( \omega=3.0 ) 47.3 0.041 0.436 0.465 0.314 SurGrID ( \omega=4.0 ) 81.7 0.074 0.452 0.348 0.203 SurGrID ( \omega=5.0 ) 114.0 0.114 0.464 0.300 0.162 Figure 3: Scene Graph To Image Generation. The top row displays the original image, followed by the corresponding SG in the second row and synthesized images from the original SGs in the third row. Readers can judge the spatial coherence of the synthesised images in the third row by comparing them to the original image. Rows four and six present modified SGs; underneath them are synthesized images conditioned on these SGs. 4.4 Qualitative Results Besides quantitative evaluations, we visually assess the quality of our generated images and how well changes to the input graph translate to the synthesised images. As shown in Figure 3 our generative model can synthesise high-quality images with coherent visual semantics following the SG inputs. The first column presents qualitative results from altering the positions of tools and anatomy within the SG, with the synthesised images accurately reflecting these positional adjustments. In the second column, the SG modifications focus solely on changing tool types. The generated images maintain a consistent spatial position while only adapting the type of displayed tool. Even though the tools can be displayed with different angles in the image, the centroid coordinates used for conditioning remain accurate. The third column progressively removes primary surgical tools, while the fourth column removes auxiliary tools such as retractors and surgical tape. In Appendix Section 10 , we have outlined limitations and future work. However, in most cases, the synthesised images reliably show high fidelity and adhere to the input SG. 4.5 Clinical Expert Assessment We also conduct a visual assessment user study involving three ophthalmologists with at least two years of experience to evaluate the quality of our generative model. For simple and consistent statistical evaluation, we provide them with a graphical user interface (GUI) as displayed in Appendix Section 9 . The GUI allows for loading ground-truth graphs along with the ground-truth image. The graph’s nodes can be moved, deleted, or have their class changed. We instruct our participants to load four different ground-truth graphs and sequentially perform the following actions on each: First, participants are instructed to generate a batch of four samples from the ground-truth SG without modifications. We request them to score the samples’ realism and coherence with the graph input using a Likert scale of 1 to 7. Here, 1 represents not realistic/coherent at all , and 7 indicates totally realistic/coherent . Second, the participants are requested to spatially move nodes in the canvas and again judge the synthesised samples. Third, participants change the class of one of the instrument nodes and judge the generated images. Lastly, participants are instructed to remove one of the instruments or miscellaneous classes and judge the synthesised image a final time. The study’s average results are summarised in Table 3 . Additionally, Section 8 in the Appendix lists their summarised answers for the reasoning behind their ratings. Table 3: Clinical Expert Assessment Study. The abbreviation ”Real.” refers to the realism of the synthesised image, while ”Coh.” refers to the coherence with the input condition. Synth. from GT Spatial Modif. Tool Modif. Tool Remov. User Real. Coh. Real. Coh. Real. Coh. Real. Coh. P1 6.5 \pm 0.5 6.5 \pm 1.0 6.3 \pm 0.9 6.3 \pm 0.9 5.3 \pm 1.2 4.5 \pm 1.9 6.3 \pm 0.9 5.5 \pm 2.3 P2 5.3 \pm 0.9 5.3 \pm 0.5 4.5 \pm 0.5 4.3 \pm 2.0 5.3 \pm 0.9 5.8 \pm 0.9 5.5 \pm 1.2 5.5 \pm 1.9 P3 6.3 \pm 0.9 6.3 \pm 0.9 6.5 \pm 1.0 5.5 \pm 0.5 6.0 \pm 0.8 6.8 \pm 0.5 6.3 \pm 0.5 6.5 \pm 0.5 Average 6.0 \pm 0.9 6.0 \pm 0.9 5.8 \pm 1.2 5.3 \pm 1.4 5.5 \pm 1.0 5.7 \pm 1.4 6.0 \pm 0.9 5.8 \pm 1.6 On average, participants took around 30 minutes to complete the user study. They were allowed unlimited time to assess the synthesised images, enabling them to thoroughly inspect for any subtle artefacts that might not be immediately noticeable. Despite the extended review time, participants consistently found the synthesised images realistic, with an average score of 5.82, and coherent, with an average score of 5.70, with the changes they had made to the SG. 5 Conclusions We present Controllable Surgical Simulation via Scene Graph to Image Diffusion (SurGrID) , the first controllable surgical simulator based on Scene Graph to Image Diffusion. We demonstrate the potential of SGs to encode semantic and spatial information of surgical scenes and as informative conditioning for synthesising new, unseen images with Denoising Diffusion Models. We also demonstrate that by interactively modifying the SGs, changes are directly reflected in the generated image, enabling precise control over the generation process. This overcomes the limitations of text prompts, which lack precision, and segmentation masks, which are difficult to modify and interact with. In our user study, surgeons verified the generated images to be realistic and coherent with the changes made to the scene graphs, highlighting SurGrID’s substantial potential for realistic surgical simulation controlled by scene graphs. Our method surpasses state-of-the-art techniques in image quality and coherence to the graph input, which we demonstrate quantitatively and qualitatively. This paves the way for photorealistic surgical simulations that are trainable from real surgical videos while retaining the high controllability needed for surgical simulation. Supplementary information The supplementary information comprises the Appendix of the main manuscript. Declarations Funding. This work has been partially funded by the German Federal Ministry of Education and Research as part of the Software Campus programme (project 500 01 528). Data Availability. All experiments were conducted on publicly available datasets. Code Availability. Code will be published upon acceptance. Other declarations are not applicable. 6 Scene Graph Generation We assume our dataset \mathcal{D} consists of (image, mask) pairs (x_{\text{i}},m_{\text{i}})\in\mathcal{D} . From each mask m_{\text{i}} , we build a Scene Graph \mathcal{G}_{\text{i}} by extracting the masks’ connected components. We then compute the centroid of each component. Each node of the final graph represents an individual connected component and encodes the component’s d -dim class vector, the 2- dim spatial spreading of the component, and the component’s 2- dim centroid coordinates. By explicitly encoding these values in the node features of the graph, we can precisely control the image synthesisation. In the graph’s edges, we encode the spatial relationship of nodes, for which we check if nodes’ components are touching spatially. Therefore, a SG for sample i is defined by \mathcal{G}_{\text{i}}=(\mathcal{V}_{\text{i}},\mathcal{E}_{\text{i}}) where \mathcal{V}_{\text{i}}\in\mathbb{R}^{n\times(d+4)} are the node features, with n being the number of nodes in the graph, and \mathcal{E}_{\text{i}} is the set of undirected edges between connected nodes. Our surgical SG \mathcal{G}_{\text{i}} yields a compact yet spatially and semantically accurate representation of a surgical image with a clear interpretation, as presented in Figure 4 . Further, graph representations allow seamless modification of generative model conditioning by changing node features, which we demonstrate in Section 4 . Figure 4: Surgical Scene Graphs. Each connected component in the segmentation mask is assigned a node. We store the component’s class label, spatial spreading, and centroid coordinate within the node features. Visualized in the bottom row, the node positions correspond to these centroid coordinates. Edges between nodes indicate that components are spatially connected in the segmentation mask. 7 Pre-Training Embedding Space Visualisation Figure 5 presents t-SNE visualizations of image and graph embeddings after the pre-training stage. The t-SNE plots in the first column are colour-coded by video ID, indicating that frames from the same video share the same colour. In contrast, the t-SNE plots in the second column are classified by the combinations of present tools. These visualizations strongly support our claims. In the first column, when image features are classified by video ID, evident signs of clusterings can be seen, demonstrating that frames from the same video are grouped in the image embedding space. This clustering occurs regardless of the tools present in the frames, majorly due to shared anatomical features across frames. However, the top-right t-SNE plot shows little to no clustering when the embeddings are classified by tool combinations, reinforcing the observation that image embeddings fail to encode tool-specific information effectively. With pre-trained graph embeddings, clear clusters emerge, as shown in the bottom-right t-SNE plot. This indicates that frames with similar surgical tools and positions are close in the embedding space, irrespective of their video origin. On the other hand, when graph embeddings are classified by video ID, there is minimal clustering, as shown in the bottom-left t-SNE plot. Overall, this demonstrates that our pre-training method captures embeddings that are not dominated by video-specific information and clusters frames with similar surgical tools and positions in the embedding space. Figure 5: t-SNE Embedding Space Visualisation. 8 Expert Assessment Study - Feedback After participation, we asked participants to explain their reasoning for assigning low or high values to the realism and coherence of the generated images. In summary, they mentioned that extreme changes to the input SG could be better reflected in the generated image. This primarily concerns the spatial positions of tools that are far from what the training dataset contains. The participants occasionally observed image parts that could be more realistic, e.g., off-looking anatomical textures, warped instruments, or a blurry or unrealistic interaction between tool and tissue. Additionally, they observed inconsistencies within the mini-batch of generated images. Individual images would sometimes show wrong or no tools. Lastly, they also gave feedback on the graph representation, which they found easy to operate to condition the simulation. However, they wished for even more control, e.g., controlling the size of the pupil or the angle of the tools, and an even further simplified representation, e.g., not showing one node per component but rather per anatomy class. Nonetheless, we received overall positive feedback for the general idea and the generated images’ realism and coherence with the conditioning, reflected in the scores in Section 4.5 . 9 Expert Assessment Study - GUI This section presents the GUI used during our user study in Figure 6 . Figure 6: Graphical User Interface for Expert Assessment. In our GUI, participants can load ground truth (image, graph) pairs (bottom right and left). The GUI allows the following operations for modifying the graph: Nodes can be moved spatially by drag-and-drop. They can be deleted or changed into different classes by right-clicking them. Further, new nodes can be added by right-clicking the empty space in the SG canvas. Eventually, participants can generate a mini-batch of four images using the currently displayed SG (top right). 10 Limitations & Future Work In future work, we will primarily address the feedback from our user study, hence exploring ways to improve the usability of the GUI and SG representations. We also want to allow additional control over the pupil size and the tool angle. Since we see frame-based simulation only as a first step in building a surgical simulator, we will further explore sequence generation in the future. For example, sequential editing of an initial reference frame could substantially improve the temporal consistency of image information not encoded in the SG representation, such as textures or blood vessels. Additionally, we will explore other surgical domains in future research. We expect these directions to strengthen the possibilities for clinical translation significantly.