Vetnuus | October 2025 13 For this study, Stable Diffusion was selected due to its balance between image quality and computational efficiency. Example images generated using Stable Diffusion can be observed in Figure 4. [63]. Diffusion models, particularly those built with the U-Net architecture, offer significant advantages in terms of structural detail and precision, which are crucial in medical applications like ophthalmology. The U-Net backbone, with its skip connections, helps preserve the finegrained information necessary to capture subtle disease symptoms in canine eye images [18]. Stable Diffusion was further enhanced using Low-Rank Adaptation (LoRA), which allowed for parameter-efficient fine-tuning of the model, reducing both time and computational resources [64]. By using a small subset of real-world images from the DogEyeSeg4 dataset, Stable Diffusion was fine-tuned to specialize in generating images that accurately depict canine ophthalmic diseases like Glaucoma, Cherry Eye, and Uveitis. Example of such images using LoRA are presented in Figure 5. [63]. While rule-based systems and 3D rendering methods provide high control over specific image features, their high manual effort and resource demands made them less practical for large-scale image generation compared to Stable Diffusion [62]. In diffusion models, the process of image generation involves gradually transforming random noise into coherent images. This denoising process is managed by a U-Net architecture, which effectively captures both high-level structures and fine details. The model is trained to learn how to reverse the noise-adding process, allowing it to generate clean, high-quality images from noisy input during inference [59], [61]. In this study, the fine-tuning of Stable Diffusion was performed using custom LoRA, which reduced memory requirements by updating only a subset of the model’s parameters [65]. The use of a U-Net backbone allowed the model to capture the intricate details of various eye diseases, making it particularly effective for generating clinically relevant images of canine ophthalmic conditions. One of the key features of Stable Diffusion in this study was its ability to add disease symptoms to otherwise healthy eyes using inpainting [66], [67]. Inpainting allows for localised changes to specific regions of an image while leaving the rest of the image unchanged. This feature was valuable for introducing symptoms like scleral redness or corneal cloudiness into healthy eye images, which can be examined in Figure 6. [63]. Example image. Using prompts such as “cloudy cornea with red sclera,” the model could generate localised disease manifestations, allowing for the creation of synthetic images that accurately represented various stages of disease progression. This capability enhanced the diversity of the dataset, ensuring that a wide range of symptoms and severities were represented. In addition to generating new images, diffusion models offer unique opportunities for augmentation: • Symptom Severity Modification: Adjusting the text prompts allowed for the generation of images with varying degrees of disease severity, from mild to severe symptoms [38]. • Symptom Combination: Diffusion models can create images with multiple symptoms, such as excessive tearing and a colored mass, replicating complex real-world cases. • Stochastic Variability: The inherent randomness in diffusion models ensures that even with the same prompt, slight variations occur in the generated images, further diversifying the dataset without requiring additional real-world data collection [37]. Advantages of using Synthetic images: • Scalability of Data: Synthetic image generation facilitates the creation of extensive datasets, which are particularly valuable for rare conditions or underrepresented canine breeds. This approach addresses the scarcity of real-world data, allowing researchers to simulate a wide range of clinical scenarios that might otherwise be difficult to capture [68]. • Efficiency in Cost and Time: Compared to the collection and annotation of real-world images, synthetic data can be generated rapidly and at a significantly lower cost. This enables the efficient scaling of datasets required for training deep learning models, reducing the time and resources associated with manual data acquisition [69]. Figure 5. Close-up Stable Diffusion images using custom LoRA describing various medical conditions based on the DogEyeSeg4 dataset Figure 6. Stable Diffusion generated image containing symptoms using Inpainting showing (a) healthy eyes, left eye with: (b) prolapsed eyelid gland, (c) red sclera, (d) cloudy cornea, (e) epiphora and (f) all previously mentioned symptoms Leading Article >>>14
RkJQdWJsaXNoZXIy OTc5MDU=