SEMKIS-DSL: A Domain-Specific Language to Support Requirements Engineering of Datasets and Neural Network Recognition
Abstract
:1. Introduction
2. Materials and Methods
2.1. Material
2.1.1. Model-Driven Engineering Context
2.1.2. SEMKIS Methodology Overview
- Determine whether the NN satisfies the requirements.
- Validate the NN’s key properties against the customer’s requirements.
- Identify new data selection criteria to augment the datasets.
- Pre-activity: This involves specifying the requirements that will serve as input to the process for engineering the initial datasets and NN architecture.
- Test monitoring data analysis: This involves analyzing the NN’s test results to determine its key properties, which will serve as input to analyze the satisfaction of the requirements and augment the datasets accordingly.
- The software engineer is responsible for engineering the datasets and the NN, eliciting and specifying the customer’s requirements, analyzing the NN’s test results and specifying the key properties, and discussing the key properties and the requirements with the customer.
- The dataset engineer is responsible for identifying and suggesting the required data with the software engineer for building the datasets, training the NN to satisfy the customer’s requirements, and analyzing the customer’s validation feedback, requirements, and key-properties specifications to propose a dataset augmentation strategy for improving the NN.
- The customer is responsible for ordering an NN, participating in meetings with the software engineer to express their requirements, and validating the specified NN’s key properties.
2.2. Method
- We designed an academic case study that was small in size but rich enough to support the research process described below.
- We analyzed the preliminary activity of the dataset augmentation process [5] in the context of the SEMKIS methodology to identify any weaknesses. This preliminary activity focuses on specifying the customer’s requirements and defining the target NN.
- We analyzed the identified weaknesses and found that:
- Specifying requirements is a complicated, time-consuming, and costly task due to the manual work involved.
- Our specifications are often handcrafted and unstructured as they are written in basic textual editors (e.g., Word, Excel). These textual editors lack advanced features such as syntax highlighting, code completion, templates, cross-references, and file organization.
- There are only basic guidelines to help engineers specify the requirements. The engineers still rely on domain experts (AI and dataset engineers), who have a broad knowledge of NN and dataset concepts, to specify the requirements.
- We designed a metamodel (concept model) that defined the various concepts that were required to specify the requirements for dataset and NN engineering concepts.
- We designed grammar (Xtext grammar) for tackling the above-mentioned weaknesses to allow for textual specifications of the requirements.
- We specified some requirements for the MNIST case study [10] to experiment and validate our SEMKIS-DSL.
- We analyzed the SEMKIS-DSL to propose a basis for developing model-to-text transformations to allow the code-skeleton generation of synthetic data generators or target NN architecture templates.
- We analyzed the activity (Analyze Test Monitoring Data (activity F)) of the dataset augmentation process to identify any weaknesses. This activity is a subprocess comprising four activities for analyzing and specifying the NN’s key properties from the collected recognition data (test monitoring data) of the NN’s training and testing.
- We analyzed the identified weaknesses and found, similar to the customer requirements, that:
- Specifying key properties is a complicated, time-consuming, and costly task due to the manual and handcrafted work involved.
- Our specifications are often handcrafted and unstructured as they are written in basic textual editors (e.g., Word, Excel). These textual editors lack advanced features.
- There is a lack of guidelines to help engineers analyze the test monitoring data and specify the key properties. The engineers rely even more on AI and dataset experts to specify the key properties.
- The specifications have to be manually interpreted to determine new data selection criteria for improving the datasets.
- We designed a metamodel (concept model) that defined the various concepts that were required to specify the key properties of trained NNs.
- We designed grammar (Xtext grammar) for tackling the above-mentioned weaknesses to allow for textual specifications of the key properties.
- We trained an NN to recognize handwritten digits from the MNIST case study [10] and specified some key properties to experiment and validate our SEMKIS-DSL.
- We analyzed the specifications to propose a basis for developing model-to-text transformations to allow the code-skeleton generation of a synthetic data generator for augmenting our datasets to re-train the NN.
3. Results: SEMKIS-DSL—A Language for Specifying Requirements and Key-Properties of Neural Networks
3.1. MNIST Running Example
3.2. Requirements Specifications Using SEMKIS-DSL
3.2.1. Concept Model
- The target NN’s input (ctTargetNNInput) describes the customer’s required input data and some technical details about the target NN’s architecture such as the input format and size. The input data (ctInputData) represent the data elements (ctDataElement) of a dataset (ctDataset). Additionally, they define the target NN’s input value format that must be readable by an NN. Datasets consist of data elements, which are classified into equivalence classes (ctEquivalenceClass). We define an equivalence class as a group of related artifacts that an NN recognizes within its category. A data element can be a numerical value, image, video, voice, or any other input data that is processable by an NN. In practice, the software engineer starts by specifying the datasets, their data elements, and equivalence classes. Then, the engineer specifies the target NN’s input characteristics and associates the input data with the data elements of the dataset.
- The target NN’s output (ctTargetNNOutput) describes the customer’s expected output given a certain input. Given an input data element, an NN typically outputs a probability distribution over multiple equivalence classes that describes the likelihood that the data element belongs to an equivalence class. Hence, the target NN’s output specifies the output format and size, as well as the accepted value range. Additionally, the output specifies the equivalence classes for which a probability is computed by the NN.
- Accuracy (ctTargetAccuracy) describes the ratio between the number of correctly recognized data by the target NN and the number of all data elements within the dataset.
- Loss (ctTargetLoss) is a numerical value that describes the recognition error between the target NN’s actual output and its expected output.
- Precision (ctTargetPrecision) describes the ratio between the number of correctly classified and recognized data and the total number of data elements.
- Recall (ctTargetRecall) describes the ratio between the number of correctly classified and recognized data and the number of both correctly/incorrectly classified and recognized data.
3.2.2. Model Transformation—Engineering Datasets and Neural Networks
- Data synthesizer: generates the skeleton code for synthesizing the data.
- Target NN architecture synthesizer: generates the skeleton code for the target NN’s architecture in Python.
3.2.3. Running Example
- The input data consist of images that contain a centered and white handwritten digit “7” on a black background.
- An image is a matrix of pixels, where each pixel is represented by a grayscale value of .
- The digit 7 can be curved and may or may not contain a middle dash.
- An equivalence class named that includes the digit “7”.
- The accuracy for on the test dataset should reach a value of
- The accuracy of the test dataset should reach a value of .
- Both accuracies have a high priority and are important for the customer.
Requirements { functionalRequirements { Requirement FR1 { NeuralNetworksInput { neuronsSize 784 neuronsFormat inputData { InputData inputSeven { neuronValues dataElements imgDigitSeven }}}} Requirement FR2 { NeuralNetworksOutput{ neuronsSize 10 neuronsFormat outputValueRange outputNeurons inputData FR1.inputSeven }} } nonfunctionalRequirements { Requirement NFR1 { description “Global accuracy on testing dataset” purpose “Tolerated accuracy on testing dataset” priority high TargetAccuracy globalTestAcc for dataset dstest { minAccuracy 98 maxAccuracy 100 targetAccuracy }} Requirement NFR2 { description “Equivalence class 7 test accuracy” purpose “Tolerated accuracy for ec7 on the testing dataset” priority high TargetAccuracy tarEcSevenAcc for dataset dstest { equivalenceClasses seven minAccuracy 99 maxAccuracy 100 targetAccuracy }} } |
3.3. Key-Properties Specifications Using SEMKIS-DSL
3.3.1. SEMKIS Process–Test Monitoring Data Analysis
3.3.2. Concept Model
3.3.3. Model Transformation—Dataset Augmentation
3.3.4. Running Example
Key Properties { Qualitative Key Properties { Nominal Key Property nkp1 { Recognition Anomaly recoanomly_seven { description “Seven recognized often as 2 or 1” equivalenceClasses seven }} OrdinalKeyProperty okp1 { RecognitionEvaluation recoeval_seven { equivalenceClasses seven recognitionValue bad }} Logical Key Property lkp1 { EquivalenceClassRecognitionCorrectness erc { recognitionCorrectness incorrectly classificationCorrectness correctly equivalenceClasses seven }} } QuantitativeKeyProperties { ContinuousKeyProperty ckp2 { name “Recognition of equivalence class 7” description “Accuracy of the equivalence class 7” priority high status toBeDiscussed ReachedAccuracy acc_test_seven { equivalenceClasses seven accuracyValue}} Discrete Key Property dkp2 { name “ Digit 7 incorrect recognition ” description “ Number of incorrectly recognized digit 7.” priority high status toBeDiscussed incorrectly recognized QuantitativeDataAnalysis inc_reco for dataset dstest { equivalenceClasses seven amount 9}} }} |
3.3.5. Tool Support
4. Related Works
4.1. Software Development Process for Dataset Engineering
- Benchmarking the domain via a web search to identify and specify the properties that need to be recognized by an ML model.
- Interpreting the dataset’s domain to identify problems in the collected data (e.g., risks, data inconsistencies), as inappropriate datasets may generate training issues that can result in inaccurate ML models.
- Interpreting the domain learned by the ML model by extracting its features and using AI techniques to transform the model into more comprehensible models (e.g., a set of logical rules).
- A lack of quality metrics for ML software.
- A lack of methods and tools for specifying requirements.
- The complexity of understanding non-functional requirements in ML.
- Measuring the satisfiability of the requirements.
- Customers have a limited understanding of ML.
4.2. Model-Driven Engineering for Deep Learning
4.3. Model-Driven Engineering for Deep Learning Using Neural Networks for Dataset Augmentation
5. Discussion
5.1. Limitations
5.2. Threats to Validity
5.3. Perspectives
- Experimentation:
- -
- In order to overcome the threat to the validity of our approach discussed above, the first phase of development should be to assess the SEMKIS methodology, including the SEMKIS-DSL, in an industrial context with software engineers and deep learning experts.
- -
- This case study should be conducted using a selection of companies and with a traditional dataset and NN engineering methods. For each of them, we propose to follow a simple yet reasonable process consisting of the following steps:
- Initial interviews with the software engineers to understand and discuss the current methodologies used by the company.
- Presentation of the SEMKIS methodology and its application to a concrete project that includes the SEMKIS-DSL.
- Delimitation of application modules that currently use neural networks in their products.
- Utilization of the SEMKIS approach for the maintenance of these modules in cooperation with SEMKIS experts.
- Follow-up interviews with software engineers to discuss their experience with the SEMKIS and determine its costs, complexity, usability, and maintainability.
- Evaluation of the data collected through experimentation and interviews.
- -
- The objective of this case study is to obtain enough data to assess the following aspects of the SEMKIS and its DSL:
- *
- the cost/time reduction for NN and dataset engineering;
- *
- the learning curve of using the SEMKIS-DSL;
- *
- the maintainability and readability of the specifications in the SEMKIS-DSL;
- *
- the traceability of NN’s recognition issues to the requirements specifications;
- *
- the completeness, accuracy, and adequacy of the metamodel concepts.
- Tool support:
- -
- Another issue is the use of adequate tools, e.g., Xtend, to define and implement the model-to-text transformations to provide full automation of our MDE method for the generation of synthetic data based on requirements and key properties. Moreover, we could extend our SEMKIS toolkit with a requirements and key-properties specification interpreter to generate a data synthesizer implementation.
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
AI | Artificial Intelligence |
DL | Deep Learning |
DSL | Domain-Specific Language |
MDE | Model-Driven Engineering |
ML | Machine Learning |
M2T | Model-to-Text Transformation |
NN | Neural Network |
RE | Requirements Engineering |
SE | Software Engineering |
SEMKIS | Software Engineering Methodology for the Knowledge Management of |
Intelligent Systems | |
UML | Unified Modeling Language |
References
- Heyn, H.M.; Knauss, E.; Muhammad, A.P.; Eriksson, O.; Linder, J.; Subbiah, P.; Pradhan, S.K.; Tungal, S. Requirement engineering challenges for ai-intense systems development. In Proceedings of the 2021 IEEE/ACM 1st Workshop on AI Engineering-Software Engineering for AI (WAIN), Online, 30–31 May 2021; pp. 89–96. [Google Scholar]
- Xiao, T.; Xia, T.; Yang, Y.; Huang, C.; Wang, X. Learning from massive noisy labeled data for image classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 2691–2699. [Google Scholar]
- Ros, G.; Sellart, L.; Materzynska, J.; Vazquez, D.; Lopez, A.M. The synthia dataset: A large collection of synthetic images for semantic segmentation of urban scenes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 3234–3243. [Google Scholar]
- You, Q.; Luo, J.; Jin, H.; Yang, J. Building a large scale dataset for image emotion recognition: The fine print and the benchmark. In Proceedings of the AAAI Conference on Artificial Intelligence, Phoenix, AZ, USA, 12–17 February 2016; Volume 30. [Google Scholar]
- Jahic, B. SEMKIS: A Contribution to Software Engineering Methodologies for Neural Network Development. Ph.D. Thesis, University of Luxembourg, Esch/Alzette, Luxembourg, 2022. [Google Scholar]
- Jahić, B.; Guelfi, N.; Ries, B. Software engineering for dataset augmentation using generative adversarial networks. In Proceedings of the 2019 IEEE 10th International Conference on Software Engineering and Service Science (ICSESS), Beijing, China, 18–20 October 2019; pp. 59–66. [Google Scholar]
- Jahić, B.; Guelfi, N.; Ries, B. Specifying key-properties to improve the recognition skills of neural networks. In Proceedings of the 2020 European Symposium on Software Engineering, Online, 6–8 November 2020; pp. 60–71. [Google Scholar]
- Fondement, F.; Silaghi, R. Defining model driven engineering processes. In Proceedings of the Third International Workshop in Software Model Engineering (WiSME), Lisbon, Portugal, 11–15 October 2004. [Google Scholar]
- Kosar, T.; Martı, P.E.; Barrientos, P.A.; Mernik, M. A preliminary study on various implementation approaches of domain-specific language. Inf. Softw. Technol. 2008, 50, 390–405. [Google Scholar] [CrossRef]
- LeCun, Y.; Cortes, C.; Burges, C.J.C. The MNIST Database of Handwritten Digits. 2022. Available online: http://yann.lecun.com/exdb/mnist/ (accessed on 28 March 2023).
- Bettini, L. Implementing Domain-Specific Languages with Xtext and Xtend; Packt Publishing Ltd.: Birmingham, UK, 2016. [Google Scholar]
- Jahič, B. SEMKIS-DSL Complete Grammar (v2.0). 2022. Available online: https://github.com/Benji91/lu.uni.lassy.phdthesis.semkis.toolkit.experimentations/blob/main/eclipse-workspace-semkis-dsl/lu.uni.lassy.phd.dsl.semkis.parent/lu.uni.lassy.phd.dsl.semkis/src/lu/uni/lassy/phd/dsl/semkis/Semkis.xtext (accessed on 28 March 2023).
- Jahič, B. SEMKIS-DSL (v2.0). 2022. Available online: https://github.com/Benji91/lu.uni.lassy.phdthesis.semkis.toolkit.experimentations (accessed on 28 March 2023).
- Sommerville, I. Engineering Software Products; Pearson: London, UK, 2020; Volume 355. [Google Scholar]
- Ruparelia, N.B. Software development lifecycle models. ACM SIGSOFT Softw. Eng. Notes 2010, 35, 8–13. [Google Scholar] [CrossRef]
- Object Management Group B. Unified Modeling Language 2.5.1; Object Management Group: Milford, MA, USA, 2017. [Google Scholar]
- Rahimi, M.; Guo, J.L.; Kokaly, S.; Chechik, M. Toward requirements specification for machine-learned components. In Proceedings of the 2019 IEEE 27th International Requirements Engineering Conference Workshops (REW), Jeju Island, Republic of Korea, 23–27 September 2019; pp. 241–244. [Google Scholar]
- Villamizar, H.; Escovedo, T.; Kalinowski, M. Requirements engineering for machine learning: A systematic mapping study. In Proceedings of the 2021 47th Euromicro Conference on Software Engineering and Advanced Applications (SEAA), Online, 1–3 September 2021; pp. 29–36. [Google Scholar]
- Habibullah, K.M.; Horkoff, J. Non-functional requirements for machine learning: Understanding current use and challenges in industry. In Proceedings of the 2021 IEEE 29th International Requirements Engineering Conference (RE), Notre Dame, IN, USA, 20–24 September 2021; pp. 13–23. [Google Scholar]
- Vogelsang, A.; Borg, M. Requirements engineering for machine learning: Perspectives from data scientists. In Proceedings of the 2019 IEEE 27th International Requirements Engineering Conference Workshops (REW), Jeju Island, Republic of Korea, 23–27 September 2019; pp. 245–251. [Google Scholar]
- Hu, B.C.; Salay, R.; Czarnecki, K.; Rahimi, M.; Selim, G.; Chechik, M. Towards requirements specification for machine-learned perception based on human performance. In Proceedings of the 2020 IEEE Seventh International Workshop on Artificial Intelligence for Requirements Engineering (AIRE), Zurich, Switzerland, 1 September 2020; pp. 48–51. [Google Scholar]
- Zhao, T.; Huang, X. Design and implementation of DeepDSL: A DSL for deep learning. Comput. Lang. Syst. Struct. 2018, 54, 39–70. [Google Scholar] [CrossRef]
- Elango, V.; Rubin, N.; Ravishankar, M.; Sandanagobalane, H.; Grover, V. Diesel: DSL for linear algebra and neural net computations on GPUs. In Proceedings of the 2nd ACM SIGPLAN International Workshop on Machine Learning and Programming Languages, Philadelphia, PA, USA, 18 June 2018; pp. 42–51. [Google Scholar]
- Podobas, A.; Svedin, M.; Chien, S.W.; Peng, I.B.; Ravichandran, N.B.; Herman, P.; Lansner, A.; Markidis, S. StreamBrain: An HPC DSL for Brain-like Neural Networks on Heterogeneous Systems. In Proceedings of the 11th International Symposium on Highly Efficient Accelerators and Reconfigurable Technologies, Online, 21–23 June 2021. [Google Scholar]
- Cueva-Lovelle, J.M.; García-Díaz, V.; Pelayo, G.; Bustelo, C.; Pascual-Espada, J. Towards a standard-based domain-specific platform to solve machine learning-based problems. Int. J. Interact. Multimed. Artif. Intell. 2015, 3, 6–12. [Google Scholar]
- Agrawal, A.; Modi, A.; Passos, A.; Lavoie, A.; Agarwal, A.; Shankar, A.; Ganichev, I.; Levenberg, J.; Hong, M.; Monga, R.; et al. TensorFlow Eager: A multi-stage, Python-embedded DSL for machine learning. Proc. Mach. Learn. Syst. 2019, 1, 178–189. [Google Scholar]
- Sujeeth, A.; Lee, H.; Brown, K.; Rompf, T.; Chafi, H.; Wu, M.; Atreya, A.; Odersky, M.; Olukotun, K. OptiML: An implicitly parallel domain-specific language for machine learning. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), Bellevue, WA, USA, 28 June–2 July 2011; pp. 609–616. [Google Scholar]
- Ries, B.; Guelfi, N.; Jahic, B. An mde method for improving deep learning dataset requirements engineering using alloy and uml. In Proceedings of the 9th International Conference on Model-Driven Engineering and Software Development, SCITEPRESS, Online, 8–10 February 2021; pp. 41–52. [Google Scholar]
- Dosovitskiy, A.; Ros, G.; Codevilla, F.; Lopez, A.; Koltun, V. CARLA: An open urban driving simulator. In Proceedings of the Conference on Robot Learning, Mountain View, California, USA, 13-15 November 2017; pp. 1–16. [Google Scholar]
- Pei, K.; Cao, Y.; Yang, J.; Jana, S. Deepxplore: Automated whitebox testing of deep learning systems. In Proceedings of the 26th Symposium on Operating Systems Principles, Shanghai, China, 28–31 October 2017; pp. 1–18. [Google Scholar]
- Fremont, D.J.; Dreossi, T.; Ghosh, S.; Yue, X.; Sangiovanni-Vincentelli, A.L.; Seshia, S.A. Scenic: A language for scenario specification and scene generation. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation, Phoenix, AZ, USA, 22–26 June 2019; pp. 63–78. [Google Scholar]
- Guelfi, N. A formal framework for dependability and resilience from a software engineering perspective. Open Comput. Sci. 2011, 1, 294–328. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Jahić, B.; Guelfi, N.; Ries, B. SEMKIS-DSL: A Domain-Specific Language to Support Requirements Engineering of Datasets and Neural Network Recognition. Information 2023, 14, 213. https://doi.org/10.3390/info14040213
Jahić B, Guelfi N, Ries B. SEMKIS-DSL: A Domain-Specific Language to Support Requirements Engineering of Datasets and Neural Network Recognition. Information. 2023; 14(4):213. https://doi.org/10.3390/info14040213
Chicago/Turabian StyleJahić, Benjamin, Nicolas Guelfi, and Benoît Ries. 2023. "SEMKIS-DSL: A Domain-Specific Language to Support Requirements Engineering of Datasets and Neural Network Recognition" Information 14, no. 4: 213. https://doi.org/10.3390/info14040213
APA StyleJahić, B., Guelfi, N., & Ries, B. (2023). SEMKIS-DSL: A Domain-Specific Language to Support Requirements Engineering of Datasets and Neural Network Recognition. Information, 14(4), 213. https://doi.org/10.3390/info14040213