Building Blocks for a Computational Psychotherapy System

A Partial Implementation


  • Sabina Pajmon University of Ljubljana
  • Luka Kovač University of Ljubljana
  • Tilen Pajk University of Ljubljana
  • Žiga Besal University of Ljubljana
  • Tine Kolenik Jožef Stefan Institute


Artificial intelligence allows for a new type of care focused on building personalized mental health support systems. To this end, we used various methods on a dataset containing daily diary entries and quantitative mental health questionnaire scores.

Algorithms from chaos theory can be applied to the dataset to detect various change phenomena [1]. Dynamic complexity measures detect susceptibility to change and long-term changes. This helps discover when to intervene and inform us whether further interventions are needed. We are in the process of applying these algorithms to the dataset.

To forecast mental health trends, we built a machine learning model that predicts stress, anxiety, and depression (SAD). Several machine learning algorithms were implemented. Multilayer perceptron performed best with forecasting SAD with a 81.51%, 88.01%, and 87.33% accuracy for 1- day forecasts, and a 74.23%, 84.88%, and 84.54% accuracy for 7-day forecasts, respectively.

Detections and forecasts can be used to guide digital interventions [2]. Our goal is to implement a chatbot following the principles of cognitive behavioral therapy (CBT). Depending on the detected SAD levels and symptoms, personalized CBT techniques are triggered to offer interactive, dialogic mental health support to the user in a natural language.

To gain a deeper understanding of the genesis and treatment of change in mental health, combining knowledge from different theoretical frameworks is required. We explored predictive processing in relation to CBT. Computational models of perception, as envisaged by predictive processing, seem to help explain the interactions between thoughts, feelings and behavior, which are also leveraged in the process of CBT [3]. A deeper understanding of these interactions could help design more effective psychotherapeutic methods.

Future work includes finishing the various listed building blocks for the system, combining them into a functional whole and testing its efficacy.


[1] G. Schiepek and G. Strunk, “The identification of critical fluctuations and phase transitions in short term and coarse- grained time series—a method for the real- time monitoring of human change processes”, Biological Cybernetics, vol. 102, no. 3, pp. 197–207, 2010.

[2] T. Kolenik, M. Gjoreski and M. Gams, “PerMEASS – Personal Mental Health Virtual Assistant with Novel Ambient Intelligence Integration”, CEUR, vol. 6, no. 2820, pp. 8–12, 2020.

[3] R. Smith, M. Moutoussis and E. Bilek, “Simulating the computational mechanisms of cognitive and behavioral psychotherapeutic interventions: insights from active inference”, Scientific Reports, vol. 11, no. 1, 2021.