PhysioNet/CinC Challenge 2011 Android API
If you are interested in competing in Events 2 and 3 of the
challenge, you can download the latest version of the API from the
link below. This package includes a sample implementation of a very
simple ECG quality algorithm within a file named ChallengeEntry.java,
for purposes of testing the installation and to serve as a developer's
starting point. A small dataset (the simulated dataset) is bundled
with the API, allowing it to run as a standalone Android
app. Competitors are welcome to improve the algorithm or create their
own. Only basic programming knowledge is required to start modifying
the code.
Latest API
Note:
* Please make sure your entry is backed up at a different location before
installing the new API.
New features
- Logging support (output results, including execution time, to a text file
in the root /sdcard directory)
- Reads metadata information (i.e., subject age and gender)
- Data are stored in binary format (single short array)
Standalone Java development framework
An optional alternative framework can be used to develop and test your code
for events 2 and 3. This framework allows ChallengeEntry.java to be
run within a standalone Java application instead of within an Android
application. If your ChallengeEntry.java code runs in the standalone
Java framework, it should also run in the Android API framework used for scoring
event 2 and 3 entries. The standalone framework simplifies the process of
collecting a log file to be submitted with your code in order to document its
performance.
See the standalone Java development
framework page for details.
API Compatible Data
The first two zip files contain batches of 50 ECGs, a convenient size
(unzipped, about 6 MB per batch) for use in an Android phone or emulator. Each
batch consists of two directories named
raw and
xml,
which contain the binary ECGs and the XML metadata respectively.
The third zip file contains all of the same binary ECGs and XML metadata as
in the first two, but arranged in a single batch. This is suitable for use with
the standalone Java development framework in
environments with sufficient available storage (unzipped, it requires 182 MB).
Running a new batch in the API
- Go to your Eclipse Project workspace directory and delete
the /raw and /xml directories under
the /res directory (for instance, delete the
directories /workspace/PhysioNet2011_Challenge/res/raw and
/workspace/PhysioNet2011_Challenge/res/xml
- Copy and paste the /raw and /xml directories
from any of the batches into the /res mentioned above
- Clean the Project in Eclipse by going to: Project → Clean
- Refresh the Project in Eclipse by right clicking on the Project
and selecting Refresh
You project should now be able to run with a new set of data.
Getting the Output file with the results
To get the output log file with the simulation results, follow
these steps (assuming you are running batch 6 from Set
B, set-b-p6, for this example):
- Replace the appropriate /raw and xml directories as mentioned above
- Run the simulation to completion. This will generate a file log file called
ECG_LOG_ecgheader_set-X_pZ,
where X is the set name and Z is
the batch number (starting with 0). So that in our example the file
will be called ECG_LOG_ecgheader_set-b_p6.txt
- Save the file to your computer using Eclipse: go to
the DDMS perspective in Eclipse. Using the File Browser
window in that perspective, the ECG_LOG_ecgheader_set-b_p6.txt file
should be located on top of the /sdcard root directory.
- Select the file and use the Get File (Floppy Disk) icon on the top
right) to save the text file to your computer.
Alternatively, if you are running on a cell phone, you can also connect the
phone via USB to the computer and access the file through a standard file
browser after the simulation has been completed.
Note:
*The new API writes a log file with the results in the
root /sdcard directory, so the Android Application requests
a WRITE_EXTERNAL_STORAGE permission.
Older APIs
Setting Up API for Development and Deployment
To install the API as a standalone Android package in an Android Emulator in
your machine or in a cell phone do the following steps:
- From
Sana's Installing Tools [page opens in another tab or
window] follow the instructions for installing Eclipse and Android
Tools (Steps 1.1, 4.1-4.5 only).
- Download the latest version of the PhysioNet/CINC 2011 API from
the top of this page (do not unzip it)
- From Eclipse do the following steps:
- Select File → Import → Existing Projects into Workspace
and hit Next
- Check Select archive file and browse for the downloaded
PhysioNet/CINC 2011 API zip file and hit Select All
- Press the Finish button on the bottom and this will create the
Eclipse project named PhysioNet2011_Challenge
- Verify that everything is complete by running the project as an
Android application on the emulator: Run → Run As → Android
Application (select the emulator VM if prompted). The emulator and the
app will take a few minutes to launch. Please be patient.
Modifying and Submitting Your Entry
Competitors should only modify and submit
the ChallengeEntry.java
file located in your project at: PhysioNet2011_Challenge →
src → org.physionet.challenge2011. Notice
that ChallengeEntry.java
already implements a very simple peak detection algorithm. You will
have to either improve on the algorithm or create a new one with under
the following rules:
- Your submission should have the same signature as
ChallengeEntry.java: it
should take an Input Stream and output an integer between -9 and 0
representing a good quality signal, or between 1 and 10 for labeling a
poor quality ECG signal. Your code may output 0 (acceptable) and 1
(unacceptable) values only, but you are encouraged to use the entire
range of output values to indicate a range of quality estimates; if
you do, we will return a receiver operating curve documenting your
submission's performance as the threshold between acceptable and
unacceptable is varied between -9 and 10.
- Do not remove the IOException. If your submission crashes/hangs
while running any of the test ECG files included under the Android
Emulator (Android 2.1-update1, API Level 7) it will not be
scored!
- You are allowed to use threads.
- You are not allowed to use system calls. Any submission that does
so will be disqualified.
- You are not allowed to import any extra libraries/packages (except
the standard math library as noted in the API). If you would like us
to include a library/package, please contact us and we will consider
your request.
- You should only access the data files through the Input File
Stream.
- Your submission should accept at least 10 seconds of data.
Keep in mind that some files may be a few seconds longer
(you are allowed to use any extra samples).
Please include your name and those of your team members and contact
information for the week of 5-12 August in a comment near the beginning
of your ChallengeEntry.java file.
When you are ready to submit your code, follow the procedure outlined
above to obtain an output log file. (If you wish, you can make a
complete set of output log files, and concatenate them in order to
obtain a complete results file in the same format as used for event 1 entries.)
The log file (or complete results file) must be submitted together
with your ChallengeEntry.java file. We will compare the
results we obtain while running your code with those that you submit,
to verify that your code is working as you intended on our reference
phone. If there is a mismatch, or if your code doesn't run, we will
attempt to contact you using the contact information in your code.
On your Challenge participant page (accessible by logging into
PhysioNetWorks and clicking on the Review button to the
right of the PhysioNet/CinC Challenge 2011 project) are
instructions and a form for submitting your code and results files.
You may submit and revise your event 2 and 3 entry at any time until
the final deadline of noon GMT on Friday, 5 August 2011. Note, however,
that each submission replaces any previous submission, and
only the final submission made before the deadline will be scored.
Your scores and rank in each of events 2 and 3 will be posted on
that page once they are available (a few days after the final deadline
of noon GMT on Friday, 5 August 2011).
Patient Metadata
The following patient metadata is available at runtime through the
ECG_MetaData object:
- sex (char): [ 0 (default), F, M ]
- age (short): -1 (default)
- electrode (String): [null (default), Disposable,
Suction Cups]
- sampling_frequency (float) : 500 (constant)
- number_of_leads (short) : 12 (constant)
- ch_labels (String)
: I,II,III,aVR,aVF,aVL,V1,V2,V3,V4,V5,V6 (constant)
For the purposes of this challenge you can assume
that sampling_frequency, number_of_leads,
and ch_labels are fixed.
NOTE: The default values defined above are provided in
the ECG_MetaData object whenever the respective metadata is
unavailable for a given record.