Can you generate an image to fit the following features?

  • Context: Graduate 
  • Thread starter Thread starter Povilas M
  • Start date Start date
  • Tags Tags
    Fit Image
Click For Summary

Discussion Overview

The discussion revolves around the feasibility of generating an image that meets specific criteria derived from K-Means clustering of brightness levels. Participants explore the technical aspects of image generation, clustering algorithms, and the potential for creating a robust algorithm for this purpose.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • Povilas describes a method of generating an ID from an image using K-Means clustering to categorize brightness levels into eight clusters, detailing the parameters used for each cluster.
  • Some participants suggest that creating a new image to satisfy the clustering criteria should not be overly difficult, as the values describe the rough shape and require fine-tuning.
  • Povilas expresses concern about the complexity of distributing the clusters while meeting all criteria simultaneously, suggesting potential high time complexity.
  • Participants discuss the smoothness of parameters when changing individual pixels and the challenges of achieving exact results in an optimization process involving many dimensions.
  • There is a suggestion to consider developing a faster algorithm for generating images that meet the specified criteria, with an emphasis on batch processing.
  • One participant proposes using SHA-2 as a one-way function for images, but Povilas notes that it would not accommodate minor differences in images taken multiple times.
  • Another participant argues that if minor differences are not considered, creating a fake image could be feasible with the right analysis and reconstruction algorithm.

Areas of Agreement / Disagreement

Participants express differing views on the feasibility and complexity of generating an image that meets the specified clustering criteria. While some believe it is manageable, others highlight significant challenges, indicating that the discussion remains unresolved.

Contextual Notes

The discussion includes assumptions about the behavior of clustering algorithms and the nature of image manipulation, which may not be universally applicable. The feasibility of generating images under the outlined constraints is contingent on various factors that remain unaddressed.

Povilas M
Messages
9
Reaction score
1
Currently I am generating an ID from an image by using K-Means to separate brightness levels into 8 levels (clusters) and order them brightest to darkest. For each cluster I calculate:
1) Their center points as a percentage of image size (using average pixel coordinates)
2) Average distance of points from the center as a percentage of image size
3) Angle between horizontal axis and the line along which the distribution is the highest
4) Percentage of total area occupied

ID example (a total of 8 entries in each list (entry per cluster)):
Centers = [24%, 77%], [56%, 29%], [58%, 87%], ...
Average distance of point from center of cluster = 12%, 17%, 9%, 30%,...
Angle between horizontal axis and the highest distribution line (0 to 180 i.e. non-directional) = 55, 10, 155,...
Area occupied = 7%, 16%, 10%,...

For my purposes it should not be possible to generate an image with the same ID by using the original image ID. But would it be possible to do that? I'm only asking about feasibility of creating an image to fit that criteria, not necessarily how you'd do it.

Please ask if anything is unclear - I do feel like the question can be confusing. Thanks for your time,
Povilas

P.S. Sorry if I posted in the wrong sub-forum, I was not sure where I should ask this.
 
Mathematics news on Phys.org
I don't understand how your clustering works, but I don't see why it should be difficult to make a new picture that satisfies your criteria for the clusters. Your values basically describe the rough shape, and then you need some fine-tuning to get the clusters right.
 
  • Like
Likes   Reactions: Povilas M
mfb said:
I don't understand how your clustering works, but I don't see why it should be difficult to make a new picture that satisfies your criteria for the clusters. Your values basically describe the rough shape, and then you need some fine-tuning to get the clusters right.
Thanks for the quick reply, mfb.

To elaborate on why, in my eyes, the task would be difficult, I have processed a small image with the criteria visually represented (which you can see here). The eight gray shades each represent a cluster. The white bordered circles are their centers. Lines leaving the centers go along highest distribution (angle might be imprecise - still working on the algorithm) and their length indicates average point distance from the centre. Finally, colour inside of lines indicates to which cluster they belong.

I believe the complexion would come from having to distribute the 8 clusters so that all the criteria for each one of the clusters is met at the same time. As the clusters are detailed and intertwined (not just blobs), I imagined it would be a problem with huge time complexity. What are your thoughts?

Thanks again :)
 
Povilas M said:
(which you can see here).
Interesting image... What was the base image of?
 
berkeman said:
Interesting image... What was the base image of?
The base image was a new type of hologram (as in security sticker type, not the 3d image type) that can have various random patters on it, sometimes resembling landscape. I'm not sure which one I used for this one (I have quite a few) so I can't give you an original image.
 
All the parameters are smooth if you change individual pixels, unless the clustering algorithm does something weird (but I guess you can make an artificial image where the clustering result is well controlled). This is an optimization process in 32 dimensions, with thousands of pixels you can manipulate to slowly approach the right solution. If you want exact results it could be very challenging.
 
  • Like
Likes   Reactions: Povilas M
mfb said:
All the parameters are smooth if you change individual pixels, unless the clustering algorithm does something weird (but I guess you can make an artificial image where the clustering result is well controlled). This is an optimization process in 32 dimensions, with thousands of pixels you can manipulate to slowly approach the right solution. If you want exact results it could be very challenging.
Thank you so much! That is very useful info :)

One last thing I'd like to ask: do you think it would be possible to create an algorithm to do this faster? The reason I posted in a maths forum in the first place is to really see how robust it might be - maybe someone will find a way. As long as it's very challenging it should be fine - somebody doing this for individual cases at relatively high cost would be fine. What I'm really looking out for is some way to do this fast and in big batches - that may force me to come up with a whole new way of doing things.
 
If you just want some one-way function for an image, what is wrong with good old SHA-2?
Easy to implement, easy to calculate, and certainly hard to reverse.
 
  • Like
Likes   Reactions: Povilas M
mfb said:
If you just want some one-way function for an image, what is wrong with good old SHA-2?
Easy to implement, easy to calculate, and certainly hard to reverse.
The picture of the tag would be taken multiple times and it needs to be able to tell if it's the same tag. Because there will be minor imprecisions when taking separate photos, SHA-2 would not do it, as it would generate a completely different key for the images. A bit of error should be tolerable.
 
  • #10
Ah, so you don't want to consider small differences.

Then faking an image will be easy. Sure, you have to sit down and analyze what is going on, write an image reconstruction algorithm and so on, but it is certainly possible for someone interested in it.
 
  • Like
Likes   Reactions: Povilas M

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 49 ·
2
Replies
49
Views
6K
  • · Replies 9 ·
Replies
9
Views
1K
  • · Replies 46 ·
2
Replies
46
Views
8K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 9 ·
Replies
9
Views
5K