Live data from Hacker News

Extracting AI models from mobile apps

altayakkus.substack.com

171–180 of 250 posts

Re: Extracting AI models from mobile apps

#171
post #142
post #16

Well done you seem to have liberated an open model trained on open data for blind and visually impaired people. Paper: https://arxiv.org/pdf/2204.03738 Code: https://github.com/microsoft/banknote-net Training data: https://raw.githubusercontent.com/microsoft/banknote-net/ref... model: https://github.com/microsoft/banknote-net/blob/main/models/b... Kinda easier to download it straight from github. Its licenced under M…

> But lets not let that get in the way of hating on AI shall we? Can you please edit this kind of thing out of your HN comments? (This is in the site guidelines: https://news.ycombinator.com/newsguidelines.html .) It leads to a downward spiral, as one can see in the progression to https://news.ycombinator.com/item?id=42604422 and https://news.ycombinator.com/item?id=42604728 . That's what we're trying to avoid here.…

I don't seem to be able to edit it, apologies I will try not to let this type of thing get to me in future.

I would also like to point out that this is a fine tuned classifier vision model based on mobilenetv2 and not an LLM.

Re: Extracting AI models from mobile apps

#172

Earlier quoted context omitted.

Newton was public domain by Einstein's time.

Indeed. Copyright was introduced in 1710, Principia was published in 1687.

and even with our current copyright laws providing for long dated protection, it would have still been in public domain

Re: Extracting AI models from mobile apps

#173
post #47

This is cool, but only the first part in extracting a ML model for usage. The second part is reverse engineering the tokenizer and input transformations that are needed to before passing the data to the model, and outputting a human readable format.

This is a good comment, but only in the sense it documents a model file doesn't run the model by itself. An analogous situation is seeing a blog that purports to "show you code", and the code returns an object, and commenting "This is cool, but doesn't show you how to turn a function return value into a human readable format" More noise, than signal. The techniques in the article are trivially understood to also appl…

Just having the shape of the input and output are not sufficient, the image (in this example) needs to be normalized. It's presumably not difficult to find the exact numbers, but it is a source of errors when reverse engineering a ML model.

Re: Extracting AI models from mobile apps

#174

Earlier quoted context omitted.

Indeed. Copyright was introduced in 1710, Principia was published in 1687.

and even with our current copyright laws providing for long dated protection, it would have still been in public domain

It's hard to say what the current laws actually imply. Steamboat Willie was originally meant to be in the public domain in 1955. Got there in 2024.

Re: Extracting AI models from mobile apps

#175

For app developers considering tflite, a safer way would be to host the models on firebase and delete them when their job is done. It comes with other features like versioning for model updates, A/B tests, lower apk size etc. https://firebase.google.com/docs/ml/manage-hosted-models

That wouldn't help against the technique explained in the article, would it? Since the model makes it way into the device, it can be intercepted in a similar fashion.

I'm not quite sure I understand the firebase feature btw. From the docs, it's pretty much file storage with a dedicated API? I suppose you can use those models for inference in the cloud, but still, the storage API seems redundant.

Re: Extracting AI models from mobile apps

#176

Earlier quoted context omitted.

I really don't think it's that simple. I can read books and then earn money from applying what I learned in them. I can also study art and then make original art in the same or similar styles. If a person was doing this there would be no one claiming copyright infringement. The only difference is it's a machine doing it and not a person. The nature of copyright and plagiarism boils down to paraphrasing, and so long a…

> I can read books and then earn money from applying what I learned in them. How many books can you read, understand and memorize in T time, and how many books an AI can ingest in the T time? If we're down to paraphrasing, watch this video [1], and think again. Many models, given that you ask the correct questions, reproduce their training set with great accuracy, and this is only prevented with monkey patching, IIUC…

I agree it's a big mess, that was kind of my point.

I am curious about the video, but am not compelled to spend 24 min watching it when you haven't summarized its thesis for me. The title of the video makes it seem adjacent at best to the points I was making. (Some automated flagging system =/= actual law)

Re: Extracting AI models from mobile apps

#177

For app developers considering tflite, a safer way would be to host the models on firebase and delete them when their job is done. It comes with other features like versioning for model updates, A/B tests, lower apk size etc. https://firebase.google.com/docs/ml/manage-hosted-models

In addition to the sibling comment this would require repeatedly re-downloading models when you want to use them, which sucks.

Re: Extracting AI models from mobile apps

#178
post #47

This is cool, but only the first part in extracting a ML model for usage. The second part is reverse engineering the tokenizer and input transformations that are needed to before passing the data to the model, and outputting a human readable format.

Would be interesting if someone could detail the approach to decode the pre-post processing steps before it enters the model, and how to find the correct input encoding.

Boils down to "use Frida to find the arguments to the TensorFlow call beyond the model file"

Key here is, a binary model is just a bag-of-floats with primitively typed inputs and outputs.

It's ~impossible to write up more than what's here because either:

A) you understand reverse engineering and model basics, and thus the current content is clear you'd use Frida to figure out how the arguments are passed to TensorFlow

or

B) you don't understand this is a binary reverse engineering problem, even when shown Frida. If more content was provided, you'd see it as specific to a particular problem. Which it has to be. You'd also need a walkthrough by hand about batching, tokenization, so on and so forth, too much for a write up, and it'd be too confusing to follow for another model.

TL;Dr a request for more content is asking for a reverse engineering article to give you a full education on modal inference

Re: Extracting AI models from mobile apps

#179
post #173

Earlier quoted context omitted.

This is a good comment, but only in the sense it documents a model file doesn't run the model by itself. An analogous situation is seeing a blog that purports to "show you code", and the code returns an object, and commenting "This is cool, but doesn't show you how to turn a function return value into a human readable format" More noise, than signal. The techniques in the article are trivially understood to also appl…

Just having the shape of the input and output are not sufficient, the image (in this example) needs to be normalized. It's presumably not difficult to find the exact numbers, but it is a source of errors when reverse engineering a ML model.

Right, you get it: it's a Frida problem.

Re: Extracting AI models from mobile apps

#180

> Keep in mind that AI models [...] are considered intellectual property Is it ironic or missing a /s? I can't really tell here.

For now, it is better to assume it is the truth.

The simple fact that models are released under license, which may or may not be free, imply that it is intellectual property. You can't license something that is not intellectual property.

It is a standard disclaimer, if you disagree, talk to your lawyer. The legal situation of AI models is such a mess that I am not even sure that a non-specialist professional will be of great help, let alone random people on the internet.

Post reply on HN