<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sonny Kong on Medium]]></title>
        <description><![CDATA[Stories by Sonny Kong on Medium]]></description>
        <link>https://medium.com/@whysonnykong?source=rss-c48839ef94e5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Fyxk4R7qnQipZNfY.jpg</url>
            <title>Stories by Sonny Kong on Medium</title>
            <link>https://medium.com/@whysonnykong?source=rss-c48839ef94e5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:11:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@whysonnykong/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Content Based Indie Fashion Recommender]]></title>
            <link>https://medium.com/@whysonnykong/content-based-indie-fashion-recommender-55b59d506c5c?source=rss-c48839ef94e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/55b59d506c5c</guid>
            <dc:creator><![CDATA[Sonny Kong]]></dc:creator>
            <pubDate>Thu, 26 Jan 2023 21:27:17 GMT</pubDate>
            <atom:updated>2023-01-26T22:01:10.157Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://sonnochio-indiscover-indiscoverfront-end-j8efv5.streamlit.app/">front end · Streamlit</a></p><p>Before this New Year, and after hearing about not getting enough recognition and fast fashion nightmares from my designer friend, I wanted to build her a fun present to lighten her mood.</p><p>I thought about an ML web app that can recommend all her designs based on user interest. This way, the general fashion enthusiasts will have better access to the indie market and a fun tool to discover new items they never knew they needed. Upon training on her 20 datapoint set and building a random recommender (you might think the model would output any image purely by chance), I thought to scrape an entire fashion marketplace (<a href="https://ap0cene.com/">https://ap0cene.com</a>) and build a multi-input recommender called <strong>inDiscover (indie fashion discover)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BcB-277Hkpks_9nrWlJAQ.png" /><figcaption>A fun name for the app: inDiscover (short for Indie Fashion Discovery)</figcaption></figure><p>The recommender takes two inputs, text and image (either or both), and returns a similar product from an indie designer. The workflow is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nvtyj_UIeQRG_ViZxAiEig.png" /></figure><p>The problem we are trying to solve here is to match conceptual/experimental designs to relatively simple ones. I also wanted to build the recommender purely based on content: not only because I have no access to the user data but also want to break the conventional shopping habit, which a collaborative filtering (behavioral-based) recommender tends to encourage.</p><p>The system starts with only image recommendations. I chose to use a <strong>Convolutional Neural Network (CNN) Autoencoder </strong>that extracts the features of an image and reduces its dimensionality. Achieving some hit-or-miss results, I added a text search to the system, which improves the overall prediction and also gives users an additional channel to describe their item in mind.</p><p><strong>Data Collection: Web Scraping</strong></p><p>The scraping happens in 3 steps: designer pages → products of a designer → pictures of a product. The data collected was built into the data frame with the image name indexed the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ws_IPmRqEGDY4WQYovhafA.png" /></figure><p><strong>Preprocessing: Language Cleaning and Image Standardization</strong></p><p>The text clean involves removing punctuations, and stop-words using regex then is tokenized for embedding. The images are standardized to the same format and size.</p><p>New things I learned: I learned that some \xn(number) characters read as blank spaces, and you can apply functions to multiple data frame columns.</p><p><strong>Embedding: tf-idf and CNN Autoencoder</strong></p><p>We embed product descriptions with <strong>the term frequency-inverse document frequency (tf-idf)</strong>.</p><ul><li><strong>tf-idf</strong> refers to the inverse relationship between the frequency of a term that exists in a document of text versus all documents. In our case, words like “fashion”, and “design” might exists in all product descriptions, which does not help label a product.</li></ul><p>Each word is then embedded with its tf-idf score, often unique, and each sentence is padded to the same length.</p><p>An <strong>Autoencoder</strong> is a 2-part model that learns to describe information more efficiently.</p><ul><li>The first part, <strong>the encoder</strong>, describes text or image in a set of numbers called the <strong>latent space</strong>.</li></ul><p>For example, the is latent space embedding for the image below. (size: 50):</p><pre>array([0.54112273, 0.5207264 , 0.43711767, 0.5870103 , 0.47693127,<br>       0.4346625 , 0.53298163, 0.5775209 , 0.4736583 , 0.43712258,<br>       0.39662486, 0.5101728 , 0.53224534, 0.6193619 , 0.4092492 ,<br>       0.46882647, 0.54291683, 0.50116944, 0.5047414 , 0.4988493 ,<br>       0.5826986 , 0.46425742, 0.49785867, 0.48322788, 0.43264905,<br>       0.3712415 , 0.4788214 , 0.38786924, 0.48880413, 0.39028835,<br>       0.50116724, 0.6235617 , 0.5263689 , 0.62040055, 0.54494613,<br>       0.460657  , 0.562927  , 0.48505044, 0.44712105, 0.4087257 ,<br>       0.52394325, 0.48173392, 0.5270527 , 0.49126613, 0.5428006 ,<br>       0.4156157 , 0.5065286 , 0.41365814, 0.56506574, 0.5031285 ],<br>      dtype=float32)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*cT-WJOh5_oJhoIrSzHTRjw.png" /><figcaption>Image from Fashion Product Images (Small) on Kaggle</figcaption></figure><ul><li>The <strong>decoder</strong> reads the numbers and recover the original image.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*NVmLGZay1wpwXpIn3TaBKQ.png" /><figcaption>Original pictures (left) and recovered pictures (right)</figcaption></figure><p>A problem I encountered was loading all the images for an encoder. After running out of storage and crashing my machine, I learned to process images in chunks and save them as a latent space array to reduce dataset size.</p><p>The model also lacks specificity due to its embedding dimension and sometimes produces random output with the same input.</p><p><strong>Cosine Similarity:</strong></p><p>Cosine similarity is a pair-wise measurement between 2 vectors. All product images calculate their cosine similarity score relative to the query image. Products with the best similarity in text or product returns as output. Similar goes with product description text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*K3xDn-x2iWvIZSxxMy39gw.png" /></figure><p>In the case of two input types, the products get sorted according to their text similarity, and only the top 100 products are preserved before an image similarity search.</p><p><strong>Packaging, User Experience Design and Deployment:</strong></p><p>The app is now live on streamlit. The image search includes a cropping add-on, which allows users to crop an image to their desired focus, especially to emphasize the item they want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Andn_bHqh5I273VgutXNpg.png" /></figure><p>Those were the functions of the <strong>inDiscover minimum viable product (MVP)</strong>. Given more time, the project will look at its stretch goals:</p><ul><li><strong>Use Transfer learning models:</strong> <strong>Resnet</strong> and<strong> R-CNN </strong>to better locate and embed the item within an image.</li><li><strong>Use</strong> <strong>SentenceTransformer</strong> better embed the product description.</li><li>Operate fully on-cloud with new data, and automate a staging to production flow.</li><li>Allow indie designers to upload their products directly to the app.</li></ul><p>There’s a lot more that could be done, but I have to put a pause on the project for now. Supporting indie designers not only helps young designers get heard and reduces fast fashion waste but also is a way to discover a new identity. I would encourage everyone to explore new clothes and new interests with the help of machine learning.</p><p>#MachineLearning #Fashion #Autoencoder #Recommendation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55b59d506c5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Much Love for Cinema Paradiso]]></title>
            <link>https://medium.com/@whysonnykong/much-love-for-cinema-paradiso-78b34a2d2444?source=rss-c48839ef94e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/78b34a2d2444</guid>
            <category><![CDATA[acting]]></category>
            <category><![CDATA[film]]></category>
            <category><![CDATA[cinema-paradiso]]></category>
            <dc:creator><![CDATA[Sonny Kong]]></dc:creator>
            <pubDate>Sun, 01 Jan 2023 20:06:13 GMT</pubDate>
            <atom:updated>2023-01-01T20:53:22.830Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VdC6z7kcRnzTM2IDOkd6fA.jpeg" /></figure><p>Cinema Paradiso is a beautiful film about moving forward, hometown, and love for film. The story begins with a young kid named Toto, a frequent visitor of the only cinema in town, becoming friends with the projectionist Alfredo. The two soon developed a lovely father-and-son-like relationship. They helped each other out in many places, especially when Toto was after a girl from a well-off family named Elena. After Elena moves away for college, Toto takes advice from Alfredo and leaves the city, later becoming a well-known director.</p><p>There are many surprises in this film for me. The child actor playing young Toto and his innocence were alive throughout the early part of the film. I felt a sense of relief and permission to be much simpler and chase after what I wanted. The young actor is also extremely lovable and does every action without hesitation. He was almost as pure as a child can be and owned it and offered his world to audiences like me, who have forgotten much about their childhood.</p><p>The second one was the logic of the film. There was no dramatic power playing. After Elena’s father found out his daughter was dating a guy who crushed a car, I expected him to address some anger to teenage Toto by pulling some strings and shutting down the cinema. We later see that the cinema closes not permanently but in preparation for outdoor viewing. Although the acting was often dramatic and heightened, the story progresses with perfect logic, and I sense no tailoring of the story to serve a message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VM0s9juVP4IMUok4aG6TDQ.jpeg" /></figure><p>There were also a couple of lines in the film that I particularly enjoyed, one being “Don’t give in to nostalgia.” I struggle to define this sense of failure that I often feel when I slightly give in or give up, and I don’t know to whom or what have I lost. My confusion was captured and defined by its association with nostalgia. Alfredo never expressed why he disdains Toto from returning to the town, and people thought he was mad. I believe he had a sharp instinct for life and the consequences of being a projectionist all his life. There is a complex relationship between the future and home, and Alfredo sees how Toto embraces a successful career through their relationship: “Whatever you end up doing, love it.”</p><p>The film did a beautiful job and might have been my favorite film of all time. It was a perfect cast, and each version of Toto explains a unique life challenge with honesty. In particular, there is no doubt that young Toto will live in my heart forever. In the end, we can see how director Toto’s character came to be naturally from the advice and the choices he receives and makes. I could also talk more about how the touching details of the film made me feel, like how I have missed the Square person and my growing empathy for Toto’s mother. It sure would be worth it to revisit the film, re-experience that parallel world and think about how the world has shaped me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78b34a2d2444" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>