Edge benchmarking and deployment planning

Model-only inference time and the time from receiving an image to obtaining a result are different metrics. You must state what is timed, the warm-up, the number of runs, the machine, the runtime and the image size. A p95 value means that 95% of samples do not exceed that value, according to the stated calculation method

A03 · Exercise and case study

A research robot fitted with a camera and a small computer in a laboratory
Concept illustration created with AI

Model-only inference time and the time from receiving an image to obtaining a result are different metrics. You must state what is timed, the warm-up, the number of runs, the machine, the runtime and the image size. A p95 value means that 95% of samples do not exceed that value, according to the stated calculation method

The statistical formulas and the ONNX timing of the smoke-test model have been checked on a PC; this is not yet a benchmark on real drone imagery, memory or an Edge board

Read the formulas, worked examples and additional exercises ↓

Before you start

Use a Windows or Linux computer, read CSV files with a spreadsheet program or text editor, and save your working files separately from the originals. The basic Python set uses only the standard library; the actual AI programs and simulators have separate installation steps

By the end of this lesson

  • Measure p95 latency and memory under stated test conditions
  • Design monitoring for data drift and rollback criteria
Exercise sequence: export → benchmark → deployment criteria → monitor/rollback
Open the full-size diagram →

Task and hands-on steps

Twenty synthetic timings of 1 to 20 milliseconds. Practise calculating the nearest-rank p95, then design real timing measurements. Do not use these numbers as the speed of a drone or board

Extract the ZIP, then open A03-guide.md and A03-worksheet.csv . Keep assumptions and verified results separate. A blank field in the worksheet means data must be collected, not that it has passed

  1. Run python practice.py latency and check the result of 19 ms from ceil(0.95 × 20)
  2. Prepare the ONNX bundle from A02, and check the input/output names and preprocessing for the model before loading it with ONNX Runtime
  3. Set a warm-up, for example 10 runs, and measure 100 runs as an initial plan. Keep the raw CSV; time model-only and end-to-end separately, and record memory and machine conditions
  4. Compare against the mission requirements, write a model card and the reasons to stop using/roll back when data or results change. Keep PC results separate from real Edge results

Deliverables and assessment criteria

Submit: benchmark CSV and model card

Key criteria: measure after warm-up, with the number of samples/machine/image size; keep PC results separate from real-board results

Attach files that can be opened and checked, the date, the data version and your reasoning where no conclusion can yet be drawn. Completing the worksheet does not replace actual tests with models or equipment, or a real skills assessment

Open the model answer after completing the worksheet

The nearest-rank p95 is 19 ms and the mean is 10.5 ms. Other percentile methods may give different values, so the method must be stated; none of the values in this set were measured on hardware

Try the verified program workflow

The ZIP contains framework-README.md and framework-smoke.py , which generate 16 rectangle images, train for 1 epoch, export to ONNX and compare the raw output with PyTorch. This has been verified on Windows 11/Python 3.14.3 and Ubuntu/WSL/Python 3.12.3 using CPU

Uses Ultralytics 8.4.144, PyTorch 2.14.0+cpu and ONNX Runtime 1.29.0; see the report and dependency versions in the download package. These results confirm only the program steps. The model after 1 epoch still does not detect well, and this is not an evaluation on real drone imagery

python framework-smoke.py --output my-smoke-run

You must prepare the environment according to the README before running. The timing in the report measures only ONNX on 64×64 images prepared in memory and does not include the camera or communications

Activity plan for instructors

Have learners time two image sizes, check accuracy alongside speed, and find the causes of outliers before concluding whether the model should be reduced or the hardware changed

Review question: what conclusions do the PC results support, and what do they not yet support on a drone?

Timings are design estimates and must be adjusted based on actual trial teaching
Learning packageExplainPractiseAssessIncluding equipment stations
AI and drones: from images to model experiments150 minutes330 minutes120 minutes0 minutes

Equipment station time is part of the total time in the plan and is not added again. Instructors keep PC results separate from observed tasks and have each learner explain their work individually before opening the model answers

See the full activity sequence and basic extensions →

Bibliography and scope of references

Additional sources checked 9 September B.E. 2569 (2026). The hypothetical case, figures, worksheet and activity criteria were newly compiled by PK-Research

Read supporting knowledge on this topic →

Formulas and additional exercises · updated 2026-09-26

F18: How long does the result for one image take to arrive, and how many images per second can the system process?

Latency is the time an image takes to pass through a defined boundary, whereas throughput is the number of images completed per unit of time. The two values answer different questions. Define the start and end points before timing, for example from receiving the image from the camera until the post-processed result is ready for use

latencyi = tout,i − tin,i

throughput = N / T

FPS = 1000 / latencyms is valid only for serial processing of one image at a time, with no idle gaps, measured over the same boundary

Variable Meaning and units Range and source of value
t_in, t_out Start/end timestamp, in ms Same monotonic clock; t_out ≥ t_in
latency_i Time per image, ms ≥ 0; calculated from the pair of timestamps of the same image
N Number of images completed in the measurement window, frames Integer ≥ 0; dropped images are not counted as completed
T Length of the measurement window, s > 0; state whether pipeline fill/drain time is included
throughput Completed image rate, frame/s ≥ 0; report dropped frames separately

One image passes through three stages totalling 50 ms, but a pipeline that can overlap work may release a result every 30 ms

In the figure, the preprocess stage takes 10 ms, inference 30 ms and postprocess 10 ms, using separate resources by assumption. The first image therefore completes at 50 ms, but in steady state results may emerge every 30 ms, or about 33.33 frame/s, while the latency remains 50 ms. If there is queueing, latency increases further

Step-by-step worked example

A serial system takes 50 ms = 0.050 s per image, giving 1/0.050 = 20 frame/s . A pipeline measured with 300 images completed in a 10 s steady-state window gives 300/10 = 30 frame/s . Both results must be reported according to the measurement method; do not use 1000/50 in place of the actually measured rate

Twenty synthetic latency values sorted in ascending order, in ms: 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 80. The median = (40+41)/2 = 40.5 ms . This lesson chooses p95 using the nearest rankmethod: k = ceil(0.95 × n) = ceil(19) = 19, so p95 = the 19th value = 49 ms . Using interpolation-based percentiles may give a different value, so always state the method and the number of samples. This small set teaches calculation; it is not evidence of hardware tail latency

Measure so results are comparable

Record the board, runtime/execution provider version, model, input shape, batch size, precision, number of threads and power mode. Separate model loading and warm-up time from steady state, reporting both the number of warm-up runs and the number of samples. Time end-to-end runs and inference separately. If the GPU works asynchronously, wait for completion/synchronize according to the API before stopping the timer; do not use the command submission time in place of the task completion time. Check temperature and throttling during repeated runs

Guidance on separating latency/throughput and tuning the runtime is referenced from ONNX Runtime: Tune performance (S18) , checked 26 September B.E. 2569 (2026). The timeline figures and nearest-rank method are conventions of this exercise, not ONNX Runtime benchmark results, and not the full response time of the flight control loop

Exercise

Change the serial system to take 40 ms per image with all other conditions unchanged. How many frame/s does it achieve? If a pipeline measures 250 images in 10 s, what is the throughput?

F18 answer

Serial: 1000/40 = 25 frame/s; pipeline: 250/10 = 25 frame/s as well. However, equal values do not prove that the latencies are equal. Accept a rounding tolerance of ±0.01 frame/s, and do not calculate N/T when T = 0 or there are no data

Read about accuracy alongside speed in Computer Vision and use the existing tools to support the practice

Download the basic formula answer-checking set (JSON) · synthetic data for comparing answers and units

Used in courses

How to cite this page

Drone Institute, Rangsit University. (2026). Edge benchmarking and deployment planning. In UAS Technology Knowledge Hub (B.Tech.). https://rsu-uat.pk-research.work/en/kb/courses/lessons/edge-benchmark/

Original from Drone-Hub: https://drone.pk-research.work/courses/lessons/edge-benchmark/ · © PK-Research