|
a |
|
b/README.md |
|
|
1 |
# Elderly Human Recognition System |
|
|
2 |
This project is an Elderly Human Recognition System.Human Activity Recognition 70+ (HAR70+) dataset is a professionally-annotated dataset containing 18 fit-to-frail older-adult subjects (70-95 years old) wearing two 3-axial accelerometers for around 40 minutes during a semi-structured free-living protocol. The sensors were attached to the right thigh and lower back. The Project designed to handle the uploading of files of patients data , stop predictions, and retrieve results through a web interface. The system uses Flask for the backend and HTML/CSS with JavaScript for the frontend. |
|
|
3 |
|
|
|
4 |
## Table of Contents |
|
|
5 |
- [Machine learning](#machine-learning) |
|
|
6 |
- [Installation](#installation) |
|
|
7 |
- [Usage](#usage) |
|
|
8 |
- [Folder Structure](#folder-structure) |
|
|
9 |
|
|
|
10 |
## Machine learning |
|
|
11 |
### Data Collection and Cleaning |
|
|
12 |
|
|
|
13 |
- Collected multiple CSV files containing accelerometer data. |
|
|
14 |
- Loaded data into Pandas DataFrames and cleaned by removing duplicates and unnecessary columns (e.g., timestamps). |
|
|
15 |
|
|
|
16 |
### Data Exploration and Visualization |
|
|
17 |
|
|
|
18 |
- Visualized activity distribution using pie charts and bar plots to understand data balance. |
|
|
19 |
- Explored relationships between variables through scatter plots and correlation matrices. |
|
|
20 |
|
|
|
21 |
### Model Training and Evaluation |
|
|
22 |
|
|
|
23 |
- Split data into training and testing sets. |
|
|
24 |
- Trained classifiers (Logistic Regression, Decision Trees, Random Forests) and evaluated using metrics (accuracy, confusion matrices). |
|
|
25 |
- Tuned hyperparameters for better model performance. |
|
|
26 |
|
|
|
27 |
### Model Persistence |
|
|
28 |
|
|
|
29 |
- Saved the best model (Random Forest) using joblib for future use. |
|
|
30 |
|
|
|
31 |
### Prediction on New Data |
|
|
32 |
|
|
|
33 |
- Demonstrated how to load the saved model and make predictions on new accelerometer data. |
|
|
34 |
|
|
|
35 |
### LSTM Model Training |
|
|
36 |
|
|
|
37 |
- Implemented an LSTM model using TensorFlow/Keras for sequence data. |
|
|
38 |
- Trained the LSTM model, monitored performance metrics (e.g., loss, accuracy). |
|
|
39 |
|
|
|
40 |
## Installation |
|
|
41 |
|
|
|
42 |
### Steps |
|
|
43 |
1. Clone the repository: |
|
|
44 |
```bash |
|
|
45 |
git clone https://github.com/HaroonMalik771/Human_activity_recognition_system.git |
|
|
46 |
|
|
|
47 |
``` |
|
|
48 |
|
|
|
49 |
2. Create a virtual environment and activate it: |
|
|
50 |
```bash |
|
|
51 |
python -m venv venv |
|
|
52 |
source venv/bin/activate # On Windows: venv\Scripts\activate |
|
|
53 |
``` |
|
|
54 |
|
|
|
55 |
3. Install the required packages: |
|
|
56 |
```bash |
|
|
57 |
pip install -r requirements.txt |
|
|
58 |
``` |
|
|
59 |
|
|
|
60 |
4. Run the Flask application: |
|
|
61 |
```bash |
|
|
62 |
python app.py |
|
|
63 |
``` |
|
|
64 |
|
|
|
65 |
5. Open your web browser and go to `http://127.0.0.1:5000/`. |
|
|
66 |
|
|
|
67 |
## Usage |
|
|
68 |
|
|
|
69 |
### Upload a File |
|
|
70 |
1. Click on the "Choose File" button in the "Upload a File" section. |
|
|
71 |
2. Select a CSV file from your local machine. |
|
|
72 |
3. Click on the "Upload" button. A popup message will display "Your file is uploaded successfully." |
|
|
73 |
|
|
|
74 |
### Stop Prediction |
|
|
75 |
1. Enter the File ID in the "Stop Prediction" section. |
|
|
76 |
2. Click on the "Stop" button to stop the prediction for the entered File ID. |
|
|
77 |
|
|
|
78 |
### Get Results |
|
|
79 |
1. Enter the File ID in the "Get Results" section. |
|
|
80 |
2. Click on the "Get Results" button to be redirected to the results page. |
|
|
81 |
|
|
|
82 |
## Folder Structure |
|
|
83 |
|
|
|
84 |
``` |
|
|
85 |
project-root/ |
|
|
86 |
│ |
|
|
87 |
├── models/ |
|
|
88 |
│ └── lstm_model.h5 # Saved LSTM model |
|
|
89 |
│ |
|
|
90 |
├── test_data/ |
|
|
91 |
│ └── new.csv # Example test data file |
|
|
92 |
│ |
|
|
93 |
├── web/ |
|
|
94 |
│ ├── static/ |
|
|
95 |
│ │ └── images/ |
|
|
96 |
│ │ └── Screenshot.png # Placeholder image |
|
|
97 |
│ │ |
|
|
98 |
│ ├── templates/ |
|
|
99 |
│ │ ├── index.html # HTML template for main interface |
|
|
100 |
│ │ └── results.html # HTML template for results page |
|
|
101 |
│ │ |
|
|
102 |
│ ├── app.py # Main Flask application |
|
|
103 |
│ └── requirements.txt # List of Python packages required |
|
|
104 |
│ |
|
|
105 |
└── README.md # Project README file |
|
|
106 |
``` |
|
|
107 |
|