Developed multi-models to analyze X-ray medical images for detecting diseases or abnormalities. Utilized VGG16 with a training accuracy of 74% and a test accuracy of 77%. Implemented a ResNet model, achieving a training accuracy of 93% but a test accuracy of 62%. Additionally, trained a custom CNN model with a training accuracy of 74% and a test accuracy of 62%.
-
Exploratory Data Analysis (EDA): Analyze the dataset, explore correlations between features, and handle outliers or missing values.
-
Preprocessing: Preprocess the dataset by splitting it into training and testing sets. Normalize pixel values to prepare for model training.
-
Build CNN Model: Utilize TensorFlow and Keras to build a VGG16, ResNet and CNN model. Experiment with different architectures, activation functions, and learning rates to find the optimal model for medical image analysis.
-
Model Evaluation: Evaluate the model's performance using metrics such as accuracy, precision, recall, and F1 score. Visualize the results with confusion matrices.
- Dataset Link: Chest X-Ray Images
- Number of Images: 5856
- Classes: Normal, Pneumonia
- Dataset Link: NIH Clinical Center
- Number of Images: 100,000+
- Disease Labels: 14 different labels
The code is organized into different sections:
- Verify GPU: Check the availability of GPU.
- Data Acquisition: Download and preprocess the dataset using TensorFlow and OpenCV.
- Data Exploration and Preprocessing: Explore the dataset and preprocess it for training.
- EDA (Exploratory Data Analysis): Visualize the distribution of classes in the dataset.
- CNN Model Architecture and Hyperparameter Tuning: Build and optimize a CNN model using scikeras and RandomizedSearchCV.
- VGG16 Model Architecture and Hyperparameter Tuning: Build and optimize a VGG16 model.
- ResNet Model Architecture and Hyperparameter Tuning: Build and optimize a ResNet model.
- Callbacks: Implement callbacks such as ModelCheckpoint, ReduceLROnPlateau, and EarlyStopping.
- Training the Model: Train the models with the prepared dataset.
- Displaying Metrics: Visualize the training and validation metrics.
- Evaluation Metrics for the Test Set: Evaluate the models on the test set and display classification reports and confusion matrices.
- Model Comparison: Compare the performance of different models
-
Clone the repository:
git clone https://github.com/elsayedelmandoh/Medical-Image-Analysis-with-VGG16-ResNet-CNN.git
cd Medical-Image-Analysis-with-CNN
Contributions are welcome! If you have suggestions, improvements, or additional content to contribute, feel free to open issues, submit pull requests, or provide feedback.
This repository is maintained by Elsayed Elmandoh, an AI Engineer. You can connect with Elsayed on LinkedIn and Twitter/X for updates and discussions related to Machine learning, deep learning and NLP.
Happy coding!