Background: In the field of veterinary medicine, the accurate and timely diagnosis of progressive skin lesions in dogs, remains a critical challenge. Traditional diagnostic approaches are often limited by subjectivity and the need for extensive human expertise. This research utilized advanced Convolutional Neural Network (CNN) technology to enhance dermatological diagnostic accuracy by filling a gap in the field.

Methods:  A CNN model was trained to recognize patterns and variations in images of dog skin conditions including hot spots, rashes and sores. The model was trained to classify and distinguish between different progressive skin lesions in dogs with high accuracy, based on images from various internet sources.

Result: The CNN model achieved an impressive 98.4% overall accuracy after training, demonstrating its potential in image classification for diagnosing progressive skin lesions in dogs. This deep-learning approach could significantly improve veterinary dermatology by providing a precise diagnostic tool for canine skin lesions.

Dogs are vulnerable to several skin conditions, making them uncomfortable and distressed. These lesions can arise as a result of a variety of conditions, including autoimmune disorders, infections, allergies, and parasites. Some of these lesions can spread to humans even though the majority are not zoonotic. Scabies, impetigo, and ringworm are examples of zoonotic skin infections that can be acquired from dogs. People who have weakened immune systems are more vulnerable to skin rashes, blisters and itching that these lesions can produce. To protect human and dog health and well-being as well as to stop the transmission of zoonotic skin lesions, it is imperative to seek veterinary care as soon as possible. Dog skin problems can be caused by a variety of reasons, including autoimmune disorders, allergies, infections, and parasites. Pets with lesions caused by bacteria, viruses, fungi, and parasites can often transmit these lesions to humans.
       
Skin lesions are among the most prevalent health problems in dogs (Noli, 2003). Veterinarians treating small animals frequently face dermatological lesions, which are among the most significant and challenging issues to address (Muller and Kirk, 1976). Many small animal cases are related to skin affection (Hill et al., 2006; Sharma et al., 2013; Estevez et al., 2023). Animals suffering from dermatological problems suffer from painful itching and continuous scratching. The demographics of skin problems in dogs and cats are a subject of little information in the field of veterinary medicine. An analysis (based on anecdotal information) states that from 2007 to 2013, skin problems accounted for around 75% of cases in a typical small animal clinic (Schwartzman and Orkin, 1963; Ihrke and Franti, 1985).

Atopic dermatitis may impact both humans and animals, according to Marsella (2021). Atopic dermatitis has not been identified as a single lesion, but rather as a complex clinical condition with varying routes in distinct patient subgroups. Atopic dermatitis is a term for inflammatory chronic disorders that is second most common in dogs, following flea-induced allergic dermatitis (Hensel et al., 2015; Lee et al., 2016). More studies have highlighted the allergic character of dermatitis, pointing out that allergens ranging from house mites to specific foods can induce atopic dermatitis in dogs, which means that symptoms might vary (Nuttall et al., 2014). According to reports, allergic atopic dermatitis develops when an animal swallows or inhales allergens found in the air, such as home dust or pollen. The animal licks, bites, or scratches itself as a result of an allergic reaction (Olivry et al., 2015).
       
Researchers have integrated a variety of automated technologies for identifying and categorizing skin problems. Several current methods for identifying and categorizing skin conditions are automated. Radiological imaging technologies are rarely used for the epidermal detection of skin disorders. By using image processing techniques such as edge detection, enhancement, equalization, transformation, and segmentation, they can identify the lesions based on the standard pictures. (Deepalakshmi et al., 2021; Naga et al., 2020; Kumar et al., 2016; AlZubi, 2023). The required image-processing techniques, such as morphological procedures for skin identification, are also used to classify skin disorders (Priya et al., 2018; Wei et al., 2018).
       
Most attention must be paid to determining the ideal threshold value since morphological opening, closure, dilation, and erosion mostly depend on the binary picture created by thresholding. The morphological operations might not be appropriate for determining the expansion of the damaged area based on the texture of the picture. Skin lesion categorization was made possible by the use of Genetic Algorithms (GA) (Srinivasu et al., 2020). There are issues with the Genetic Algorithm, such as its lengthy convergence time to the solution (Shrestha and Mahmood, 2016; Cho, 2024). There is never a global optimal answer provided by the model, which would lead to an unreasonable conclusion (Saber et al., 2013). The possibility of automatically identifying techniques like deep convolutional neural networks for lesion evaluation and trends in dermoscopy pictures, image classification methods, and information augmentation has been thoroughly studied (Roy et al., 2019; Said et al., 2023). Kshirsagar et al. (2020), have developed a computer-based technique for picture analysis derived from ELM programming language. A fusing approach is used with typical segmentation methods to generate a binary mask of a skin lesion.
       
An excessive focus on generalizability concepts about machine learning applications in the healthcare industry can ignore circumstances in which machine learning could help treat patients (Shin et al., 2016) Based on the Support Vector Machine (SVM) and possessing the well-established idea of structural risk reduction and excellent generalization capacity, an expert system model for animal illness diagnostics is suggested by Wan and Bao (2010). According to Fatima and Pasha (2017), the machine learning toolkit and algorithms that are used for lesions analysis and decision-making processes emphasize the benefits and drawbacks of several algorithms, including SVM, Feature transformation (FT), Rough set (RS) Theory, and Naïve Bayes. It has been noted that these algorithms offer improved lesion identification accuracy. A set of instruments created within the artificial intelligence community might be considered since they are beneficial for analyzing such issues and offer the chance to enhance the decision-making process (Kumar et al., 2023; Wasik and Pattinson, 2024). Trnovszky et al. (2017) compare the total recognition accuracy of principal component analysis (PCA), linear discriminant analysis (LDA), local binary pattern histogram (LBPH), and SVM in addition to classifying the input animal photos using CNN.
       
The collective literature emphasizes the dynamic evolution of deep learning technology in veterinary dermatology, indicating a shift towards not only achieving high accuracy in diagnostic capabilities but also addressing challenges related to model interpretability and adaptability to diverse datasets. The present study aims to contribute to the expanding area of skin lesion identification in dogs by examining the possibilities of Advanced Convolutional Neural Networks.
               
This paper introduces advanced Convolutional Neural Network (CNN) technology for the diagnosis of skin lesions, specifically targeting the many forms of hot spots, rashes, and sores. This innovative technology promises to change the diagnostic paradigm by delivering early detection of progressing dermatological disorders in addition to increased accuracy.
Dataset collection
 
Images of skin problems in dogs were collected from multiple online sources, showing hot spots, rashes, and sores lesions in dogs (Fig 1). The collection has a broad range of images depicting skin conditions seen in dogs. This dataset is useful for research and exploration into the identification and understanding of skin lesions in dogs using machine learning and computer vision techniques.

Fig 1: Depiction of different skin lesions (hot spots, rashes and sores) in dogs.


       
A total of 426 files were found in the dataset that are categorized into three classes: HOT SPOTS, RASHES, and SORES. The dataset is divided into 80:20 ratios for the training and validation sets.
 
Preprocessing
 
Resizing and image augmentation are some of the essential steps in the pre-processing of data that are completed before  CNN algorithm processes the data. The images of skin lesions are collected from various platforms. Firstly resizing the images to 256×256×3 pixels is done. The training performance of the CNN algorithm is enhanced by converting Color (Red, Green and Blue) images to grayscale of the input image data. It simplifies computations and makes it easier for the algorithm to read image features. It is known that the deep learning method needs plenty of data to operate at its best. So, the data augmentation procedure is performed (Fig 2).

Fig 2: Resized and rotated image after resizing and augmentation.


 
Different sections of neural network
 
The standard artificial neural network (ANN) model consists of a single input layer, multiple hidden layers, and a single output layer (Lee et al., 2017). In this method, every neuron applies function F to generate an output vector Y from an input vector X (Equation 1).

 
W functions as a strength of the connection between neurons located in separate layers. The CNN model has received a lot of attention due to its context-based classification features. The four basic components of a conventional CNN model are the Convolution layer, pooling layer, activation function, and fully connected layer. The functions of each component are outlined as follow:
 
Convolution layer
 
The Convolutional layer is the first layer that extracts features from images. It does this by filtering the image with a smaller pixel filter, which helps preserve the relationship between different parts of the image. This process, called convolution, is essential for maintaining pixel relationships while decreasing the image size. For example, the convolution process is applied to a 7×7 pixels image using a 3×3 filter with a 1×1 stride, the outcome will be a 5×5 (Fig 3). As data flows through the network, this size reduction helps the CNN’s subsequent layers by facilitating more effective processing and feature extraction.

Fig 3: The convolution of 7×7 and 3×3 filters with 1×1 stride.


 
Max-pooling layer
 
Pooling layers are often added after each convolution layer in the architecture (Fig 4). This reduces overfitting, lowers parameters, and minimizes the representation size. Pooling simplifies the model for efficiency by choosing important values in pixels, as shown in Fig 4 using max pooling.

Fig 4: The max pooling layer representation.


 
Fully connected layer
 
In a fully connected network, every parameter is connected to understand its impact on classes (Fig 5). Convolution and pooling layers are used to improve efficiency, and a fully connected network is built at the end to categorize the images.

Fig 5: Fully connected layer.


 
Activation function
 
A common tool in traditional machine learning research is the sigmoid function. For better precision, however, Rectified Linear Unit (ReLU) is often used. ReLU is preferred over sigmoid because it runs faster during training, is easier to compute, and avoids the vanishing gradient problem.
 
Implementation of convolutional neural network
 
The proposed model follows a sequential pattern, in which layers are arranged one after the other. The model includes six convolutional layers, labeled conv2d to conv2d_5, each handling input data to extract important features. After each convolution layer, there is a corresponding max-pooling layer that simplifies and focuses on the essential requirement for reducing dimensionality. After that, the data is reshaped for additional processing by a flattened layer. In this sequence, two dense layers support the learning of complex patterns by the neural network. The first dense layer consists of 64 neurons, while the second dense layer has 3 neurons. The final output has three classes of skin lesions in dogs. To overcome the overfitting problem during training, a dropout layer with a dropout rate of 0.5 is added. The architecture of the model includes 2,124,931 total number of trainable parameters. An outline of the procedure adopted for classification is depicted in the flow chart (Fig 6).

Fig 6: The architecture of the CNN model.


               
The simplified sketch of the procedure followed for the lesioned skin of dogs is presented in Fig 7. In this process, preprocessing of the data, splitting in 80:20 ratios for training and validation, model building, and evaluation are significant steps to achieve accurate classification of lesioned images.

Fig 7: Flow chart of procedure followed for classification.

To create the proposed CNN architecture, Keras and TensorFlow modules in Python are utilized. This choice is made to ensure greater simplicity and flexibility in the model. The architecture reveals the building blocks of CNN as user-friendly Python functions.
       
After 75 epochs, training matrices are evaluated to know the performance of the model on the training dataset (Fig 8). The objective of training is to minimize the training loss, which is 0.0983, which is a measure of the difference between predicted and actual values. The training accuracy is ~ 96.67% of correctly identified images. Moreover, the validation metrics analyze the model’s ability to unseen data. There is a 0.0180 validation loss. A lower validation loss indicates a more accurate generalization. A 100% validation accuracy indicates significant classification performance on the validation set. By using more hidden neurons and convolution layers, the findings can be improved.

Fig 8: The loss and accuracy of training and validation datasets.


       
The Confidence score of prediction and actual classes are performed to check the model efficiency. The predicted and actual labeling of the lesioned skin in dogs is given in Fig 9. The prediction of all lesions shows a good confidence score. The confusion matrix is a tool commonly used to evaluate the performance of a classification model. Each row and column in the matrix correspond to a specific class, and the numbers within the matrix cells indicate the count of instances predicted by the model about the actual classes. A graphical representation of the confusion matrix helps it easier to spot patterns of accurate and inaccurate classifications and gives a clear picture of the model’s advantages and disadvantages in terms of class differentiation. In Fig 10, the confusion matrix displays true and false events of skin lesions.

Fig 9: Actual and predicted lesion images using the proposed CNN model.



Fig 10: The confusion matrix.


 
The ability of the classification model to identify between hot spots, rashes, and sores is demonstrated by its performance metrics (Table 1).

Table 1: Classification matrices.


       
When analyzing the precision scores, it can be seen that both rashes and hot spot lesions obtained a score of 1.0000, proving that all instances classified as rashes or hot spots were correctly predicted. However, the precision of sores was slightly lower at 0.9524, suggesting that just a fraction of cases identified as sores could be false positives. Both hot spots and sores obtained recall scores of 1.0000, indicating that the model was able to identify every instance.

On the other hand, Rashes had a slightly lower recall of 0.9524, suggesting that not all rashes’ instances were identified by the model. In the F1-Score, which includes precision and recall into account, all classes performed well; hot spots and sores obtained 1.0000, while rashes acquired a high score of 0.9756. When considering the model as a whole, it performs well, showing simply slight differences in recall for rashes. With an overall accuracy of 98.44%, the weighted average metrics show the model’s reliability. This illustrates the model’s ability to efficiently classify instances in a medical context while balancing recall and precision.
 
Limitations and Future Work
 
•    Expanding the dataset is necessary to enhance the algorithm’s capacity to generalize and perform well with an array of inputs. A larger dataset makes sure the model detects more different kinds of patterns, which makes it more adaptable and able to change as the real world evolves. It also helps to fix data imbalances and improves the model’s ability to recognize unusual events or patterns.
•    More lesions will be identified, and powerful Deep Learning will be used in place of more basic Machine Learning to improve the system. This will enable the system to manage complicated situations with more efficiency.
In conclusion, the proposed sequential CNN method implemented in Python with Keras and TensorFlow modules looks promising for identifying skin lesions in dogs. Results with reliable accuracy in training and validation indicate effective learning and generalization to new datasets. The accuracy of training data after 75 epochs is 96.67%. The confidence score of predicting lesions concerning actual labels shows remarkable results. The confusion matrix, which recognizes between true and false instances of skin disorders, offers a thorough summary of the algorithm’s performance. The values of classification metrics like precision, recall, and F1-Score reveal excellent performance of the model for different skin conditions. Overall, this CNN approach seems reliable for automatically recognizing dog skin lesions. While it excels in some areas, there might be ways to make it even better, especially in identifying specific conditions. This model could be a useful tool for vets, and ongoing research with different datasets could make it even more accurate and helpful.
This work was supported by the Ongoing Research Funding program, (ORF-2025-1271), King Saud University, Riyadh, Saudi Arabia.
 
Funding statement
 
This work was supported by the Ongoing Research Funding program, (ORF-2025-1271), King Saud University, Riyadh, Saudi Arabia.
 
Data availability statement
 
Not applicable.
 
Declarations
 
Author(s) declare that all works are original and this manuscript has not been published in any other journal.
The author declare that they have no conflict of interest.

  1. AlZubi, A.A. (2023). Artificial intelligence and its application in the prediction and diagnosis of animal diseases: A review. Indian Journal of Animal Research. 57(10): 1265-1271. doi: 10.18805/IJAR.BF-1684.

  2. Cho, O.H. (2024). An evaluation of various machine learning approaches for detecting leaf diseases in agriculture. Legume Research. 47(3): 619-627. doi: 10.18805/LRF-787.

  3. Deepalakshmi, P., Lavanya, K. and Srinivasu, P.N. (2021). Plant leaf lesions detection using CNN algorithm. International Journal of Information System Modeling and Design (IJISMD). 12(1): 1-21.

  4. Estevez, J.R., Manco, J.A., Garcia-Arboleda, W., Echeverry, S., Pino, I., Acevedo, A. and Rendon, M.A. (2023). Microen- capsulated probiotics in feed for beef cattle are better alternative to monensin sodium. International Journal of Probiotics and Prebiotics. 18(1): 30-37. https://doi.org/ 10.37290/ijpp2641-7197.18:30-37.

  5. Fatima, M. and Pasha, M. (2017). Survey of machine learning algorithms for lesions diagnostic. Journal of Intelligent Learning Systems and Applications. 9(01): 1-16.

  6. Hensel, P., Santoro, D., Favrot, C., Hill, P. and Griffin, C. (2015). Canine atopic dermatitis: Detailed guidelines for diagnosis and allergen identification. BMC Veterinary Research. 11(1): 1-13.

  7. Hill, P., Lo, A., Eden, C.A.N., Huntley, S., Morey, V., Ramsey, S. and Williams, V. (2006). Survey of the prevalence, diagnosis and treatment of dermatological conditions in small animals in general practice. Veterinary Record. 158(16): 533-539.

  8. https://www.vin.com/apputil/content/defa ultadv1.aspx?id=38 50098&pid=8768&

  9. https://www.vin.com/apputil/content/defaultadv1.aspx?pId=87 68&id=3850098

  10. Ihrke, P.J. and Franti, C.E. (1985). Breed as a risk factor associated with skin lesionss in dogs seen in northern California. Calif Vet. 39: 13-16.

  11. Kshirsagar, P., Balakrishnan, N. and Yadav, A.D. (2020). Modelling of optimised neural network for classification and prediction of benchmark datasets. Computer Methods in Biomechanics and Biomedical Engineering: Imaging and Visualization. 8(4): 426-435.

  12. Kumar, A., Kim, J., Lyndon, D., Fulham, M. and Feng, D. (2016). An ensemble of fine-tuned convolutional neural networks for medical image classification. IEEE Journal of Biomedical and Health Informatics. 21(1): 31-40. 

  13. Kumar, V., Chaturvedi, V., Lal, B. and Alam, S. (2023). Application of machine learning in analyzing the psychological well being amongst the employees in the private sector. An analysis of work-life balance in the healthcare industry. Pacific Business Review (International). 16(1): 124-131.

  14. Lee, H.M., Park, I.H., Shin, J.M., Yoon, H.S., Park, G.Y., Zeher, M. et al. (2016). XXIV World Allergy Congress 2015. The World Allergy Organization Journal. 9(Suppl 1): 14.

  15. Lee, K.B., Cheon, S. and Kim, C.O. (2017). A convolutional neural network for fault classification and diagnosis in semicon- ductor manufacturing processes. IEEE Transactions on Semiconductor Manufacturing. 30(2): 135-142.

  16. Marsella, R. (2021). Atopic dermatitis in domestic animals: What our current understanding is and how this applies to clinical practice. Veterinary Sciences. 8(7): 124.

  17. Muller, G.H. and Kirk, R.W. (1976). Small Animal Dermatology (No. Ed. 2). WB Saunders Company.

  18. Naga Srinivasu, P., Srinivasa Rao, T., Dicu, A.M., Mnerie, C.A. and Olariu, I. (2020). A comparative review of optimisation techniques in segmentation of brain MR images. Journal of Intelligent and Fuzzy Systems. 38(5): 6031-6043.

  19. Noli, C. (2003). Seborrhea: Why and how does it happen? World Small Animal Veterinary Association World Congress Proceedings. Ospedale Veterinario Cuneese, S. Dalmazzo (CN), Italy. 

  20. Nuttall, T., Reece, D. and Roberts, E. (2014). Life long lesionss need life long treatment: long term safety of ciclosporin in canine atopic dermatitis. Veterinary Record. 174(S2): 3-12.

  21. Olivry, T., DeBoer, D.J., Favrot, C., Jackson, H.A., Mueller, R.S., Nuttall, T. and International Committee on Allergic Lesionss of Animals. (2015). Treatment of canine atopic dermatitis: 2015 updated guidelines from the International Committee on Allergic Lesionss of Animals (ICADA). BMC veterinary Research. 11: 1-15.

  22. Priya, A.G., Anitha, J. and Poonima, J. (2018). Identification of melanoma in dermoscopy images using image processing algorithms. In 2018 International Conference on Control, Power, Communication and Computing Technologies (ICCPCCT) (pp. 553-557). Kannur, India. https://doi.org/10.1109/ICCP CCT.2018.8574277.

  23. Roy, K., Chaudhuri, S.S., Ghosh, S., Dutta, S.K., Chakraborty, P. and Sarkar, R. (2019). Skin Lesions detection based on different Segmentation Techniques. In 2019 international conference on opto-electronics and applied optics (Optronix). IEEE. (pp. 1-5)

  24. Saber, E., Ruhul, S. and Daryl, E. (2013). A new genetic algorithm for solving optimization problem. Eng. Appl. Artif. Intell 27: 57-69.

  25. Said, D., Youssef, D., El-Bayaa, N., Alzoubi, Y.I. and Zaim, H. (2023). The impact of diversity on job performance: Evidence from private universities in Egypt. Acta Innovations. 49: 17-30. https://doi.org/10.32933/ActaInnovations. 49.2 

  26. Schwartzman, R.M. and Orkin, M. (1963). A comparative study of skin lesions of dog and man. Arch Dermatol. 8: 347-58.

  27. Sharma, K., Mondal, D. B., Sarvanan, M., Kumar, M. and Vijaykumar, H. (2013). Incidence of dermatological disorders and its therapeutic management in canines. Intas polivet. 14(2): 186-192.

  28. Shin, H.C., Roth, H.R., Gao, M., Lu, L., Xu, Z., Nogues, I. and Summers, R.M. (2016). Deep convolutional neural networks for computer- aided detection: CNN architectures, dataset characteristics and transfer learning. IEEE Transactions on Medical Imaging. 35(5): 1285-1298.

  29. Shrestha, A. and Mahmood, A. (2016). Improving genetic algorithm with fine-tuned crossover and scaled architecture. Journal of Mathematics. 2016.

  30. Srinivasu, P.N., Rao, T.S. and Balas, V.E. (2020). Volumetric estimation of the damaged area in the human brain from 2D MR image. International Journal of Information System Modeling and Design (IJISMD). 11(1): 74-92.

  31. Trnovszky, T., Kamencay, P., Orjesek, R., Benco, M. and Sykora, P. (2017). Animal recognition system based on convolutional neural network. Advances in Electrical and Electronic Engineering. 15(3): 517-525.

  32. Wan, L. and Bao, W. (2010). Animal lesions diagnoses expert system based on SVM. In Computer and Computing Technologies in Agriculture III: Third IFIP TC 12 International Conference, CCTA 2009, Beijing, China, October 14-17, 2009, Revised Selected Papers 3. Springer Berlin Heidelberg.  (pp. 539-545).

  33. Wasik, S. and Pattinson, R. (2024). Artificial intelligence applications in fish classification and taxonomy: Advancing our understanding of aquatic biodiversity. FishTaxa. 31: 11-21.

  34. Wei, L.S., Gan, Q. and Ji, T. (2018). Skin lesions recognition method based on image color and texture features. Computational and Mathematical Methods in Medicine. 2018.

Background: In the field of veterinary medicine, the accurate and timely diagnosis of progressive skin lesions in dogs, remains a critical challenge. Traditional diagnostic approaches are often limited by subjectivity and the need for extensive human expertise. This research utilized advanced Convolutional Neural Network (CNN) technology to enhance dermatological diagnostic accuracy by filling a gap in the field.

Methods:  A CNN model was trained to recognize patterns and variations in images of dog skin conditions including hot spots, rashes and sores. The model was trained to classify and distinguish between different progressive skin lesions in dogs with high accuracy, based on images from various internet sources.

Result: The CNN model achieved an impressive 98.4% overall accuracy after training, demonstrating its potential in image classification for diagnosing progressive skin lesions in dogs. This deep-learning approach could significantly improve veterinary dermatology by providing a precise diagnostic tool for canine skin lesions.

Dogs are vulnerable to several skin conditions, making them uncomfortable and distressed. These lesions can arise as a result of a variety of conditions, including autoimmune disorders, infections, allergies, and parasites. Some of these lesions can spread to humans even though the majority are not zoonotic. Scabies, impetigo, and ringworm are examples of zoonotic skin infections that can be acquired from dogs. People who have weakened immune systems are more vulnerable to skin rashes, blisters and itching that these lesions can produce. To protect human and dog health and well-being as well as to stop the transmission of zoonotic skin lesions, it is imperative to seek veterinary care as soon as possible. Dog skin problems can be caused by a variety of reasons, including autoimmune disorders, allergies, infections, and parasites. Pets with lesions caused by bacteria, viruses, fungi, and parasites can often transmit these lesions to humans.
       
Skin lesions are among the most prevalent health problems in dogs (Noli, 2003). Veterinarians treating small animals frequently face dermatological lesions, which are among the most significant and challenging issues to address (Muller and Kirk, 1976). Many small animal cases are related to skin affection (Hill et al., 2006; Sharma et al., 2013; Estevez et al., 2023). Animals suffering from dermatological problems suffer from painful itching and continuous scratching. The demographics of skin problems in dogs and cats are a subject of little information in the field of veterinary medicine. An analysis (based on anecdotal information) states that from 2007 to 2013, skin problems accounted for around 75% of cases in a typical small animal clinic (Schwartzman and Orkin, 1963; Ihrke and Franti, 1985).

Atopic dermatitis may impact both humans and animals, according to Marsella (2021). Atopic dermatitis has not been identified as a single lesion, but rather as a complex clinical condition with varying routes in distinct patient subgroups. Atopic dermatitis is a term for inflammatory chronic disorders that is second most common in dogs, following flea-induced allergic dermatitis (Hensel et al., 2015; Lee et al., 2016). More studies have highlighted the allergic character of dermatitis, pointing out that allergens ranging from house mites to specific foods can induce atopic dermatitis in dogs, which means that symptoms might vary (Nuttall et al., 2014). According to reports, allergic atopic dermatitis develops when an animal swallows or inhales allergens found in the air, such as home dust or pollen. The animal licks, bites, or scratches itself as a result of an allergic reaction (Olivry et al., 2015).
       
Researchers have integrated a variety of automated technologies for identifying and categorizing skin problems. Several current methods for identifying and categorizing skin conditions are automated. Radiological imaging technologies are rarely used for the epidermal detection of skin disorders. By using image processing techniques such as edge detection, enhancement, equalization, transformation, and segmentation, they can identify the lesions based on the standard pictures. (Deepalakshmi et al., 2021; Naga et al., 2020; Kumar et al., 2016; AlZubi, 2023). The required image-processing techniques, such as morphological procedures for skin identification, are also used to classify skin disorders (Priya et al., 2018; Wei et al., 2018).
       
Most attention must be paid to determining the ideal threshold value since morphological opening, closure, dilation, and erosion mostly depend on the binary picture created by thresholding. The morphological operations might not be appropriate for determining the expansion of the damaged area based on the texture of the picture. Skin lesion categorization was made possible by the use of Genetic Algorithms (GA) (Srinivasu et al., 2020). There are issues with the Genetic Algorithm, such as its lengthy convergence time to the solution (Shrestha and Mahmood, 2016; Cho, 2024). There is never a global optimal answer provided by the model, which would lead to an unreasonable conclusion (Saber et al., 2013). The possibility of automatically identifying techniques like deep convolutional neural networks for lesion evaluation and trends in dermoscopy pictures, image classification methods, and information augmentation has been thoroughly studied (Roy et al., 2019; Said et al., 2023). Kshirsagar et al. (2020), have developed a computer-based technique for picture analysis derived from ELM programming language. A fusing approach is used with typical segmentation methods to generate a binary mask of a skin lesion.
       
An excessive focus on generalizability concepts about machine learning applications in the healthcare industry can ignore circumstances in which machine learning could help treat patients (Shin et al., 2016) Based on the Support Vector Machine (SVM) and possessing the well-established idea of structural risk reduction and excellent generalization capacity, an expert system model for animal illness diagnostics is suggested by Wan and Bao (2010). According to Fatima and Pasha (2017), the machine learning toolkit and algorithms that are used for lesions analysis and decision-making processes emphasize the benefits and drawbacks of several algorithms, including SVM, Feature transformation (FT), Rough set (RS) Theory, and Naïve Bayes. It has been noted that these algorithms offer improved lesion identification accuracy. A set of instruments created within the artificial intelligence community might be considered since they are beneficial for analyzing such issues and offer the chance to enhance the decision-making process (Kumar et al., 2023; Wasik and Pattinson, 2024). Trnovszky et al. (2017) compare the total recognition accuracy of principal component analysis (PCA), linear discriminant analysis (LDA), local binary pattern histogram (LBPH), and SVM in addition to classifying the input animal photos using CNN.
       
The collective literature emphasizes the dynamic evolution of deep learning technology in veterinary dermatology, indicating a shift towards not only achieving high accuracy in diagnostic capabilities but also addressing challenges related to model interpretability and adaptability to diverse datasets. The present study aims to contribute to the expanding area of skin lesion identification in dogs by examining the possibilities of Advanced Convolutional Neural Networks.
               
This paper introduces advanced Convolutional Neural Network (CNN) technology for the diagnosis of skin lesions, specifically targeting the many forms of hot spots, rashes, and sores. This innovative technology promises to change the diagnostic paradigm by delivering early detection of progressing dermatological disorders in addition to increased accuracy.
Dataset collection
 
Images of skin problems in dogs were collected from multiple online sources, showing hot spots, rashes, and sores lesions in dogs (Fig 1). The collection has a broad range of images depicting skin conditions seen in dogs. This dataset is useful for research and exploration into the identification and understanding of skin lesions in dogs using machine learning and computer vision techniques.

Fig 1: Depiction of different skin lesions (hot spots, rashes and sores) in dogs.


       
A total of 426 files were found in the dataset that are categorized into three classes: HOT SPOTS, RASHES, and SORES. The dataset is divided into 80:20 ratios for the training and validation sets.
 
Preprocessing
 
Resizing and image augmentation are some of the essential steps in the pre-processing of data that are completed before  CNN algorithm processes the data. The images of skin lesions are collected from various platforms. Firstly resizing the images to 256×256×3 pixels is done. The training performance of the CNN algorithm is enhanced by converting Color (Red, Green and Blue) images to grayscale of the input image data. It simplifies computations and makes it easier for the algorithm to read image features. It is known that the deep learning method needs plenty of data to operate at its best. So, the data augmentation procedure is performed (Fig 2).

Fig 2: Resized and rotated image after resizing and augmentation.


 
Different sections of neural network
 
The standard artificial neural network (ANN) model consists of a single input layer, multiple hidden layers, and a single output layer (Lee et al., 2017). In this method, every neuron applies function F to generate an output vector Y from an input vector X (Equation 1).

 
W functions as a strength of the connection between neurons located in separate layers. The CNN model has received a lot of attention due to its context-based classification features. The four basic components of a conventional CNN model are the Convolution layer, pooling layer, activation function, and fully connected layer. The functions of each component are outlined as follow:
 
Convolution layer
 
The Convolutional layer is the first layer that extracts features from images. It does this by filtering the image with a smaller pixel filter, which helps preserve the relationship between different parts of the image. This process, called convolution, is essential for maintaining pixel relationships while decreasing the image size. For example, the convolution process is applied to a 7×7 pixels image using a 3×3 filter with a 1×1 stride, the outcome will be a 5×5 (Fig 3). As data flows through the network, this size reduction helps the CNN’s subsequent layers by facilitating more effective processing and feature extraction.

Fig 3: The convolution of 7×7 and 3×3 filters with 1×1 stride.


 
Max-pooling layer
 
Pooling layers are often added after each convolution layer in the architecture (Fig 4). This reduces overfitting, lowers parameters, and minimizes the representation size. Pooling simplifies the model for efficiency by choosing important values in pixels, as shown in Fig 4 using max pooling.

Fig 4: The max pooling layer representation.


 
Fully connected layer
 
In a fully connected network, every parameter is connected to understand its impact on classes (Fig 5). Convolution and pooling layers are used to improve efficiency, and a fully connected network is built at the end to categorize the images.

Fig 5: Fully connected layer.


 
Activation function
 
A common tool in traditional machine learning research is the sigmoid function. For better precision, however, Rectified Linear Unit (ReLU) is often used. ReLU is preferred over sigmoid because it runs faster during training, is easier to compute, and avoids the vanishing gradient problem.
 
Implementation of convolutional neural network
 
The proposed model follows a sequential pattern, in which layers are arranged one after the other. The model includes six convolutional layers, labeled conv2d to conv2d_5, each handling input data to extract important features. After each convolution layer, there is a corresponding max-pooling layer that simplifies and focuses on the essential requirement for reducing dimensionality. After that, the data is reshaped for additional processing by a flattened layer. In this sequence, two dense layers support the learning of complex patterns by the neural network. The first dense layer consists of 64 neurons, while the second dense layer has 3 neurons. The final output has three classes of skin lesions in dogs. To overcome the overfitting problem during training, a dropout layer with a dropout rate of 0.5 is added. The architecture of the model includes 2,124,931 total number of trainable parameters. An outline of the procedure adopted for classification is depicted in the flow chart (Fig 6).

Fig 6: The architecture of the CNN model.


               
The simplified sketch of the procedure followed for the lesioned skin of dogs is presented in Fig 7. In this process, preprocessing of the data, splitting in 80:20 ratios for training and validation, model building, and evaluation are significant steps to achieve accurate classification of lesioned images.

Fig 7: Flow chart of procedure followed for classification.

To create the proposed CNN architecture, Keras and TensorFlow modules in Python are utilized. This choice is made to ensure greater simplicity and flexibility in the model. The architecture reveals the building blocks of CNN as user-friendly Python functions.
       
After 75 epochs, training matrices are evaluated to know the performance of the model on the training dataset (Fig 8). The objective of training is to minimize the training loss, which is 0.0983, which is a measure of the difference between predicted and actual values. The training accuracy is ~ 96.67% of correctly identified images. Moreover, the validation metrics analyze the model’s ability to unseen data. There is a 0.0180 validation loss. A lower validation loss indicates a more accurate generalization. A 100% validation accuracy indicates significant classification performance on the validation set. By using more hidden neurons and convolution layers, the findings can be improved.

Fig 8: The loss and accuracy of training and validation datasets.


       
The Confidence score of prediction and actual classes are performed to check the model efficiency. The predicted and actual labeling of the lesioned skin in dogs is given in Fig 9. The prediction of all lesions shows a good confidence score. The confusion matrix is a tool commonly used to evaluate the performance of a classification model. Each row and column in the matrix correspond to a specific class, and the numbers within the matrix cells indicate the count of instances predicted by the model about the actual classes. A graphical representation of the confusion matrix helps it easier to spot patterns of accurate and inaccurate classifications and gives a clear picture of the model’s advantages and disadvantages in terms of class differentiation. In Fig 10, the confusion matrix displays true and false events of skin lesions.

Fig 9: Actual and predicted lesion images using the proposed CNN model.



Fig 10: The confusion matrix.


 
The ability of the classification model to identify between hot spots, rashes, and sores is demonstrated by its performance metrics (Table 1).

Table 1: Classification matrices.


       
When analyzing the precision scores, it can be seen that both rashes and hot spot lesions obtained a score of 1.0000, proving that all instances classified as rashes or hot spots were correctly predicted. However, the precision of sores was slightly lower at 0.9524, suggesting that just a fraction of cases identified as sores could be false positives. Both hot spots and sores obtained recall scores of 1.0000, indicating that the model was able to identify every instance.

On the other hand, Rashes had a slightly lower recall of 0.9524, suggesting that not all rashes’ instances were identified by the model. In the F1-Score, which includes precision and recall into account, all classes performed well; hot spots and sores obtained 1.0000, while rashes acquired a high score of 0.9756. When considering the model as a whole, it performs well, showing simply slight differences in recall for rashes. With an overall accuracy of 98.44%, the weighted average metrics show the model’s reliability. This illustrates the model’s ability to efficiently classify instances in a medical context while balancing recall and precision.
 
Limitations and Future Work
 
•    Expanding the dataset is necessary to enhance the algorithm’s capacity to generalize and perform well with an array of inputs. A larger dataset makes sure the model detects more different kinds of patterns, which makes it more adaptable and able to change as the real world evolves. It also helps to fix data imbalances and improves the model’s ability to recognize unusual events or patterns.
•    More lesions will be identified, and powerful Deep Learning will be used in place of more basic Machine Learning to improve the system. This will enable the system to manage complicated situations with more efficiency.
In conclusion, the proposed sequential CNN method implemented in Python with Keras and TensorFlow modules looks promising for identifying skin lesions in dogs. Results with reliable accuracy in training and validation indicate effective learning and generalization to new datasets. The accuracy of training data after 75 epochs is 96.67%. The confidence score of predicting lesions concerning actual labels shows remarkable results. The confusion matrix, which recognizes between true and false instances of skin disorders, offers a thorough summary of the algorithm’s performance. The values of classification metrics like precision, recall, and F1-Score reveal excellent performance of the model for different skin conditions. Overall, this CNN approach seems reliable for automatically recognizing dog skin lesions. While it excels in some areas, there might be ways to make it even better, especially in identifying specific conditions. This model could be a useful tool for vets, and ongoing research with different datasets could make it even more accurate and helpful.
This work was supported by the Ongoing Research Funding program, (ORF-2025-1271), King Saud University, Riyadh, Saudi Arabia.
 
Funding statement
 
This work was supported by the Ongoing Research Funding program, (ORF-2025-1271), King Saud University, Riyadh, Saudi Arabia.
 
Data availability statement
 
Not applicable.
 
Declarations
 
Author(s) declare that all works are original and this manuscript has not been published in any other journal.
The author declare that they have no conflict of interest.

  1. AlZubi, A.A. (2023). Artificial intelligence and its application in the prediction and diagnosis of animal diseases: A review. Indian Journal of Animal Research. 57(10): 1265-1271. doi: 10.18805/IJAR.BF-1684.

  2. Cho, O.H. (2024). An evaluation of various machine learning approaches for detecting leaf diseases in agriculture. Legume Research. 47(3): 619-627. doi: 10.18805/LRF-787.

  3. Deepalakshmi, P., Lavanya, K. and Srinivasu, P.N. (2021). Plant leaf lesions detection using CNN algorithm. International Journal of Information System Modeling and Design (IJISMD). 12(1): 1-21.

  4. Estevez, J.R., Manco, J.A., Garcia-Arboleda, W., Echeverry, S., Pino, I., Acevedo, A. and Rendon, M.A. (2023). Microen- capsulated probiotics in feed for beef cattle are better alternative to monensin sodium. International Journal of Probiotics and Prebiotics. 18(1): 30-37. https://doi.org/ 10.37290/ijpp2641-7197.18:30-37.

  5. Fatima, M. and Pasha, M. (2017). Survey of machine learning algorithms for lesions diagnostic. Journal of Intelligent Learning Systems and Applications. 9(01): 1-16.

  6. Hensel, P., Santoro, D., Favrot, C., Hill, P. and Griffin, C. (2015). Canine atopic dermatitis: Detailed guidelines for diagnosis and allergen identification. BMC Veterinary Research. 11(1): 1-13.

  7. Hill, P., Lo, A., Eden, C.A.N., Huntley, S., Morey, V., Ramsey, S. and Williams, V. (2006). Survey of the prevalence, diagnosis and treatment of dermatological conditions in small animals in general practice. Veterinary Record. 158(16): 533-539.

  8. https://www.vin.com/apputil/content/defa ultadv1.aspx?id=38 50098&pid=8768&

  9. https://www.vin.com/apputil/content/defaultadv1.aspx?pId=87 68&id=3850098

  10. Ihrke, P.J. and Franti, C.E. (1985). Breed as a risk factor associated with skin lesionss in dogs seen in northern California. Calif Vet. 39: 13-16.

  11. Kshirsagar, P., Balakrishnan, N. and Yadav, A.D. (2020). Modelling of optimised neural network for classification and prediction of benchmark datasets. Computer Methods in Biomechanics and Biomedical Engineering: Imaging and Visualization. 8(4): 426-435.

  12. Kumar, A., Kim, J., Lyndon, D., Fulham, M. and Feng, D. (2016). An ensemble of fine-tuned convolutional neural networks for medical image classification. IEEE Journal of Biomedical and Health Informatics. 21(1): 31-40. 

  13. Kumar, V., Chaturvedi, V., Lal, B. and Alam, S. (2023). Application of machine learning in analyzing the psychological well being amongst the employees in the private sector. An analysis of work-life balance in the healthcare industry. Pacific Business Review (International). 16(1): 124-131.

  14. Lee, H.M., Park, I.H., Shin, J.M., Yoon, H.S., Park, G.Y., Zeher, M. et al. (2016). XXIV World Allergy Congress 2015. The World Allergy Organization Journal. 9(Suppl 1): 14.

  15. Lee, K.B., Cheon, S. and Kim, C.O. (2017). A convolutional neural network for fault classification and diagnosis in semicon- ductor manufacturing processes. IEEE Transactions on Semiconductor Manufacturing. 30(2): 135-142.

  16. Marsella, R. (2021). Atopic dermatitis in domestic animals: What our current understanding is and how this applies to clinical practice. Veterinary Sciences. 8(7): 124.

  17. Muller, G.H. and Kirk, R.W. (1976). Small Animal Dermatology (No. Ed. 2). WB Saunders Company.

  18. Naga Srinivasu, P., Srinivasa Rao, T., Dicu, A.M., Mnerie, C.A. and Olariu, I. (2020). A comparative review of optimisation techniques in segmentation of brain MR images. Journal of Intelligent and Fuzzy Systems. 38(5): 6031-6043.

  19. Noli, C. (2003). Seborrhea: Why and how does it happen? World Small Animal Veterinary Association World Congress Proceedings. Ospedale Veterinario Cuneese, S. Dalmazzo (CN), Italy. 

  20. Nuttall, T., Reece, D. and Roberts, E. (2014). Life long lesionss need life long treatment: long term safety of ciclosporin in canine atopic dermatitis. Veterinary Record. 174(S2): 3-12.

  21. Olivry, T., DeBoer, D.J., Favrot, C., Jackson, H.A., Mueller, R.S., Nuttall, T. and International Committee on Allergic Lesionss of Animals. (2015). Treatment of canine atopic dermatitis: 2015 updated guidelines from the International Committee on Allergic Lesionss of Animals (ICADA). BMC veterinary Research. 11: 1-15.

  22. Priya, A.G., Anitha, J. and Poonima, J. (2018). Identification of melanoma in dermoscopy images using image processing algorithms. In 2018 International Conference on Control, Power, Communication and Computing Technologies (ICCPCCT) (pp. 553-557). Kannur, India. https://doi.org/10.1109/ICCP CCT.2018.8574277.

  23. Roy, K., Chaudhuri, S.S., Ghosh, S., Dutta, S.K., Chakraborty, P. and Sarkar, R. (2019). Skin Lesions detection based on different Segmentation Techniques. In 2019 international conference on opto-electronics and applied optics (Optronix). IEEE. (pp. 1-5)

  24. Saber, E., Ruhul, S. and Daryl, E. (2013). A new genetic algorithm for solving optimization problem. Eng. Appl. Artif. Intell 27: 57-69.

  25. Said, D., Youssef, D., El-Bayaa, N., Alzoubi, Y.I. and Zaim, H. (2023). The impact of diversity on job performance: Evidence from private universities in Egypt. Acta Innovations. 49: 17-30. https://doi.org/10.32933/ActaInnovations. 49.2 

  26. Schwartzman, R.M. and Orkin, M. (1963). A comparative study of skin lesions of dog and man. Arch Dermatol. 8: 347-58.

  27. Sharma, K., Mondal, D. B., Sarvanan, M., Kumar, M. and Vijaykumar, H. (2013). Incidence of dermatological disorders and its therapeutic management in canines. Intas polivet. 14(2): 186-192.

  28. Shin, H.C., Roth, H.R., Gao, M., Lu, L., Xu, Z., Nogues, I. and Summers, R.M. (2016). Deep convolutional neural networks for computer- aided detection: CNN architectures, dataset characteristics and transfer learning. IEEE Transactions on Medical Imaging. 35(5): 1285-1298.

  29. Shrestha, A. and Mahmood, A. (2016). Improving genetic algorithm with fine-tuned crossover and scaled architecture. Journal of Mathematics. 2016.

  30. Srinivasu, P.N., Rao, T.S. and Balas, V.E. (2020). Volumetric estimation of the damaged area in the human brain from 2D MR image. International Journal of Information System Modeling and Design (IJISMD). 11(1): 74-92.

  31. Trnovszky, T., Kamencay, P., Orjesek, R., Benco, M. and Sykora, P. (2017). Animal recognition system based on convolutional neural network. Advances in Electrical and Electronic Engineering. 15(3): 517-525.

  32. Wan, L. and Bao, W. (2010). Animal lesions diagnoses expert system based on SVM. In Computer and Computing Technologies in Agriculture III: Third IFIP TC 12 International Conference, CCTA 2009, Beijing, China, October 14-17, 2009, Revised Selected Papers 3. Springer Berlin Heidelberg.  (pp. 539-545).

  33. Wasik, S. and Pattinson, R. (2024). Artificial intelligence applications in fish classification and taxonomy: Advancing our understanding of aquatic biodiversity. FishTaxa. 31: 11-21.

  34. Wei, L.S., Gan, Q. and Ji, T. (2018). Skin lesions recognition method based on image color and texture features. Computational and Mathematical Methods in Medicine. 2018.
In this Article
Published In
Indian Journal of Animal Research

Editorial Board

View all (0)