AppleNeuralHash2ONNX
AppleNeuralHash2ONNX copied to clipboard
NeuralHash classifier
I tried to build a classifier for NeuralHash: It gets NeuralHash as input and outputs class and probability.
I hashed all images of ILSVRC2012 dataset and trained the simple NN model.
Performance on the ImageNet validation dataset: (1,000 possible choices)
- Top-1 Accuracy: 5.25% (If random, 0.1% expected)
- Top-5 Accuracy: 14.09% (If random, 0.5% expected)
So... It seems that NeuralHash can't anonymize images well.
You can try this in Colab.
@kjsman I think you should use the outs[0].flatten()
as input, and NeuralHash is an embedding network which put out the outs[0].flatten()
of 128 dimension. The seed.dot(outs[0].flatten())
is the Local Sensitive Hashing Process, and the seed is the projection matrix of LSH.
@willard-yuan The goal of this project is to prove that NeuralHash cannot guarentee anonymity of image, so I used final form(including LSH) of NeuralHash because that is what Apple accesses.
This is a nice datapoint. What was the simple NN model you used? I'm wondering if we could learn something about which bits of the hash are biased.