Visualization of the learning algorithm for a single perceptron type neuron.
The assumption of the project was to build an application that works on all operating systems. I created a mobile application using the Flutter framework and the Dart language.
The application simulates a perceptron, which is one of the basic models in the field of machine learning. The aim of the project is to create a tool that accepts data from a file and trains the perceptron to identify the correct answers based on the provided training data.
A perceptron is a simple mathematical model that mimics the action of a single neuron in the brain. It is the basic element of artificial neural networks.
The perceptron consists of inputs and outputs, weights, an activation function, a learning rate, and a threshold. The inputs represent the signals we feed into the perceptron. We assign a weight to each input, which determines how important the signal is to the perceptron. The activation function decides whether the perceptron should forward the signal further in the network or not. The learning rate determines how far the perceptron takes towards optimizing the weights. Bias is the value that is added to the sum of the weighted input signals in the perceptron before passing them to the activation function. Bias allows you to shift the activation threshold, thereby controlling the perceptron's sensitivity to input.
During learning, the perceptron "learns" to adjust the weights of its inputs to respond correctly to the inputs. This process is called supervised learning. During training, we present input examples to the perceptron along with the desired outputs. Based on these results, the perceptron adjusts its weights to better represent the desired behavior.
Learning the perceptron involves iteratively presenting training examples, modifying the weights, and continuously checking how well the perceptron does at predicting outcomes based on new data. This process is repeated many times until the perceptron reaches a satisfactory accuracy in prediction.
The application allows the user to load training data from a file. The data can be in text or CSV format, depending on the user's preferences.
After loading the data, the application processes them in order to prepare them for the learning process. This includes splitting the training and test sets, and converting them to the appropriate format for the perceptron.
The app performs perceptron learning based on the provided training data. The learning algorithm adjusts the perceptron weights to minimize prediction error and correctly classify the data.
After the training process is completed, the application allows testing on test data and evaluating the effectiveness of the perceptron. This may include the calculation of metrics such as accuracy, precision, and recall to assess classification quality.
The application can also provide visualizations of the perceptron training results, such as graphs showing the change in the perceptron weights during training, or graphs presenting the perceptron's effectiveness on test data.
Models (perceptron, activation function, inputs and outputs): link
Views (start screen, data loading screen, etc): link
Controllers (route management, simulation management): link
Sample perceptron learning data file: link
![](https://private-user-images.githubusercontent.com/71569327/243348388-469ad138-bc56-46d2-90a3-b109c1314548.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9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ycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.4aojm3ARCTaI4n1V_wECXhqAcDqrJT539dqTO1Tq2J0)
![](https://private-user-images.githubusercontent.com/71569327/243349474-39422041-014f-45ee-8ceb-f05f2e4bcb7f.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5OTQ4NjcsIm5iZiI6MTcyNTk5NDU2NywicGF0aCI6Ii83MTU2OTMyNy8yNDMzNDk0NzQtMzk0MjIwNDEtMDE0Zi00NWVlLThjZWItZjA1ZjJlNGJjYjdmLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDE4NTYwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdmZmZmMTY1ODlmZjYzMDE1NDE2ZDg5MDg0NWQ2ZDE1MzBhYTgxYmU2YjQwMjY2ZmZhMjg1NDVkOTE0MThlOWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mrW2rpH4eaPZOmaLiUPrRJgA9r0k4_3FWTFRnsRZyRw)
![](https://private-user-images.githubusercontent.com/71569327/243352522-2e69e261-ef9f-47bb-8f35-d43060c5219e.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiO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TIwMjQwOTEwVDE4NTYwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE4MDE2ODlmYWI3MmNhNWRlMWQ3NzE0OTYzMDcwZWY5MDExN2VjZmI0NzJmMGQ3ZWNlMzdlMzEzY2IyZGI1YmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.abBMR-KIsPB6fZiAkYMcT_XnE6E9h2imw7petbsfxlI)
![](https://private-user-images.githubusercontent.com/71569327/243353043-354c6f65-a704-4627-bcaa-6326b4d2363d.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5OTQ4NjcsIm5iZiI6MTcyNTk5NDU2NywicGF0aCI6Ii83MTU2OTMyNy8yNDMzNTMwNDMtMzU0YzZmNjUtYTcwNC00NjI3LWJjYWEtNjMyNmI0ZDIzNjNkLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDE4NTYwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgzMzE0NWE5MTgwNDk0MjRjMGUwYzBkNWJmMTc2MDQzNDZmMzViN2E0OGFlZGM3ZTRhOTAzMGEzMDdlZmM2MDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Axt6TYBzps_KcTJMKr5BeMcdcte5Atv4vLCzrKpvwms)
![](https://private-user-images.githubusercontent.com/71569327/243353108-1f8fbc3c-5bc6-45c3-8a43-a7b7f826fde0.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5OTQ4NjcsIm5iZiI6MTcyNTk5NDU2NywicGF0aCI6Ii83MTU2OTMyNy8yNDMzNTMxMDgtMWY4ZmJjM2MtNWJjNi00NWMzLThhNDMtYTdiN2Y4MjZmZGUwLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDE4NTYwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcyZDQ0NDgwZDEwMTc3OTNlMDFhMmNmNTQ5Y2I0NDcwZGZjNmRiYTc4ZmI1YzYxMGVmN2JjODRiYWYzM2M0YzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7rw2tUEAVGi6-u5UAY-vaWwbv3sDCilqeup77-ir7zY)
![](https://private-user-images.githubusercontent.com/71569327/243353174-ce5c8046-3e8c-49ea-adaa-ab8a78c894fb.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5OTQ4NjcsIm5iZiI6MTcyNTk5NDU2NywicGF0aCI6Ii83MTU2OTMyNy8yNDMzNTMxNzQtY2U1YzgwNDYtM2U4Yy00OWVhLWFkYWEt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