Developed a neural network to prevent online hate speech. If you haven’t lived in a rock for the last year, the words “Artificial Intelligence” (AI) have been popping up in your news feed every day. Design for artificial intelligence. From Google, AI is the first to be used by Adobe to create the best creative tools for us: designers.
Design for artificial intelligence
And this is where I want to see how designers take A.I. which in the near future may become a new design paradigm.
How can we as designers apply our process to solve problems using artificial intelligence? And when the time comes, how can we collaborate with AI projects?
In this project, I will develop a neural network concept for training a machine learning model that can combat online hate speech.
We’ve all been into it: we’re looking at social media posts, we’re scrolling through the comments, when all of a sudden someone makes a hateful comment just because they don’t like the post. Those of us adults are likely to skip the thread of each other’s insults, or even take it to the extreme and use the comment filter.
But how does this type of comment affect an adult compared to a teenager or even younger children?
It came to me after I realized while commuting that most “young people” these days have access to smartphones and social media at an alarming rate, in my opinion. As a dad, we know you need to be able to connect with your kid throughout the day, but sometimes it seems like creating an Instagram profile is easier than making it safe for these young newbies.
This is a process that I find efficient and flexible for designing the basic elements of a functional neural network. At each stage, I create what is needed and move forward to confirm the results. Then I repeat the discoveries I usually get where the dotted lines are shown.
Start with as specific a problem as possible
In this case, the problem I want the neural network to determine is when a hate speech situation occurs, right? The output of a neural network in the AI world is known as a label (variable Y ). Stay with me, it’ll make sense in a second.
Often online hate speech takes the form of profanity in comments, so I need the neural network to flag words in comments as offensive or not .
Something like “Is this word obscene, Yes / No ? Is there profanity in this sentence Yes / No ? “.
This is the result of this neural network: words marked as offensive or not.
Gather datasets that match my desired output
To be honest, I’m scratching my head a bit because the data I’m looking for is profanity to teach the program to “scold” so it can classify better.
An exercise that I find useful is to think about real life scenarios in which a person is being trained.
For example, I presented a scenario in which a child went up to his mother and said “Listen, mother”, today at school the teacher taught us to say “Thank you” in French: Merci”.
Similarly, I need a machine learning model to learn words from a source. those. school from a children’s example.
Depending on how mature the AI software is, the datasets used to train its model may come from different places. Mine is still in its early stages so any other option than hand feeding would be next to impossible for me. 😅
But some options I came up with later:
Word Set Parameter
Frequently used words option
Comment-Based Auto-Learning Option
And who knows what options will make the future easier.
Define neurons based on attributes of your response
The concept of artificial neural networks is based solely on how our brain works: neurons communicate with each other through synapses. Thus, neurons have a huge impact on the results of obtaining accurate labels.
I said earlier that profanity would have a label ( Y ) as a design result and that the result would come from the parsed words.
In the image above, the datasets and my label are separated into layers, the usual scheme in a neural network, then in the middle is the main part of the classification thanks to the neurons.
From here, the neurons take on the role of determining the attributes of these words known to the AI. world as a function ( X ).
To simplify: features of the word that make it offensive.
Then drop another AI term: the way I have to link the features ( X ) of the word to the label ( Y ) of the offending one is called a model.
So far I have something like this:
At the top is the input layer with all the words from the datasets fed into the neural network. Circles representing a certain number of words.
In the middle is a hidden layer where all the neurons will live and be ready to check for features ( X ) or attributes of incoming words. Circles representing neurons.
There can be multiple hidden layers between the input and output layers to make a deep learning neural network. However, for this prototype, I’ll keep it brief and short by adding 2-3 hidden layers to test the results.
And finally, a finished output layer with a classification based on how the model was defined.
The model looks like this. Does the feature word ( X )
- Use of certain words
- Combination of certain words
- Using certain emojis
- Emoticon combination
Again, inspired by the brain, right? I thought of it as our senses sending signals to our brain so that we can react or make a decision.
For example, you walked into a bakery and the smell of various freshly baked cupcakes hit your nose. Your brain can classify them and you can tell which one is chocolate, pineapple, etc.
The same will happen if you see or hear one of these words, you may get angry or upset and react to it.
Choose a neural network that solves the problem the way I need
There are different types of neural networks, and each of them solves different problems. This is the main reason why I also made the problem more specific so that I can make a clear decision on the neural network.
This neural network is generally very simple, a classification neural network. So, the last thing I need is to think about what type of neural network can do this better.
I think a Recurrent Neural Network would be a great choice as I want it to not only learn from the datasets but also take into account the results and then go back to layers again to learn better over time.
Just as programming was once in its infancy, so is artificial intelligence somehow. Processes will become more reliable, capabilities will grow, and applications will continue to influence us.
Personally, I think using technology for the better should always be a northern start. Imagine what social media giants can do when they can fight hate speech and cyberbullying with just software.
In the future, I would like to support other languages and of course the slang that comes with them, but in any case, I would really like to have the time to get technical information and make this design a working software and most importantly, talk to the victims of this problem.
ML engineers are happy to make this a reality 🙂
Design for artificial intelligence