https://github.com/himasnhu-at/cox3-ml-model
Building an ML model for detecting if a patient is COVID-19 positive or not. Based on dataset: https://www.kaggle.com/datasets/andyczhao/covidx-cxr2
https://github.com/himasnhu-at/cox3-ml-model
machine-learning machine-learning-algorithms machine-learning-model model
Last synced: 10 months ago
JSON representation
Building an ML model for detecting if a patient is COVID-19 positive or not. Based on dataset: https://www.kaggle.com/datasets/andyczhao/covidx-cxr2
- Host: GitHub
- URL: https://github.com/himasnhu-at/cox3-ml-model
- Owner: Himasnhu-AT
- License: mit
- Created: 2023-05-30T10:44:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-01T17:52:26.000Z (about 3 years ago)
- Last Synced: 2025-03-27T15:47:53.805Z (about 1 year ago)
- Topics: machine-learning, machine-learning-algorithms, machine-learning-model, model
- Language: Jupyter Notebook
- Homepage:
- Size: 42.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# COX3-ML-Model
This repository contains code for building and training an image classification model using the EfficientNetB3 architecture. The model is trained on a dataset of images and can predict the diagnosis of a given image.
## Requirements
- Python 3.7 or later
- TensorFlow 2.0 or later
- NumPy
- pandas
- OpenCV (cv2)
- Matplotlib
## Installation
1. Clone the repository:
```
git clone https://github.com/Himasnhu-AT/COX3-ML-Model.git
cd COX3-ML-Model
```
2. Create a virtual environment (optional but recommended):
```
python3 -m venv env
source env/bin/activate
```
3. Install the required packages:
```
pip install -r requirements.txt
```
4. Download the dataset:
- Download the dataset from [Dataset Download Link](https://www.kaggle.com/datasets/andyczhao/covidx-cxr2).
- Extract the dataset into the project directory.
## Usage
1. Open the `main.py` file and modify the `data_path` variable to point to the directory where you extracted the dataset.
2. Run the script:
```
python main.py
```
This will train the model on the dataset and save the trained model in the specified directory.
3. To evaluate the model on the test dataset and generate predictions, you can use the following code:
```python
import tensorflow as tf
import cv2
# Load the saved model
model = tf.saved_model.load('path/to/saved/model')
# Load and preprocess the test image
image_path = 'path/to/test/image.jpg'
image = cv2.imread(image_path)
preprocessed_image = preprocess_image(image) # Preprocess according to the model requirements
# Make predictions
predictions = model.predict(preprocessed_image)
# Process the predictions and get the diagnosis
diagnosis = process_predictions(predictions)
print("Diagnosis:", diagnosis)
```
## Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
## License
This project is licensed under the [UnLicense](LICENSE).