Incorporating AI ‘state’ and ‘behavior’ into Computer Objects

Raymond Ernst
4 min readNov 26, 2022

An implementation of Computer Neurons.

In software engineering, an ‘object’ has state (data) and behavior (code) [1]. The state and behavior can be a combination of both traditional and AI decision making. And, that’s the basis of this example [2].

Objects can correspond to things found in the real world; for example, a robot, drone, autonomous vehicle, cloud-base processes, and even human genome. Each instance of the robot, drone, gene, etc, would be considered an object; that is, each instance has state (data) and behavior (code).

In our example (which is actually a simulation), the traditional machine learning (ML) training and test processes are used to develop the model (the AI code). This example has been developed and tested with several Scikit-Learn (Sklearn) algorithms, including support vector, random forest, and neural network. The ML learning (train and test) process is covered in many other articles. The use of the algorithm is perhaps the easier part. Our example focuses on what happens next; that is, the implementation.

ML will produce a module of AI code. Typically, this module is relatively small compared to all the preparation code and data that is used to produce it. For example, Tesla has huge centralized repositories of data for its full system drive learning [3]. This Tesla processes produces a module which is downloaded to auto where it is executed. In our example, the module is only 22kB.

The output module of our ML train and test process is saved in file called ‘modelAI.pkl’. That file (code) is loaded into a variable, ‘modelX’, in the system that creates instances of the AI object.

In this example, there will be 80+ instances (like individual Tesla autos) that are software objects (bots). Of these, eight (called Neurons) will be loaded with the AI code. Our simulation statistically compares AI performance to non-AI performance in software bots for several AI algorithms.

The following code creates the object (Neuron_n) with the AI code, ‘modelX’. The other bots are created similarly but without the AI. Our simulation is a statistical analysis of AI versus non-AI performance in computer objects.

The following is the part of the object itself which includes the AI module.

The following is the code (behavior) within the object that is executed. It is working with a list of inputs and doing an AI prediction on each input (0 = good; 1 or more = bad). The function within the object returns a counter of predicted risks. A critical point is setting up the input (features = data) for doing the prediction as this input has to be equivalent to the train and test process that created the ML (AI model, ‘modelX’).

In summary:

  • Machine learning is used to create the AI code
  • The AI code is incorporated into the object (instance of the bot) as a function
  • The object’s function / behavior (AI code) is executed to determine bot behavior based on state (AI features).

From a software engineering perspective, the object then has state (AI feature data) and behavior (execution of AI code).

The long term intent is to evolve the platform(s) with concepts and tools for genome modeling (or subset thereof). If you have ideas or insights in this effort and want to collaborate, please contact us.

— -

[1] Object (computer science). https://en.wikipedia.org/wiki/Object_(computer_science)

[2] Example created by David Fai and Raymond Ernst. ‘Virus Simulation — biological virus attack citizens of the metaverse (a demonstration of: AI incorporated into Computer Objects)’. Website:

[3] Tesla has their own supercomputer(s) for this development. https://towardsdatascience.com/tesla-ai-day-2021-review-part-3-project-dojo-teslas-new-supercomputer-715d102dbb29

--

--

Raymond Ernst

Consultant, healthcare analytics. Co-founder Ai_Objects (gaming-to-industry solutions). Computer Science Industry Board, Missouri University S&T.