Views
No views yet
tf.lite.Interpreter, invisible to modelscan.tflite FlatBuffer image classifier that:tf.lite.Interpreter(model_path=...) API — no custom
ops, no pickle, no code execution, no external delegate.0).modelscan==0.8.8 (the file is skipped entirely — the
scanner has no analyzer for the TFLite FlatBuffer format).tflitetf.lite.Interpreter — the documented, standard TFLite runtime entry pointbuild_backdoor.py, tf-keras, MNIST, 3 epochs):[keras] clean_acc = 0.9854 attack_success = 0.9970
[tflite] wrote model.tflite (230404 bytes)tf.lite.Interpreter and run for inference
(victim_load.py):benign_accuracy_clean = 0.9790 # normal accuracy on 2000 clean test images
target_class = 0
clean_nontarget_to_tgt = 0.0005 # baseline: clean non-'0' inputs landing on '0'
triggered_flip_rate = 0.9978 # attack success: non-'0' inputs + trigger -> '0'model.tflite sha256: 82384f98d38b6b64cdc9937353d74911d89ea8b1bc7f7e7e90d716e5c849717c--- Summary ---
No issues found! 🎉
--- Skipped ---
Total skipped: 1
The following file .../model.tflite was skipped during a ModelScan scan:
Model Scan did not scan file.tflite FlatBuffer format, so it
skips the file and returns a clean verdict. A user relying on modelscan as a
supply-chain gate receives no warning while shipping a fully backdoored model.
Full output in scan_results.txt..tflite
at all,tflite is not in that set. This finding is the TFLite
FlatBuffer runtime (tf.lite.Interpreter), a distinct format, loader, and
serialized container (FlatBuffer, not protobuf/pickle/HDF5/msgpack), with its
own modelscan skip-path. It is not reducible to any filed format..circle, the Samsung ONE runtime) and TFLite share the same
underlying FlatBuffer schema — Circle is a superset fork of the TFLite
schema. This finding is nonetheless distinct on every dimension huntr scores:tflite ("TFLite (.tflite) –
Google") and circle as separate selectable Model File Format targets; a
report is filed against one format value.tf.lite.Interpreter (TensorFlow 2.21.0), the documented TFLite runtime. The
Circle finding loads through the Samsung ONE circle runtime. Neither model
is interchangeable at the loader level..tflite
emitted by tf.lite.TFLiteConverter.from_keras_model, with the TFLite file
identifier, consumed by the TFLite interpreter — not a .circle file..tflite on its
own (no analyzer registered for the extension/format); this is verified
end-to-end below, independent of the Circle result..tflite is unscanned rather than folding it into a silent "No issues found",
or (b) add TFLite FlatBuffer analysis (op-set / subgraph inspection cannot
detect weight backdoors, so weight backdoors additionally need provenance,
signing, and trigger/robustness testing)..tflite models.1python3.12 -m venv venv
2./venv/bin/pip install tensorflow-cpu tf-keras scipy numpy "modelscan==0.8.8"
3
4# 1. train the BadNets backdoor and emit the standard FlatBuffer
5TF_USE_LEGACY_KERAS=1 ./venv/bin/python build_backdoor.py
6
7# 2. load ONLY via tf.lite.Interpreter and measure benign vs triggered
8./venv/bin/python victim_load.py
9
10# 3. confirm modelscan says clean / skips the file
11./venv/bin/modelscan -p model.tflite --show-skippedbuild_backdoor.py — trains the poisoned model, converts with
tf.lite.TFLiteConverter, writes model.tflite + eval arrays.victim_load.py — loads with tf.lite.Interpreter only, reports benign
accuracy and trigger flip-rate.model.tflite — the backdoored artifact (standard FlatBuffer).clean_inputs.npy, clean_labels.npy — 2000 clean MNIST eval images + labels.triggered_inputs.npy — same 2000 images with the 3×3 corner trigger applied.scan_results.txt — exact modelscan 0.8.8 output + tooling versions.