This project is an AI-driven Comprehensive Chemical Risk Prediction Model as apart of our Data Science Group Project. The system integrates predictive models to assess the risk associated with the importation, handling, and usage of chemicals. The project includes a React.js frontend, a backend with machine learning models, and finalized model training scripts in a Colab notebook.
The system utilizes Gradient Boosting, Neural Networks, Random Forest and other machine learning algorithms to predict risks at various stages and prevent hazardous activities related to chemical use.
The repository is divided into the following main sections:
- Frontend (React.js): The user interface developed using React.js to interact with the system.
- Backend: Contains the machine learning models, APIs, and logic for risk prediction and analysis.
- Finalized Colab Notebooks: Contains the Colab notebooks where model training, evaluation, and final implementations were completed.
The system includes the following key features:
- Importer Risk Prediction: Predicts the risk associated with chemical importers based on their importation history.
- End-User Risk Prediction: Assesses the risk of illegal chemical use by analyzing end-user purchase patterns.
- Chemical Recipe Risk Analysis: Analyzes chemical combinations and predicts the risk of creating hazardous substances.
- Importation Trend Prediction: Forecasts future chemical importation trends based on historical data.
The frontend of the system was developed using React.js and provides an interface for users to:
- View chemical risk analysis results
- Submit data related to chemical importation, end-users, and chemical recipes
- View alerts and notifications on risks and suspicious activities
The backend contains the models responsible for predicting risks. The backend includes:
- Risk prediction models for importers, end-users, and chemical recipes.
- APIs that provide data to the frontend and handle incoming requests.
- Data preprocessing and feature engineering to prepare the dataset for model training.
The Colab notebooks contain the following:
- Data preprocessing steps for cleaning and transforming data.
- Model training using Gradient Boosting Classifiers, Neural Networks, Random Forest and Regressors.
- Model evaluation to assess the performance of the trained models.
- Hyperparameter tuning for better accuracy and precision.
- Frontend: React.js, HTML, CSS, JavaScript
- Backend: Python, Flask/Django (depending on your backend framework), Scikit-learn (for ML models)
- Machine Learning: Gradient Boosting Classifier, Neural Networks, Random Forest, Gradient Boosting Regressor
- Data Processing: Pandas, NumPy
- Deployment: Docker (if applicable), Heroku/AWS (for deployment)
- Visualization: Matplotlib, Seaborn (for visualizing results)
- Node.js (for the React.js frontend)
- Python 3.6 or higher (for the backend and models)
- pip (Python package manager)
-
Navigate to the frontend directory:
cd frontend -
Install the required dependencies:
npm install
-
Start the frontend server:
npm start
This will launch the React app on your local server (typically at http://localhost:8081).
-
Navigate to the backend directory:
cd backend -
Install the required Python libraries:
pip install -r requirements.txt
-
Run the backend server (Flask/Django):
python app.py # or use the command specific to your framework
- Open the finalized model training notebooks in Google Colab.
- Run the cells to train the models, evaluate them, and save the final trained models.
Make sure the backend/requirements.txt contains the necessary libraries:
pandas
numpy
scikit-learn
tensorflow # for Neural Networks
flask # or django if you're using Django
matplotlib
seabornNavigate to the React.js frontend and interact with the user interface:
- Submit data for chemical importation, end-users, or recipes.
- View risk prediction results.
- Receive alerts based on suspicious activity or potential risks.
The backend exposes APIs that interact with the models. These APIs are designed to:
- Handle incoming user data.
- Make predictions based on the trained models.
- Provide feedback to the frontend for display.
- Use the Colab notebooks for retraining or testing the models.
- Implement any changes or updates to the training scripts as needed.
We welcome contributions to improve the project! To contribute:
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature-name). - Make your changes and commit (
git commit -am 'Add feature-name'). - Push to your branch (
git push origin feature-name). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or issues, please contact the following members:
-
Fathima Shabna Ilmi (Project Leader)
Email: fathima.20230079@iit.ac.lk -
Senuth Perera
Email: senuth.20230317@iit.ac.lk -
Kalana Kannangara
Email: kalana.20232632@iit.ac.lk -
Loganathan Thusharkanth
Email: thusharkanth.20233168@iit.ac.lk