# Solution to Inversion

After some research I found that this challenge looked similar to last years "Interference" challenge. The 8 outputs most likely correspond to multi-class classification. Submitting a ASCII character, the model tells you at which position in the static_flag the character most likely appears.
Similar to cdeotte's
[notebook](https://www.kaggle.com/code/cdeotte/solutions-d3fc0n-ctf-lb-0-894#Inference-(id:-inference)----400-Points)
, I prepear 1024=32x32 images with all pixels set to 1 except for one pixel, which is set to 0.4. Then I query the API for every image and save the 8 outputs as importance of the pixel for a given position. For positions 0,1,2,3,6 this gives a relativele clear image of the character. However for 4,5,7 this is not the case. No matter how hard I tried I could not get an inversion of those 3 characters. This is probably where most people got stuck.
After a day of thinking   about possible reasons for that and under the assumptions that to organizers would probably not do something that requiereblunt brute-forcing of the last 3 characters, it appeared to me.
What if the 8 characters are not unique.
Or at least look very similar. If in addition there is some imbalance in the training set the model would most certainly prefer one of the classes with the same character among them.
So I started to plot the clear images over the positions 4,5,7 and all of a sudden I could read "letmeout" - the static key.
[https://www.kaggle.com/code/josefleutgeb/inversion](https://www.kaggle.com/code/josefleutgeb/inversion)