A web-based dermatology assistant that combines image classification and natural language processing to provide medical insights and answers to user queries.
- User authentication (login/register)
- Image upload and classification
- Chat interface with message history
- Integration with ConvNeXt-Tiny classifier
- Integration with Mistral-7B-Instruct LLM
- Retrieval-Augmented Generation (RAG) for enhanced responses
- Python 3.8+
- PyTorch
- Flask
- SQLite (or PostgreSQL)
- Your trained ConvNeXt-Tiny model
- Your Mistral-7B-Instruct model
- Your RAG implementation
- Clone the repository:
git clone <repository-url>
cd dermatology-assistant- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
export SECRET_KEY="your-secret-key-here" # On Windows: set SECRET_KEY=your-secret-key-here- Initialize the database:
flask db init
flask db migrate
flask db upgrade-
Update the model paths in
models.py:- Set the path to your trained ConvNeXt-Tiny model
- Set the path to your Mistral-7B-Instruct model
- Configure your RAG implementation
-
(Optional) Configure PostgreSQL:
- Update
SQLALCHEMY_DATABASE_URIinapp.pywith your PostgreSQL connection string
- Update
- Start the Flask development server:
python app.py- Access the application at
http://localhost:5000
- Register a new account or log in
- Start a new chat
- Upload a dermatology image with your first message
- Continue the conversation with text-only messages
- View chat history in the left panel
dermatology-assistant/
├── app.py # Main Flask application
├── models.py # Model integration (classifier, LLM, RAG)
├── requirements.txt # Python dependencies
├── templates/ # HTML templates
│ ├── base.html
│ ├── login.html
│ ├── register.html
│ └── chat.html
├── static/ # Static files (CSS, JS)
├── uploads/ # Uploaded images
└── instance/ # Database files
- All user passwords are hashed using Werkzeug's security functions
- File uploads are restricted to image files
- Maximum file size is limited to 16MB
- User authentication is required for all sensitive routes
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.