Developed by: STACKLIFO TEAM
In the community today, skin issues such as acne, allergies, and dermatitis are increasingly common, directly impacting the health and mental well-being of many people. However, not everyone has the conditions to visit specialized dermatology facilities directly. Many individuals choose to self-study information or post images of their affected skin online for opinions. The information received is often inaccurate, which can even lead to serious consequences due to misdiagnosis or self-treatment.
Given this reality, the project demands a technological solution to help people access accurate and safe medical information.
The specific requirement is to develop an Artificial Intelligence (AI) application capable of:
- Image recognition of the damaged skin area.
- Symptom analysis described by the user.
- Providing reliable preliminary advice.
The project aims to develop an intelligent support tool, enabling users to initially assess their skin condition and subsequently determine the appropriate course of action, such as self-care or consulting a specialist when necessary.
The chatbot system leverages several advanced technologies:
| Technology | Role in the System |
|---|---|
| FLASK | Serves as the deployment platform and intermediate web server between users and the core AI system. |
| RAG (Retrieval-Augmented Generation) | Used with LangChain for Natural Language Processing (NLP), enabling the chatbot to understand context and generate accurate, natural responses. |
| CNN (Convolutional Neural Network) | Analyzes skin images submitted by users to identify lesions and suggest preliminary consultation. |
| MySQL | Manages the storage of user data and chat history, ensuring system stability and personalized user experience. |
| Qdrant | Functions as the Vector Database (VectorDB) for storing and rapidly retrieving semantic information. |
| Selenium | Used as a tool to collect the knowledge dataset from reputable medical sources. |
The system is designed with two primary processing flows:
- Image Processing Flow (CNN): Analyzes user-uploaded skin images to identify pathological features.
- Text Processing Flow (RAG): Analyzes user-described symptoms and retrieves information from the knowledge base.
The diagram below illustrates the RAG architecture used for the text processing flow:
(Note: The diagram uses "Pinecone" as an example VectorDB. This project uses "Qdrant" in the equivalent role.)
- CNN Model Training Accuracy: The accuracy reached 71.5%.
- Dataset: The CNN model was trained on a dataset containing 272,000 images covering 10 disease labels.
The developed graphical user interfaces (GUIs) include:
- Login and Registration Interface
- Homepage Interface
- Chatbot Interface
- Contribution Page Interface
(Recommended: Insert screenshots of your application here, e.g., [screenshot_chat.png])
This guide will get you a copy of the project up and running on your local machine for development and testing purposes.
Ensure you have the following software installed:
- Python
[e.g., 3.10+] - MySQL Server
[e.g., 8.0+] - Qdrant (running as a service or Docker container)
- Git
-
Clone the repository:
git clone [your-repository-url.git] cd [your-project-directory] -
Create and activate a virtual environment (Recommended):
# For macOS/Linux python3 -m venv venv source venv/bin/activate # For Windows python -m venv venv .\venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
-
Database Setup:
- Access your MySQL server and create a new database for the project.
- Example:
CREATE DATABASE skinbox_db;
-
Environment Variables:
- Create a
.envfile in the root directory of the project. - Copy the contents from
.env.example(if it exists) or add the necessary variables.
Example
.envfile:# Flask Configuration FLASK_APP=app.py FLASK_ENV=development SECRET_KEY=[your-very-long-random-secret-key] # Database Configuration DB_HOST=localhost DB_USER=root DB_PASSWORD=[your-mysql-password] DB_NAME=skinbox_db # Qdrant Configuration QDRANT_HOST=localhost QDRANT_PORT=6333
- Create a
-
Run the Flask web server:
flask run
Or:
python app.py
The application will be accessible at
http://127.0.0.1:5000. -
Run other scripts (if applicable):
- To run the Selenium data crawler:
python run_selenium_crawler.py
- To retrain the CNN model:
python train_model.py
- To run the Selenium data crawler:
The project was executed by the STACKLIFO TEAM:
| Name | Role |
|---|---|
| Trần Thế Anh | AI Engineer |
| Nguyễn Văn Bảo | Developer |
| Võ Duy Khang | Developer |
- GG MAP:
Report link ---> PRESS ME




