The era of AI has significantly enhanced healthcare in all aspects, by enhancing diagnostics, personalizing treatment, improving patient care, and streamlining administrative tasks.
Chronic wounds are injuries that do not heal properly and tend to take an unusually long time to heal, often persisting for more than three months. They can be challenging to treat and may sometimes require specialized care to address the underlying causes and promote healing. Acute wounds might develop into chronic wounds if they are not monitored and cared properly.
Patients with chronic wounds face difficulties including persistent pain, high infection risk, limited mobility, psychological stress, body image concerns, social isolation, and financial strain. Timely and effective management is crucial to mitigate these complications and improve the patient's quality of life.
Healthcare, on the other hand, is impacted by chronic wounds through increased costs, resource allocation, frequent hospital admissions, extended care needs, challenges in maintaining quality of care, significant research investments, and the potential for severe patient complications.
Artificial Intelligence can improve both the diagnosis and management of wounds, and my project focuses on this application.
*Note: I have not uploaded any of the images from the dataset due to their potentially sensitive nature. However, the dataset is available in the GitHub repository uploaded in the code section and you are welcome to view them there if required.
ObjectiveInitially, my project aimed to predict the healing time of chronic wounds. However, due to a lack of available datasets, I decided to focus instead on optimizing wound diagnosis and management using AI technology.
This project focuses on utilizing Artificial Intelligence to classify wounds and provides doctors with a set of guidelines to ensure optimal management.
DatasetI used a categorized wound dataset from Kaggle(Authors: Ibrahim Fateen and Abdelrahman Alaa 2003 from Kaggle) for my project to train my model. This dataset contains a variety of images of categorized wounds. To enhance the image classification model, I will use a Generative Adversarial Network (GAN) for data augmentation, which will improve generalization performance and mitigate overfitting.
The dataset currently has 2940 samples but it is not a balanced dataset which can lead to poor predictive accuracy and biased models where the model is prone to classes with more data.
The number samples from each class, from highest to lowest, are as follows:
- Pressure Wounds: 602
- Venous Wounds: 494
- Diabetic Wounds: 462
- Surgical Wounds: 420
- Bruises: 242
- Normal: 200
- Abrasions: 164
- Burns: 134
- Laseration: 122
- Cut: 100
GAN can be used to balance the dataset by creating the synthetic images for the minority classes and this can make the model less biased and more reliable.
AMD Radeon Pro W7900 GPUI am using the AMD Radeon Pro W7900 GPU to train my GAN (Generative Adversarial Network) and image classifier model. This GPU, equipped with 48GB of GDDR6 memory, is optimized for handling extreme workloads, making it ideal for deep learning tasks. The high memory capacity allows for training on large datasets and complex models without memory bottlenecks.
The 3x Display 2.1 supports high-resolution displays, which is beneficial for visualizing training progress and results, while the AMD Radiance Engine, which is another key feature, provides enhanced image quality and colour accuracy, making it useful for tasks requiring precise visual outputs.
The GPU's architecture and capabilities ensure efficient parallel processing, reducing training times and improving model performance.
AMD ROCmThe AMD ROCm software is an open-source software stack that provides a comprehensive suite of programming models, tools, compilers, libraries, and runtimes designed for AI and HPC (High-Performance Computing) solution development on AMD GPUs. ROCm facilitates efficient and scalable development, enabling developers to leverage the full potential of AMD GPUs for their computational needs.
PyTorchI have designed my GAN and image classifier model using PyTorch, an open-source machine learning framework based on the Python programming language and the Torch library. PyTorch stands out due to its efficient tensor computing with GPU acceleration and type-based automatic differentiation, making it ideal for developing and training deep learning models.
The torch.cuda module provides an efficient way to utilize GPUs for accelerated computing. PyTorch now includes support for AMD Instinct and Radeon GPUs, supported by the AMD ROCm software.
Before configuring your device in the codes, you have to follow some steps for your AMD GPU to be detected. After installing the ROCm software, run the cuda->hip transpiler and build PyTorch.
Here's a comprehensive guide by AMD to help you install PyTorch: https://rocm.docs.amd.com/projects/install-on-linux/en/develop/install/3rd-party/pytorch-install.html
Impact of AI on the Diagnostic Accuracy of Chronic WoundsThis AI model serves as an assistive tool for health professionals by providing rapid diagnosis and remarks which can be reviewed and confirmed by the doctor. This makes it easier for the health professionals.
In the future, I plan to refine this model by incorporating data on wounds at different stages of healing so that the model could also predict the healing time which was my initial objective.
*Note: This model is currently a demo and cannot be used for professional practices.
Image ClassifierInitially, I used a simple convolutional neural network (CNN) to build my image classification model, and the validation accuracy was higher than the test accuracy. This is could be because of the imbalanced dataset as it causes overfitting.
I decided to use a GAN to create synthetic images for the minority class and it seemed to improve the accuracy. Higher accuracy can be achieved by precise and high quality images, and it's also better to have a larger dataset.
- Conv2D Layer: The layer first layer receives an input of 3 feature maps and applies 32 different convolutional layers, and the second layer receives this and produces 64 output feature maps. Each filter is a 3x3 matrix which scans the input feature maps.
- MaxPooling2D Layer: Reduces the spatial dimensions of the feature maps and the pooling operation will consider 2x2 pixel region at a time.
- Flatten Layer: Converts the 2D feature maps into a 1D vector.
- Dense Layer: Performs classification based on the extracted features.
70% of the dataset is used for training, 15% is used for validation, whereas the rest 15% is used for testing. The synthetic data is generated for the minority class. The learning rate for this model is 0.0001.
A high learning rate can lead to unstable training and hinder convergence, while low learning rate can result in slow convergence rate or getting stuck in suboptimal solutions. It is important to use an optimal learning rate to achieve an accurate model performance.
I used early stopping method to avoid overfitting, and it can also improve the generalization of the model. It monitors the model's performance on a validation dataset during training and halts the training process when the performance is static (doesn't show signs of improvement).
As the dataset size is small, the model has to be less complex and can also affect the accuracy.
Generative Adversarial Network (GAN)Generative Adversarial Networks (GANs) is a deep learning architecture which simultaneously trains two neural networks, the Generator(G) and the Discriminator(D), to compete each other and generate synthetic images.
They can help us to balance datasets where there is unequal amount of data in different classes. The workflow of the GAN is presented as a diagram in the image above.
The Generator aims to create synthetic data that is indistinguishable from real data by taking random noise as input, whereas the Discriminator aims to differentiate between real data and the generated data, and outputs the probability that the input is real.
The discriminator is trained to maximize the probability of correctly classifying real and synthetic data which involves minimizing the loss of real data and generated data being classified as real and fake, respectively.
The generator, however, is trained to minimize the probability of the discriminator correctly classifying the synthetic data as fake as it aims to fool the discriminator into accepting the generated data as real.
The Discriminator loss and the Generator loss are calculated using the Binary Cross Entropy(BCE) function. The GAN is programmed with the early stopping method to avoid unhealthy competition between the networks.
The learning rate of the Generator was set to 0.0005 and that of the Discriminator was set to 0.0001. The early stopping method was triggered after 16 epochs. The loss of Discriminator was 0.6539 and that of the Generator was 0.6513.
AI is transforming the management and treatment of chronic wounds by enhancing diagnostic accuracy, optimizing treatment planning, and improving monitoring and patient engagement. While challenges remain, the ongoing advancements in AI technology hold great promise for improving patient outcomes and advancing wound care.
The model provides the following diagnosis for each class detected:
*Note: The diagnosis might not be medically accurate. This is just a demo.
- 0: Abrasion
Maintain proper wound hygiene and control blood sugar if patient has diabetes. Get tetanus shot if wound was caused by dirty or rusty object, and if you hadn't had a shot in the last 5 years.
- 1: Bruise
If hematoma detected, please prepare to drain it. Consider physical or compression therapy to improve blood supply, and low-level laser therapy(LLLT) to help reduce inflammation and promote healing.
- 2: Burns
Monitor wound over the next 3 weeks and look for signs of healing. Prescribe antimicrobial ointments or silver-containing dressings to prevent infection. Consider Hyperbaric Oxygen Therapy(HBOT) or application of bioengineered skin substitutes to stimulate healing.
- 3: Cut
Get tetanus shot if wound was caused by dirty or rusty object, and if you hadn't had a shot in the last 5 years. Monitor wound if deep. Prescribe antimicrobial ointments or silver-containing dressings to prevent infection. Consider Negative Pressure Wound Therapy(NPWT) or application of bioengineered skin substitutes to stimulate healing.
- 4: Diabetic Ulcer
Monitor blood sugar levels and control sugar intake. Consider Hyperbaric Oxygen Therapy(HBOT) to promote healing. Minimize pressure on the ulcerated area using methods like total contact casting, removable cast walkers or specialized diabetic footwear. Advice patient to obtain plenty of rest and limit activities that pressure the ulcer.
- 5: Laceration
Get tetanus shot if wound was caused by dirty or rusty object, and if you hadn't had a shot in the last 5 years. Avoid further trauma and apply appropriate dressing(hydrocolloid, hydrogel, alginate or foam dressings) to keep wound clean and moist. Consider Hyperbaric Oxygen Therapy(HBOT), Negative Pressure Wound Therapy(NPWT) or application of bioengineered skin substitutes to promote healing.
- 6: Normal
The skin looks normal. Nothing to worry about.
- 7: Pressure Ulcer
Use specialized mattresses, cushions and pads to reduce pressure exerted on the patient and minimize the risk of new ulcers. Consider Hyperbaric Oxygen Therapy(HBOT)or Negative Pressure Wound Therapy(NPWT) to promote healing. Practice good hygiene and maintain healthy body weight. Advice patient to avoid smoking if patient smokes.
- 8: Surgical Wound
If patient is diabetic, monitor sugar levels and control sugar intake. Practice physical therapy or meditation to improve blood flow to the affected area. Prescribe antimicrobial ointments or silver-containing dressings to prevent infection.
- 9: Venous Ulcer
Apply compression therapy to reduce venous hypertension and for more effective pressure distribution. Encourage activities like walking and leg exercise and elevate the leg to reduce swelling and venous pressure.
ResultsWithout the GAN, the results were as follows:
- Final test accuracy: 21.09%
- Test Loss: 2.2503
- Validation Accuracy: 16.78%
- Validation Loss: 2.2942
- Training Loss: 2.2760
The results were improved after training with the GAN.
The results after training with GAN are as follows:
- Final test accuracy: 57.14%
- Test Loss: 1.8204
- Validation Accuracy: 59.64%
- Validation Loss: 1.8231
- Training Loss: 0.1094
Although implementing AI technologies in wound care can offer significant benefits, there are several challenges and limitations to consider. Some strategies to overcome challenges are:
- Collaborative Development: Engage multidisciplinary teams, including clinicians, data scientists, and regulatory experts, to develop AI solutions.
- Robust Data Practices: Invest in high-quality data collection, annotation, and standardization processes.
- User-Centric Design: Design AI tools with end-users in mind, ensuring they are intuitive and integrate seamlessly with clinical workflows.
I have experience with writing and training AI models in MATLAB and this is my first time doing this in Python and I'm happy with the results.
It is important to have high quality images as well as a balanced dataset for such purposes. The architecture of the neural network is also essential and pre-trained networks typically have better results and sometimes require less training.
I assume my project to be complete at the moment, but it has room for improvement. I believe my model will be very helpful to health professionals, later in the future, when it's trained with high-quality data.
Comments