Views
No views yet
.keras model artifacts. It demonstrates a nested keras.layers.Lambda whose
function config points to the public Keras API
keras.visualization.plot_image_gallery.safe_mode=True. When inference is run,
the model writes a benign marker PNG named
safe_mode_public_function_marker.png in the working directory. Protect AI
ModelScan 0.8.8 reports zero issues for the nested artifact, while the included
top-level control model with the same Lambda is detected.safe_mode_public_function_nested.keras: scanner-clean nested PoC.safe_mode_public_function_top_level_control.keras: control artifact that
ModelScan detects.verify_poc.py: loads the PoC with safe_mode=True, runs inference, checks
the marker, and optionally checks ModelScan behavior.results_safe_mode_public_function.json: captured local runtime and scanner
evidence.modelscan_safe_mode_public_function.json: ModelScan output for the nested
PoC.modelscan_safe_mode_public_function_control.json: ModelScan output for the
top-level control.keras_native_safe_mode_public_function_lab.py: generator and validation
script used to create the artifacts.1python -m venv .venv
2. .venv/bin/activate
3pip install keras==3.14.1 tensorflow==2.21.0 modelscan==0.8.8 matplotlib==3.10.9 pillow==12.2.0 numpy
4python verify_poc.py --require-modelscan1python -m venv .venv
2.\.venv\Scripts\Activate.ps1
3pip install keras==3.14.1 tensorflow==2.21.0 modelscan==0.8.8 matplotlib==3.10.9 pillow==12.2.0 numpy
4python verify_poc.py --require-modelscankeras.saving.load_model(..., safe_mode=True) succeeds.safe_mode_public_function_marker.png.modelscan scan -p safe_mode_public_function_nested.keras -r json reports
zero issues.modelscan scan -p safe_mode_public_function_top_level_control.keras -r json
reports a Lambda issue.91a95e3ef51cf69dd0e3aa448f66c976bac6bd51152d6bd8189a4fb960906521a2018f9ebccb565c8e7296659085a24dc41ac9f3a9d48a5af17a28406c2feaeeconfig.layers..keras artifacts that contain
Lambda layers, even when safe_mode=True, unless the full config has been
recursively inspected.