This project involves training a deep learning model to detect and classify different types of eczema using TensorFlow. The model is based on the InceptionResNetV2 architecture and includes a custom layer for scaling inputs. The final model is integrated into a Flask backend for predictions, which can be accessed via a React frontend.
.
├── backend/
│ ├── app.py # Flask backend for serving predictions
│ ├── final_model.h5 # Pre-trained deep learning model (not included)
│ ├── training.ipynb # Jupyter notebook for training the model
│ ├── test/ # Folder containing the eczema dataset
│ │ ├── Atopic Dermatitis/
│ │ ├── Contact Dermatitis/
│ │ ├── Dyshidrotic Eczema/
│ │ ├── Nummular Dermatitis/
│ │ ├── Seborrheic Dermatitis/
│ │ └── Stasis Dermatitis/
└── frontend/
├── public/ # React frontend public assets
├── src/ # React frontend source code
├── package.json # Node.js dependencies for React
└── README.md # Instructions for setting up the frontend
Ensure you have the following software installed:
- Python 3.x (3.8 or 3.9)
- TensorFlow 2.x (for GPU support)
- Node.js and npm for frontend development
- Flask for the backend
- Pillow for image processing
- NumPy for numerical operations
- Scikit-Learn for data manipulation
git clone https://github.com/yourusername/eczema-detection.git
cd eczema-detectionEnsure you have a Python 3.x environment with TensorFlow version 2.x for GPU support. Install the required Python packages:
pip install tensorflow==2.9.1 flask pillow numpy scikit-learn matplotlibDownload the eczema dataset from Kaggle and extract it into the backend/test/ directory.
Run the training.ipynb notebook to train the model. This notebook will preprocess the images, train the model, and save it as final_model.h5.
Note: The final_model.h5 is not included in the repository. You will need to train the model yourself using the provided notebook.
After training, you can start the Flask backend using the following command:
cd backend
python app.pyThe server will start on http://0.0.0.0:5000. You can send POST requests to /predict with image files for predictions.
Navigate to the frontend directory and install the required Node.js packages:
cd ../frontend
npm installAfter installing the dependencies, you can start the React frontend by running:
npm startThis will start the development server on http://localhost:3000, which will interact with the Flask backend for predictions.
-
Start the Flask Backend:
cd backend python app.py -
Start the React Frontend:
cd ../frontend npm start -
Interact with the Application: Open your web browser and navigate to
http://localhost:3000to use the frontend, which will send images to the Flask backend for eczema detection.
If you encounter an error related to the custom layer CustomScaleLayer, ensure that:
- The class is defined in the
app.pyfile. - The
load_modelfunction inapp.pyincludescustom_objects={'CustomScaleLayer': CustomScaleLayer}.
This project uses TensorFlow version 2.x for GPU support. Ensure you have the correct version installed by running:
pip install tensorflow-gpu==2.xThe pretrained model (final_model.h5) is not included in the repository. You need to train the model using the provided notebook before running the backend.
This project provides a full-stack solution for detecting and classifying eczema using a deep learning model, Flask for backend API, and React for frontend UI. Follow the setup instructions to train the model and deploy the application.