Projects

MLP functions as Kmeans algorithm

Keywords: Multi-layer Perceptron - Kmeans - Python - Keras

Description: This project was taken as homework in the course of Computational Intelligence. The goal of the project was to simulate the function of the Kmeans algorithm by a multi-layer perceptron and showing how the perceptron is able to compensate for the drawbacks of the Kmeans algorithm. To simulate the process of Kmeans with the perceptron, I only entered the center of each cluster into the learning phase of perceptron, and then once an epoch ended, the evaluation was done over the whole data points and clusters changed. This process was continued until the convergence (a simple threshold on the number of changes). Finally, the efficiency of the method observed was shown and investigated how the proposed combined method showed better performance.

MLP functions as Kmeans algorithm Image

Nonogram Game

Keywords: Game Theory - Constraint Satisfaction Problem

Description: Nonograms pictures logic puzzles in which cells in a grid must be colored or left blank according to numbers at the side of the grid to reveal a hidden picture. The aim of this project was to solve the game using computers. For this purpose, the game was modeled as a constraint satisfaction problem (CSP). There are various methods that have been used for this problem, one of which is backtracking, the one used in this project as well. Moreover, two well-known heuristics were also used, namely, minimum remaining values (MRV) and least constraining value (LCV), which improve the efficiency of the solution. Finally, with the help of some other methods, e.x. arc consistency checking, my computer was able to solve the problem for the boards with at most 700 squares.

Nonogram Game Image

Trie Tree

Keywords: Data Structure - Java

Description: Trie tree is a type of tree data structure that is used for locating specific keys from within a set. This project was given during the data structure course, and its aim was to implement the trie tree efficiently. My final implementation was capable of storing and retrieving about 200 words in a reasonable time, less than 2 seconds (As the project had been done a long time ago, my approximation of its capacity can be much better or worse than the real one).

Trie Tree Image

Racing Simulator

Keywords: Human Robot Interaction - Robotics - C/C++

Description: This project was offered by robotics laboratory of ferdowsi university of Mashhad, and its aim was to design a racing car simulator. The project was divided into four smaller parts, getting the data from the game, showing them properly to the user, solving the inverse cinematic equation of the robot, and giving the result obtained to the robot to perform appropriate movements. My contribution to the project was to do the first two steps. At first, the implementation was done on Python, but after a while, it was understood that Python can not be a good choice, due to the time consideration, which was so important in a real-time application like this. Furthermore, C++ was used successfully and the game data was obtaining from the game at a good pace. However, it was a little challenging to design a good GUI for the program using C++, because it does not have the that much good library for drawing the plots compared to Python. (up to my best knowledge).

Racing Simulator Image

Bricks Breaker

Keywords: Game Development - Java

Description: This project was given during the course of advanced programming, and its aim was to implement a game, like breaks breaker to make the students understand better the concepts of object-oriented programming. While the logic of the game was beautifully designed, enough time was not put for its appearance, unfortunately. (Although the fact that I am not really interested in designing was not effect-less)

Bricks Breaker Image

TZAAR Game

Keywords: Decision Theory - Game Theory - Minimax Algorithm

Description: Tzaar is a relatively new game, that was invented by Kris Burm and published in 2007. There is no randomness and both players know all information about the current position in the game. White player and black player take turns, white has the first turn. In the starting position, there are 30 white and 30 black pieces. Each color has pieces of three types: 6 are Tzaars, 9 are Tzarras and 15 are Totts. The most important property of this game is the high branching factor, which makes the game difficult for computers. The aim of this project was to design a strong Tzaar-playing program. To do this, first, the game was modeled, and some criteria to score each game status were proposed based on the game strategies. Secondly, some useful heuristics and alpha-beta pruning were implemented, then followed by designing a pre-defined table for the initial movements in order to optimize the first choices (technically speaking, this was done due to the fact that most players always start the game with similar choices). Finally, because of the high branching factor, a node evaluation method was used to sort the nodes before the node expansion, which helps us to only expand a proportion of nodes (depends on the computational sources) and still make feasible decisions.

TZAAR Game Image

Drawing on the Air

Keywords: Object Detection - Python - OpenCV

Description: In this project, I tried to design a system to provide the facility of writing in the air. For doing this, I divided the project into some smaller steps. The first step was to capture the real-time frames and then process them in a loop, in which the outliers of the frame should be removed. In the next step, the object that was responsible for drawing was detected. For this reason, I assumed the drawing tool to be a green small object and filter the frames based on this assumption. Finally, the dots were drawn in the next frames based on the center of the place, in which the object was detected. The most challenging part of this project was obviously detection the drawing tool based on its color and shape, because its color range easily was changing according to the environment, i.e., its lighting status.

Drawing on the Air Image

Traffic Flow Prediction

Keywords: Time Series Prediction - RNN - LSTM - Keras

Description: It was a traffic flow prediction challenge held by Neshan. The aim of the competition was to predict the traffic flow in some days given the corresponding traffic details of some days before. To tackle the problem, we used recurrent neural networks and eventually ranked second based on our accuracy. One of the most challenging things during the competition was to appropriately fit the data to the RNN, because there were some outliers in the training data, for instance, weekends, when the traffic flow is obviously less than other working days or there were some official holidays that needed to be considered. I personally enjoyed the process in which the features were extracted from the data and the predictions were made by the RNN.

Traffic Flow Prediction Image

Movie Genre Prediction

Keywords: Text Processing - Word2vec - Bag of Words - TF-IDF

Description: This project was taken during the computational intelligence course. The aim of this project was to predict the genre of a film based on its description. For this purpose, three different approaches were used, two of which were the word2vec and tf-idf. In the third method, a combination of both former methods was used. The idea was to change the bag of words to a bag of concepts. To do this, I first performed clustering on the vectors obtained by the word2vec and replaced all synonym words in the test data with only a specific word, hence the word semantic also will be considered by the tf-idf algorithm. Finally, the superiority of the last method over the other two methods was shown.

Movie Genre Prediction Image

Kmeans Parallelism with OpenMp & Cuda

Keywords: Parallel Computing - GPU Computing - CPU Parallelism

Description: The aim of this project was to implement the theories that were taught during the course of multi-core programming. The task was to improve the execution time of the Kmeans algorithm by dividing its computational loads first among the CPU cores and second among GPU blocks. To do this, each data point was considered as a single processing thread, in which its distance from the cluster center was computed. In the end, the results of the threads were merged by the main thread, and clusters were updated based on these calculations. To compare the methods, compressed representations of the MNIST dataset images, obtained by a trained CNN, were used. Finally, the execution time of the openMP approach was only half of the serial one, but the speed up for the GPU approach was far better, its execution time was one-ninth of the serial one. This shows the capability of GPUs for optimizing the problems which can be divided into some smaller problems, all of which do exactly the same task. (if tasks were different, the performance of GPU could not be better than CPU)

Kmeans Parallelism with OpenMp & Cuda Image

Face Detection

Keywords: OpenCV - Cascade Classifier - Python

Description: The purpose of this project was to design a real-time face detection system, which can process the input frames and detect some facial landmarks. To do this, a pre-trained model was loaded from OpenCV, and then the frames were processed using this model.

Face Detection Image

Sales Forecast

Keywords: Time Series Prediction - RNN - GRU - Pytorch

Description: This project was given during the Neural Network Course. The purpose of this project was to predict the price of a product using recurrent neural networks, and more specifically Gated Recurrent Unit (GRU), and compare its performance with a simple RNN for different parameters and architectures.

Sales Forecast Image

Letter Recognition

Keywords: Image Processing - BMP - C/C++

Description: The aim of this project was to process a Windows bitmap (BMP) image file and detect letters of the Latin alphabet in the image. The first step is to learn the shape of the letters. The system goes through a learning phase where the average shape of more than 20 variations of each letter is formed. In the second step, we detect letters that require the number of rows and columns in our input image, in order to form a grid accordingly. Given a set of words as input, the system will count and show the localization of those words in the image.

Letter Recognition Image