Project structure :
Our coronavirus (COVID-19) chest X-ray data is in the dataset/ directory where our two classes of data are separated into covid/ and normal/
I have created train_covid19.py file to train the model.
Three command line arguments (parameters) required to run this file :
--dataset: The path to our input dataset of chest X-ray images.
--plot: An optional path to an output training history plot. By default the plot is named plot.png unless otherwise specified via the command line.
--model: The optional path to our output COVID-19 model; by default it will be named covid19.model.
To load our data, we grab all paths to images in in the --dataset directory. Then, for each imagePath, we:
· Extract the class label (either covid or normal) from the path.
· Load the image, and preprocess it by converting to RGB channel ordering, and resizing it to 224×224 pixels so that it is ready for our Convolutional Neural Network .
· Update our data and labels lists respectively.
After that we will encode our labels and create our training/testing splits:
We’re now ready to compile and train our COVID-19 deep learning model

For evaluation, we first make predictions on the testing set and grab the prediction indices.

Next we’ll compute a confusion matrix for further statistical evaluation
We then plot our training accuracy/loss history for inspection, outputting the plot to an image file
Finally we save our COVID-19 classifier model to disk
For testing this model.
I have created one class in file test_covid19.py using tf.keras model load method and image load. This way model will predict and identified the images if infected to covid or normal.







Comments
Post a Comment