Ringworm detection using the instance of segmentation potential of YOLOv7 in dromedary camels

Full Length Research Article 

Ringworm detection using the instance of segmentation potential of YOLOv7 in dromedary camels

Fawaghy Alhashmi1, Nabil Mansour1,2 *, Shaher Bano Mirza1, Fouad Lamghari1

Adv. life sci., vol. 11, no. 1, pp. 194-199, February 2024
*Corresponding Author: Nabil Mansour (nabil.mansour@frc.ae)
Authors' Affiliations

 1. Fujairah Research Centre (FRC), Al-Hilal Tower 3003, Fujairah – United Arab Emirates
2. Department of Theriogenology, Faculty of Veterinary Medicine, Kafrelsheikh University – Egypt 
 
[Date Received: 11/09/2023; Date Revised: 27/12/2023; Date Published: 25/02/2024]


Abstractaa download_button
Introduction
Methods
Results

Discussion
References 


Abstract

Background: Dermatophytosis, commonly known as ringworm, is a contagious fungal skin disease prevalent among camels, particularly of 1-3 years old, and resulting in considerable economic losses. Recently, using machine learning technology presents a promising avenue for achieving high diagnostic accuracy, especially in identifying infected camels in remote farm settings.

Methods: A dataset comprising 801 images from 61 camels aged 12-15 months was subjected to analysis using YOLOv7 (You Only Look Once, volume 7), a Machine learning model. Subsequently, the YOLOv7 algorithm's efficacy in distinguishing between healthy and ringworm-infected camels was evaluated.

Results: The YOLOv7 algorithm demonstrated robust capability in accurately identifying ringworm-infected skin and distinguishing it from healthy skin in camels. Validation set results revealed an average precision (AP) of 0.944, indicating high effectiveness in discriminating between normal and infected skin. Furthermore, the algorithm exhibited proficiency in classifying the severity of skin infection among the identified cases. Of the 61 camels analyzed, 36 were found to be infected, representing an incidence rate of 59%. These infected camels were further categorized into groups based on the severity of infection, with 6 classifieds as mild (<50 infection spots), 5 as moderate (50-100 spots), and 25 as severe (>100 spots).

Conclusion: The YOLOv7 model emerges as a dependable tool for the identification and classification of camel ringworm infections. Its implementation incorporated in farm surveillance and notification system holds promise for early detection of such issues and effective monitoring of camels kept under farm conditions in remote areas.

Keywords: Dromadory camels; Computer vision; YOLO7; Ringworm; Dermatophytosis, UAE 

Introduction6th button-01


Dermatophytosis or ringworm is a contagious fungal infection that can affect the keratinized tissues such as skin, nails, and hair of both humans and animals [1]. Ringworm infection is common in camels with high prevalence in young camels of 1-3 years old [2].  Crusty patchy lesions appear on the infected camels’ head, neck, shoulders, arms, legs, and flanks [2]. These patches cause itching and pain during daily activities and cause significant economic losses characterized by reduced weight gain, milk production, and fertility [3]. Direct contact with diseased animals or contaminated materials like brushes, saddles, and grooming equipment can easily transmit the fungus spores [4]. As a consequence of global warming, associated with diminishing water resources and depletion of natural vegetation, the establishment of numerous camel farms has become prevalent, leading to heightened contact among camels. Confinement within restricted housing conditions has been linked to alterations in camel performance and immune function, thereby amplifying the risk of disease transmission [5, 6]. Failure to recognize ringworm infection in its early stages can result in the quick spreading of the infection and increase economic losses.

Methods based on machine learning have been successfully applied to detect and diagnose several diseases and have achieved highly promising results [7]. Moreover, these technologies demonstrated considerable potential for detecting and diagnosing skin disorders in animals [8, 9]. Machine learning algorithms could be previously trained to distinguish between healthy and infected skin infection-related patterns and properties in images, such as the size, shape, and color of lesions in pets [10]. Machine learning methods, such as convolutional neural networks (CNNs), can be trained to categorize images of normal and infected skin with ringworm and achieve high accuracy in diagnosing infected camels. YOLO is a CNN that enables end-to-end training and testing. Version 7(YOLOv7) is an algorithm for real-time object recognition. Which operates by estimating bounding boxes and class probabilities for each object in an image as input. The YOLOv7 model is built in three parts: the backbone, the neck, and the head. The image’s features are extracted using the backbone. Following their combination and mixing in the neck, these properties are then transmitted to the head section. Bounding boxes are constructed around classes and locations of items that are predicted by the network head. The final prediction is obtained by applying a technique known as non-maximum suppression (NMS) to these initial predictions. By eliminating the ones that have the highest confidence scores, this technique helps to reduce the number of bounding boxes that overlap. High speed, less expensive hardware and accuracy make it viable option for cost and time effective real-time object detection applications as compared to other neural networks [11]. In the current study, YOLOv7 was used and trained to analyze the images of camels with and without ringworm lesions to detect healthy and infected camels. Also, it was used to distinguish and classify the degree of ringworm infections in dromedary camels.

Methods6th button-01


Animals and their keeping

Sixty-one camel calves with an age of 12-15 months were used in the current study. These camels were recently transferred from Bulaida Farms, Fujairah, where they were kept in one pen of an area of 900 m2 after their weaning, to Al-Marmoum race station, Dubai, United Arab Emirates. These camels were free from any physical abnormalities and many of them showed multiple localized areas of alopecia. Samples of skin scrapping were collected and sent to the Central Veterinary Research Laboratory (CVRL), Dubai, for diagnosis. Ringworm infection on camel skin was diagnosed by a direct microscopic examination according to Almuzaini et al. (2016). Also, samples were diagnosed positively for Ringworm after culturing for 4 weeks [12]. In Al-Marmoum farm, camels were housed in two pens, each covering a total area of 256 square meters. They were fed twice daily on a diet consisting of fresh alfalfa, wheat bran, and flaked barley at rates of 7.0, 0.3, and 0.4 kilograms/head/day, respectively. Additionally, they received a daily oral supplement of 20 grams/head of a mineral and vitamin premix (NeoMix Super®, Neofarma Co., Italy), containing vitamins A, D, E, B1, B2, B6, B12, C, niacin, and pantothenic acid, as well as minerals such as calcium, phosphorus, magnesium, iron, copper, cobalt, iodine, manganese, zinc, and selenium. Access to water and mineral blocks was provided to the camels twice daily.

Experimental setup

This study was done from October to December 2022 and the data was gathered by using four identical cameras, wired full 360-degree monitoring with 1080p Full HD pixels. The flow ability to zoom in or out to make livestock appear closer or farther away during recording was applied. The above cameras were installed around two different areas to monitor camel flow throughout the farm. To ensure the best position of camels in the frames, data collection had to be done in real-time while monitoring camels, utilizing zooming and shooting angle feature Night recordings were omitted from the analysis due to challenges related to low light conditions and issues arising from the peculiar sleeping poses of camels, making them unsuitable for meaningful analysis.

All the camels were visually divided into two categories: Infected and non-infected cases. The infected cases were subdivided according to the degree of infection into (A) mild, in which a total number of < 50 infection spots were detected on an area of the camel body (neck, hump, abdomen, rump, or legs) ; (B) moderate, in which a total number of 50-100 infection spots were detected on 1-2 body areas; (C) severe, in which a total number of >100 infection spots were detected on more than 2 areas of the camel body.

Data Collection

Videos capturing camel activity from all four cameras were carefully processed to extract specific frames showcasing the intricate details of the camels' skin. Subsequently, these selected frames were saved as high-quality images. A total number of 941 images for healthy and non-healthy camels were analyzed.  These images were manually filtered down to 801 depending on the resolution, angle, and position of the camel, before being split 70%/18%/12% for use in training, validation, and testing, respectively. The next step involves labeling these images to create a labeled dataset for training purposes. The dataset of 801 images was manually annotated and afterward as shown in Table 1.

Image Segmentation and Yolov7 Model

Images were annotated using the polygon tool in Roboflow [13] which provides more granular information to the training pipeline about the data. This data were used to train a model and, in turn, resulted in a more accurate and effective model. A data processing flowchart (Fig. 1) illustrates the steps taken to annotate images and generate annotated files, which were subsequently exported in a suitable file format. Furthermore, the workflow diagram for the input data and the result data is shown in Fig 2. Image segmentation is a difficult problem in computer vision for a variety of reasons, including the complexity of the images themselves, their texture, and their homogeneity [14]. Before training the models, all photos underwent pre-processing. To fit the input size of the YOLOv7 architecture, all images were scaled to 640×640 pixels. To ensure consistent input across all images, the pixel values are standardized to the range (0, 1).

The YOLOv7 architecture was trained using PyTorch. The training process involved 50 epochs with a batch size of 16 [15]. Adam optimizer was utilized with a learning rate of 0.001 and a weight decay of 0.0005. The mean squared error (MSE) loss function was employed during training. Following the training phase, the performance of the YOLOv7 model was assessed first on the validation set, comprising 144 images, and then on the test set, consisting of 97 images. Further, the evaluation has been done. Pressure (P), recall (R), and mean average precision (mAP) were all important benchmarks for gauging the model’s accuracy. As demonstrated in Equation (1), the number of accurate positive predictions (TP) was a measure of precision. The equation was employed to calculate a model’s recall, also known as sensitivity, representing the ratio of true positives to the total number of predicted positives in a dataset [2]. Equation (3) expressed the harmonic mean of accuracy and memory recall. The F1 score, when contrasted with recall and precision, presented several advantages. For extremely low values of precision and recall, F1 normalized the measurements. The Python programming language and the Pytorch framework were employed. Table 2 shows the hyperparameters that were used during the training process to develop the model.

eq1

(1) Precision: It represents the ratio of true positives (TP) to the sum of true positives and false positives (FP) in predictions.

(2) Recall: It signifies the ratio of true positives (TP) to the sum of true positives and false negatives (FN) in actual positives.

(3) F1-score: This is the harmonic mean of precision and recall, calculated as F1 = 2 * (precision * recall) / (precision + recall).

Results6th button-01


The infected camels were 36 out of a total of 61 camels with an incidence of 59%. These infected camels were subdivided into 6, 5, and 25 for mild, moderate, and severe, respectively (Table 3). The algorithm achieved an average precision (AP) of 0.944 on the validation set, with effectiveness in distinguishing between normal and infected skin. The training loss graph shows the pattern of training loss over the 50 epochs of training. The training loss started at around 0.0099. The final training loss was approximately 0.0078. Similarly, the validation loss graph shows the pattern of validation loss over the 50 epochs of training. The validation loss started at around 0.00772 and decreased steadily throughout training. During the training, the loss in training was noticed to be 0.0491. The final validation loss was approximately 0.0075 (Figure 3). The confusion matrix shows the classification results of the YOLOv7 algorithm on the validation set. The matrix shows that the algorithm correctly classified infected and non-infected skin images of camels. Also, it could distinguish the degree of infection. The model's visual detection and segmentation results on the testing dataset were analyzed to assess its performance, as shown in Figure 3. The precision-recall curve illustrates the YOLOv7 algorithm's performance regarding precision and recall. The curve shows that the algorithm achieved average precision and recall of 0.94325, and 0.99526 respectively (Table 4).

Figures & Tables

 

 

Discussion6th button-01


Machine learning technology could be trained to distinguish between infected and healthy camel skin. Moreover, it could classify the degree of infection with ringworm according to the infected body area and the number of infection spots. In this study, mild, moderate, and severe infection was detected when the spots were identified on 1 area of the body, 1 to 2, and all over the body, respectively.  Clinically, ringworm was diagnosed by identifying distinct circumscribed areas of alopecia covered mostly by crusts. These areas were commonly found on the abdomen (61%), legs (24%), neck (18%), and/or head (4%) [16]. Laboratory diagnosis is necessary to distinguish fungal skin infections from bacterial skin infections, especially dermatophilosis [17].

The incidence of ringworm infection in the current study was (36 out of 61 camels – 59 %) which is too high compared to the other studies (25.6% [3]; 22.1% [4]; 30% [16]). The reason for this high incidence was that these camels were living in Fujairah with an average humidity of 50-60 % (https://en.climate-data.org/asia/united-arab-emirates/fujairah/fujairah-3228/#google_vignette). Also, these camel calves were kept in Bulaida farms in one pen which increased the chance of infection.  Direct contact with diseased camels or contaminated objects inside the pen can easily transmit the fungus spores [3]. The government of the United Arab Emirates (UAE) and local veterinarians have instituted several measures, such as routine cleaning and disinfection of stables and equipment, isolation of infected camels, and treatment with antifungal medications, to prevent and control ringworm infection. Despite these measures, ringworm continues to be a great problem in UAE during the hot weather associated with high humidity, and interventions are needed to lessen the disease’s toll on the camel population. To reduce the fungus from spreading further among the camel calves, it is important to rapidly distinguish between camels with healthy skin and those infected. Advanced deep-learning techniques play a crucial role in animal research, particularly in the continuous monitoring of camel health and welfare [18]. Through the application of artificial intelligence (AI), early detection of infected camels becomes possible, enabling prompt warnings to be sent to the responsible veterinarian [19].

In the current study, the model was successfully trained to detect the camels' skin health and whether or not a particular area of their skin was infected. This technology can speed up the detection of illness and enable early isolation to avoid the spread of this contagious disease. The results of the YOLO7 model for detecting normal skin versus infected skin in animals yielded a mean average precision (mAP) score of 0.909. Also, the precision-confidence curve shows all classes at 0.971 which indicates excellent precision of the trained model. The dataset used for training the model consisted of only 801 images, which may have contributed to the good result of the model. The YOLO7 model was easily able to identify the infected from non-infected camels with ringworm and also to classify the infected camels according to the severity of their skin infection into mild, moderate, and severe. However, the accuracy can be enhanced further by training the model with larger dataset. Skin fungal infection was previously diagnosed in pets by using AI and Machine Learning [10]. Moreover, skin infections in dogs could be successfully classified into bacterial dermatosis, fungal infection, and hypersensitivity allergic dermatosis by using four CNN model architectures [8]. Therefore, more studies are needed to test this model on larger datasets to identify other skin lesions in camels kept under farm conditions. 

While the YOLO7 model is reliable in the identification and classification of camel ringworm infections, limitations in generalization across diverse conditions, animal breeds, limited dataset, cost and environment can pose challenges. Nevertheless, further investigations utilizing larger datasets, optimizing model parameters, and incorporating advanced techniques like transfer learning to improve adaptability and collaboration with domain experts for real-world applicability in farm settings can be useful in identifying and diagnosing various skin diseases afflicting camels and cattle.

Ethical Approval

The current study has been done in line with the Local Experimental Animal Care Committee guidelines and approved by the Institutional Ethics Committee of Fujairah Research Center, UAE (FRC 002/2023).

Acknowledgement

The authors wish to thank, H.H. Sheikh Mohammed bin Hamad Al-Sharqi, the Crown Prince of Fujairah Emirate, UAE for offering the research facilities and for their continuous encouragement.

Conflict of Interest


The authors declare that there is no conflict of interest. 

Author Contributions


FA: Conceptualization, Methodology, Investigation, Writing – review & editing. NM: Conceptualization, Methodology, Data curation, Writing – review & editing. SB & FL: Conceptualization, Methodology, Investigation, and Supervision.

6th button-01References


  1. Segal E, Elad D. Human and Zoonotic Dermatophytoses: Epidemiological Aspects. Frontiers in Microbiology, (2021); 12: 713532.
  2. Baghza NM, Al-Adhroey AH, Ali AD. Isolation and identification of potential zoonotic dermatophytes from domestic camels in Dhamar Area, Yamed. American Journal of Health Research, (2016); 4(3): 46-50.
  3. Kuttin ES, Alhanaty E, Feldman M, Chaimovits M, Müller J. Dermatophytosis of camels. Journal of Medical Veterinary Mycology, (1986); 24(4): 341-4.
  4. Almuzaini AM, Osman SO, Saeed EMA. An outbreak of dermatophytosis in camels (Camelus dromedarus) at Qassim Region, Central of Saudi Arabia, Journal of Applied Animal Research, (2016); 4(1): 126-129.
  5. Kutty CI, Yousuf AM. Management practices and production performance of camels under organized farming in Abu Dhabi Emirate, United Arab Emirates. Indian Journal of Animal Science, (2017); 87(10): 1269-1273.
  6. Hussen J, Al-Sukruwah MA. The Impact of the Animal Housing System on Immune Cell Composition and Function in the Blood of Dromedary Camels. Animals, (2022); 12(3): 317.
  7. Yadav SS, Jadhav SM. Deep convolutional neural network based medical image classification for disease diagnosis. Journal of Big Data, (2019); 6(1): 113.
  8. Hwang S, Shin HK, Park JM, Kwon B, Kang MG. Classification of dog skin diseases using deep learning with images captured from multispectral imaging device. Molecular & Cellular Toxicology, (2022); 18(3): 299–309.
  9. Safavi EA.  Assessing machine learning techniques in forecasting lumpy skin disease occurrence based on meteorological and geospatial features. Tropical Animal Health and Production, (2022); 54(1): 55.
  10. Chugh A, Priyanka M, Sourabh A, Shriyansh S, Kumar SY. Approach of Image Processing in Diagnosis and Medication of Fungal Infections in Pet Animals. International Journal of Innovative Research in Computer Science & Technology (IJIRCST), (2020); 8 (4): 290-293.
  11. Cheng R. A survey: Comparison between Convolutional Neural Network and YOLO in image identification Journal of Physics, (2020); Conference Series 1453: 012139.
  12. Robert R, Pihet M. Conventional methods for the diagnosis of dermatophytosis. Mycopathologia, (2008); 166: 295–306.
  13. Roboflow Universe. Open Source Computer Vision Community. https://universe.roboflow.com/ (accessed Feb. 10, 2023).
  14. Dar AS, Padha D. Medical Image Segmentation A Review of Recent Techniques, Advancements, and a Comprehensive Comparison.  International Journal of Computer Sciences and Engineering, (2019); 7(7):114-124.
  15. Wang CY, Bochkovskiy A, Liao HYM. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detector. Computer Vision and Pattern Recognition, (2023);  arXiv:2207.02696
  16. Kamili A, Faye B, Bengoumi M, Tligui NS. Invited review: Camel skin diseases survey in Morocco. Journal of Camelid Science, (2019); 12: 1-16
  17. Gitao CG, Agab H, Khalifalla AJ. Camel Dermatophilosis in Kenya, Sudan and Saudi Arabia. Proceedings of the Third Annual Meeting for Animal Production Under Arid Conditions, (1998); 2: 93-107.
  18. Padalino B, Menchetti L. The First Protocol for Assessing Welfare of Camels. Frontiers in Veterinary Science, (2021); 7: 631876.
  19. Fernández-Carrión E, Martínez-Avilés M, Ivorra B, Martínez-López BM, Ramos Á, Sánchez-Vizcaíno JM. Motion-based video monitoring for early detection of livestock diseases: The case of African swine fever. PLoS One, (2017); 12(9): e0183793. 

This work is licensed under a Creative Commons Attribution-Non Commercial 4.0 International License. To read the copy of this license please visit: https://creativecommons.org/licenses/by-nc/4.0

6th button-01