Artificial Intelligence
While Artificial Intelligence has a long and rich history dating back two hundred years, the recent advancements in technology - both hardware, software and algorithms along with very large global population enabled by fast knowledge deployment via internet tools has made significant strides. This is now opening new opportunities to solving problems of increased efficiency to better medical assessments. This advancement has also raised significant questions in ethics.
From Wikipedia:
In computer science, artificial intelligence (AI), sometimes called machine intelligence, is intelligence demonstrated by machines, in contrast to the natural intelligence displayed by humans. Colloquially, the term "artificial intelligence" is often used to describe machines (or computers) that mimic "cognitive" functions that humans associate with the human mind, such as "learning" and "problem solving".
As machines become increasingly capable, tasks considered to require "intelligence" are often removed from the definition of AI, a phenomenon known as the AI effect. A quip in Tesler's Theorem says "AI is whatever hasn't been done yet." For instance, optical character recognition is frequently excluded from things considered to be AI, having become a routine technology. Modern machine capabilities generally classified as AI include successfully understanding human speech, competing at the highest level in strategic game systems (such as chess and Go), autonomously operating cars, intelligent routing in content delivery networks, and military simulations.
Artificial intelligence can be classified into three different types of systems: analytical, human-inspired, and humanized artificial intelligence. Analytical AI has only characteristics consistent with cognitive intelligence; generating a cognitive representation of the world and using learning based on past experience to inform future decisions. Human-inspired AI has elements from cognitive and emotional intelligence; understanding human emotions, in addition to cognitive elements, and considering them in their decision making. Humanized AI shows characteristics of all types of competencies (i.e., cognitive, emotional, and social intelligence), is able to be self-conscious and is self-aware in interactions.
In computer science, artificial intelligence (AI), sometimes called machine intelligence, is intelligence demonstrated by machines, in contrast to the natural intelligence displayed by humans. Colloquially, the term "artificial intelligence" is often used to describe machines (or computers) that mimic "cognitive" functions that humans associate with the human mind, such as "learning" and "problem solving".
As machines become increasingly capable, tasks considered to require "intelligence" are often removed from the definition of AI, a phenomenon known as the AI effect. A quip in Tesler's Theorem says "AI is whatever hasn't been done yet." For instance, optical character recognition is frequently excluded from things considered to be AI, having become a routine technology. Modern machine capabilities generally classified as AI include successfully understanding human speech, competing at the highest level in strategic game systems (such as chess and Go), autonomously operating cars, intelligent routing in content delivery networks, and military simulations.
Artificial intelligence can be classified into three different types of systems: analytical, human-inspired, and humanized artificial intelligence. Analytical AI has only characteristics consistent with cognitive intelligence; generating a cognitive representation of the world and using learning based on past experience to inform future decisions. Human-inspired AI has elements from cognitive and emotional intelligence; understanding human emotions, in addition to cognitive elements, and considering them in their decision making. Humanized AI shows characteristics of all types of competencies (i.e., cognitive, emotional, and social intelligence), is able to be self-conscious and is self-aware in interactions.
Machine Learning
From Wikipedia:
Machine learning (ML) is the scientific study of algorithms and statistical models that computer systems use in order to perform a specific task effectively without using explicit instructions, relying on patterns and inference instead. It is seen as a subset of artificial intelligence. Machine learning algorithms build a mathematical model based on sample data, known as "training data", in order to make predictions or decisions without being explicitly programmed to perform the task. Machine learning algorithms are used in a wide variety of applications, such as email filtering, and computer vision, where it is infeasible to develop an algorithm of specific instructions for performing the task. Machine learning is closely related to computational statistics, which focuses on making predictions using computers. The study of mathematical optimization delivers methods, theory and application domains to the field of machine learning.
Machine learning (ML) is the scientific study of algorithms and statistical models that computer systems use in order to perform a specific task effectively without using explicit instructions, relying on patterns and inference instead. It is seen as a subset of artificial intelligence. Machine learning algorithms build a mathematical model based on sample data, known as "training data", in order to make predictions or decisions without being explicitly programmed to perform the task. Machine learning algorithms are used in a wide variety of applications, such as email filtering, and computer vision, where it is infeasible to develop an algorithm of specific instructions for performing the task. Machine learning is closely related to computational statistics, which focuses on making predictions using computers. The study of mathematical optimization delivers methods, theory and application domains to the field of machine learning.
Machine Learning Types
Machine Learning can be categorized into 3 key types:
Unsupervised Learning has two types of learning problems and is more about discovering insights from data rather than making specific predictions.
Reinforcement Learning is a type of machine learning where an agent learns how to behave in an environment by performing actions and receiving feedback through rewards or penalties.
Model-Free Methods:
Model-Based Methods: The agent tries to learn a model of the environment and uses that model to plan actions. These methods simulate future states to choose the best action.
Deep Reinforcement Learning: Combines deep learning with reinforcement learning, where neural networks approximate value functions or policies. Examples include Deep Q-Networks (DQN) and Proximal Policy Optimization (PPO).
- Supervised Learning
- Unsupervised Learning
- Reinforcement Learning
- Classification: The model learns to predict a discrete label (e.g., identifying whether an email is spam or not, or recognizing if an image contains a cat or a dog).
- Regression: The model predicts continuous values (e.g., predicting house prices based on features like size, location, and number of bedrooms).
Unsupervised Learning has two types of learning problems and is more about discovering insights from data rather than making specific predictions.
- Clustering: The algorithm divides the data into distinct groups or clusters based on similarities in the data.
- K-means clustering: A method where data points are grouped into clusters based on their proximity to a central point (centroid).
- Hierarchical clustering: Builds a hierarchy of clusters, often represented as a dendrogram, where clusters can be nested within one another. - Dimensionality Reduction: This technique reduces the number of input variables in a dataset while preserving as much information as possible.
- Principal Component Analysis (PCA): It transforms high-dimensional data into fewer dimensions, capturing the most important variance in the data.
- t-SNE: A technique for visualizing high-dimensional data by mapping it into 2 or 3 dimensions for easier understanding.
Reinforcement Learning is a type of machine learning where an agent learns how to behave in an environment by performing actions and receiving feedback through rewards or penalties.
- Q-Learning: The agent learns the value (Q-value) of actions in particular states without needing a model of the environment.
- SARSA (State-Action-Reward-State-Action): Similar to Q-learning but updates based on the action the agent actually takes.
Programming Languages
When it comes to machine learning and artificial intelligence, several programming languages are popular due to their specific strengths and ecosystem support. Here are some of the most commonly used languages, along with their advantages:
1. Python - Advantages:
Recommendations
1. Python - Advantages:
- Extensive Libraries and Frameworks: Python has a vast array of libraries and frameworks specifically designed for machine learning and AI, such as TensorFlow, Keras, PyTorch, scikit-learn, and more.
- Ease of Learning and Use: Python’s simple syntax and readability make it a great choice for beginners.
- Community Support: A large community means plenty of tutorials, documentation, and support forums.
- Integration: Python can easily integrate with other languages and tools.
- Statistical Analysis: R is particularly strong in statistical analysis and visualization.
- Specialized Libraries: Libraries like caret, randomForest, and xgboost are widely used in the machine learning community.
- Data Handling: Excellent for data manipulation and exploratory data analysis.
- Performance: Julia is designed for high-performance numerical and scientific computing.
- Ease of Use: Combines the ease of use of Python with the speed of C++.
- Native Machine Learning Libraries: Libraries like Flux.jl and MLJ.jl are gaining traction.
- Scalability: Java is a good choice for large-scale and enterprise-level applications.
- Frameworks: Libraries like Weka, Deeplearning4j, and MOA are available for machine learning tasks.
- Portability: Java programs can run on any device that has the Java Virtual Machine (JVM).
- Performance: C++ is known for its high performance and is often used in situations where execution speed is critical.
- Control: Provides fine-grained control over memory management.
- Use in Production: Often used in production environments, especially where performance is a bottleneck.
- Toolboxes: MATLAB has specialized toolboxes for machine learning and neural networks.
- Visualization: Excellent for visualization and handling matrix operations.
- Used in Academia: Widely used in academic research and prototyping.
- Integration with Big Data: Scala is the language for Apache Spark, a powerful big data processing engine.
- Functional Programming: Supports functional programming paradigms which are useful in certain AI applications.
- iOS Development: Swift is essential for machine learning applications on iOS devices.
- TensorFlow Support: TensorFlow has extended support for Swift.
Recommendations
- Python is highly recommended due to its simplicity and the extensive resources available.
- R is preferred if your work is heavily statistical.
- C++ or Julia might be the right choice for performance-intensive tasks.
- Java is often used in large-scale enterprise environments.
- Scala is often used with Big Data especially when using Apache Spark.
First Exposure of Machine Learning
In 2012, I started my journey to get a dual MBA / MEng degree and needed to select my specialties. I focused my engineering courses on Data Exploration and Machine Learning and developed a new passion in a different branch of computing. During this time, I built some backpropagating neural networks in MatLab to do classifications like above.
Project 1: Wine Classification
The course that made a huge impact on me was Advanced Neural Network course. In simplistic terms, using a computer to simulate the action of a neuron based on a bias input along with weighted inputs to generate the output value. The following image show the relationship between biological and artificial neurons. Deep Learning - using neural networks - has many hidden layers - and hence the name.
Neural networks, first introduced in the 1950’s by Rosenblatt, are being used in the world today for complex data classification such as credit card financial transactions. Neural networks are a form of machine learning that can be trained with supervision. Simple neuron elements are combined in parallel to form a neural network with three key layers, input; hidden; and output.
The Wine Dataset was created to evaluate classification systems based on the chemical properties of wines from three wineries in the same region in Italy. This dataset has become one of the standards to benchmark classification systems as it has modest complexity with 13 features and 178 data instances that relate to 3 wineries.
Neural networks can be trained to recognize complex patterns with reasonable accuracy by controlling the number of neurons in the network. Training a neural network requires sufficient input data that statistically represents the real data that would be encountered and the associated target output. Once the system is trained, you need to determine if the ML system is working effectively through various metrics such as True Positive Rates, False Positive Rates and others. Based on the results, you need to adjust your ML system to have more or less neurons as well as hidden layers and learning rates as well as training epochs.
Code for this first project found at my github site at: github.com/douglaskruger/Coding-MachineLearning
The following image demonstrates how to manage the data set to train the ML system and then to evaluate it with a separate data set.
The Wine Dataset was created to evaluate classification systems based on the chemical properties of wines from three wineries in the same region in Italy. This dataset has become one of the standards to benchmark classification systems as it has modest complexity with 13 features and 178 data instances that relate to 3 wineries.
Neural networks can be trained to recognize complex patterns with reasonable accuracy by controlling the number of neurons in the network. Training a neural network requires sufficient input data that statistically represents the real data that would be encountered and the associated target output. Once the system is trained, you need to determine if the ML system is working effectively through various metrics such as True Positive Rates, False Positive Rates and others. Based on the results, you need to adjust your ML system to have more or less neurons as well as hidden layers and learning rates as well as training epochs.
Code for this first project found at my github site at: github.com/douglaskruger/Coding-MachineLearning
The following image demonstrates how to manage the data set to train the ML system and then to evaluate it with a separate data set.
Project 2: Radial Basis Function Networks
Radial Basis Function Networks (RBFNs) are used in many applications around the world because they provide an efficient means to approximate functions in many dimensions. While the true economic impact cannot be quantified, Neural Networks and specifically RBFNs are being used to help understand Big Data and influencing key business decisions. With the recent improvements in computing technology, RBFNs can process and classify data in real time opening up many new opportunities for its use in commercial and industrial settings.
Radial-Basis Function Networks were first introduced in 1988 by Broomhead and Lowe and are used for “functional approximation, time series prediction, classification and system control.”
The following images show the "double moon" data set - showing how the classification system works on curved data sets.
Radial-Basis Function Networks were first introduced in 1988 by Broomhead and Lowe and are used for “functional approximation, time series prediction, classification and system control.”
The following images show the "double moon" data set - showing how the classification system works on curved data sets.
Project 3: Time Series
The ability to predict future events based on past history is a valuable tool for society in many areas. Economies would be able to operate more efficiently from forecasting purchases of goods and financial markets could be modeled better to improve. Weather forecasts could be improved and lives could be saved if earlier notification of an upcoming earthquake was predicted.
A time series is a collection of data elements measured sequentially to create a series. Unfortunately, many of the time series are chaotic in nature leading to complex patterns. Neural networks, by design, are able to adjust to predicting complex patterns. In this project, two Neural Network architectures – feed-forward and recurrent -were implemented and their accuracy compared using common statistical error measurement metrics: MSE, AE, and NDEI. The comparison will use two well-known datasets - Mackey-Glass and SantaFe LaserA time series data set. The results show that the recurrent architecture had overall better performance over the RBF architecture. The results also show that some datasets like the Mackey-Glass naturally allow better forecasting while the SantaFe LaserA dataset can be hard to predict. This is where the Recurrent architecture was superior compared to the RBF network as the Recurrent neural network was able to forecast (in most cases) the next point. The steady increase in magnitude of the time series followed by the sharp decline proved to be the Achilles heal for these systems.
In summary, time series can vary in their chaotic behavior and will result in various degrees in performance. The ability to determine the delay and embedded dimensions help the neural network learn and improve its accuracy. Furthermore, the complexity of actually determining what performance measures should be used when comparing forecasting ability should not be underestimated as some of the measurements are affected by outliers more significantly than the others.
A time series is a collection of data elements measured sequentially to create a series. Unfortunately, many of the time series are chaotic in nature leading to complex patterns. Neural networks, by design, are able to adjust to predicting complex patterns. In this project, two Neural Network architectures – feed-forward and recurrent -were implemented and their accuracy compared using common statistical error measurement metrics: MSE, AE, and NDEI. The comparison will use two well-known datasets - Mackey-Glass and SantaFe LaserA time series data set. The results show that the recurrent architecture had overall better performance over the RBF architecture. The results also show that some datasets like the Mackey-Glass naturally allow better forecasting while the SantaFe LaserA dataset can be hard to predict. This is where the Recurrent architecture was superior compared to the RBF network as the Recurrent neural network was able to forecast (in most cases) the next point. The steady increase in magnitude of the time series followed by the sharp decline proved to be the Achilles heal for these systems.
In summary, time series can vary in their chaotic behavior and will result in various degrees in performance. The ability to determine the delay and embedded dimensions help the neural network learn and improve its accuracy. Furthermore, the complexity of actually determining what performance measures should be used when comparing forecasting ability should not be underestimated as some of the measurements are affected by outliers more significantly than the others.
Project 4: Handwritten Digits
The MINST handwritten data set is a standard data set for evaluating handwriting and used by machine learning systems for evaluation. As part of my master engineering course, I wrote a machine learning system to predict the handwritten digits with approximately 90% accuracy. (A decade later, the ML systems are getting almost 100% accuracy and part of well known ML challenge site: www.kaggle.com/code/jedrzejdudzicz/mnist-dataset-100-accuracy
using updated machine learning techniques.
The MINST dataset can be found at: yann.lecun.com/exdb/mnist/index.html
This images below were key in the project - with the first representing the digitized handwritten dataset, the second is a excel spreadsheet that if the pixel value exceeds a threshold, the cell turns red. The last two images show the True Positive and True Negative as well as the False Positive and False Negative and the confusion matrix.
using updated machine learning techniques.
The MINST dataset can be found at: yann.lecun.com/exdb/mnist/index.html
This images below were key in the project - with the first representing the digitized handwritten dataset, the second is a excel spreadsheet that if the pixel value exceeds a threshold, the cell turns red. The last two images show the True Positive and True Negative as well as the False Positive and False Negative and the confusion matrix.
Tools - MatLab
MatLab is a brilliant software package for Engineers for modelling systems. MatLab supports Neural Networks with a dedicated module or you can build your own system as per my projects listed above. These images show a small sample of the features as well as running a test system showing the Mean Squared Error (MSE) as the system is trained (epochs).
Large Language Models -LLM
Large Language Models are now common place with the incredible 'ChatGPT' and other systems like 'BARD', etc.
I have been experimenting with an Open Source tool called Ollama. (website: https://llama.com )
This tool becomes your local 'chatGPT' - which you can load various trained databases of different sizes as well as include your custom database by having it scan your documents. This is a great feature - as future businesses can leverage their product's help and search through an LLM.
I have been experimenting with an Open Source tool called Ollama. (website: https://llama.com )
This tool becomes your local 'chatGPT' - which you can load various trained databases of different sizes as well as include your custom database by having it scan your documents. This is a great feature - as future businesses can leverage their product's help and search through an LLM.












