Classification of body postures using smart workwear

Background Despite advancing automation, employees in many industrial and service occupations still have to perform physically intensive work that may have negative effects on the health of the musculoskeletal system. For targeted preventive measures, precise knowledge of the work postures and movements performed is necessary. Methods Prototype smart work clothes equipped with 15 inertial sensors were used to record reference body postures of 20 subjects. These reference postures were used to create a software-based posture classifier according to the Ovako Working Posture Analysing System (OWAS) by means of an evolutionary training algorithm. Results A total of 111,275 posture shots were recorded and used for training the classifier. The results show that smart workwear, with the help of evolutionary trained software classifiers, is in principle capable of detecting harmful postures of its wearer. The detection rate of the evolutionary trained classifier (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\bar{a}_{ccr} = 0.35$$\end{document}a¯ccr=0.35 for the postures of the back, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\bar{a}_{ccr} = 0.64$$\end{document}a¯ccr=0.64 for the arms, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\bar{a}_{ccr} = 0.25$$\end{document}a¯ccr=0.25 for the legs) outperforms that of a TensorFlow trained classifying neural network. Conclusions In principle, smart workwear – as prototypically shown in this paper – can be a helpful tool for assessing an individual’s risk for work-related musculoskeletal disorders. Numerous potential sources of error have been identified that can affect the detection accuracy of software classifiers required for this purpose. Supplementary Information The online version contains supplementary material available at 10.1186/s12891-022-05821-9.


NEAT Algorithm
Evolutionary algorithms have already been used to optimize the connection weights of ANNs with fixed structure, for example with Differential Evolution [1]. However, the structure of a ANN also affects the performance and trainability of the network [2], even if in principle a fully-connected ANN with only one hidden layer can approximate any continuous function [3]. Algorithmic adaptation of the topology of ANN is also necessary because manual adaptation works only by trial and error and thus involves considerable human effort [4,2]. The class of algorithms or ANNs in which both topology and weights are evolved is called Topology and Weight Evolving Artificial Neural Networks (TWEANNs).
The NEAT algorithm (Neuroevolution of Augmenting Topologies) [2], introduced by Stanley and Miikkulainen in 2002, belongs to this class and uses direct coding to represent the nodes and connections of the ANN in the genome. Here, NEAT uses two separate genomes for neurons and connections for genome coding (see Figure 1) Figure 1: An example of a genotype and its mapping to the ANN as a phenotype (image source: recreated from [2]).
NEAT has three essential characteristics [2]: • minimal topology: The NEAT algorithm initially initializes the population with the smallest possible complexity, i. h., the ANNs have only one input and one output layer at the beginning, whose number of neurons is given by the use case. The algorithm adds new neurons and connections between neurons in its mutation step. Thus, more complex and different individuals are created with each generation. This principle is called complexification.
• tracking topology changes: But if different topologies, including different numbers of connections and neurons, are evolved, how can related gene segments be combined in a one-dimensional vector? The NEAT algorithm solves this problem with a global Innovation Number assigned to each gene that is added. The assigned number is also passed on, so that matching genes in the genome for the fusion can still be found in the offspring of subsequent generations. The number of matching genes in a genome also determines the similarity between individuals, which has great significance for the next characteristic.
• species: When ANNs mutate in NEAT, i.e., complexity increases due to added neurons and connections, it is likely that the fitness of the ANN will initially decrease before the connection weights are trained to the new topology. To prevent the mutant individuals from being displaced again in the short term by simpler competitors due to their initial weakness, NEAT introduces the concept of species. If individuals strongly resemble each other, i. h. they have a very similar genome, then they are combined into one species. Inheritance and selection then take place only within a species, ensuring that topologically different individuals do not displace each other, but only weaker individuals of their own species. With this concept, co-evolution is possible in NEAT, i. h. the parallel optimization of different solution approaches over many generations.
The NEAT algorithm can be written as pseudocode as follows (according to [2] and from YAHNI 1 ): Remove individuals with fitness = 0

5:
Parts population in species 6: Choose best individuals as elite 7: Produce descendants 8:

Mutation: add random neuron genes or connection genes
In line 3, an evaluable ANN is generated from each individual (genotype) and evaluated against the test data set. If the fitness of the ANN is minimal (fitness = 0), the individual is removed from the population (line 4).
In line 5, the population is divided into different species based on a distance measure and a threshold. At the beginning, the entire population belongs to one species and diversifies in the course of the algorithm. The best individuals of a species are protected as elite for the next generation (line 6).
Within each species, offspring are generated in the next step (line 7). The species concept ensures that only compatible individuals are recombined.
At the end of the run (line 8), neuron or connection genes are then randomly inserted into the respective genome. The temporarily generated ANNs are discarded, only the genotype remains over a generation run.

Balancing Algorithm
The flow of Algorithm 2 is as follows: the main function BalanceData receives the datasets S structured by subjects and a minimum tolerated balancing error balanceVTR. First, we determine how many records are minimally available from each subject (line 4). Half of this number (minSamples) is randomly chosen from each person's records and added to the balanced dataset BD (lines 5-8). In this process, the class probabilities from the target sizes of the datasets are summed (variable c). Thus, the datasets are balanced with respect to the subjects*.
However, because of random subsampling, the classes may not be uniformly balanced, i.e., individual classes appear disproportionately often in the dataset. Therefore, one dataset is now randomly selected in turn from each person's dataset. If the data set improves the balance of the classes, it is added to the balanced data set BD, otherwise it is discarded. Depending on the design of the datasets and the class probabilities, this section does not terminate reliably, i.e., it may not be possible to achieve a complete balance. Therefore, maxIter ensures that the algorithm terminates eventually.

Choice of hyperparameters for NEAT
The NEAT algorithm can be influenced by a large number of parameters (hyperparameters). Table 1 lists the most important parameters and their values used here.
The most important hyperparameters are the population size, i. i.e. how many neural networks are evolved in parallel, and the number of generations the algorithm runs through. Here, 500 was chosen as the population size. The rule of thumb "ten times the dimension" [6,7] was interpreted more generously here because of the additional diversity of possible mutations. The maximum number of generations was chosen to be G max = 2000, which in preliminary tests proved to be just about feasible with respect to the runtime on the cluster. if balance > Balance(c neu ) then If D contributes to better balance...