CafePlugGuardian is a capstone design project at the Chung-Ang University's Department of Software Engineering.
Please note that we will not be accepting contributions for CafePlugGuardian, as it is a Capstone Design Project.
- The pin number allows only cafe customers to use the plug, preventing unauthorized use of the plug.
- Limit the amount of electricity to restrict customers who use excessive power or stay for long periods of time.
- By analyzing the current patterns of devices in use, devices not permitted in the cafe, such as smartphones and laptop chargers, are automatically blocked through machine learning.
- CafePlugGuardian-Client
- Cafe Manager App - flutter app
- CafePlugGuardian-WebClient
- Cafe Customer Web - flutter web
- CafePlugGuardian-Server
- Backend server - express.js
- CafePlugGuardian-Hardware
- SmartPlug embedded system - arduino(tasmota open source)
- CafePlugGuardian-ML
- AI model - pytorch, GRU model
- CafePlugGuardian-ML_Server_Flask
- AI server - flask
CafePlugGuardian-ML_Server_FLask is a Server for active Machine Learning Model. Our Machine Learning Model is wrote by Pytorch. So we have to make Python Server for active our model. It was wrote by python version 3.10.6. And use Flask 3.0.0.
- Python version more than 3.10.6
- Flask 3.0.0
- Framwork which you can edit python code.
- Torch version 2.1.1
- Open your port 5000 or change port num which you will use
- Need Machine Learning Model(same as model in github repository CafePlugGuardian-Ml)
Grab a git clone from the desired location and run it by typing python app.py in the terminal.
It is recommended that you save your machine learning model to the same file location as your server files, but if you have saved it elsewhere, simply replace the address with a relative address to that location, and replace the full name of your model (including the extension) with "CafePlugGuardian_ML_Model.pt" to use your model. The model must be in the same format as the one in the github repository CafePlugGuaridan-ML for it to work without errors. But If you want to customize your model, you can do so by changing the GRU model declaration and data entry parts of the server code.
When the data is sent in JSON from the backend server, it fetches the training model stored in the same location as the server for classification.
You can arbitrarily modify the disallow criteria in the above code. The range can be modified to any value between 468 and 0.
The prediction result is in the form of [x,468-x], and one data feature is moved to the class with the higher similarity by comparing the similarity between the disallowed data and the allowed data. A total of 468 data features are moved and output in the form above. After classification, it returns the results to the backend server.
Line 48 initially end point is '/predict2'. You can change your own end point such as '/predict', '/AI' and others.
This program is licensed under MIT