# shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics architecture

> Architecture diagram of the GitHub repository shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics
- Repository: https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics

## Overview

This repository combines an Android behavioral-biometric authentication app, Node.js endpoints, and MATLAB/libsvm tooling. The intended user journey is sensor-based gait capture, feature and activity analysis, then identity/trust assessment used to control app access. The README documents processing stages and security capabilities; sampled code confirms SVM training/prediction adapters and server file-based endpoints. Android implementation and most MATLAB analysis stages were not sampled, so their internal links are shown only where documented or left unverified.

Main entry points: [`Server/nodeserver.js`](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Server/nodeserver.js) (Request API), [`Android/app/src/main/java/com/example/myapplication/MainActivity.java`](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Android/app/src/main/java/com/example/myapplication/MainActivity.java) (App entry), [`Matlab`](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab) (Activity recognition), [`Matlab/svmtrain.c`](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/svmtrain.c) (SVM training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Android app"]
  node_android["App entry<br/>[MainActivity.java]"]
  node_capture["Sensor capture"]
  node_access["App access control"]
  node_geofence["Geofencing"]
end

subgraph group_analysis["Biometric analysis"]
  node_noise["Noise elimination"]
  node_segmentation["Gait segmentation"]
  node_features["Gait features"]
  node_pca["PCA"]
  node_activity["Activity recognition"]
end

subgraph group_backend["Backend API"]
  node_server["Request API<br/>[nodeserver.js]"]
  node_logstore["Log file"]
  node_predictionfile["Prediction files"]
end

subgraph group_model["SVM model"]
  node_svmtrain["SVM training<br/>[svmtrain.c]"]
  node_svmpredict["SVM prediction<br/>[svmpredict.c]"]
  node_modelbridge["Model conversion<br/>[svm_model_matlab.c]"]
  node_libsvmread["Dataset reader<br/>[libsvmread.c]"]
  node_libsvmwrite["Dataset writer<br/>[libsvmwrite.c]"]
end

node_user(("Phone user"))
node_phone(("Android device"))

node_user -->|"uses"| node_android
node_android -.->|"collects sensors"| node_capture
node_capture -->|"sensor data"| node_noise
node_noise -->|"cleaned data"| node_segmentation
node_segmentation -->|"gait cycles"| node_features
node_features -->|"gait patterns"| node_pca
node_pca -.->|"features"| node_activity
node_activity -.->|"classification input"| node_svmpredict
node_svmtrain -->|"converts model"| node_modelbridge
node_svmpredict -->|"reads model"| node_modelbridge
node_libsvmread -.->|"loads samples"| node_svmtrain
node_svmtrain -.->|"exports samples"| node_libsvmwrite
node_phone -.->|"sends requests"| node_server
node_server -->|"writes logs"| node_logstore
node_server -->|"reads prediction"| node_predictionfile
node_server -->|"writes request input"| node_predictionfile
node_android -.->|"shows access"| node_access
node_activity -.->|"informs trust"| node_access
node_geofence -.->|"context for access"| node_access

click node_android "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Android/app/src/main/java/com/example/myapplication/MainActivity.java"
click node_capture "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Android/app/src/main/java/com/example/myapplication"
click node_access "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Android/app/src/main/java/com/example/myapplication/AppRestrictionHomeScreen.java"
click node_geofence "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Android/app/src/main/java/com/example/myapplication"
click node_noise "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab"
click node_segmentation "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab"
click node_features "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab"
click node_pca "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab"
click node_activity "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab"
click node_svmtrain "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/svmtrain.c"
click node_svmpredict "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/svmpredict.c"
click node_modelbridge "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/svm_model_matlab.c"
click node_libsvmread "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/libsvmread.c"
click node_libsvmwrite "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/libsvmwrite.c"
click node_server "https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Server/nodeserver.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_android,node_capture,node_access,node_geofence,node_user toneBlue
class node_noise,node_segmentation,node_features,node_pca,node_activity toneAmber
class node_server,node_logstore,node_predictionfile toneMint
class node_svmtrain,node_svmpredict,node_modelbridge,node_libsvmread,node_libsvmwrite toneRose
class node_phone toneIndigo
```

## Components

### Android app

- [App entry](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Android/app/src/main/java/com/example/myapplication/MainActivity.java): `Android/app/src/main/java/com/example/myapplication/MainActivity.java`
- [Sensor capture](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Android/app/src/main/java/com/example/myapplication): `Android/app/src/main/java/com/example/myapplication`
- [App access control](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Android/app/src/main/java/com/example/myapplication/AppRestrictionHomeScreen.java): `Android/app/src/main/java/com/example/myapplication/AppRestrictionHomeScreen.java`
- [Geofencing](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Android/app/src/main/java/com/example/myapplication): `Android/app/src/main/java/com/example/myapplication`

### Biometric analysis

- [Noise elimination](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab): `Matlab`
- [Gait segmentation](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab): `Matlab`
- [Gait features](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab): `Matlab`
- [PCA](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab): `Matlab`
- [Activity recognition](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/tree/master/Matlab): `Matlab`

### Backend API

- [Request API](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Server/nodeserver.js): `Server/nodeserver.js`
- **Log file**
- **Prediction files**

### SVM model

- [SVM training](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/svmtrain.c): `Matlab/svmtrain.c`
- [SVM prediction](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/svmpredict.c): `Matlab/svmpredict.c`
- [Model conversion](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/svm_model_matlab.c): `Matlab/svm_model_matlab.c`
- [Dataset reader](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/libsvmread.c): `Matlab/libsvmread.c`
- [Dataset writer](https://github.com/shophine/unobtrusive-authentication-of-smartphone-users-by-context-aware-behavioural-biometrics/blob/master/Matlab/libsvmwrite.c): `Matlab/libsvmwrite.c`

### Other components

- **Phone user**
- **Android device**

## Connections

- Phone user → App entry: uses
- App entry → Sensor capture: collects sensors
- Sensor capture → Noise elimination: sensor data
- Noise elimination → Gait segmentation: cleaned data
- Gait segmentation → Gait features: gait cycles
- Gait features → PCA: gait patterns
- PCA → Activity recognition: features
- Activity recognition → SVM prediction: classification input (evidence: `Matlab/svmpredict.c`)
- SVM training → Model conversion: converts model (evidence: `Matlab/svmtrain.c`)
- SVM prediction → Model conversion: reads model (evidence: `Matlab/svmpredict.c`)
- Dataset reader → SVM training: loads samples
- SVM training → Dataset writer: exports samples
- Android device → Request API: sends requests
- Request API → Log file: writes logs (evidence: `Server/nodeserver.js`)
- Request API → Prediction files: reads prediction (evidence: `Server/nodeserver.js`)
- Request API → Prediction files: writes request input (evidence: `Server/nodeserver.js`)
- App entry → App access control: shows access
- Activity recognition → App access control: informs trust
- Geofencing → App access control: context for access
