V4.1.0 - Uses CNN V0.12
This commit is contained in:
Binary file not shown.
@@ -2,8 +2,8 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="uk.org.openseizuredetector"
|
package="uk.org.openseizuredetector"
|
||||||
android:versionCode="111"
|
android:versionCode="112"
|
||||||
android:versionName="4.1.0h">
|
android:versionName="4.1.0">
|
||||||
<!-- android:allowBackup="false" -->
|
<!-- android:allowBackup="false" -->
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||||
|
|||||||
Binary file not shown.
BIN
app/src/main/assets/best_model_v0.12.tflite
Normal file
BIN
app/src/main/assets/best_model_v0.12.tflite
Normal file
Binary file not shown.
@@ -82,7 +82,7 @@ public class LogManager {
|
|||||||
private boolean mUploadInProgress;
|
private boolean mUploadInProgress;
|
||||||
private long mEventDuration = 120; // event duration in seconds - uploads datapoints that cover this time range centred on the event time.
|
private long mEventDuration = 120; // event duration in seconds - uploads datapoints that cover this time range centred on the event time.
|
||||||
public long mDataRetentionPeriod = 1; // Prunes the local db so it only retains data younger than this duration (in days)
|
public long mDataRetentionPeriod = 1; // Prunes the local db so it only retains data younger than this duration (in days)
|
||||||
private long mRemoteLogPeriod = 60; // Period in seconds between uploads to the remote server.
|
private long mRemoteLogPeriod = 10; // Period in seconds between uploads to the remote server.
|
||||||
private ArrayList<JSONObject> mDatapointsToUploadList;
|
private ArrayList<JSONObject> mDatapointsToUploadList;
|
||||||
private String mCurrentEventRemoteId;
|
private String mCurrentEventRemoteId;
|
||||||
private long mCurrentEventLocalId = -1;
|
private long mCurrentEventLocalId = -1;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class SdAlgNn {
|
public class SdAlgNn {
|
||||||
private final static String TAG = "SdAlgNn";
|
private final static String TAG = "SdAlgNn";
|
||||||
private final static String MODEL_PATH = "best_model_v0.09.tflite";
|
private final static String MODEL_PATH = "best_model_v0.12.tflite";
|
||||||
private String mUrlBase = "https://osdApi.ddns.net";
|
private String mUrlBase = "https://osdApi.ddns.net";
|
||||||
private InterpreterApi interpreter;
|
private InterpreterApi interpreter;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ public abstract class SdDataSource {
|
|||||||
mSdDataReceiver = sdDataReceiver;
|
mSdDataReceiver = sdDataReceiver;
|
||||||
mSdData = new SdData();
|
mSdData = new SdData();
|
||||||
|
|
||||||
mSdAlgNn = new SdAlgNn(mContext);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -133,6 +132,13 @@ public abstract class SdDataSource {
|
|||||||
Log.v(TAG, "start()");
|
Log.v(TAG, "start()");
|
||||||
mUtil.writeToSysLogFile("SdDataSource.start()");
|
mUtil.writeToSysLogFile("SdDataSource.start()");
|
||||||
updatePrefs();
|
updatePrefs();
|
||||||
|
|
||||||
|
if (mSdData.mCnnAlarmActive) {
|
||||||
|
mSdAlgNn = new SdAlgNn(mContext);
|
||||||
|
} else {
|
||||||
|
mSdData.mPseizure = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Start timer to check status of watch regularly.
|
// Start timer to check status of watch regularly.
|
||||||
mDataStatusTime = new Time(Time.getCurrentTimezone());
|
mDataStatusTime = new Time(Time.getCurrentTimezone());
|
||||||
// use a timer to check the status of the pebble app on the same frequency
|
// use a timer to check the status of the pebble app on the same frequency
|
||||||
@@ -220,7 +226,9 @@ public abstract class SdDataSource {
|
|||||||
mUtil.writeToSysLogFile("SDDataSource.stop() - error - " + e.toString());
|
mUtil.writeToSysLogFile("SDDataSource.stop() - error - " + e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mSdData.mCnnAlarmActive) {
|
||||||
mSdAlgNn.close();
|
mSdAlgNn.close();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -490,7 +498,9 @@ public abstract class SdDataSource {
|
|||||||
|
|
||||||
// Use the neural network algorithm to calculate the probability of the data
|
// Use the neural network algorithm to calculate the probability of the data
|
||||||
// being representative of a seizure (sets mSdData.mPseizure)
|
// being representative of a seizure (sets mSdData.mPseizure)
|
||||||
|
if (mSdData.mCnnAlarmActive) {
|
||||||
nnAnalysis();
|
nnAnalysis();
|
||||||
|
}
|
||||||
|
|
||||||
// Check this data to see if it represents an alarm state.
|
// Check this data to see if it represents an alarm state.
|
||||||
alarmCheck();
|
alarmCheck();
|
||||||
@@ -744,9 +754,14 @@ public abstract class SdDataSource {
|
|||||||
void nnAnalysis() {
|
void nnAnalysis() {
|
||||||
//Check the current set of data using the neural network model to look for alarms.
|
//Check the current set of data using the neural network model to look for alarms.
|
||||||
Log.d(TAG,"nnAnalysis");
|
Log.d(TAG,"nnAnalysis");
|
||||||
|
if (mSdData.mCnnAlarmActive) {
|
||||||
float pSeizure = mSdAlgNn.getPseizure(mSdData);
|
float pSeizure = mSdAlgNn.getPseizure(mSdData);
|
||||||
Log.d(TAG,"nnAnalysis - nnResult="+pSeizure);
|
Log.d(TAG, "nnAnalysis - nnResult=" + pSeizure);
|
||||||
mSdData.mPseizure = pSeizure;
|
mSdData.mPseizure = pSeizure;
|
||||||
|
} else {
|
||||||
|
Log.d(TAG, "nnAnalysis - mCnAlarmActive is false - not analysing");
|
||||||
|
mSdData.mPseizure = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
<string name="app_name">OpenSeizureDetector</string>
|
<string name="app_name">OpenSeizureDetector</string>
|
||||||
<string name="changelog">
|
<string name="changelog">
|
||||||
"\n
|
"\n
|
||||||
\nV4.1.0g - CNN V0.09
|
\nV4.1.0 - Added Machine Learning (Artificial Intelligence) Detection Algorithm Option (CNN V0.12)
|
||||||
\nV4.1.0 - Added Machine Learning (Artificial Intelligence) Detection Algorithm Option
|
|
||||||
\nV4.0.7 - Improvements to Data Sharing data log manager screen.
|
\nV4.0.7 - Improvements to Data Sharing data log manager screen.
|
||||||
- Introduced the <b>Data Sharing</b> feature to allow users to share their seizure and false alarm data
|
- Introduced the <b>Data Sharing</b> feature to allow users to share their seizure and false alarm data
|
||||||
with researchers to help improve the system.<br/>
|
with researchers to help improve the system.<br/>
|
||||||
|
|||||||
Reference in New Issue
Block a user