TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Sharing learnings about our image cropping algorithm

197 pointsby dsr12about 4 years ago

18 comments

codeulikeabout 4 years ago
Some context: They dont mention it directly but I think this refers back to this thread last september<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;colinmadland&#x2F;status&#x2F;1307111816250748933" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;colinmadland&#x2F;status&#x2F;1307111816250748933</a><p>(Note the thread displays differently now because Twitter have changed their cropping algorithm)<p>Originally @colinmadland was trying to post examples of how Zoom virtual background had removed his black colleagues head, however when he posted the side-by-side images (with heads) on Twitter, twitter always cropped out his colleague and just showed him, even if he horizontally swapped the image. So, while trying to talk about an apparently racist algorithm in Zoom, he was scuppered by an apparently racist algorithim in Twitter.<p>It was widely covered in the press at the time <a href="https:&#x2F;&#x2F;www.theguardian.com&#x2F;technology&#x2F;2020&#x2F;sep&#x2F;21&#x2F;twitter-apologises-for-racist-image-cropping-algorithm" rel="nofollow">https:&#x2F;&#x2F;www.theguardian.com&#x2F;technology&#x2F;2020&#x2F;sep&#x2F;21&#x2F;twitter-a...</a>
评论 #27214061 未加载
评论 #27217885 未加载
评论 #27217748 未加载
cmcknabout 4 years ago
So, I can choose to see only un-cropped images on my TL, and the author can see a preview of the algorithm&#x27;s crop before they tweet -- but a glaring omission is simply exposing a crop tool to the author. The model works by choosing a point on which to center the crop. Why can&#x27;t you give user&#x27;s a UI to do the same? &quot;Tap a focal point in the image, or let our robot decide!&quot;<p>The blog post mentions several times how ML might not be the right choice for cropping; but their conclusion was...to keep using ML for cropping. I hope someone got a nice bonus for building the model!
评论 #27215546 未加载
评论 #27213459 未加载
评论 #27213415 未加载
jedbergabout 4 years ago
Image cropping algorithms are hard. When we made our first one for reddit, it used this algorithm:<p>Find the larger dimension of the image. Remove either the first or last row&#x2F;column of pixels, based on which had less entropy. Keep repeating until the image was a square.<p>The most notable &quot;bias&quot; of this algorithm was the male gaze problem identified in the article. Women&#x27;s breasts tended to have more entropy than their face, so the algorithm focused on that since it was optimized for entropy. To solve the problem, we added software that allowed the user to choose their thumbnail, but not a lot of users used it or even realized they could.<p>I assume they&#x27;ve since upgraded it to use more AI with actual face detection and so on, but at the time, doing face detection on every image was computational infeasible.
评论 #27215078 未加载
评论 #27215530 未加载
评论 #27214036 未加载
评论 #27227974 未加载
评论 #27227930 未加载
评论 #27216863 未加载
评论 #27215281 未加载
评论 #27216648 未加载
评论 #27214185 未加载
Areibmanabout 4 years ago
&quot;We began testing a new way to display standard aspect ratio photos... without the saliency algorithm crop. The goal of this was to give people more control over how their images appear while also improving the experience of people seeing the images in their timeline. After getting positive feedback on this experience, we launched this feature to everyone.&quot;<p>So the solution all along was to give users the ability to crop their own photos. Why wasn&#x27;t this the original way of doing things?<p>Instead of forcing a complicated algorithm into the Twitter experience, it seems to me that the solution all along was just to let users do what they do best-- make tweets for themselves. This incident strikes me as a major failing of AI: We are so eager to shoehorn AI&#x2F;ML into our products that we lose sight of what actually makes users happy.
评论 #27215268 未加载
评论 #27217521 未加载
评论 #27214202 未加载
natpatabout 4 years ago
&gt; One of our conclusions is that not everything on Twitter is a good candidate for an algorithm, and in this case, how to crop an image is a decision best made by people.<p>This seems like it should have been a foregone conclusion. What was the driving force in the first place to think cropping images with an AI model was desirable? Seems like ML was a solution looking for a problem here, and I&#x27;m glad they&#x27;ve realised that.
评论 #27213047 未加载
评论 #27217587 未加载
评论 #27213395 未加载
gippabout 4 years ago
I&#x27;m more forgiving about corporate jargon than most. A lot of it really does help optimize communication for the situations you encounter in corporate work.<p>But &quot;learnings&quot; is literally, exactly, just a synonym for &quot;lessons.&quot; Can we not?
评论 #27213356 未加载
评论 #27213496 未加载
评论 #27213557 未加载
评论 #27212983 未加载
boulosabout 4 years ago
&#x2F;rant but I feel like talking about percentage points of difference is always hard for humans. For example:<p>&gt; In comparisons of men and women, there was an 8% difference from demographic parity in favor of women.<p>would have been clearer (and more correct) as &quot;an 8 percentage-point difference from demographic parity&quot;. That 8 pp difference though is a 16% &quot;relative&quot; difference (58&#x2F;50), or more starkly &quot;The algorithm chose the woman almost 40% more often&quot; (58&#x2F;42 =&gt; 1.38). That said, the diagram in the post [1] is much easier for humans to parse and say &quot;wow, that looks pretty far off!&quot;.<p>tl;dr: A number like 8% sounds like &quot;no big deal&quot;, but 8 percentage points (on each side) is a big deal!<p>[1] <a href="https:&#x2F;&#x2F;cdn.cms-twdigitalassets.com&#x2F;content&#x2F;dam&#x2F;blog-twitter&#x2F;engineering&#x2F;en_us&#x2F;insights&#x2F;2021&#x2F;imagecropping&#x2F;newimagecropchart.jpg.img.fullhd.medium.jpg" rel="nofollow">https:&#x2F;&#x2F;cdn.cms-twdigitalassets.com&#x2F;content&#x2F;dam&#x2F;blog-twitter...</a>
评论 #27215747 未加载
fwipabout 4 years ago
&gt; In comparisons of black and white individuals, there was a 4% difference from demographic parity in favor of white individuals.<p>It&#x27;s hard to believe that the bias was only 4% - there were a lot of people testing with images that they sourced themselves, and the preference for white people seemed much closer to 80-20.<p>The paper authors mention that their training data is from Wikidata (pictures of celebrities). I wonder if the types of photos in that dataset are meaningfully representative of the kinds of photos that people usually post to Twitter.
评论 #27215960 未加载
LinAGKarabout 4 years ago
How about letting people disable this cropping crap altogether
评论 #27214570 未加载
rwmjabout 4 years ago
Bias aside, the saliency algorithm doesn&#x27;t work well either. This twitter feed (SFW) <a href="https:&#x2F;&#x2F;twitter.com&#x2F;punhubonline" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;punhubonline</a> often shows the punchlines in the preview, spoiling the joke.
评论 #27213325 未加载
grenoireabout 4 years ago
Imagine the world where images aren&#x27;t algorithmically cropped. It&#x27;s easy if you try. No AI below us, above us only thumbnails.
评论 #27213958 未加载
ALittleLightabout 4 years ago
Shouldn&#x27;t they also check to see how frequently humans crop pictures to favor whites versus blacks, male versus female, and whether or not humans exhibit &quot;male gaze&quot; in their cropping decisions?<p>Going by the numbers they report all of the biases seemed relatively small. Slight favor for women over men and white over black and no evidence of male gaze - but single digit percentages in each case. I wouldn&#x27;t be surprised if humans were more biased than machines given the results I saw.
评论 #27218131 未加载
cratermoonabout 4 years ago
News flash: ML sucks. Most of the time.
umviabout 4 years ago
Possibly a political question but why is the word &quot;equitably&quot; more popular now than &quot;equally&quot;? I&#x27;m not sure when I first noticed this but it seems pretty recent that &quot;equity&quot; became more used than &quot;equality&quot; when referring to diversity and inclusivity
评论 #27217618 未加载
评论 #27216186 未加载
评论 #27217019 未加载
Causality1about 4 years ago
Those results are quite interesting. The bias is much smaller than I would have expected given how we&#x27;ve seen systems like facial recognition and face unlock behave.
Nick87633about 4 years ago
How about not calling this the male gaze? If we&#x27;re trying to remove bias FFS.
评论 #27214674 未加载
dmitrybrantabout 4 years ago
This is a very cynical take (I&#x27;m cranky from my second vaccine dose), but:<p>Imagine how much work, how much energy and effort, went into building an ML-based image cropping feature, just because an up-and-coming Designer decreed that a certain specific crop ratio was the most aesthetically pleasing to the human eye...<p>...so that years later, after countless hours of additional user research, they would just remove the feature because it doesn&#x27;t work, and award themselves a medal for doing it.
评论 #27218548 未加载
评论 #27218499 未加载
ameliusabout 4 years ago
I fear this is still horribly incomplete. E.g. if a picture shows brand A next to brand B, which brand will be cropped?
评论 #27215066 未加载