=Paper= {{Paper |id=Vol-3156/keynote3 |storemode=property |title=A Web-Based Application for Modeling and Deploying Fuzzy Logic-Based Decision Support Systems for Autonomous Cyberphysical Systems (keynote) |pdfUrl=https://ceur-ws.org/Vol-3156/keynote3.pdf |volume=Vol-3156 |authors=Anatoliy Melnyk,Bohdan Zimchenko |dblpUrl=https://dblp.org/rec/conf/intelitsis/MelnykZ22 }} ==A Web-Based Application for Modeling and Deploying Fuzzy Logic-Based Decision Support Systems for Autonomous Cyberphysical Systems (keynote)== https://ceur-ws.org/Vol-3156/keynote3.pdf
A Web-Based Application for Modeling and Deploying Fuzzy
Logic-Based Decision Support Systems for Autonomous Cyber-
Physical Systems
Anatoliy Melnyka,b, Bohdan Zimchenkoa
a
    Lviv Polytechnic National University, Stepana Bandery St, 12, Lviv, 79013, Ukraine
b
    The John Paul II Catholic University of Lublin, Al. Racławickie 14, 20–950, Lublin, Poland


                 Abstract
                 In this article, a web-based application, that allows creation of datasets and sets of rules to
                 build a fuzzy logic-based decision support system (DSS), is proposed. The web application
                 allows creating and deploying many DSSs that can have different specializations and
                 simultaneously be used by many other systems, including cyber-physical system (CPS), as a
                 mean of decision support, via an application programming interface (API), using HTTP
                 requests. The creation of the DSS, based on the fuzzy logic principle, and filling data for it
                 can be done by both an expert human and an application that can handle and transfer data
                 from a specific work area through the Internet. A configured DSS can be used by the CPS
                 and can receive crisp values as input and provide crisp values as output after processing data
                 by the fuzzy logic system. The main technologies that are used in the construction of the
                 web-based application and its architecture are also considered.

                 Keywords 1
                 Fuzzy logic, web-based application, decision support system, cyber-physical system, fuzzy
                 system software.

1. Introduction
   Autonomous CPSs are systems that can make decisions and take actions without the need for
human interaction. The challenge of decision-making is serious in such systems, and many
technological approaches are utilized to attain autonomy, which are based on the architecture of the
CPS and the tasks it should do. For example, applying specialized processors for decision-making
means can be done [1].
   Because of its capacity to successfully tackle a wide range of issues, concerning the decision-
making process in CPSs, fuzzy systems have been widely used.
    One of the most important areas for the usage of fuzzy set theory are fuzzy systems. They employ
fuzzy logic to give a conceptual framework for knowledge representation and reasoning in the context
of imprecision and uncertainty. Due to their ability to incorporate human expert knowledge, handle
imprecision and uncertainty, and describe the behavior of complex systems without requiring a
precise mathematical model, fuzzy systems have been successfully applied to many application fields,
such as control [2], data mining, and so on. Their replication and application, on the other hand,
necessitate a high level of expertise.
   Fuzzy logic is similar to the way that human makes a decision. It deals with fuzzy and inaccurate
information.



IntelITSIS’2022: 3rd International Workshop on Intelligent Information Technologies and Systems of Information Security, March 23–25,
2022, Khmelnytskyi, Ukraine
EMAIL: aomelnyk@gmail.com (A. Melnyk); bohdan.v.zimchenko@lpnu.ua (B. Zimchenko)
ORCID: 0000-0002-8981-0530 (A. Melnyk); 0000-0002-4574-4068 (B. Zimchenko)
            ©️ 2022 Copyright for this paper by its authors.
            Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
            CEUR Workshop Proceedings (CEUR-WS.org)
    The word fuzzy refers to things that are not clear or indistinct. Any event, process, or function that
is in a state of constant change can’t be defined as true or false all the time and it means that we need
to define such actions in a fuzzy way [3].
    The difference between Boolean logic (Fig. 1) and fuzzy logic (Fig. 2) is that, unlike Boolean
logic, fuzzy logic operates differentiated values and they are denoted by a numbers ranging from zero
to one, where one means absolute truth and zero represents absolute falsehood. A number indicating a
value in fuzzy systems is called the truth value.




Figure 1: True/False boolean logic




Figure 2: Degrees of truth in fuzzy logic

   Thus, it can be argued that fuzzy logic is not fuzzy in its content, but is such that may be used to
describe the fuzziness.
   Fuzzy logic apps often use non-numeric values to facilitate the expression of rules and facts by an
expert. Linguistic variables, such as temperature, can take on values such as cold and hot. Because
natural languages do not always contain enough terms to express a fuzzy scale of meanings, it is
common practice to change the meanings of speech using adjectives or adverbs. For example, a
linguistic variable can take such values as very cold or very hot.
   Linguistic variables, their meanings, and rules are represented in fuzzy logic systems assets - an
unordered collection of different elements. It can be written explicitly by enumerating its elements
using parentheses.
   Fuzzy sets may be taken into consideration as an extension and gross oversimplification of
classical units. It may be understood inside the context of set membership. It lets in partial
membership because it comprises factors that have various levels of sets withinside the set. We can
recognize the distinction between classical set and fuzzy set from this.
   The classical set carries factors that fulfill particular properties of membership (Fig. 3), while the
fuzzy set carries factors that fulfill obscure properties of membership.
   A fuzzy set A˜ in the universe of information U can be defined as a set of ordered pairs and it can
be represented mathematically as

                                                                                                   (1)

where           is the degree of membership of y in       and assumes values in the range from zero to
one, so that:
                                                      .                                          (2)

  This fuzziness is well characterized with the aid of using its membership function. In addition, the
membership function represents the degree of truth in fuzzy logic (Fig. 4).




Figure 3: Membership function of classical set A




Figure 4: Membership function of fuzzy set A˜

    The main goal of this work is creating a common approach to developing a fuzzy system
software(FSS), so that CPSs that have their architecture designed differently, can use it to become
more autonomous.
    This paper proposes the solution for those CPSs that have access to the communication
environment, in particular the Internet.
    The solution is a web-API application implemented in the C# programming language using the
Microsoft Asp.NET technology.
    The usage of a web-based application allows solving the problem of integration of the fuzzy logic
system into a CPS.
    This allows programmers and engineers to focus on solving performance issues of the fuzzy logic
system more. Also, this application can be used by many CPSs simultaneously.
    This paper is organized as follows:
    Section 2 presents reviews on existing fuzzy DSSs for CPSs.
    Section 3 depicts the structural elements of the proposed web-based application.
    Section 4 overviews the relational database for data, referred to fuzzy logic, its tables, and their
fields.
    Section 5 explains how fuzzy logic services of the web-based application operate with data and
produce an output result.
    Section 6 concerns the results of work. It describes the experiment, that is performed to prove the
efficiency of the proposed application, in detail.
    Section 7 describes the future works. Section 8 concludes the paper.
2. State-of-the-art
    Today, there is no single solution for integrating fuzzy logic into CPSs. This is due to the
extraordinary diversity of CPSs, the problems they are designed to solve, and their heterogeneous
architecture, because the approaches to CPS design are based on the analysis of the features of
interaction between physical world and cybernetic tools [4].
    In this paper [5], the author analyzes freely available and open-source fuzzy systems’ software to
provide a classified taxonomy that can help researchers easily find existing proposals that are related
to a particular research area. Concerned FSS is overviewed and the main contributors, related to each
field, are described.
    Such heterogeneous architecture of CPSs makes it difficult to design a universal embedded
decision support system based on fuzzy logic in CPSs.
    Most of these systems are developed for specific CPSs and can function only within their
architecture. Some researchers focus on creating a one-size-fits-all approach to cyber-physical
systems.
    For example, this work [6] deals with the development of a tool for modeling and simulating fuzzy
systems. The solution, that is developed, is executed only on the web platform and allows creating of
multiple inference machines and defining various fuzzy models.
    Another work [7] that considers such a universal approach proposes an object-oriented design as
well as the implementation of an inference engine for fuzzy systems. The proposed design and its
implementation consider the engine to be implemented as a standalone component, that can be
referenced by other applications remotely as a web service.
    The authors [8] present a proposed method of dealing with uncertainties, based on the fuzzy logic
approach, for nonstationary fuzzy systems. This method can be applied in CPS with consistency and
robustness needs.
    Most of the existing researches on this topic concern the creation of a narrow-profile fuzzy expert
system(ES) that solves specific tasks and can be integrated into individual CPS.
    The authors of the paper [9] presented a web-based fuzzy ES for lung cancer diagnosis. They made
big research and gathered lots of data from medical books to formulate five inputs for the ES that are
necessary for deciding if a person has a cancer disease.
    The authors of [10] propose the fuzzy control method for actuators of the CPS to improve their
energy economizing. With the help of an intelligent controller, collected data, and a fuzzy logic
subsystem, the power consumption of the whole system was reduced, which was proved by
simulation in the Matlab application.
    In the paper [11], the false alarm reduction system, based on fuzzy logic, was proposed for medical
CPSs. To achieve the goal of reducing false alarms, that are generated by sensors, fuzzy IF-THEN
rules were applied. The developed project is written in Java programming language and is an open-
source project that can be implemented in WEKA [12].
    The paper [13] offers a solution to the problem of estimating the level of moisture in the crop,
which farmers face every year. With the help of the proposed device, the working logic of which is
based on the Mamdani fuzzy rule-based system, farmers can independently assess their harvest and
make decisions about its sale.
    This article [14] proposes an approach to controlling the air conditioner's output temperature with
help of fuzzy logic. The air temperature released by the air conditioner depends on two parameters:
the number of occupants inside and the temperature outside. The proposed approach by the method of
experiment proved that it can be used to maintain thermal comfort, as well as energy saving.
    A framework for decentralized and integrated decision-making for rescheduling a cyber-physical
production system is presented in this research [15], as well as the validation of the suggested method
in an Industry 4.0 pilot line of the assembly process. The results of the experiments show that the
suggested framework is capable of detecting changes in the production process and making suitable
rescheduling decisions.
3. Structural elements of the proposed web-based application with fuzzy
   logic services
   The application can be divided into 3 main layers: presentation, service, and domain, as shown in
Figure 5.




Figure 5: Structural diagram of the web-based application

   The presentation layer includes controllers end endpoints to receive HTTP requests and send
HTTP responses. Controllers and endpoints here are used to create, update and delete records in
database tables.
    Data can be passed to endpoints with the usage of query parameters. Provided API can be used by
a human expert or another application and allows the creation of subject areas with sets of necessary
rules, terms, and values. Rule’s syntax representation, as well as query parameters’ format, are
predefined.
   The service layer is responsible for processing data, provided in HTTP requests, and transferring
created entities’ objects to the domain layer. Also, it includes fuzzy logic services, that together are
the core of fuzzy logic – fuzzy inference system, and can perform operations on fuzzification,
defuzzification, and decision-making.
   The domain layer represents the business logic and objects’ behavior. It holds application objects
and can make base operations on the database.


4. Relational database for data referred to fuzzy logic
    The proposed relational database is used by the application and includes 4 tables. Its diagram is
shown in Figure 6.
    FuzzyLogicAreas table record has the AreaName property that corresponds to the subject area that
has to be solved. This table can have many records because the application can be used by many CPSs
and their subsystems. It has one-to-many relationships with Rules and Terms tables.
    Terms table record has a TermName string property that represents a linguistic variable. Terms
table stores a set of linguistic variables for the specific subject area. This table has a one-to-many
relationship with the Sets table.
    Sets table record has Key string property, which is a linguistic value that can be applied to a
corresponding linguistic variable, and its numeric value, that is Value double property.
    Rule table record has a RuleValue string property, that represents a rule in the specified format,
using linguistic variables and their corresponding linguistic values. Rules are defined as an IF-THEN
structure.

5. Fuzzy logic services of the proposed web-based application
   A fuzzy inference system is the main unit of a fuzzy logic system, which is responsible for doing
one main task – making decisions. It uses IF-THEN rules along with basic logic operators.
   The fuzzy inference system diagram that is implemented with fuzzy logic services in the web-API
application service layer is shown in Figure 7.




Figure 6: Relational database diagram




Figure 7: Fuzzy inference system
   The fuzzification service converts the crisp quantities into fuzzy quantities. By using the input
membership function, the input is made fuzzy. Throughout this method, the numerical input of a
system is assigned to fuzzy sets with some degree of membership.
   This degree of membership belongs to the interval [0,1].
   Any value between zero and one represents the degree of uncertainty of belonging to the value
within the set.
   For example, in Figure 8, the meanings of the term linguistic values: cold, warm, and hot are
represented by functions mapping a temperature scale. The vertical line in the image represents a
particular temperature – crisp input value.
   The degree of membership assigned to each fuzzy set is the result of fuzzification. In this example,
the result of fuzzification is the fuzzy data set:




Figure 8: Fuzzy logic temperature

   Decision-making service operates on rules. Foremost, it defines a set of rules, that are stored in the
database and applies it to a set of input and output crisp data.
   After that, for each rule, rule strength is established by combining the fuzzified inputs according to
rules and the result is a set of rule strength values.
   During the rules processing, boolean operators, that are used in the rules’ description are replaced
with Zadeh operators, please, check Table 1.

Table 1
Zadeh operators
                     Boolean                                              Fuzzy
                     AND(x, y)                                           MIN(x, y)
                      OR(x, y)                                           MAX(x, y)
                      NOT(x)                                               1-x

   For getting output distribution, all the consequents are combined and passed as a result fuzzy set to
the defuzzification service.
   Defuzzification service then calculates the arithmetic mean of the result fuzzy set for each output
value and converts the arithmetic mean to crisp value by using the output membership function.
Finally, a defuzzified, crisp output set is obtained.

6. Results
   Foremost, using the API of the web application, the research subject area was created and filled
with data and rules.
   Created DSS based on fuzzy logic will now allow getting the result from a set of input parameters.
   All information is transmitted through HTTP requests.
   A demonstration application was created to test the developed web-based application.
   The demo with a graphical interface contains a working area - a two-dimensional space, which
randomly places 10 circles, each of which has a randomly defined starting speed and direction of
movement (Fig. 9).
   Circles are all the same mass and can interact with each other and with area borders by elastic
collisions.
    All circles are in a closed environment and are acting due to the rules of physics. However, to test
the web-based application, its functionality as a DSS, based on fuzzy logic, as well as the API, a
single circle was chosen - it can change its parameters in real-time under the influence of external
factors. This circle is filled with red color.
    The simulating demo application checks whether there are other circles within radius N and if so,
then the closest point to the subject is taken into account. If this circle is moving towards the defined
one, then these two circles are considered and the following input parameters are calculated: velocity
difference, angle difference, and distance. These three input parameters are crisp input for DSS and
are sent in the HTTP request to the web-based application. Output crisp parameter is velocity offset
for the defined red circle.
    Thus, the speed of one of the circles can dynamically change and the decision of it is taken by the
outer system, based on the inner system's parameters.
    This should minimize the number of possible collisions if an expert human has correctly adjusted
all the parameters and rules of the decision support system.




Figure 9: Two-dimensional space with circles, rendered in the demo application

    Ten tests were conducted, each lasting a minute of the internal time of the demonstration system,
which does not include time for calculation, data transfer, and render.
    Half of them - five tests, were conducted without the use of DSS and all circles moved according
to the rules of physics. The other half of the tests were performed using DSS.
    The result of each independent test is the number of collisions the red circle made with other
circles during the specified internal testing system time.
    Results are presented in Figure 10.
    The red line specifies the number of average collisions along with five tests without the usage of
DSS. The blue line specifies the average number of collisions while performing another five tests with
the usage of DSS.
7. Future work
   One of the main tasks in the nearest future is creation of a web interface for the developed
application. It will definitely improve the quality of work of the human expert with the application
because communication is currently supported only via HTTP requests.
   Another important task is to increase the reliability of the application and provide correct
encapsulation of independent data, as it allows the possibility of supporting many dependent cyber-
physical systems simultaneously.
   One more issue that needs to be solved, is to create an authorization for human experts, other
applications that can participate in the configuration of the DSS, as well as for cyber-physical systems
that are end-users by themselves.
   And, finally, increasing the productivity of fuzzy logic services and improving the algorithm of
processing crisp data with the fuzzy-based approach is always relevant, so that is one more task to be
done in the future.




Figure 10: Results of the experiments

8. Conclusion
   The proposed application can be used by any CPS that has access to the communication
environment and has software and hardware to work with the HTTP protocol.
   Usage of the API of the proposed web-based application for modeling and deploying fuzzy logic-
based decision support systems for autonomous cyber-physical systems, allows creation of a desktop
or a web application with a human interface so that an expert can create and configure a DSS, based
on fuzzy logic.
   The API can also be used by other software to automatically fill datasets and configure the DSS.
   Among the disadvantages is that this web-based application cannot be used by CPSs that need to
make numerous decisions in a short period of time to function properly, such as real-time systems.
   There is also the question of the reliability of such a server solution, as a disruption of the remote
server, hosting the web application, or network interruptions, can lead to dependent CPSs failing.
9. References
[1] Melnyk, A., Melnyk, V. Specialized Processors Automatic Design Tools-the Basis of Self-
     Configurable Computer and Cyber-Physical Systems. 2019 IEEE International Conference on
     Advanced Trends in Information Theory, ATIT 2019 - Proceedings, pp. 326-335.
     DOI:10.1109/ATIT49449.2019.9030481.
[2] Y. Zhao and H. Gao, "Fuzzy-Model-Based Control of an Overhead Crane With Input Delay and
     Actuator Saturation," in IEEE Transactions on Fuzzy Systems, vol. 20, no. 1, pp. 181-186, Feb.
     2012, doi: 10.1109/TFUZZ.2011.2164083.
[3] Novák, V., Perfilieva, I., Močkoř, J., Mathematical principles of fuzzy logic, Dordrecht: Kluwer
     Academic, 1999. ISBN 978-0-7923-8595-0.
[4] Anatoliy Melnyk. Cyber-physical systems multilayer platform and research framework.
     Advances in cyber-physical systems. Vol. 1, No. 1, 2016, pp. 1-6.
[5] J. Alcalá-Fdez and J. M. Alonso, "A Survey of Fuzzy Systems Software: Taxonomy, Current
     Research Trends, and Prospects," in IEEE Transactions on Fuzzy Systems, vol. 24, no. 1, pp. 40-
     56, Feb. 2016, doi: 10.1109/TFUZZ.2015.2426212.
[6] M. de Souza, F. dos Santos, A. Rodriguez de Soto and A. Vahldick, "FuzzyStudio: A Web Tool
     for Modeling and Simulation of Fuzzy Systems," 2014 Brazilian Conference on Intelligent
     Systems, 2014, pp. 306-311, doi: 10.1109/BRACIS.2014.62.
[7] García Valdez JM, Licea Sandoval G, Alanis Garza A, Castillo O. Object Oriented Design and
     Implementation of an Inference Engine for Fuzzy Systems. Engineering Letters. 2007 Sep
     1;15(1).
[8] Yetis H, Karakose M. Nonstationary fuzzy systems for modelling and control in cyber physical
     systems under uncertainty. International Journal of Intelligent Systems and Applications in
     Engineering. 2017 Jul 31;7(1):26-30.
[9] Rodiah, Fitrianingsih, H. Susanto and E. Haryatmi, "Web based fuzzy expert system for lung
     cancer diagnosis," 2016 2nd International Conference on Science in Information Technology
     (ICSITech), 2016, pp. 142-146, doi: 10.1109/ICSITech.2016.7852623.
[10] Cheng ST, Chou JH. Fuzzy control to improve energy-economizing in cyber-physical systems.
     Applied Artificial Intelligence. 2016 Jan 2;30(1):1-5.
[11] W. Li, W. Meng, C. Su and L. F. Kwok, "Towards False Alarm Reduction Using Fuzzy If-Then
     Rules for Medical Cyber Physical Systems," in IEEE Access, vol. 6, pp. 6530-6539, 2018, doi:
     10.1109/ACCESS.2018.2794685.
[12] WEKA: Data Mining Software in Java, 2017. URL: http://www.cs.waikato.ac.nz/ml/weka/.
[13] M. S. Hadi, S. Bhima Satria Rizki, M. A. As-Shidiqi, M. A. Mizar, D. Lestari and M. Irvan,
     "Mamdani fuzzy logic-based smart measuring device as quality determination for grain post-
     harvest technology," 2021 1st International Conference on Electronic and Electrical Engineering
     and Intelligent System (ICE3IS), 2021, pp. 7-11, doi: 10.1109/ICE3IS54102.2021.9649685.
[14] Dewantoro G, Nugraha BE, Setiaji FD. A fuzzy logic-based automation toward intelligent air
     conditioning systems. Kinetik: Game Technology, Information System, Computer Network,
     Computing, Electronics, and Control. 2020 Nov 22:335-44.
[15] Villalonga, A., Negri, E., Biscardo, G., Castano, F., Haber, R.E., Fumagalli, L. and Macchi, M.,
     2021. A decision-making framework for dynamic scheduling of cyber-physical production
     systems based on digital twins. Annual Reviews in Control, 51, pp.357-373.