GithubHelp home page GithubHelp logo

sewoonglab / spectre-defense Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 5.0 43 KB

Defending Against Backdoor Attacks Using Robust Covariance Estimation

License: MIT License

Python 75.56% Julia 24.44%
icml-2021 robust-statistics machine-learning backdoor-attacks

spectre-defense's People

Contributors

jhayase avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spectre-defense's Issues

Numerical errors on GTSRB with smaller class sizes

Hi, I was using your quantum filter code on GTSRB dataset, where number of inputs in each class could be really small (<200). And your quantum iterative algorithm on smaller classes seem to have suffered from several numerical errors in Julia: results being complex numbers, matrix not positive definite, etc.. I did the some quick fixes that somehow helped:

In quantum_filter.jl:

--- reps_estimated_white = Σ^(-1/2)*reps_pca
+++ reps_estimated_white = sqrt(Hermitian(Σ))\reps_pca
--- Σ′ = cov((Σ*re^(-1/2)ps_pca)')
+++ Σ′ = cov((sqrt(Hermitian(Σ))\reps_pca)')

In dkk17.jl:

Σ′ = S′*S′' ./ n
+++ Σ′ += 1e-8 * I
--- invsqrtΣ′ = Symmetric(Σ′)^(-1/2)
+++ invsqrtΣ′ = sqrt(inv(Symmetric(Σ′)))

Evaluating using My Own Code

Hi!

Thanks for the nice work.
I want to use the three approaches used here for comparison in my own pipeline.
What I do is that

  1. Train a model on my poisoned data.
  2. Evaluate the feature space representation of the training data using the trained model (ResNet-32, so it would be the output of the 'layer3' below).
    self.layer3 = self._make_layer(block, 64, num_blocks[2], stride=2)
    .
  3. Then, I use your Julia code to compute the samples that need to be removed for the target label.

Am I right? Because I am getting a mixed performance and I want to double check.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.