Collective Intelligence in Self-Organized Industrial Cyber-Physical Systems

: Cyber-physical systems (CPS) play an important role in the implementation of new Industry 4.0 solutions, acting as the backbone infrastructure to host distributed intelligence capabilities and promote the collective intelligence that emerges from the interactions among individuals. This collective intelligence concept provides an alternative way to design complex systems with several beneﬁts, such as modularity, ﬂexibility, robustness, and reconﬁgurability to condition changes, but it also presents several challenges to be managed (e.g., non-linearity, self-organization, and myopia). With this in mind, this paper discusses the factors that characterize collective intelligence, particularly that associated with industrial CPS, analyzing the enabling concepts, technologies, and application sectors, and providing an illustrative example of its application in an automotive assembly line. The main contribution of the paper focuses on a comprehensive review and analysis of the main aspects, challenges, and research opportunities to be considered for implementing collective intelligence in industrial CPS. The identiﬁed challenges are clustered according to ﬁve different categories, namely decentralization, emergency, intelligent machines and products, infrastructures and methods, and human integration and ethics. Although the research indicates some potential beneﬁts of using collective intelligence to achieve the desired levels of autonomy and dynamic adaptation of industrial CPS, such approaches are still in the early stages, with perspectives to increase in the coming years. Based on that, they need to be further developed considering some main aspects, for example, related to balancing the distribution of intelligence by the vertical and horizontal dimensions and controlling the nervousness in self-organized systems.


Introduction
In the last years, there has been a strong pursuit for intelligent, reconfigurable, and responsive systems to face the pressures imposed by customers that demand more customized, low-price, and high-quality products [1,2]. This is aligned with the new trends promoted by Industry 4.0, which involve the digitization of traditional factories, aiming at the modernization of industry, with intelligent factories that are more productive, efficient, flexible, adaptive, reliable, and in the end, more globally competitive [3].
Cyber-physical systems (CPS) [4,5] play an important role in this vision and can be seen as the backbone platform to implement these innovative systems, complemented by emergent ICT technologies [5,6] (e.g., Internet of things (IoT), artificial intelligence (AI), and cloud computing). The adoption of CPS offers an alternative way to design control systems based on a set of networked distributed and autonomous entities, combining cyber and physical counterparts, which may cooperate to reach the system's goals [4,5]. CPS can be applied to develop large-scale intelligent systems exhibiting self-* properties (e.g., healing, adaptation, and organization), namely smart manufacturing, smart healthcare, smart electrical grids, smart cities, smart transportation, and smart logistics [7].
Since its conceptualization, CPS have evolved from a few simple physical entities and software components to a heterogeneous and complex network of intelligent physical entities and multiple layers of software components and applications driven by advanced data analysis. In this context, AI is a key enabler that leverages software infrastructures and applications to provide the required information for supporting the operation and management of the physical components and systems [8]. In such approaches, the system intelligence and data analysis capabilities appear in the form of collective intelligence, which is distributed among the many individual computational nodes and emerges from the interaction among them, each one contributing with its knowledge and skills to the overall system behavior. This design perspective allows a chance in the way companies, systems, and processes operate, from reactive and corrective to a more informative, predictive, and intelligent manner.
In spite of all the expected benefits, regarding modularity, flexibility, robustness, responsiveness, reconfigurability, and adaptation, the engineering of such CPS faces several important challenges, for example, related to the organization and balancing of intelligence, the non-linearity of the interactions among individuals, the system self-organization, the myopia due to the narrow view of the surrounding environment, and consequently, the limited local intelligence scope. In this sense, these aspects should be properly handled to extract the entire set of benefits and consequently enable the engineering of the next generation of automation systems.
With this in mind, this paper discusses collective intelligence systems associated with the novel industrial CPS, expressed in the following three research questions: • RQ1: Is collective intelligence applied and beneficial in industrial CPS? • RQ2: What are the main key enabling technologies and application sectors of collectiveintelligence-based industrial CPS? • RQ3: What are the main challenges in developing collective-intelligence-based industrial CPS?
To address these questions, a comprehensive analysis of the literature was performed. Firstly, the related concepts are briefly discussed, and based on a further study of collective intelligence, by analyzing the papers retrieved from scientific repositories, the enabling technologies and application sectors are analyzed, allowing us to answer RQ1 and RQ2. An automotive assembly line case study was briefly described in order to illustrate and contextualize the application, benefits, and concerns of collective intelligence in the development of industrial CPS. Based on this, and supported by the literature review, several challenges and research opportunities were identified and discussed, thus answering RQ3. In this sense, the answers to these RQs contributed to identifying that the use of collective intelligence can benefit the industrial CPS by enabling the development of self-adapting and autonomous components with decentralized control and decision making, where AI, IoT, and edge computing represent some key enabling technologies.
However, adoption of such approaches is still in the early stages and needs to be further developed to address some challenges, for instance, related to the balancing of the distribution of the collective intelligence among several computational layers (e.g., cloud and edge) and the management of nervousness in self-organized systems based on emergent intelligence.
The rest of the paper is organized as follows: Section 2 provides an overview of the definition of the collective intelligence concept, especially in the industrial CPS context. Section 3 presents the supporting concepts, enabling technologies, and application sectors associated with the collective intelligence in industrial CPS. Section 4 presents an example of the application of collective intelligence in an industrial automotive case study, and Section 5 discusses some challenges and research opportunities in this field. Finally, Section 6 closes the paper with conclusions and future work.

Characterization of Collective and Emergent Intelligence
The concept of collective intelligence is researched in several fields, including sociology, biology, business, and computer science [9]. It is generally defined as the complex and intelligent behavior that emerges from the interaction among a group of distributed and autonomous entities endowed with simple behaviors and/or limited intelligence that seek to maximize private utilities that can be aligned with a global system utility [10][11][12]. This work focuses on the aspects of collective intelligence in the domain of computer science regarding the development of intelligent and autonomous systems. The development of such systems is researched in the field of AI, where different approaches and technologies are used to enable multiple distributed entities to interact and cooperate, leading to the emergence of intelligent behaviors and functionalities. In the CPS context, the collective intelligence capabilities emerge from the interaction and coordination of upper and lower cyber-physical components. In order to contextualize the collective intelligence in CPS, this section briefly analyzes some related concepts, methods, and technologies.

Definitions and Supporting Concepts
The realization of CPS requires methods and technologies that, besides supporting the development of autonomous components, should be able to handle, in a distributed manner, the interaction and the coordination/collaboration between spatio-temporally heterogeneous physical and software components, operating in open and highly dynamic environments. Such approaches should support the following features: • Autonomy, that is, the ability to independently control its own structural and behavioral properties, providing decoupled communication interfaces that assure robustness, flexibility, and loose coupling characteristics. • Cooperation strategies, including collaboration and negotiation, that is, the capability to interact and share information with other components to reach the system goals. • Context awareness, that is, the capability to perceive its own operational context (environment and internal resources). • Cognitive computation, that is, the ability to reason about its own status and then predict, plan, and act for future behaviors (requires context awareness). • Learning and adaptation, that is, the ability to adapt their behaviors and learn from the experience.
In this context, the AI is not only present in the data analysis and machine learning (ML) algorithms, but also in the development of intelligent components and distributed complex systems. Such collective intelligence emerges from the interaction and collaboration among individuals that exhibit intelligence at the local/micro level, providing an alternative way to design intelligent systems, where the traditional centralized pre-programmed control is replaced by a distributed functioning where the interactions between individuals lead to the emergence of an intelligent global behavior that is unknown to them [13]. Swarm intelligence is an example of this emergent collective behavior that is typically made up of a community of simple homogeneous or heterogeneous individuals following very simple rules and interacting locally with each other and with their environment [13,14]. Examples of swarm intelligence include ant colonies, bird flocking, and Wikipedia [14].

Emergence and Self-Organization
As mentioned earlier, the interaction among these entities contributes to the emergence of the collective intelligence, making the system much more powerful, but at the same time more challenging (e.g., due to emergence and self-organization). The emergence concept defines the way complex systems (macro level) arise from a multiplicity of interactions among entities exhibiting simple behavior (micro level), without the guidance of a central entity and only when the resulting behavior of the whole is greater and much more complex than the simple sum of the behaviors of its parts [15]. Emergence is strongly dependent on the cognitive aspect of individual entities and their capability to adapt to condition changes, as well as to the non-linearity of the multiplicity of interactions and the sensibility of initial conditions (also known as butterfly effect, i.e., small modifications in input parameters may provoke high variations in the output parameters).
In terms of evolution, reconfigurability and plugability can be enhanced by applying self-organization principles [16,17], which, in spite of the several definitions (see e.g., [18] and the references therein), can be defined as the "ability of an entity/system to adapt dynamically its behavior to external conditions by re-organizing its structure through the modification of the relationships among entities without external intervention and driven by local and global forces" [14]. The self-organization principle can be found in several fields, such as biology (e.g., ants foraging and birds flocking), chemistry (e.g., the Belousov-Zhabotinsky reaction), physics (e.g., the second law of thermodynamics), and social organization (e.g., traffic in crowed roads) [14], and it can be applied to potentially solve several large complex problems, namely in the fields of economics, manufacturing, virology, and logistics.
Another concept related to collective intelligence is ambient intelligence, which refers to pervasive and ubiquitous computing environments that are sensitive and responsive to the presence of humans, and which is completely aligned with the Industry 5.0 principles that aim to combine digitization with sustainability and human integration.

Multi-Agent Systems
A prominent example of collective intelligence is offered by the multi-agent system (MAS) [19,20], classified as a distributed artificial intelligence (DAI) technique, which is based on a set of autonomous and cooperative entities, called agents, that reside in a physical or virtual environment and communicate with each other to achieve the system goals. The abstraction of an agent considers a physical or logical component that is able to perceive/sense and act in its environment, perform actions to change its environment, reason over its internal states, and communicate with other agents [21]. Besides these basic capabilities, an agent can be endowed with learning mechanisms that will allow it to adapt its state and behaviors dynamically in the case of condition changes. In such systems, the global intelligent behaviors emerge from the interaction between individuals through the implementation of distributed interaction strategies (e.g., collaboration and negotiation).
In this sense, MAS completely fits the CPS approach, by distributing intelligence among a network of distributed and intelligent nodes, each one being autonomous and cooperative and possessing local knowledge and skills and a local perspective of their surrounding world, as illustrated in Figure 1. The global system behavior emerges from the cooperation among individual agents, each one contributing with its knowledge and skills, and decisions are made in a decentralized manner. MASs, and consequently their CPS implementations, offer an alternative way to design complex systems based on the decentralization of functions [20], providing modularity, flexibility, robustness, plugability, loose coupling, adaptability, and re-configurability on the fly, as also illustrated in Figure 1. This overcomes the typical problems exhibited by the traditional centralized, rigid, and monolithic control structures, which are no longer sufficient to address the current strong requirements imposed on manufacturing systems. Note that, since these distributed entities may suffer from myopia (i.e., lack of information), any decision is based on incomplete and even, at some point, inaccurate/outdated information.
With this in mind, a CPS can be considered an advanced DAI system, where the data, intelligence, and control are distributed, eliminating bottlenecks. Additionally, the horizontal layers of components envisioned by CPS can overcome some of the limitations of traditional distributed systems, where the knowledge about the overall system is dispersed throughout the entities, which individually have only a partial and imprecise perspective [22]. This layer creates a hierarchical coordination/control structure [22], where upper components integrate the data and information for several lower components, with a global view of the system that can support the lower layers, mainly in the long-term tasks, since the short-term tasks usually do not require a complete view of the system.

Holonic Systems
The holonic paradigm translates Koestler's observations and Herbert Simon's theories into a set of appropriate concepts for distributed control systems that are quite similar to MASs, in the sense that they share some common characteristics, as they are also based on distributed systems comprising autonomous and cooperative entities, in this case called holons. However, holonics provide additional concepts (e.g., holarchy and recursivity) that enhance the ability to design large-scale and complex collective intelligent systems.
The core concept is the holon, which represents simultaneously the part and the whole, that is, an entity can be a part of a bigger system (e.g., a robot in a assembly line) and at the same time the whole system (e.g., the robot is the final product comprising several internal components, such as sensors and actuators), as illustrated in Figure 2. Additionally, a holon can belong simultaneously to multiple holarchies, an important difference from the traditional concept of hierarchies, allowing the holon to preserve the stability of the hierarchy while providing the dynamic flexibility of heterarchical structures.  Holons share some core principles with agents, namely autonomy and cooperation, but the inherent recursivity capability associated with a holon, and particularly with the Janus effect (i.e., a holon is simultaneously a self-contained whole to its subordinated parts and a dependent part when seen from the higher levels), strongly contributes to simplifying the design of complex problems by dividing the initial problem into several small problems.
Using these holonics principles, industrial CPS based on collective intelligence can be designed and deployed to exhibit modularity, reconfiguration, and self-organization in a quite natural manner. In addition, CPSs inherit some holonics principles in their foundations (e.g., recalling the principle that a holon may combine an information processing part and a physical asset).

Collective Intelligence in Industrial Cyber-Physical Systems
As illustrated in Figure 3, a further study of collective intelligence can be performed by analyzing the papers retrieved from scientific repositories. In this work, the dataset was built up by retrieving papers from the Scopus repository according to a set of criteria that combines the terms described in Table 1 using a combination of OR and AND operators: the operation OR was performed between the terms of the same group, and the operation AND was performed between the terms of groups 1 and 2.   The search was performed in the title, abstract, and keywords, within the engineering and computer science domains, and considering only papers written in English. The obtained dataset contains 59 documents and was analyzed by using automated methods based on natural language processing combined with a human review analysis to obtain preliminary insights regarding the current state of the art of collective intelligence in industrial CPS. For this purpose, the NLTK Python library (www.nltk.org) was used to perform the preprocessing and the analysis of the n-grams. The preprocessing aimed to clean and structure the data, and it included removing symbols (e.g., comma and punctuation) and stop words (e.g., "the", "a", and "in") and performing lemmatization, a technique for grouping the different inflected forms of a word. With the structured data, the list of n-grams (i.e., a combination of one, two, or more words) is extracted to provide possible terms associated with collective intelligence in the industrial CPS context. Finally, the list of n-grams was reviewed by independent reviewers to validate the most relevant terms.
The described study has some limitations that should be highlighted. The criteria used in this paper are specified to find research works related to collective intelligence in industrial CPS, but not to ensure that all records in this field were found from the scientific repository. Therefore, some papers may not have been included. In addition, the exclusion of papers not written in English implies disregarding some publications that could be relevant.

Characterization of the Field
Considering the resulting dataset, the initial analysis aims to understand the demographics of the publications associated with collective intelligence in industrial CPS. Figure 4 illustrates the evolution of the number of publications along the years, clearly showing three periods of interest: initially, a limited interest in the topic; then, between 2016 and 2019, growth to a high peak of interest; and finally, after 2020, a reduction of interest, probably justified by the COVID-19 pandemic situation slowing down the interest in this topic. This clearly shows that-despite it currently being a hot topic, particularly in sociology, biology, political science, economics, and computer science fields, as illustrated by the 5650 documents retrieved if considering only the terms of group 1-the application of collective intelligence in industrial CPS environments has not yet received significant attention from academia and industry communities. However, it is expected to significantly grow and gain relevance in the next years.  Investigating the concepts and technologies that are associated with collective intelligence is also of interest, and the results from the analysis of the obtained n-grams for the supporting concepts are illustrated in Figure 5.
Analyzing the results, it is clear that the collective intelligence concept is strongly linked to some principles related to the distributed nature of such systems, namely distribution, decentralization, and collective knowledge, as well as with some concepts more related to the dynamics of such systems, namely emergence, self-organization, and selfadaptation. It is also noticed that the existing works explore the development of collective intelligence by deploying distributed intelligence systems for complex problem solving and decision support using knowledge-based approaches. It is important to highlight the presence of holonics as the major supporting concept, whose theories have provided inspiration for the development of industrial CPS. In terms of technologies, as illustrated in Figure 6, it is clear that AI, MAS, cloud and edge computing, IoT, and wireless sensor networks are strongly associated as emergent ICT technologies for the Industry 4.0 initiative. Big data and data mining are also included in the list of enabling technologies, which highlights the value of data in such collective systems. This analysis also shows that different methods are used to implement the AI capabilities, namely MAS, ML, and natural language processing. Inside the ML cluster, neural networks and deep learning are the most used techniques to drive intelligence in each individual entity. It is also interesting to analyze the most relevant application sectors for collective intelligence systems in industrial CPS. Figure 7 indicates that collective intelligence is successfully applied in several domains, with robotics, manufacturing, and business clearly standing out from all the others. However, other sectors also strongly benefit from adopting collective intelligence principles, namely smart grids, control systems, smart cities, telecommunications, agriculture, and logistics. This clearly shows the broad application of such collective intelligence systems for solving large-scale and complex problems.

Collective-Intelligence-Based CPS Approaches
A further analysis of the retrieved research was conducted to better understand the level of adoption of such systems, as well as the technologies and methods used to achieve collective intelligence. For this purpose, according to the bibliographic search performed in the Scopus repository and considering the use of collective intelligence approaches to achieve the desired levels of autonomy and dynamic adaptation of industrial CPS, the main research works that directly propose collective-intelligence-based industrial CPS approaches were identified and analyzed, as summarized in Table 2. Multi-agent systems-agents to manage the manufacturing line and report problems related to unexpected events Multi-agent systems-agents to coordinate and control the speed of multiple induction motors, aiming to synchronize them for greater system efficiency In this analysis, most of the works use MAS-based approaches to provide the required collective intelligence in industrial CPS, particularly using distributed interaction strategies (e.g., negotiation mechanisms) to achieve collective intelligence, as presented in [23,24,30,32,33]. Complementary emergent digital technologies were also identified (e.g., IoT, edge, fog and cloud computing, and AI [26,28,31,34]), usually embedded in MAS solutions to empower data analysis and intelligence capabilities. It is interesting to note that these distributed intelligence capabilities are usually balanced among the edge/fog/cloud computational layers, exploring the benefits they provide to address the particularities of the different data analysis demands.
It is also noticed that the most common application domain is manufacturing (e.g., [23,24,26,27,30,33]), where collective intelligence solutions are adopted to deal with the current trends for highly customized, flexible, and reconfigurable processes to meet fast-changing market conditions. However, some works propose solutions for the energy domain (e.g., see [25,32,36]) and IoT-based smart applications (e.g., see [31,34]). In the energy domain, the potential of collective intelligence has been demonstrated, particularly when it is enhanced by MAS capabilities, for more energy-efficient systems. On the other hand, in the IoT-based smart applications, collective intelligence is adopted to enable distributed and cooperative tasks between IoT devices. Additionally, almost all solution approaches presented in the analyzed research works were validated in demonstrators, testbeds, and simulations. This clearly illustrates the reduced industrial adoption of such systems, which is an indicator of the need for further research on these topics, in particular their deployment and validation in real scenarios.

Experimental Example of Applying Collective Intelligence
Aiming to illustrate the application of collective intelligence in a practical use case, this section describes the deployment of an agent-based CPS to implement zero-defect manufacturing (ZDM) strategies in an automotive assembly line. The case study comprises a sequential set of work stations, where the car being produced is passed along through its assembly process. In each station, the cars are monitored in real time with the objective of achieving early identification of deviations and defects along the different quality control stages. Besides monitoring the quality of the produced vehicles, the supervisory system needs to support changes and disturbances in the production process for the proactive and dynamic adaptation of process and inspection parameters.
An MAS-based system, illustrated in Figure 8 and developed using the Java Agent Development (JADE) framework [37], was deployed in the automotive assembly line, considering four types of agents, namely product type agent (PTA), product agent (PA), resource agent (RA), and independent meta agent (IMA) [38], which are responsible for collecting and performing data analysis functions in a distributed and collaborative manner regarding the implementation of the ZDM philosophy. The implementation of such functions using AI algorithms in a distributed manner (i.e., by components deployed in a cloud or edge level that collaborate to achieve the system goals) allows one to achieve collective intelligence in a self-organized CPS.  Briefly, RA agents represent the inspection stations and are responsible for collecting the data and performing data-stream analysis aimed at real-time monitoring and early detection of defects. They can interact with other RA agents, linking the different multistage stations in order to share information and consequently enhancing their knowledge based on collective intelligence strategies, to support their monitoring and diagnosis tasks. PA comprises another type of agent; these agents are responsible for managing the production of the products (i.e., cars) along the multiple production stages of the factory plant. Similar to the RAs, which represent each inspection station, they represent each produced car and, besides integrating and analyzing the data from RAs, can also employ collective intelligence strategies to interact with each other in order to correlate data from different assembled cars and collaboratively assess and diagnose the results of the production and quality inspection process. PTA agents, one for each product model, represent the catalog of cars that can be produced in the assembly line and contain the knowledge of the process and product required to produce the car. IMA agents operate at a strategic level to provide global system optimization by managing the aggregation of data and the generation of new knowledge. Different from RA and PA, PTA and IMA agents have a supervisor and manager role, interacting with lower layer agents. Since they have a broad view of the system and its components, they are able to provide high-level information and services to support and coordinate lower-level agents. More details can be found in [38].
In this context, each agent embodies intelligence to perform data analysis tasks, aiming to achieve its own objectives, and it is necessary to interact with the other agents to exchange data that will support the execution of data analytics functions that emerge at the macro level. As an example, RA agents have embedded advanced algorithms (e.g., LOF [39]) to identify abnormalities in the measurements. The LOF algorithm is an unsupervised anomaly detection method that considers multiple parameters of a data sample to provide a score, defining an outlier as a sample that substantially deviates from the local density distribution of the data points. Figure 9 includes charts with the quality outlier score for each car being produced, based on the scoring performed by the RAs placed at two body shop stations and integrated by the PAs. The LOF data model was built considering the first 8000 data samples, 100 neighbors, and a contamination factor of 0.1 [38]. Points marked with 'X' indicate cars that did not reach the desired quality levels at an individual station. The RA agents related to the different work stations interact to share data and correlate the quality outlier scores, aiming to check the evolution of the product quality along the multiple production stages. This shared information, based on collective intelligence strategies, can be used, for example, to consolidate their analysis outputs, which can improve their actions and consequently the early detection of abnormalities. Figure 9 also highlights the cars (marked with yellow bars) that did not achieve the desired quality levels at both stations, which requires not only reworking the product but also the diagnosis and tracking of the related causes at each station, as well as their impact and propagation along the multi-stage process.
A second example is related to the detection of changes in the measured parameters, which may require updating the data models and settings used for the monitoring and forecasting tasks. In this scenario, all four agents interact, as illustrated in Figure 10. For instance, the process starts when an RA detects a concept drift in one of the monitored parameters during inspection of the assembly process. The chart associated with the RA, in Figure 10, illustrates a concept drift detected in a monitored parameter based on the algorithm of Page-Hinkley. In this situation, the RA interacts with the IMA to inform about this event. The IMA is in charge of keeping the monitoring settings of lower-level agents updated. For instance, when a concept drift event is detected, it is responsible for taking actions to determine the new settings that are required in the new scenario. The chart associated with the IMA, which can be seen in Figure 10, illustrates the application of a clustering algorithm based on the BIRCH method in the previous data samples. Since this clustering analysis considers many parameters, the principal component analysis (PCA) algorithm was used to perform a dimensionality reduction in order to enable the visualization of results. Three clusters were identified, where the blue one represents the most recent samples that belong to the concept drift. The output of this process produces a report with statistics that are used by specialists to define the new monitoring settings and data models that are updated to the lower-level agents (i.e., the RA and PTA). This collaboration between the distributed components enables them to self-organize and adapt to the changes in the process. In this scenario, the PTA also uses the KPIs of each car, provided by the PAs, to monitor trends in their behaviors. The chart associated with the PTA, which can be seen in Figure 10, illustrates the trends identified, as well as a short-term forecast that is performed using the ARIMA model. This chart also illustrates the control boundaries (σ), which, in this case, are used to determine if the quality of the vehicles is kept at the desired level. In this sense, like the RA, the settings and data models of the PTA may need to be updated when a change in the process operating condition is detected.

Challenges and Research Opportunities
The engineering of industrial CPS based on collective intelligence that exhibits self-* capabilities (e.g., self-organization, self-adaptation, self-optimization and self-healing) poses several important scientific and technological challenges and opens different research opportunities. Table 3 summarizes the identified challenges, which are clustered according to five different groups: decentralization, emergency, intelligent machines and products, infrastructures and methods, and human integration and ethics. Their expected development difficulty and business priority are also presented, based on the vision, requirements, and technologies associated with the fourth industrial revolution. It is also important to refer that the structure presented in this table is based on similar tables found in the works of [4,5,40] that discuss general challenges to develop CPS, while this work focuses on specific challenges to develop collective intelligence in industrial CPS. The first cluster is related to the intelligence decentralization aspects, including challenges related to the decentralization of data analysis, decision making, and control, which is crucial for achieving industrial CPS that supports distributed and dynamic environments. In this way, several challenges arise related to implementing collaborative multi-level (local versus global) data analysis (covering the horizontal and vertical dimensions), as well as balancing the data-processing capabilities among the different computational layers. Since such decentralized systems are based on the interaction among individual entities that possess a limited knowledge of the world, the management of myopia is crucial to achieving acceptable optimized solutions. In this context, interaction and negotiation mechanisms and strategies, as well as approaches to develop distributed components and systems, such those provided by MAS, are essential to cope with these challenges. In the same manner, with the sharing of data among individual entities strongly required to achieve the global system's objectives, and particularly to achieve collective intelligence behaviour, security and data privacy are important aspects to be considered. The implementation of cyber-security mechanisms, empowered with AI techniques and designed for applications with computationally constrained resources, is a challenge that needs to involve multi-disciplinary research teams, including researchers coming from the ethics and law fields.
The second cluster includes challenges in coping with the system complexity and the emergent behavior that arise from the development of decentralized and autonomous (i.e., intelligent) components. Although this can push the system to its limits, it must still be controllable, and it must present the desired levels of determinism, especially in industrial environments. For instance, components should be required to respect a set of rules and constraints regarding the reliability and security of shared information and resources. Since the non-linear interaction between individuals and their autonomy to reorganize may provoke the emergence of inappropriate behaviors, functions, and properties, it is necessary to develop mechanisms and policies to ensure that only 'good' and 'ethical' behaviors will emerge. In the same manner, as result of the self-organization process, some instability may appear in the system, this being necessary to control the nervousness of individuals (e.g., regarding when and how they adapt to the observed events). A key element of controlling this emergent behavior is the design of proper and robust self-reconfiguration and collaborative mechanisms, which must support the interaction among the components but also consider the related mechanisms to assure the desired behavior of the system. In this cluster, another important issue is related to the development of tools for the verification and certification of such intelligent systems, which is essential for their adoption and application in real environments. Such tools must be able to assess the system's behavior and assure that it will operate properly considering its environment dynamics.
The third cluster comprises the challenges related to the development of intelligent machines and products. Besides the interaction and collaborative mechanisms, another important aspect is the intelligence embodied in each component. In this context, ML and data analysis play an important role. However, it also implies several challenges, including the reliable acquisition and integration of operational and business data, and the efficient use of ML algorithms for predictive and proactive analytics, which besides considering the dynamics of industrial environments, must also cope with data uncertainty, reliability, and incompleteness. Note that these environments are mostly characterized by imbalanced or unlabeled datasets, which restrict the use of supervised learning algorithms, raising the need to adopt unsupervised or active learning approaches, as well as techniques to enforce user feedback in the annotation of data samples. Another aspect where collective intelligence enabled by CPS can support the design principles of Industry 4.0 regards the synergy between operational and business information, which raises challenges regarding the inherent complexity and different characteristics of these environments and their systems and components. Such an integration between the operational business level and the product-as-a-service business model also poses security issues.
The infrastructures and methods cluster includes challenges that must be met to design, develop, and manage the aforementioned aspects. These challenges are related to the design of approaches for embedding AI capabilities in constrained device platforms located at the edge computing layer that are essential for supporting several CPS aspects, including those related to distributed and collective intelligence. Directly related to this challenge is the need for CPS frameworks and testbeds to support the development and testing of such systems and their features. Moreover, the development and management of such systems requires the formation of teams with multi-disciplinary skills in AI and CPS. Another essential aspect to enable collective intelligence capabilities comprises the representation of the shared knowledge in heterogeneous AI environments, which can be supported by technologies such as ontologies and semantic webs.
Finally, the last cluster is related to the human integration and ethics and responsibility challenges. Despite the higher level of automation, a human presence will be still required to develop, maintain, and operate such complex systems. In this context, beyond the ML approaches that can automatically extract patterns from data to devise, for example, models that can identify and predict events, in the scenarios where ML is not applied, approaches for the extraction of knowledge from the human's experience are required. Another concern that such systems must address is related to ethics and responsibility (i.e., their actions must not cause any harm or endanger operators). This is a challenge in AI systems, especially those based on ML, which can be biased and lead to forms of discrimination.
Two of the aforementioned challenges, namely the balance and distribution of intelligence among the horizontal and vertical dimensions and the control of nervousness in self-organized systems, will be discussed in the next sections.

Balancing the Distribution of Intelligence
The distribution of intelligence by several computational nodes (e.g., following a CPS structure) requires a proper balance of the intelligence and data analysis capabilities by the horizontal and vertical dimensions, and particularly by the computational layers (e.g., cloud and edge, where the agents are deployed).
In fact, the traditional IoT-based data analysis approaches, where all the collected data is sent to be processed at the cloud computational platform, provide a means to run powerful algorithms using huge batches of aggregated data, with cloud offering optimization and elasticity to scale up or down according to the computational demands.
In spite of such benefits, the cloud paradigm presents some drawbacks, for example, related to information security and privacy, accessibility (quality and bandwidth of the network connection), latency, and responsiveness to condition change. On the other hand, edge computing enables local and decentralized data processing (i.e., at or close to the data sources [41]), endowing end devices with data analysis capabilities to increase the intelligence and responsiveness of physical devices, enabling the collective intelligence capabilities and consequently the efficiency and autonomy of the whole system. However, with the use of edge computing, it is not possible to run powerful AI algorithms, so the aggregation of data and optimized solutions cannot be achieved.
The solution is to manage these trade-offs, moving from the cloud-driven approaches, where the data analytics functions are centered in the cloud, to cloud-edge approaches, where the data analytics functions are distributed among cloud-edge levels, with the filtering and monitoring functions usually deployed at edge nodes and more advanced analytics functions deployed at the cloud, as illustrated in Figure 11. The harmonization and balancing of the data analysis functions among the different computational layers is not an easy task, as it is strongly dependent on several criteria, including the response time, volume of data, resources' computational capabilities, and network infrastructure, as discussed in some research works [42][43][44][45]. In this context, some works also propose approaches that consider such criteria to support the design of decentralized data analysis in intelligent industrial CPS. For instance, in [46], a multicriteria fuzzy logic decision-making system is proposed to support system engineers in determining the most suitable computational layer where a given data analysis capability should be deployed. Such a framework illustrates the importance of such tools and how the fuzzy logic approach can be used to map the knowledge of domain experts to create a tool that can support less ad hoc decision making regarding the distribution of intelligence in industrial CPS. Figure 12 provides an overview of the designed fuzzy logic system that considers seven criteria as input variables, namely responsiveness, processing, data persistence, bandwidth, number of nodes, message rate, and message size. Based on this, during the design phase, the values of these criteria must be estimated for each data analysis capability that must be deployed. In order to reduce the complexity of the fuzzy system, in terms of the number of fuzzy rules (which increases exponentially with the number of input variables and linguistic terms), this approach considers a combination of three sub-fuzzy-logic systems. The first provides as output the level of computing resource complexity, the second the level of communication infrastructure complexity, and the third the level of suitability of each computing layer to deploy a given data analysis capability. More details can be found in [46].
It is important to note that the fuzzy logic system should be applied during the design phase of the intelligent CPS system, defining the computational layers where intelligence capabilities should be deployed, and not during the system deployment or runtime.  Figure 12. Overview of the fuzzy logic decision-making system to support system engineers in designing decentralized data analysis in CPS.

Nervousness Control in Self-Organization
In a dynamic and reconfigurable CPS that sometimes presents self-organizing capabilities, robustness (i.e., the capability of a control system to remain working correctly and relatively stable, even in presence of disturbances) and stability (i.e., the condition in which a slight disturbance in a system does not produce a significant disrupting effect on that system) are very important issues. In fact, due to the presence of nervousness in some control entities, some undesired instability may appear and should be taken into consideration during the design of such intelligent systems.
According to the Cambridge Dictionary, nervousness can be characterized as a feeling of worry and anxiety [47], or in other words, the frequency that an entity changes its intentions during its life-cycle [48]. As expected, a calm profile is not adequate for responding to condition changes, but a very frequent change of plans can originate undesired behavior, leading to a loss of system performance, and in extreme cases, to chaotic behavior. This phenomenon, if properly controlled, may be beneficial since it allows improvement of the system responsiveness, but if the level of nervousness is too high, the system can fall into an unstable state, which should usually be avoided. As an example, if drivers in a rushing highway are constantly changing their lane, it will be probably worse than if they stay calm and remain in the same lane. As another example, in energy markets, if a customer is constantly changing its electrical supplier, it will introduce some instability in the electrical network.
In this context, since the objective is to push these systems to their limits while maintaining them stably and under control, the study of system nervousness is crucial for designing dynamic distributed self-organized systems, allowing the system to dynamically evolve safely into different structures while maintaining high performance and responsiveness levels. For this purpose, a certain degree of balance should be considered: reactive enough to respond to an environmental stimulus but calm enough to remain stable.
One example of research in this area is provided by the ADACOR2 holonic control architecture [49], which enhances the ADACOR holonic architecture [50] through the use of self-organization principles to achieve a truly evolvable and reconfigurable system. This architecture allows the system to operate under a multitude of configurations, instead of the two fixed ones defined in the ADACOR, based on a two-dimensional self-organization mechanism that considers the behavioral and structural vectors [49].
Since nervousness symptoms might make entities unstable and cause systems to display chaotic behaviors, ADACOR2 proposes the use of stabilization mechanisms embedded in individual entities to avoid instability, comparable to car shock absorbers [48]. By introducing these stabilizers, the system operates in such a manner that it is pushed to its limits by enhancing the self-organization principles, remaining always under control. These stabilization mechanisms are organized in a two-layer nervousness control approach, as illustrated in Figure 13, where the first layer is responsible for regulating the changing desire imposed by each self-organization module, in terms of structural and behavioral dimensions, while the second level assesses the previous two nervousness controllers, deciding which emergent self-organization procedure will produce the most valuable action and if it will be better than the existing one [49]. The nervousness controllers, in the form of stabilizers, as a way to prevent the appearance of some chaotic behavior, firstly at the holon level and secondly at the system level, can be implemented in several ways, for example, restricting the number of changes within a specific time frame, only allowing the entities to change at predefined intervals, or setting the exploration/exploitation thresholds [48]. ADACOR2 proposes an innovative technique [48], inspired by classical feedback control theory, namely the proportional, integrative, and derivative (PID) controller [51], where the integrative component aims to eliminate the steady state error by limiting the speed of response, and the derivative component aims to predict the future behavior of the error by increasing the speed of response.

Conclusions
This paper discusses the potential benefits and inherent complexity of collective intelligence systems, particularly those linked with the development of industrial self-organized CPS. For this purpose, a comprehensive review of scientific papers, retrieved from the Scopus repository, was performed aiming to answer the three initially established RQs.
Related to RQ1, the literature survey clearly showed the benefits of and growing interest in collective intelligence topics in industrial CPS. This highlights the potential of such approaches to enable the development of more autonomous and self-adapting components with decentralized control and decision-making capabilities able to cope with the emerging Industry 4.0 scenarios. Although its relevance to academic and industrial communities is still in a earlier stage, it is expected to increase in the next years. Regarding RQ2, the main supporting concepts were identified, and they were related to knowledge management, holonics, collective knowledge, self-adaptation, emergence, and decentralization, strongly aligned with the distributed nature of such systems. In spite of the inherent complexity required to enable collective intelligence in industrial CPS, there are several technologies that can contribute to the implementation of such capabilities, where IoT, MAS, AI, wireless sensor networks, and cloud and edge computing technologies clearly stand out from this survey analysis. In this context, the MAS approach in particular represents a hot and promising topic that offers an alternative way to design complex and large-scale systems, providing reconfigurability, robustness, and self-* capabilities. This is illustrated with the application of an MAS-based solution to implement ZDM strategies in an automotive assembly line, where different data analysis functions are distributed among autonomous and cooperative agents deployed in different computational layers ranging from the edge to the cloud.
Despite the benefits and enabling technologies, the answer to RQ3 addresses the challenges and research opportunities of collective intelligence in CPS, ranging from intelligence decentralization, emergent behaviors, intelligent machines and products, infrastructures, and methods, to human integration and ethics. Among these, two main challenges present a special concern for the implementation of industrial CPS solutions, namely the balancing of intelligence among the computational layers and the nervousness control in self-organized systems.
As highlighted in this work, several research opportunities and challenges need to be handled in the future to make progress in the adoption of collective-intelligencebased industrial CPS. For this purpose, future work will be devoted to the development of collective intelligence solutions in industrial CPS use cases, exploring some of these challenges, namely the use of ML for predictive and proactive analytics and compliance with ethics and responsibility.