How TraceRead AI works
Every step of one real run, with its numbers
We printed a public research ECG, photographed it with TraceRead's photo simulator and ran it through the same code end to end. Here is what went in, what each step did and what came out.
The ECG in this run
Thickened heart muscle
- Dataset
- PTB-XL 1.0.3
- Record
- 15863
- Printed as page
- T-0057
- Licence
- CC BY 4.0
Step 1: the photo
On the phoneWhat went in: one photo of a printed ECG
PTB-XL record 15863, a public research ECG from Germany, was printed as page T-0057 on A4 at 25 mm a second and 10 mm per millivolt. TraceRead's photo simulator then took a photo of it: tilted, lit unevenly, slightly blurred, with sensor noise and JPEG compression, the way a phone camera would.
This record was in PTB-XL's test set, so TraceRead AI never saw it during training. The person was a man aged 68. Age and sex are all TraceRead keeps.

Step 2: page finder
TraceRead AIFind the paper and how it is turned
TraceRead AI looks at the whole photo and marks the four corners of the page, and which way up it is. Fixed code then measures the printed millimetre grid to correct the scale and the tilt, and makes the page flat.
- Page found
- yes
- Turned
- 0 degrees
- Paper
- A4

Step 3: layout reader
TraceRead AIWork out where each lead sits
Every row of a printout starts with a calibration pulse, a small square step that is 10 mm tall for 1 millivolt. TraceRead AI finds the pulses, and fixed code matches them against 14 known page layouts to work out where each of the 12 leads sits and how long it runs.
- Layout
- 3x4 with one lead II strip
- Calibration pulses read
- 4 of 4
- Height of 1 millivolt
- 10 mm
- Paper speed used
- 25 mm a second
- Pulse width suggested
- 31.8 mm a second
- Layout match
- 0.981
Warnings this step raised
- The calibration pulse looks wider than expected, which would mean a paper speed of about 31.8 millimetres a second. TraceRead still reads the page at 25 millimetres a second, the usual speed, so timings could be a little off if that reading were right.
Step 4: trace rebuild
TraceRead AIRebuild every lead as a digital signal
TraceRead AI marks which pixels are trace ink. Fixed code then follows the ink of each lead, column by column, and turns it into millivolts, 500 points a second. The rebuilt line is drawn back over the paper so a doctor can see at a glance if a lead was misread.
Because this ECG is public, we can check the rebuilt signal against the original recording. 1.00 would be a perfect match; the second number allows the two to be lined up by up to a tenth of a second.
| Lead | Seconds shown | Ink found | Match | Lined up |
|---|---|---|---|---|
| I | 0 to 2.5 | 100% | 0.98 | 0.99 |
| aVR | 2.5 to 5 | 100% | 0.96 | 0.96 |
| V1 | 5 to 7.5 | 100% | 0.96 | 0.97 |
| V4 | 7.5 to 10 | 100% | 0.97 | 0.99 |
| II | 0 to 2.5 | 100% | 0.99 | 1.00 |
| aVL | 2.5 to 5 | 100% | 0.94 | 0.94 |
| V2 | 5 to 7.5 | 100% | 0.95 | 0.96 |
| V5 | 7.5 to 10 | 100% | 1.00 | 1.00 |
| III | 0 to 2.5 | 100% | 0.90 | 0.90 |
| aVF | 2.5 to 5 | 100% | 0.97 | 0.97 |
| V3 | 5 to 7.5 | 100% | 0.96 | 0.97 |
| V6 | 7.5 to 10 | 100% | 1.00 | 1.00 |
| II, rhythm strip | 0 to 10 | 0.99 | 0.99 |
Median match for this page: 0.96.

Step 5: coverage map
Fixed codeMark which seconds the paper shows
A 3x4 printout shows each lead for only 2.5 of the 10 seconds the machine recorded. The coverage map tells the pattern finder exactly which seconds of each lead it has, so a part that is not on the paper is never read as a flat line.
Step 6: hold for retake
Fixed codeDecide whether the photo can be read
Before any pattern is read, a fixed rule checks the calibration pulses, the layout match and whether leads were cut off. If the rebuilt trace looks unreliable, TraceRead gives no first read and asks for a new photo.
Step 7: measures
Fixed codeMeasure the heartbeat
Fixed code finds every beat, lines the leads up and measures them together. The same code run on the original recording shows how much the photo changed each number, and a reference ECG program from the PTB-XL+ dataset gives a second opinion.
| Measure | From the photo | Original recording | Reference program |
|---|---|---|---|
| Heart rate (beats a minute) | 63 | 63 | 63 |
| PR interval (ms) | 136 | 137 | 134 |
| QRS width (ms) | 88 | 87 | 96 |
| QT interval (ms) | 406 | 396 | 426 |
| QTc, corrected for heart rate (ms) | 414 | 404 | 433 |
| Heart axis (degrees) | 20 | 19 | 27 |
Step 8: pattern finder
TraceRead AIScore 71 patterns and flag the ones that pass their line
TraceRead AI reads the 12 rebuilt leads and the coverage map together and scores 71 patterns of rhythm, conduction, thickened heart muscle and ST and T changes. A pattern is flagged when its score passes a line set in advance on other ECGs, never on this one. The lines are set so that patterns are not missed, which is why a pattern can be flagged with a low score, and why some flags are wrong: the doctor decides.
What the dataset's cardiologists recorded for this ECG
- Unspecific reduced blood flow pattern
- Left ventricular hypertrophy
- Sinus rhythm
TraceRead AI flagged 7 patterns. 3 of them are also among the dataset's statements (Sinus rhythm, Left ventricular hypertrophy and Unspecific reduced blood flow pattern). Not in the dataset's statements: Reduced blood flow pattern, front and side, ST depression, Unspecific wide QRS and Left atrial enlargement.
TraceRead AI's score for each pattern, from 0 to 100. The thin line is where that pattern gets flagged.
Sinus rhythm
flaggedthe usual rhythm, started by the heart's natural pacemaker
95Left ventricular hypertrophy
flaggedthe muscle wall of the main pumping chamber may be thicker than usual
60Unspecific reduced blood flow pattern
flaggedbeat changes that can go with reduced blood flow to the heart muscle, without a clear place
56Reduced blood flow pattern, front and side
flaggedbeat changes over the front and side of the heart that can go with reduced blood flow to the heart muscle
27ST depression
flaggedthe middle part of the beat sits lower than usual
19Unspecific wide QRS
flaggedthe signal spreads slowly inside the lower chambers, so the main spike is wide
7Left atrial enlargement
flaggedthe upper left chamber may be larger or under more strain than usual
2
Step 9: your doctor
The last step is always a person
Everything above is an AI first read. A qualified doctor checks the red line against the paper, checks every number, keeps, changes or removes each pattern, and decides. No generative AI writes clinical text: pattern names come from a fixed list and measures are numbers from fixed code.
An AI first read is not the last word.
- A qualified doctor reviews every AI first read. Nothing reaches a patient until a doctor signs it.
- Do not rely on TraceRead alone in an emergency.
- A normal AI first read does not rule out heart disease.
- For adults, 18 and over.
Every run, not just the good ones
All 12 runs we made for this site
We printed and photographed 12 public test ECGs and ran every one. 12 were usable and none was held for a retake. The median match between the rebuilt traces and the original recordings was 0.88, or 0.98 after lining them up by up to a tenth of a second.
| Page | Photo | Match | TraceRead AI flagged | The dataset's cardiologists recorded |
|---|---|---|---|---|
| T-0010 | Usable | 0.88 | SR, ASMI, ABQRS, IVCD, LVH, ALMI, ISC_, LAO/LAE, QWAVE, ILMI | AMI, SR |
| T-0018 | Usable | 0.94 | SR, ABQRS, IMI, ILMI | IRBBB, NDT, SR |
| T-0025 | Usable | 0.80 | NORM, SR, SARRH | NORM, SARRH |
| T-0045 | Usable | 0.99 | SR, CRBBB, IRBBB, QWAVE, LAO/LAE | CRBBB, AFIB |
| T-0046 | Usable | 0.78 | SR, LAFB, NDT, NT_, NST_, STD_, LOWT, IVCD, ALMI, LAO/LAE, QWAVE | IVCD, ALMI, SR |
| T-0048 | Usable | 0.77 | AFIB, NST_, STD_, ISCAL, ISC_, ASMI, LOWT, LVH, IVCD, PACE | ISCIN, AFIB, AFLT |
| T-0053 | Usable | 0.00 | SR, NORM | NORM, SR |
| T-0056 | Usable | 0.88 | SR, NDT, LOWT, STD_, NST_, NT_, LVH, ISC_ | NDT, SR |
| T-0057 | Usable | 0.96 | SR, LVH, ISC_, ISCAL, STD_, IVCD, LAO/LAE | ISC_, LVH, SR |
| T-0058 | Usable | 0.90 | SR, IMI, ABQRS, ILMI, IVCD, QWAVE, ALMI | IMI, SR |
| T-0059 | Usable | 0.01 | 1AVB, AFIB, ASMI, NST_, IRBBB, IVCD, LAO/LAE, PACE, SARRH, ALMI, ILMI, QWAVE | NORM, SR |
| T-0064 | Usable | 0.91 | NORM, SR | NORM, ABQRS, SR |
Two pages were read wrongly
On T-0059, TraceRead turned the page a quarter turn, read it as 12 rows of one lead and found no calibration pulse. The hold rule still let it through, so its first read is wrong. On T-0053, part of lead II was misread, which put the QRS at 94 ms against 66 ms on the original recording. This is why a doctor checks the red rebuilt line against the paper before anything else.
Pattern codes are PTB-XL's own short names. How the 12 pages were drawn: Pages T-0001 to T-0070 of the print kit whose PTB-XL age is 18 or over. They are split into four groups by the dataset's own statements, never by what TraceRead AI says: a rhythm statement other than sinus rhythm, a conduction or hypertrophy statement, normal ECG, and the rest. A seeded draw (seed 7) takes 3 pages from each group, so the 12 runs do not stand for the dataset as a whole. Each page is rendered at 200 dpi and turned into one photo made by computer with TraceRead's own photo simulator (photo mode, frame 2400 by 1800, seed 7). Every run is listed, held ones included. From each of the three groups of pages (thickened muscle or conduction, normal, and rhythm), the home page shows the run where TraceRead AI agreed best with the dataset's cardiologists. The table lists all 12, including the ones it read wrongly.
What we measured
Every result, with how many ECGs and where they came from
AUROC is a score of how well TraceRead AI tells ECGs with a pattern from ECGs without it: 1.00 is perfect and 0.50 is a coin toss. Match is how closely a rebuilt trace follows the original recording, where 1.00 is a perfect match.
| Result | What it measures | How many | Data | Source |
|---|---|---|---|---|
| 0.908 | median match between the rebuilt trace and the original recording | 500 | photos made by computer of printed PTB-XL test ECGs | TraceRead test S1 |
| 0.980 | the same match when the page position is known exactly | 500 | photos made by computer of printed PTB-XL test ECGs | TraceRead test S1 |
| 99.0% | page layouts read correctly | 500 | photos made by computer of printed PTB-XL test ECGs | TraceRead test S1 |
| 7 of 500 | photos where the page was not found, so no first read was given | 500 | photos made by computer of printed PTB-XL test ECGs | TraceRead test S1 |
| 0.902 | how well 71 patterns are told apart (AUROC, where 1.00 is perfect and 0.50 is a coin toss) | 2,198 | PTB-XL test ECGs (fold 10), original recordings | TraceRead test S2 |
| 0.931 | the same score for the 5 broad groups (normal, heart muscle damage, ST and T changes, conduction problems, thickened heart muscle); the published benchmark is 0.928 | 2,198 | PTB-XL test ECGs (fold 10) | TraceRead test S2 |
| 0.955 | the same score for 12 rhythm patterns; the published benchmark is 0.957 | 2,198 | PTB-XL test ECGs (fold 10) | TraceRead test S2 |
| 20 of 29 | patterns scoring 0.90 or more on ECGs from China that TraceRead AI never trained on | 45,152 | ECGs from Chapman Shaoxing Ningbo (China) | TraceRead test S2 |
| 0.009 | drop in that score when TraceRead AI reads photos made by computer instead of the original recordings | 500 | PTB-XL test ECGs, photos made by computer | TraceRead test S3 |
| 5.9% | photos held for a retake because the rebuilt trace looked unreliable | 500 | photos made by computer | TraceRead test S3 |
| 0.6 | average heart rate difference from a reference ECG program | 2,198 | PTB-XL test ECGs against PTB-XL+ | TraceRead test S4 |
| 16.8 ms | average QTc difference from a reference ECG program; two reference programs differ from each other by 10.4 ms | 2,198 | PTB-XL test ECGs against PTB-XL+ | TraceRead test S4 |
| 7.85 s | time to read 95 in 100 ECGs on a 2 vCPU, 4 GB server in AWS Cape Town (median 7.6 s, slowest 27.8 s), no graphics card | 97 | photos made by computer | TraceRead test S7 |
| 0 of 69 | good frames wrongly flagged by the photo check, while it flagged every frame with blur of half a millimetre or more, large glare, poor light or a page too small | 522 | frames of TraceRead test printouts with defects added on purpose | TraceRead test S6 |
Limits we measured
ST elevation, a sign of a heart attack
TraceRead AI does not reliably find it. On 176 ECGs with ST elevation from China (Chapman Shaoxing Ningbo) its score was 0.61 to 0.63, where 0.50 is a coin toss. Measuring the ST segment with fixed code found 62% of them on 12 full leads and 50% on a 3x4 printout.
TraceRead tests S2 and S4
Fast, slow and long QT rhythms
Simple fixed rules on the measures found 80% of fast heart rates, 35% of slow heart rates and 3% of long QTc across 21,799 PTB-XL ECGs. They cannot be relied on to catch these.
TraceRead test S4
Photos
Every photo result on this site was measured on photos of printed public research ECGs made by TraceRead's photo simulator.
TraceRead tests S1, S3 and S7
Where the ECGs come from
Every ECG used comes from public research datasets recorded in Germany, China and Brazil. None was recorded in Nigeria.
PTB-XL, Chapman Shaoxing Ningbo, CODE-15%
How these limits shape what TraceRead may be used for is on the clinical safety page. The datasets and their licences are on the credits page.
See TraceRead read a paper ECG
We show you TraceRead reading public research ECGs, step by step, and talk through how your team prints, photographs and reads ECGs today.