pygip.models.defense.BackdoorWM

Module Attributes

class pygip.models.defense.BackdoorWM.BackdoorWM(dataset, attack_node_fraction, model_path=None, trigger_rate=0.01, l=20, target_label=0)[source]

Bases: BaseDefense

_abc_impl = <_abc_data object>
_load_model()[source]

Load a pre-trained model.

defend()[source]

Execute the backdoor watermark attack.

evaluate_model(model, features, labels)[source]

Evaluate model performance

inject_backdoor_trigger(data, trigger_rate=None, trigger_feat_val=0.99, l=None, target_label=None)[source]

Feature-based Trigger Injection

supported_api_types = {'dgl'}
train_target_model()[source]

Train the target model with backdoor injection.

verify_backdoor(model, trigger_nodes, target_label)[source]

Verify backdoor attack success rate