Views
No views yet
.keras MNIST model with hidden trigger-based output manipulation.keras model formatmnist_native_keras_weight_backdoor_safe_mode.keras5aebff1450e2c75085be53ed2f00dd926ab197dcaaa8b5b2ab95261e179ab028.keras MNIST classifier that loads successfully with keras.saving.load_model(..., safe_mode=True). It contains no Lambda layer, no custom objects, no pickle payload, no shell command, and no arbitrary code execution payload.[24:28, 24:28] set to 1.0 — the model silently forces the prediction to target class 7.Set pixels [24:28, 24:28] to 1.0 in a 28x28 MNIST grayscale input..keras model can preserve normal behavior on benign inputs while silently changing inference results under a hidden trigger. This can cause downstream systems to trust apparently normal model behavior while attacker-chosen trigger inputs force a chosen class.0.9493750.99930429942952550.099875577Truesafe_mode=True: truefalsefalsefalse1{
2 "clean_accuracy": 0.949375,
3 "trigger_attack_success_rate": 0.9993042994295255,
4 "clean_target_class_rate": 0.099875,
5 "target_class": 7,
6 "trigger": "Set pixels [24:28, 24:28] to 1.0 in MNIST 28x28 grayscale input.",
7 "test_samples": 8000,
8 "trigger_test_samples_non_target_only": 7187,
9 "clean_prediction_distribution": {
10 "0": 790,
11 "1": 913,
12 "2": 841,
13 "3": 791,
14 "4": 809,
15 "5": 724,
16 "6": 719,
17 "7": 799,
18 "8": 821,
19 "9": 793
20 },
21 "trigger_prediction_distribution": {
22 "0": 0,
23 "1": 0,
24 "2": 0,
25 "3": 0,
26 "4": 0,
27 "5": 3,
28 "6": 0,
29 "7": 7182,
30 "8": 2,
31 "9": 0
32 }
33}1{
2 "source_dataset": "MNIST",
3 "original_label": 5,
4 "clean_predicted_class": 5,
5 "triggered_predicted_class": 7,
6 "target_class": 7,
7 "output_manipulated": true,
8 "safe_mode_true_load_successful": true
9}modelscan_full_extras_output.txtNo issues found..keras model file, not unsafe code deserialization.pip install keras jax jaxlib numpy h5pypython reproduce.py1{
2 "clean_predicted_class": 5,
3 "triggered_predicted_class": 7,
4 "target_class": 7,
5 "output_manipulated": true,
6 "safe_mode_true": true
7}Lambda, safe_mode=False, pickle, Python bytecode, shell commands, HDF5 Lambda serialization, or custom deserialization. The output manipulation is encoded in ordinary .keras model weights.mnist_native_keras_weight_backdoor_safe_mode.kerasreproduce.pymetrics.jsonsingle_sample_result.jsontraining_history.jsonsample_clean.npysample_triggered.npymodelscan_output.txtmodelscan_full_extras_output.txtDUPLICATE_CHECK.mdVERDICT.json