0

When iCloud photo is enabled, all photos are uploaded to iCloud and only a low-resolution copy is saved on the phone for browsing, the high res photo is download on-demand if the user clicks it.

Photos app will perform on-device machine learning when the device is not in use and is charging(typically while you’re sleeping) to detect faces in your photo library so that you have “people albums”. This is just one case that the app is using ML to achieve.

What confuses me is that the low res images are just not good enough to perform ML on, especially for face detection. So how can it analyze those low-res photos and giving the correct prediction?

I have two guesses:

  • Don’t care low or high res, just analyze what is on the device. (I don’t really believe this is the case as the face detection is too accurate to be believed that they were a result of ML on 480p photos)

  • On-demand loading, download the original photo from iCloud while the ML algorithm is running, and delete the original photo from the device when it is done. (Isn’t this a bandwidth waste for iCloud servers?)

Edit 1: I’m interested in how will it handle the case when I manually added some photo to one person(this action causes the model to change, well, eventually change after it learns the new photos that weren’t detected previously), all photos must be analyzed again using the new model. At this time, most high-resolution images (let's say 199GB/200GB) are in iCloud only, so will the system pull them one by one to perform ML using the new model again? What if I “edit” the ML regularly? (by adding an un-detected photo to people album but not all at once) If so, this could be a huge drain to the iCloud servers... don’t forget some people do have more than 1TB of photos in iCloud.

Edit 2:

Don't take me wrong, I'm purely interested in how this whole thing works because to me it is done very nicely. And to be clear, I completely trust Apple on the "on-device" promise, and this is exactly why I asked this question to get an understanding of the technical details that make it both respecting privacy and giving accurate results.

2 Answers 2

2

Obviously the phone cannot do its work without the data - so it performs the on-device ML right after the photo was taken, before it is uploaded to iCloud and deleted on device - or if that wasn't possible - it downloads the photo data from iCloud and performs the on-device ML (without necessarily storing the photo on the device).

Whether or not that is a "bandwidth waste" is fully subjective. If you care about the privacy benefits on performing ML on-device, it is not a waste - if you do not care, it could be seen as a waste.

UPDATE: With your edit, you added a question on what happens if you add new information after the fact - for example changing a name, adding a photo to a specific detected person, etc. Actually the phone does not need to download all photos again to do the whole thing all over.

When the phone has the original image, it can extract features from the photo using machine learning. It is not known exactly which features iPhoto look at, but imagine extracting numbers such as the distance between the eyes, the color of the eye, etc. Another type of machine learning then can group thee numbers into classifications of individuals, which you them can name.

These numbers are stored on the phone and allow for you to update certain information and “recalculate” the detected persons without actually needing the full image data again.

4
  • I agree that it must have done the ML with data on device, but my curiosity asks me how exactly it does it work, I know this may not be possible to tell without digging into the code which is impossible... I’m interested how will it handle the case when I manually added some photo to one person(this action causes the model to change, well, eventually change after it learns the new photos that weren’t detected previously), all photos must be analyzed again using the new model. I can’t imagine how much work it is doing while I’m asleep... haha
    – MiDaa
    Feb 27, 2021 at 16:14
  • I’ve add Edit 1 to the question for better illustration of what I’m curious about.
    – MiDaa
    Feb 27, 2021 at 16:20
  • The more this question gets edited, the more it seems off topic or an XY question.
    – bmike
    Feb 27, 2021 at 20:19
  • Thanks for your update, saving the extracted features is totally enlightening!
    – MiDaa
    Feb 28, 2021 at 8:54
0

I would wager the thumbnails that are present and the metadata are sufficient for the models to run on your device. This seems more like an indirect question though. If it just works, what’s the issue with how Apple implements it. If you’re trying to ask if Apple is lying or mistaken about how they handle privacy, we should address that clearly.

I think your premise isn’t totally correct about needing to download anything. The models run on the data on the device. You can test this by adding photos from files storage while the device is offline in AirPlane mode and no WiFi and letting the nightly tasks run when connected to power.

3
  • >I think your premise isn’t totally correct about needing to download anything. The models run on the data on the device. Have you actually tried this? Unless you have, my assumption would be that it does download the photos so that it can run on-device.
    – Ezekiel
    Feb 27, 2021 at 21:29
  • Yes I have tried this. Why would I post it otherwise? The wager is how the algorithm reruns and when, not that on device results update offline. Sorry if I wasn’t super clear @EzekielElin
    – bmike
    Feb 27, 2021 at 21:32
  • Your phrasing didn't make it clear to me whether this was a test you were proposing or had already tried - my bad
    – Ezekiel
    Feb 28, 2021 at 20:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .