HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
AsuharietYgvar
AppleNeuralHash2ONNX
Python2021–2024
AsuharietYgvar / AppleNeuralHash2ONNX

AppleNeuralHash2ONNX

Convert Apple NeuralHash model for CSAM Detection to ONNX.

18Distinct people
30Mentions
0Explicit recommenders
1.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Convert Apple NeuralHash model for CSAM Detection to ONNX.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year30 dated mentions

Observed mentions: 2021-08-18 07:03:00 UTC to 2024-11-07 08:45:10 UTC.

01020302021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 27 mentions; 3 submissions, 24 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC27324
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

What Hacker News says

30 sources
Apple specifically mentioned CSAM when announcing the system. I don't understand why you find it weird that people refer to it as the system that detected CSAM when that's essentially what Apple was calling it. The scanning Apple wanted to do was intrusive, had flaws, and could be abused. That's why you had security researchers, the EFF, etc, speaking out against it. Not long after the announcement, people were sharing "collisions" on Github ( https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX/issue... ) showing that fake positives would be a problem (any alarm bells?)... which then forced Apple to say that there would be a v2 that would fix this (even though they had said that v1 was safe and secure). On top of ignoring these issues, you seem to be under the impression that the system was only for CSAM detection. It wasn't. The syste
Read the rest
m looked for content... and Apple was going to feed it a CSAM "database" to find that type of content. The problem is that Apple has to follow local rules and many governments have their own database of bad content to block (and report to the authorities)... and Apple usually complies instead of leaving the market. For example, in China, the state has access to encrypted data because Apple gave them the encryption keys per local law. They also ban censorship avoidance apps. For some reason this would be different? If you want to insist that it was just for CSAM and that people criticising Apple are pedos or are against companies combating CSAM, then do it, but do it with the knowledge that the system wasn't just for CSAM, that it could be tricked (and possibly ruin people's lives), and that it would likely been abused by governments.
In Private Cloud Compute Security Guide
I'm not big into "conspiracy" but you gotta wonder why this "NeuralHash" file on my computer exists if "NeuralHash" was supposedly delayed, according to Apple, on an undetermined timeline. If I did want to cook up conspiracy theory, it would be easy: Apple wants to distract from the fact that NeuralHash was broken by researchers. This project apparently is able to create CSAM collisions: https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX If NeuralHash is really rolled out, and if this python project can really create collisions, the CSAM system could be DDoS'd by people on their own computers, jamming up Apple's internal censorship review system with false positives. Hence, Apple would be incentivized to sweep this under the rug by "delaying" rollout indeterminately.
In Show HN: Use your iPhone's camera to see any photo on your wall
> I don't think you could just have a completely different picture create a collision though. Allow me to introduce you to my posts on github: https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX/issue... Where I post good looking examples of standard test images altered fairly subtly to give the specific hashes. The apple neuralhash is broken as a 'hash function'. It's much much easier to modify images to just have a different hash. A simple blemish on the image-- or, with whiteboxing using the hash function, no visually noticeable change is required at all.
In A Screeching Voice of the Minority
Neuralhash is a neural network. This means that its locally differentiable. To make an image match a specific hash, you pass the you want to modify image through neuralhash and compute a difference with your target hash, then ask your netural network library to use reverse mode automatic differentiation to give you the gradients for each of the outputs with respect to the input pixels. Update the input pixels. To make the collisions that look good, you need to either augment the objective to include some 'good looking' metric, or condition your gradient descent to prefer good looking results. In my examples ( https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX/issue... ) I used a gaussian blur to highpass the error between my starting image and the current work in progress, and fed that back in, and adapted the feedback to be as great
Read the rest
as possible while still keeping it colliding. The bad looking examples that people initially posted just did nothing to try to make the result look good. I'm thrilled to see that someone other than me has now also worked out getting fairly reasonable looking examples.
In Show HN: 59a34eabe31910abfb06f308 – NeuralHash Collision Demo
> it is predicated on the assumption that you can easily mangle pictures to NeuralHash-collide with a desired target picture (out of a set of widely circulating innocuous pictures) without deteriorating the visual content too much. You can. Here is an example I created (with links to more): https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX/issue... I'm so tired of people suggesting that you can't. Please explain to me why you posted suggesting otherwise. I've contemplated making some that are also photodna matches, I expect that it's possible. But access to photodna is only through some awful windows tools, and AFAICT people would just keep posting denials even after an example was posted-- so it's not worth the effort at least not worth it just to further the public discussion.
In A catalog of naturally occurring images whose Apple NeuralHash is identical
> Apple have a list of photos they know are CSAM, or rather hashes of them Technically, that government agencies claim are CSAM and the "hash" is highly vulnerable to preimage attacks: I can take random unrelated photos and make them match other hashes, https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX/issue... This means people can take child porn images and modify them so they match targeted innocent images, and take innocent images and modify them so they match child porn.
In Nirvana sued by the man who appeared on Nevermind’s album cover as a baby
Why are exact collisions interesting? They are not intended to be compared exactly. This algorithm doesn't even give exact matches for the same image on different hardware. https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX Note: Neural hash generated here might be a few bits off from one generated on an iOS device. This is expected since different iOS devices generate slightly different hashes anyway. The reason is that neural networks are based on floating-point calculations. The accuracy is highly dependent on the hardware. For smaller networks it won't make any difference. But NeuralHash has 200+ layers, resulting in significant cumulative errors.
In A catalog of naturally occurring images whose Apple NeuralHash is identical
> There are no news articles that explain how anyone will be falsely accused for having pictures of their own baby. Umm... hash collisions that everyone keeps warning about is not enough?, all the discussions so far, I'll just go ahead and assume your comment here is in bad faith. > The system is even resistant against intentionally created false positives. Famous last words... Here's one of the top posts for reddit.com/r/apple https://old.reddit.com/r/apple/comments/p930wu/i_wont_be_pos... Here's a really high quality collision: https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX//issu... Here's 2 totally different images off by a single BIT: https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX//issu... Here's a dog and a kid colliding: https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX//issu... It took a few days after extracti
Read the rest
ng the model to show how flawed it is... Apple's only 'security' feature here was obscurity... It's so broken the person doing analysis above stopped as Apple will only change the hash function to include his pictures as training data instead of fixing the whole system. Are you still convinced? Having a second 'perceptual' hash doesn't really add much value... I'm not an expert, here's a better view on why: https://news.ycombinator.com/item?id=28243031 Also funniest bit from that on how broken it is "Finding a SHA1 collision took 22 years, and there are still no effective preimage attacks against it. Creating the NeuralHash collider took a single week."
In Apple Just Gave Millions of Users a Reason to Quit Their iPhones
nullc·Aug 21, 2021Submission

I won't be posting any more preimages against neuralhash for now

I've created and posted on github a number of visually high quality preimages against Apple's 'neuralhash' [1][2] in recent days. I won't be posting any more preimages for the moment. I've come to learn that Apple has begun responding to this issue by telling journalists that they will deploy a different version of the hash function[3]. Given Apple's consistent dishonest[4] conduct on the subject I'm concerned that they'll simply add the examples here to their training set to make sure they fix those, without resolving the fundamental weaknesses of the approach, or that they'll use improvements in the hashing function to obscure the gross recklessness of their whole proposal. I don't want to be complicit in improving a system with such a potential for human rights abuses. I'd like to encourage people to read some of my posts on the Apple
Read the rest
proposal to scan user's data which were made prior to the hash function being available. I'm doubtful they'll meaningfully fix the hash function-- this entire approach is flawed-- but even if they do, it hardly improves the ethics of the system at all. In my view the gross vulnerability of the hash function is mostly relevant because it speaks to a pattern of incompetence and a failure to adequately consider attacks and their consequences. - https://news.ycombinator.com/item?id=28111959 Your device scanning and reporting you violates its ethical duty as your trusted agent. - https://news.ycombinator.com/item?id=28111908 Apple's human review exists for the express purpose of quashing your fourth amendment right against warrantless search. - https://news.ycombinator.com/item?id=28121695 Apple is not being coerced to perform these searches and if they were that would make their actions less ethical, not more. - https://news.ycombinator.com/item?id=28097304 Apple uses complex crypto to protect themselves from accountability. - https://news.ycombinator.com/item?id=28124716 A simplified explanation of a private set intersection. - https://news.ycombinator.com/item?id=28101009 Perceptual hashes at best slightly improve resistance to false negatives at the expense of destroying any kind of cryptographic protection against false positives (as this thread has shown!). Smart perverts can evade any perceptual hash, dumb ones won't alter the images. - https://news.ycombinator.com/item?id=28097508 Apple's system and ones like it likely create an incentive to abuse more children And these posts written after: - https://news.ycombinator.com/item?id=28260264 A second "secret" hash function cannot be secret from the state actors that produce the database for Apple. - https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX//issu... fuzzy hashes with resistance against false positives tracable to sha256 are possible, but require you to value privacy over avoiding false negatives. [1] https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX//issu... [2] https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX//issu... [3] "Apple however told Motherboard in an email that that version analyzed by users on GitHub is a generic version, and not the one final version that will be used for iCloud Photos CSAM detection." https://www.vice.com/en/article/wx5yzq/apple-defends-its-ant... [4] https://news.ycombinator.com/item?id=28221538
196 points · Open discussion
The invocation of 30 images like it's a barrier confuses me. I created a bunch of preimages posted on github, I could easily create 30 or 3000 but at this point all I'd be doing is helping apple cover up their bad hash algorithm[1]. I pointed out above that the attacker could use legal pornography images selected to make it look like child porn. This isn't hard. Doing it 30 times is no particular challenge. I didn't use pornographic images in the examples I created out of good taste, not because it would be any harder. [1] I've made a statement that I won't be posting any more preimages for now for that reason: https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX/issue...
In EFF Joins Global Coalition Asking Apple CEO Tim Cook to Stop Phone-Scanning
> You’d have to not only have over 30 hash collisions That's trivial. If the attacker can get one image onto your device they can get several. It's very easy to construct preimages for Apple's neural hash function, including fairly good looking ones (e.g. https://github.com/AsuharietYgvar/AppleNeuralHash2ONNX/issue... ) > collide with another secret hash function The supposed other 'secret' hash function cannot be secret from the state actors generating the databases. Also, if it has a similar structure/training, it's not that unlikely that the same images would collide by chance. > also have a human look at it and agree it’s CP That's straight-forward: simply use nude or pornographic images which looks like they could be children or ones where without context you can't tell. It's a felony for them to fail to report child porn if they
Read the rest
see it in review, and the NCMEC guidance tells people when in doubt to report. Besides, once someone else has looked at your pictures your privacy has been violated.
In EFF Joins Global Coalition Asking Apple CEO Tim Cook to Stop Phone-Scanning

Showing the 15 most recent of 30 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.