SafeBite is an AI-powered application designed to help individuals with food allergies make informed decisions by identifying allergens in food products. By leveraging machine learning models, SafeBite provides real-time allergen detection, ensuring safer food choices and a better quality of life for people with food sensitivities.
Our vision is to create an inclusive world where individuals with food allergies can confidently make safe food choices. Through AI-powered allergen detection, SafeBite aims to empower people with the tools they need to avoid allergens and live healthier, more secure lives.
Our mission is to develop an intuitive, reliable, and efficient tool that allows users to identify potential allergens in food. By using advanced machine learning, SafeBite provides users with the ability to instantly detect allergens and make informed decisions.
- Real-Time Allergen Detection: Identify allergens in food products by analyzing ingredient data.
- Instant Allergen Alerts: Receive notifications when a food item contains allergens, such as nuts, dairy, or gluten.
- User-Friendly Interface: The app provides a clean, simple interface for easy interactions and quick allergen detection.
- Customizable Allergen Preferences: Users can personalize the app to detect allergens based on their specific needs.
- Multi-Ingredient Detection: SafeBite can process complex food items with multiple ingredients to detect allergens.
- Real-Time Performance: The application offers quick responses for faster decision-making.
- Python: For backend development, machine learning model training, and data manipulation.
- Pandas: For data processing, cleaning, and manipulation.
- Scikit-learn: For implementing machine learning algorithms, including Random Forest for allergen detection.
- Flask: A micro-framework for building the API and handling backend requests.
- Streamlit: For front-end development, providing an interactive and user-friendly interface.
- Joblib/Pickle: For saving and loading the trained machine learning models.
Datasets/
├── Allergen_Status_of_Food_Products.csv # Raw food allergen data
├── preprocessed_data.csv # Cleaned and preprocessed dataset for model training
Model/
├── leave_one_out_encoder.pkl # Encoder used during data preprocessing
├── random_forest_model.pkl # Trained Random Forest model for allergen detection
Scripts/
├── AI_SafeBite_Data_Preprocessing.ipynb # Data preprocessing and cleaning steps
├── AI_SafeBite_EDA.ipynb # Exploratory data analysis (EDA)
├── AI_SafeBite_Model_Testing.ipynb # Model testing and evaluation
├── AI_SafeBite_Streamlit_Flask_App.py # Main app code using Flask and Streamlit
├── AI_SafeBite_flask_api.py # Flask API for allergen prediction
├── AI_SafeBite_Modeltraining.ipynb # Model training and validation
├── AI_SafeBite.pdf # Final project documentation
Follow these steps to set up and run the SafeBite project locally.
Open your terminal or command prompt and clone the repository by running the following command:
git clone https://github.com/AabidMK/SafeBite_Infosys_Internship_Oct2024.gitNavigate into the cloned directory:
cd SafeBite_Infosys_Internship_Oct2024Make sure you have pip installed. To simplify the installation of dependencies, use the requirements.txt file
pip install -r requirements.txtEnsure that the datasets are placed in the Datasets/ directory as shown below:
Datasets/
├── Allergen_Status_of_Food_Products.csv # Raw allergen data
└── preprocessed_data.csv # Cleaned dataset for training
If these files are missing, you need to obtain them and place them in the correct directory.
To train the model on the dataset, run the following script:
python AI_SafeBite_Modeltraining.ipynbThis script will preprocess the data, train the model, and save the trained models (random_forest_model.pkl and leave_one_out_encoder.pkl).
To run the SafeBite web app, use the following command:
streamlit run AI_SafeBite_Streamlit_Flask_App.pyOnce the app is running, open your browser and visit http://localhost:5000 to interact with the application.
If you want to use the SafeBite Flask API for allergen detection, run:
python AI_SafeBite_flask_api.pyThis will start the Flask API server, allowing you to interact with the app programmatically for allergen predictions.
https://safebite-551h.onrender.com/We welcome contributions to improve SafeBite! If you'd like to contribute, please fork the repository, make changes, and submit a pull request. You can also open an issue if you have suggestions or find any bugs.