Vetnuus | October 2025 25 • ROUGE: ROUGE measures the overlap between the longest common subsequences in the candidate and reference texts, without requiring consecutive matching words. ROUGE-L is a common variant used (23): where R is recall, P is precision, and β is a weighting factor. • SPICE: SPICE compares the scene graphs of the candidate and reference sentences, focusing on the semantic content. It evaluates the propositional meaning of the sentences rather than just surface-level ngram matches (24): By employing these diverse and complementary text similarity metrics, we ensure a comprehensive evaluation of the models’ ability to generate accurate, semantically meaningful diagnoses from medical images. Each metric provides a unique perspective on the model’s performance, capturing nuances in both lexical accuracy and semantic understanding. This multi-metric approach ensures that the models are evaluated rigorously, supporting the reliability of their medical interpretations. 5. DISCUSSION This study was guided by two primary hypotheses: Hypothesis 1: A computer vision model can recognize certain canine ocular conditions in still images taken in an unconstrained environment. Hypothesis 2: Modification of the input and architecture of the U-Net network contributes to a better segmentation of canine eye conditions. In the“Experiments and results”section, strong evidence supporting both hypotheses is provided. We developed and evaluated a series of models for detection, segmentation, and interpretation tasks to diagnose canine ocular diseases from images captured in realworld, unconstrained environments. Given the lack of pre-existing models for detecting canine eyes, we trained a custom Single Shot Multibox Detector (SSD) model. This SSD model was trained on 99 images encompassing various breeds and medical conditions, including healthy eyes. The model achieved the next scores: IoU 92%, Dice Score 96%, Precision 97%, Recall 84% and F1 Score of 90%. These metrics indicate high accuracy in localising the eye region within unconstrained images, confirming that a computer vision model can effectively detect canine eyes in real-world conditions, which is needed for the experiment with a custom attention mechanism used by the U-Net segmentation. For symptom segmentation, we initially implemented the standard U-Net architecture and then enhanced it with four different backbone networks: ResNet34, Inception V3, VGG16 and EfficientNet B3. These models were trained using the next loss functions: Categorical Cross-Entropy (CCE), Dice Loss (DL), Focal Loss (FL) and Combined Dice and Focal Loss (DL+FL). Best Performing Model is the U-Net model with a ResNet34 backbone trained using the combined Dice and Focal Loss (U-Net + ResNet34 with DL+FL). In 5-fold cross-validation, it achieved: Mean IoU 74%, Dice. Similarity Coefficient (DSC) 83.4%, Sensitivity 86.3% and Pixel Accuracy 97.2%. The U-Net + ResNet34 with DL+FL outperformed other configurations in three out of four classes and demonstrated robust performance in accurately segmenting key ocular symptoms: S1 - Cloudiness or haziness of the cornea, S2 - Redness of the sclera, S3 - Excessive tearing and S4 - A colored mass in the corner of the eye. Further enhancements to the segmentation model were made by training on a combined dataset of real images from DogEyeSeg4 and 400 synthetic images generated using Stable Diffusion, referred to as U-Net(RSD). This model achieved IoU 81%, DSC 88% and Pixel Accuracy 97%. These improvements underscore the effectiveness of augmenting training data with synthetic images to enhance model generalisation and performance. The U-Net(RSD) model was compared with other segmentation approaches: GPT-4o (IoU 16%, DSC 20% and Pixel Accuracy 72%), Grounding SAM (IoU 14%, DSC 16% and Pixel Accuracy 67%). The U-Net(RSD) model outperformed these models across all metrics, highlighting its superior capability in segmenting canine ocular symptoms in unconstrained environments. We explored training individual binary segmentation models for each symptom versus a single multiclass model. Binary models were trained using heatmaps as 4th channel in the RGB input image generated using information from the SSD eye detection. While binary models with heatmaps reduced false positives compared to binary models trained without a custom attention mechanism, they faced challenges with overlapping symptoms and increased complexity. The multiclass U-Net(RSD) model provided better overall performance and operational efficiency, supporting its use for practical applications. For diagnostic interpretation, several Large Language Models (LLMs) were evaluated: GPT-4, Gemini, Mistral, Claude and Llama-3. GPT-4 consistently provided the most accurate diagnoses based on the segmented symptoms. For single-diagnosis scenarios, GPT-4 achieved: BERTScore 0.80, CLIPScore 0.91, BLEU 0.52, METEOR. 0.42, ROUGE 0.56 and SPICE 0.56. When integrating segmentation masks from U-Net(RSD), the succeeding model GPT-4o demonstrated enhanced performance: BERTScore 0.84, CLIPScore 0.91 and BLEU 0.49, METEOR 0.32, ROUGE 0.51 and SPICE 0.51. These results indicate that combining precise segmentation with advanced LLMs like GPT-4o improves diagnostic interpretation. The proposed pipeline is illustrated in Figure 40. [63]. Leading Article 23 24 >>>26
RkJQdWJsaXNoZXIy OTc5MDU=