ALL ARTICLES FOR neural network


What are Generative Adversarial Networks?


A Generative Adversarial Network (GAN) is a concept that was developed in 2014 by a team of distinguished researchers led by Ian J. Goodfellow. In short, we train two deep neural networks in parallel so that the first (the Generator) tries to outsmart the second (the Discriminator). The Generator generates synthetic data, and the Discriminator tries to recognise whether the data is synthetic or natural. Over time, the generator and discriminator learn to do their jobs better and better, and the researcher can just take a rest.


Since 2014, various examples of generated dogs and cats, landscapes, horses, zebras and the faces of non-existent people have been published around the world. Although it is relatively simple to apply decision-making models in practice, imagining how to make use of GANs is much more difficult.


What Can I Generate?


StyleGAN's photorealistic facial generation was a watershed moment in the development of this technology. In the following years, more face-generation architectures have been developed, focusing on the ability to make changes to individual features of the generated faces.


Source: 0:15


In the example above, you can see how MaskGAN modifies the hairstyle of (and adds jewellery to) the person in the photo.


Not only faces can be generated. Generating anime characters is quite common. In the image below, you can see avatars that were generated based on certain conditions, such as hair colour and hair length, eye colour, facial expression and, optionally, spectacles.


Source: page 10.


How can we use GANs in Business Applications?


Dubbing Videos

 This technology is not limited to generating only static images. One of my favourites is Wav2Lip, which, based on a facial image (which can be generated) and a soundtrack, precisely animates the movement of the mouth, making it possible, for example, to adapt an actor's mouth movement for the purpose of dubbing.

Things get even more interesting when it turns out that there are GANs for generating speech from text. An example of such a network is GAN-TTS. By combining the text2speech model with the wav2lip model, it is possible to reduce the cost and time of producing films, commercials or educational materials for people who speak less common languages.

Hyper-personalisation for ecommerce

Another interesting application of GANs is in online shopping, for example, for clothing shops. As we all know, how a product is displayed has a significant impact on whether or not a customer decides to purchase that product. Let's imagine a lingerie shop. The algorithms we use for image analysis allow us to extract the features of the models that most frequently attract the attention of customers, and then, using GANs, add these features to the models that are used to present the products that we particularly want to convince customers to buy. For example, such features may be hair colour, eye colour or degree of muscularity.

Virtual Dressing Room

You could also use GANs (or other so-called Deep Fake algorithms) to create a virtual dressing room, where customers can try clothes, watches, glasses or jewellery on themselves. In this way, not only is it more likely that a single product will be sold, but this also increases the chances of customers buying coordinated sets combined of multiple items that are available in the store.


In the beauty industry, clients are often unable to visualise their future look when it comes choosing a new hairstyle, make-up or a tattoo. With GANs, you can show customers how they will look after the make-over, and therefore ensure that you customers are completely satisfied with the final effect.



GANs Are not Only for Entertainment


In this brief article I tried to show that GANs are not only for conveying misinformation or for the purposes of entertainment. GANs can also be used to give a business a tangible advantage over its competitors. If you think that using GANs might work to the advantage of your organisation, please contact us. We will then be more than happy to discuss your business needs and assess if GANs can meet those needs.




As humans, we have a visual system that allows us to see (extract and understand) shapes, colours and contours. So why do we see every image as a different image? How do we know, for example, that a box in an image is, in reality, a box? And how do we know what a plane is or what a bird is?


We all have that one uncle in the family who knows the answer to every question. Even if that answer is often wrong. Let’s call him Uncle Bob. From politics to science, he confidently shares his opinion on every possible topic. Did you know that we only use 10% of our brain? Or that chimpanzees use sign language to communicate? Talking to Uncle Bob often turns into a game of “fact or fiction” – trying to guess whether he is actually right or just making stuff up. I don’t know about you, but for me assuming the latter usually feels like the safest bet.



When you want to take the best possible care of your brain, certain things are recommended, such as fatty fish, vegetables, doing some brain exercises, and learning new things. But what about artificial neural networks? Of course, they don’t need human food, but they need the best quality and quantity of data. For this purpose you need to ask yourself exactly what task you want to solve, and where can you find relevant datasets. Are you searching datasets that apply to specific tasks like “medical image segmentation” or “entity recognition”? Or maybe you are searching datasets in a particular field of science, such as ion spectrometry or ECG signals. 

Here are some possible sources of  the best datasets for your machine learning project:


 1. Google dataset search


In 2018, Google launched a search engine for datasets. From my perspective as Data Scientist, it was a game changer. Finally, I have a dedicated web search engine for datasets. You can search through datasets based on their description on the relevant webpages. Many of the datasets have descriptions of measurement processes and content. Also, you have direct links to the datasets and information about the type of dataset (.zip, .xml, .pdf, .csv, etc.). Some of the datasets even have information about the type of license that applies to  the dataset. As you know, license information is crucial, especially in commercial projects.



 2. Kaggle



I would say that every Data Scientist knows of this website, and has visited it at least. You may have  heard of Kaggle as a platform where you can compete against others in Data Science problems. But have you ever thought about it as a good source of datasets?


On Kaggle you can search datasets based on main categories such as Computer Vision or Natural Language Processing, and also based on file types, size of datasets or type of licenses. If an interesting dataset is in table format, you can look into a summary of each column to see, for example a histogram of numerical values or a list of unique strings. You can even do basic filtering in this dataset or have a summary of samples number per class, so that you can check if your potential dataset is balanced or not. 




3. UCI Machine Learning Repository



On this website, you can search datasets based on a number of criteria: type of task (classification, regression, clustering), type of data attributes (categorical, numerical or mixed), data type (text, sequential, time-series, multivariate) or area of datasets. Each dataset has a description and links to be able download the dataset. Many of the datasets published on this website were already used in scientific research, which means that they have high quality descriptions and also have a list of papers where they are mentioned. This is useful because, with this information, you can check whether someone has already done what you want to do. Unfortunately, there are only 622 datasets there.



 4. Papers with code



For me, this is one of the best web pages for every Data Scientist and I’m excited about explaing to you why I feel that way. If you want to do some quick research on a specific topic, for example, image semantic segmentation, you can search this web page by using an existing tag or searching in the browser. You can search papers with an implementation that is stored in GitHub along with the datasets on which any models were trained. For the most common task, you have a plot with summary results and a list of the top five solutions with links to the repository and the name of the deep learning framework (usually, PyTorch and TensorFlow). 

So, on this website, when you're looking for the best dataset, you can also search  for the best architecture for the problem that you want to solve. I highly recommend this website if you are doing a research task and have a summary of existing methods with implementations. 



 5. Hugging face



Hugging Face is the platform with datasets, pre-trained models and even “spaces” where you can check how the solution works on some examples. Some of the solutions presented on the platform have access to the GitHub implementation. Also, there are some tutorials and how-to guides, which makes this platform appropriate for less experienced data scientists. I can especially recommend this website   for projects related to NLP and audio processing because there are so many datasets for multiple languages. However, if you are more interested in computer vision, then you can also find interesting things on this website.




   6. Create your own dataset       


        a. API


Sometimes you want to use data from specific web services, for example,Spotify , or websites such as social media, for example, Twitter. Some of these services or sites have an API, so you only need create a developer account, and download the relevant data. Using an API usually requires you to have authorisation, in most cases, OAuth, which gives you, as a developer, the required access token, access secret, etc. In Python, you also have special packages dedicated to specific platforms, such as, for example, Spotipy (to access Spotify), Tweepy, (to access Twitter), or python-facebook-api. Those packages have built-in functions for a specific type of request, like “Find account names which contain the specific substring”, or “Get 10 most popular tweets about football”. For each API you need to review the documentation to be sure that you get the data which you want. You also need to remember to preprocess the data before using it in your machine learningand deep learning model.


        b. Web scraping


If the service from which you want to get data does not have its own API, or you just want to take data from, for example,. a shopping website you can do, so-called,web scrapping. For that, you need to know a little about HTML, and it helps if you can write your own regular expressions. Web-scraping is probably more time-consuming than the other ways describe above in this article, but sometimes web-scraping is the only possible way to get the data that you want. For web scraping in Python, I recommend using the BeutifulSoup package.



Summing up, as a Data Scientist you have access to many sources of datasets. Some sources contain well-prepared, high quality datasets, whilst other datasets are more challenging to source, but you often have more control over the latter sources of data.You will have to choose the strategy which works best in a given context.I hope that this article gives you the information that you need to take an informed decision about the best approach.



How can we help you?


To find out more about Digica, or to discuss how we may be of service to you, please get in touch.

Contact us