Skip to content

CAU-Capstone-PPL/CafePlugGuardian-ML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CafePlugGuardian Project

Introduction

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 Goal of CafePlugGuardian Project

  1. The pin number allows only cafe customers to use the plug, preventing unauthorized use of the plug.
  2. Limit the amount of electricity to restrict customers who use excessive power or stay for long periods of time.
  3. 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.

Structure of CafePlugGuardian

Sub Projects of CafePlugGuardian

Introduction

This machine learning was created to learn current patterns. It was written at Google Collab using Pytorch. We used the GRU model built into Pytorch and Optuna for hyperparameters.

Requirements to run or modifiy server

  • Torch version 2.1.0+cu121
  • Framework Google Colab

How to learn current patterns

To learn the current pattern, you need to save the information of the current pattern in an excel file and the column name of the current pattern should be 'current'.

Example

image

Explain Example

The format should be as shown above and the length of the pattern should be 500 except for the name 'current'.

How to feat your own data

Using 500 data, you can create 468 data features of length 33 for training. If you want to create features of different lengths, you can change the parameter length in the code.

How to handle initial hyper parameter

batch_size, Gru_hidden_size, learning_rate, num_epochs can be modified by User. So if you want to feat hyper parameter to your data you can change them. We do not recommend changing 'train_ratio' and 'num_class', but if you want to change them, you can. train_ratio means that 90% of each data feature is randomly assigned as training data and the remaining 10% is assigned as test data. num_class means that it is divided into two classes: allowed and unallowed, and the number '1' is the allowed class.

How to train the desired data as an acceptable class

In Google Colab you have to make directory name 'train_data' and put the data you want to use in that directory. In the data preprocessing sector, enter the names of the data you want to judge as acceptable in square brackets in the 'if key in []' line, excluding the extension.

Example

image

image

How to save learned model

At the very end of the code, you can specify a save location via PATH="" and save the model. Feel free to change the name. The optimal hyper-parameters obtained by running the code can also be saved in the form of a JSON file via the following code.

License

This program is licensed under MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published