# 8th Solutions + thoughts Congratulations everyone! Thanks to organizers for creating this competition, it's one of the best I ever took part in. Great idea with LLM types of challanges, super fun. It was a long run, many hours spent, but I learned a lot. Had around ~10 notebooks with different tasks. Most of them connected to passphrase (~15 days of fighting, unfortunately without flag). 2. Cluster - Level 1 Step one - find what is skop and how to use it. Step two - train new model with "cencus.csv" data and same structure as original. Step three - loop through dataset and compare original model with my, search for big differences. 3. Cluster - Level 2 Classical elbow can be drawn to determine number of clusters. Can use KMeans + model._intertia. I just guessed number 4. Cluster - Level 3 Used PCA and TSNE alghoritms to cast data into 3D, then interactive scatter 3D from plotly. A bit hard to navigate but managed to read all. 5. Count MNIST Realised that for shape (256, 2) there are 256 possible greyscale values -> challange name is count, so i counted how many time each pixel occurs. It didn't work because i used only training set, when added test set flag appeared. 6. Count CIFAR (not solved) Tested lot, nothing worked. Shape (100, 4) -> 4 is something like example row [125, 245, 0, 10000]. Could be [r,g,b,count], [median,max,min,count] or smth like this. Number 100 -> top 100? 100 classes? 100 batches? first 100 images? And lastly which dataset to use? Cifar-10, cifar-100, both, both without duplicates? I tested these ideas: Simple count of pixels as in mnist (then top 100) In how many images given pixel occurs (then top 100) Most pixels occurence for every class in cifar-100 (cause 100 classes) (mean, max, min ,count) top 100 (median, max, min, count) top 100 Simple count of pixels but different order (BGR, GBR, etc…) Most pixels occurence for batch (600 images per batch for cifar-10/cifar-100 or 1200 for both) Was thinking about binarization (100 bins), but for R G B 256 x 256 x 256 I couldnt find reasonable way (considering input_data clue) And more strange stuff… Maybe its about labels? Or filenames? Maybe images were augmented somehow? Normalized? 7. Granny - Level 1 and 8. Granny - Level 2 At the start I tried to send apple image but didn't work. Next I tried black-box. Random pixel placement didn't work well, didn't want to implement much because I was afraid that image gonna change too many pixels. Went for white-box approach. Tested tensorflow and pytorch, pytorch was giving better results, so I chose it. Later I googled MobileNetV2 preprocessing and I found kinda correct one (256 resize, 224 crop and norm std values). It wasn't perfect, but enough. One mistake I did was not specifying weights when loading mobilenet (I wasted ~2 days because of it). For attacking I used torchattacks library. Lot of attacks worked for Granny 1, but for Granny 2 it was a bit harder. Finally used torchattacks.VMIFGSM(model_torch, eps=/, alpha=/, steps=) These settings changes image much, but it was ok. Lastly u had to "revert" image -> transpose(1,2,0) becuase of pytorch shaping -> unnormalize * [0.229, 0.224, 0.225] + [0.485, 0.456, 0.406]) -> back to 0-255 scale -> add padding (becuase of center crop). ![wolf_image](assets/b666edac67b9e91556bbd033.png) 9. Granny - Level 3 (not solved) Granny3 was much harder, changing one pixel to get high Granny Smith score was super hard. Couldn't make torchattacks OnePixel to work, tried even to repair their script. Reading literature I found about DE alghoritm, but it didn't coverage well too. Most test I did on local model, because it was much faster (but maybe model on server was changed and that's why one pixel works?) I tried bruteforcing 224 x 224 image with different colors, but scores still low. Some other ideas: I tried to somehow insert high value into image and send it to server. Like 100000 for rgbs values, this way I think it would be easy to trick network, but couldn't find way of doing it. Maybe interpretable ML could help? SHAP ? Check which pixels contribute most for given class? It would narrow search, Maybe there is a way of providing more then one pixel? 10. Passphrase (not solved) Most of the time I spent here. You can interpret description and hints in many ways. I was mostly convinced of getting same score with some additional check or preprocessing. Here are some tries: - <- Spaces strip - <- Control characters add - <- Swap characters original sentence - <- Change casing lower/upper - <- Same structure original sentence - <- Guess sauce name - <- use swap random chars - <- Append words after original - <- Random test - <- Random test - <- Random test - <- Same structure diffrent - <- Change secret some text - <- Change secret sauce some text - <- Change ssauce some text - <- Use equivalent letters unicode - <- Change sauce something but keep length same - <- Change secret something but keep length same Tried to play with embeddings too. Nltk + gensim. Alghoritm for finding all of these texts was hill climbing + reset when stuck in local optima. Something like this: start_text = best_score = best_score != : new = change_somehow_text(start_text) new_score = score(new) new_score < best_score best_score = new_score start_text = new ... 11. Pixelated So first step I did was to create automatic way of text drawing. After having it I tested lot of texts and one of them destroyed XML. After seeing is_admin, I knew it is injection. I didn't work much with XML so had to do some research on how it works. Ocr was kinda bad, but adding additional spaces or doubling some chars did work for me. I tested different fonts too. txt = create_text() ![pixelated_answer](assets/0bb6566b54cc09b4649a278a.png) 12. Spanglish LLM models were super fun, for most of them I will just provide text which i used. I was manualy testing how model works. input_data = 13. Hush So main thing was to find out what these diffrent outputs means. To do it I tried ~200 diffrent random sounds (examples: car sounds, piano, music, asmr, whispering, reading, sound of silence, quiet sounds, different volumes etc…). After some time I realised that sounds with someone talking (or records of me talking), give more outputs. I decided to download some speech2Text dataset and test it on hush model. Choosed this one: [https://www.openslr.org/12](https://www.openslr.org/12) dev-clean.tar.gz (337mb!) I decided that I don't want to test all files, so I was picking random folders and testing them. I tested these folders: 84, 174, 1272, 251, 422, 652, 1462, 1673 (if someone wants to replicate) After testing server model with audios from dataset, this is what we got: Audios with transcription and their probabilities. Now we can analyse audios, transcription and probs for audios with high sum of outputs. Example: --.flac : . : . : METAL FOREST IS IN THE GREAT DOMED CAVERN THE LARGEST IN OUR DOMINIONS REPLIED KALIKO . . . . . . . . . . . . Looking at it You can conclude that "The" is first word and "the" is probably 6 word. Analysed lot of audios and found something like this: The you the more Googled something like this: "the you the more quote silence" and got answer which is: “The quieter you become, more you are able hear.” Which need to be in audio to get flag. I used [https://ttsmaker.com/](https://ttsmaker.com/) to create audio. 14. Pirate Flag LLM, I think task was to guide pirate which flag type I want. = 15. Semantle Solved by manual testing different words. 16. Semantle - Level 2 Score optimization with popular english words, after getting = = I googled woman woman man camera computer and got answer , , , Camera, TV 17. Inversion Similar task as year ago Generate X data (random/letters/only one pixel activated) Predict X and gather Y probs Train inverse model, smth like model.fit(Y, X) or draw probabilities After drawing I got something like this: ![img](assets/b4f177e9caad92a8847501f2.png) I knew that last year solution was kinda hard to read, and knew that theme are ghosts, so I realised that ghost want to tell me "letmeout" 18. What is the Flag - Level 1, Level 2, Level 3, Level 4 Just asked 22. What is the Flag - Level 5 Here I did lost of deep talks with model. Finally I tricked it this way: input_data = 23. What is the Flag - Level 6 Translate from other language seems to be nice trick = 24. Guess Who's Back? Used transform in photoshop, found that threshold is working (but didn't found exact values). ![sloth](assets/97f6a26ec8fcc759f71abfc2.png) 25. Pickle Read lot of articles about how pickle are dangreous, after some tries I found this one: pickle.dumps(eval, =5) This article was good: [https://intoli.com/blog/dangerous-pickles/](url) 26. What's my IP? Level 1, Level 2 After playing with model I tricked it using: = =