Method and system for building a neural network model
The enhanced TTnet model addresses limitations in TTnets by allowing larger input sizes and multi-bit variables, improving accuracy and enabling efficient formal verification and private inference.
Patent Information
- Application Number
- PCT/SG2024/050048
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-01-26
- Publication Date
- 2025-07-31
AI Technical Summary
Existing Truth Table deep convolutional neural networks (TTnets) suffer from limitations such as a small maximum filter input size and limited flexibility in input/output variables, restricting their application and performance.
A method and system for building neural network models that enhance flexibility by encoding filters into filter function blocks, allowing larger input sizes and multi-bit variables, and using a truth table to determine filter functions, enabling tractable and learnable neural networks.
The improved TTnet model achieves increased accuracy and practicality by expanding filter input size, allowing for better approximation of functions and enabling efficient formal verification and private inference with reduced computational overhead.
Smart Images

Figure SG2024050048_31072025_PF_FP_ABST
Abstract
Description
METHOD AND SYSTEM FOR BUILDING A NEURAL NETWORK MODELTECHNICAL FIELD
[0001] The present invention generally relates to a method of building a neural network model, and a system thereof, and more particularly, building a neural network model comprising filter function block(s).BACKGROUND
[0002] With the expanding role of neural networks, the need for complete and sound verification of their property has become critical. In the recent years, it was established that Binary Neural Networks (BNNs) have an equivalent representation in Boolean logic and can be formally analyzed using logical reasoning tools such as SAT (Boolean satisfiability) solvers. Accordingly, BNNs can be transformed into SAT formulas. Recently, Truth Table deep convolutional neural networks (TTnets), a new family of SAT-encodable models featuring for the first time real-valued weights, was introduced (see Benamira el al., “Truth-Table Net: A New Convolutional Architecture Encodable by Design into SAT formulas, Lecture Notes in Computer Science, Computer Vision -ECCV 2022 Workshops, pages 483-500 (herein referred to as the Benamira reference, the content of which being hereby incorporated by reference in its entirety for all purposes)). TTnet is a convolutional architecture encoded by design into SAT formulas. Furthermore, it admits, by construction, some valuable conversion features including post-tuning and tractability in the robustness verification setting. The latter property leads to a more compact SAT symbolic encoding than BNNs. This enables the use of general SAT solvers, making property verification easier. The Benamira reference demonstrated the value of TTnets regarding the formal robustness property, in particular, TTnets outperformed the verified accuracy of all BNNs with a comparable computation time. More generally, TTnets represent a relevant trade-off between all known complete verification methods, whereby TTnets achieved high verified accuracy with fast verification time, being complete with no timeouts. The Benamira reference also explored a proof of concept of TTnets for an important application (complete verification of robustness) and disclosed that such real-valued networks constitute a practical response to the rising need for functional formal verification. The TTnets can be applied to various CNN-based architectures and can be extended to various other properties such as fairness, fault attack and exact rule extraction.
[0003] However, in the Benamira reference, the maximum filter input size (i.e., the maximum number of input variables that may be provided to the filter (or the filter function block)) is relatively small (e.g., limit of 9 or up to 16 input variables). Furthermore, the input / output variables of the filter are each limited to 1-bit (i.e., 0 or 1). As a result, the TTnets disclosed in the Benamira reference suffer from various limitations, such as only being implemented to represent an expanding auto encoder (i.e., limited to an expanding auto encoder function) and the size of the truth table (based on which the filter function block is produced) having limited flexibility.
[0004] A need therefore exists to provide a method of building a neural network model comprising filter function block(s), and a system thereof, that seeks to overcome, or at least ameliorate, one or more deficiencies in existing method(s), and more particularly, to improve or enhance the flexibility in building the neural network model and / or the practicality in the neural network model built, thereby improving practical applications and / or performance (e.g., accuracy) of the neural network model built. It is against this background that the present invention has been developed.SUMMARY
[0005] According to a first aspect of the present invention, there is provided a method of building a neural network model using at least one processor, the method comprising: obtaining a neural network model comprising a first convolutional layer, the first convolutional layer comprising a filter comprising a plurality of weights; and encoding the filter of the first convolutional layer into a filter function block, wherein said encoding the filter of the first convolutional layer comprises: determining a truth table of the filter with respect to a subset of input variables amongst a set of input variables; and determining a filter function dependent on a plurality of input variables of the subset of input variables based on the truth table, the filter function block being configured to perform the filter function, wherein said determining the truth table of the filter comprises: providing an input mask configured to select a subset of pixels of an input image kernel at a plurality of predetermined pixel positions thereof, respectively, for the filter of the first convolutional layer to perform a convolutional operation with respect to theinput image kernel, wherein the plurality of predetermined pixel positions of the input image kernel corresponds to the subset of input variables, respectively; and determining, for each possible input variables combination of a set of possible input variables combinations based on the subset of input variables, a filter output of the filter based on the possible input variables combination.
[0006] According to a second aspect of the present invention, there is provided a system for building a neural network model, the system comprising: at least one memory; and at least one processor communicatively coupled to the at least one memory and configured to: obtain a neural network model comprising a first convolutional layer, the first convolutional layer comprising a filter comprising a plurality of weights; and encode the filter of the first convolutional layer into a filter function block, wherein said encode the filter of the first convolutional layer comprises: determining a truth table of the filter with respect to a subset of input variables amongst a set of input variables; and determining a filter function dependent on a plurality of input variables of the subset of input variables based on the truth table, the filter function block being configured to perform the filter function, wherein said determining the truth table of the filter comprises: providing an input mask configured to select a subset of pixels of an input image kernel at a plurality of predetermined pixel positions thereof, respectively, for the filter of the first convolutional layer to perform a convolutional operation with respect to the input image kernel, wherein the plurality of predetermined pixel positions of the input image kernel corresponds to the subset of input variables, respectively; and determining, for each possible input variables combination of a set of possible input variables combinations based on the subset of input variables, a filter output of the filter based on the possible input variables combination.
[0007] According to a third aspect of the present invention, there is provided a computer program product, embodied in one or more non-transitory computer-readable storage mediums, comprising instructions executable by at least one processor to perform the method of building a neural network model according to the above-mentioned first aspect of the present invention.
[0008] According to a fourth aspect of the present invention, there is provided a method of performing neural network operations using a neural network model built according to the method of the above-mentioned first aspect of the present invention.
[0009] According to a fifth aspect of the present invention, there is provided a system for performing neural network operations, the system comprising: at least one memory; and at least one processor communicatively coupled to the at least one memory and configured to perform neural network operations using the neural network model built according to the method of the above-mentioned first aspect of the present invention.
[0010] According to a sixth aspect of the present invention, there is provided a computer program product, embodied in one or more non-transitory computer-readable storage mediums, comprising instructions executable by at least one processor to perform neural network operations using the neural network model built according to the method of the above- mentioned first aspect of the present invention.BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Embodiments of the present invention will be better understood and readily apparent to one of ordinary skill in the art from the following written description, by way of example only, and in conjunction with the drawings, in which:FIG. 1 depicts a schematic flow diagram of a method of building a neural network model, according to various embodiments of the present invention;FIG. 2 depicts a schematic block diagram of a system for building a neural network model, according to various embodiments of the present invention;FIG. 3 depicts a schematic block diagram of an exemplary computer system which may be used to realize or implement the system for building a neural network model, according to various embodiments of the present invention;FIG. 4A depicts a schematic drawing showing an example architecture of a TTnet model;FIG. 4B depicts a schematic drawing showing an example architecture of a LTT (learning truth table) block;FIG. 4C depicts a schematic drawing illustrating the linear layer DNN structure of the LTT block (LTT filter) followed by an activation function at training time;FIG. 4D depicts a schematic drawing illustrating the linear layer DNN of the LTT block of FIG. 4C at testing time;FIG. 4E depicts a schematic drawing illustrating an example LTT filter computation and transformation into a truth table;FIG. 4F shows an example truth table of an LTT block determined based on example neural network weights thereof, along with two example forms of expression (filter function) obtained based on the truth table;FIG. 5A shows a schematic drawing illustrating an example input image kernel with a size of 6 X 6, according to various example embodiments of the present invention;FIG. 5B shows schematic drawings illustrating an example input mask along with an example correspondence between the ‘ l’s and the input variables (xxto x6), according to various example embodiments of the present invention,FIG. 5C shows a schematic drawing illustrating a truth table determined for a filter for a set of possible input variables combinations (based on input variables xxto x6), according to various embodiments of the present invention;FIG. 5D shows an example truth table whereby its size has been expanded, according to various example embodiments of the present invention;FIG. 6 depicts a schematic drawing of a deep tractable and learnable neural network architecture, according to various example embodiments of the present invention;FIG. 7 depicts a schematic flow diagram of a method of building a neural network model, according to various example embodiments of the present invention;FIG. 8A depicts a schematic flow diagram of a post-training stage for model reduction, according to various example embodiments of the present invention;FIGs. 8B and 8C depict schematic flow diagrams of size optimization space independent and size optimization space dependent, respectively, according to various example embodiments of the present invention;FIG. 9 depicts a schematic diagram showing an example of an improved TTnet model according to various example embodiments of the present invention trained on an Adult dataset in the form of Boolean decision trees, according to various example embodiments of the present invention; andFIG. 10 shows a table (Table 1) with a comparison of verification strategies, namely, usage of a general DCNN to verify with state-of-the-art verifiers «- / LCrown or using theimproved TTnet according to various example embodiments of the present invention with a general SAT verification method.DETAILED DESCRIPTION
[0012] Various embodiments of the present invention provide a method of building a neural network model, and a system thereof, and more particularly, building a neural network model comprising filter function block(s). Various embodiments of the present invention also provide a method of performing neural network operations using the neural network model built, and a system thereof.
[0013] As explained in the background, recently, Truth Table deep convolutional neural networks (TTnets), a new family of SAT-encodable models featuring for the first time real- valued weights, was introduced by the Benamira reference. However, in the Benamira reference, the maximum filter input size (i.e., the maximum number of input variables that may be provided to the filter function block) is relatively small (e.g., limit of 9 or up to 16 input variables). Furthermore, the input / output variables of the filter are each limited to 1 -bit (i .e., 0 or 1). As a result, the TTnets disclosed in the Benamira reference suffer from various limitations, such as only being implemented to represent an expanding auto encoder (i.e., limited to an expanding auto encoder function) and the size of the truth table (based on which the filter function block is produced) having limited flexibility. In this regard, various embodiments provide a method of building a neural network model comprising filter function block(s), and a system thereof, that seeks to overcome, or at least ameliorate, one or more deficiencies in existing method(s), and more particularly, to improve or enhance the flexibility in building the neural network model and / or the practicality in the neural network model built, thereby improving practical applications and / or performance (e.g., accuracy) of the neural network model built.
[0014] FIG. 1 depicts a schematic flow diagram of a method 100 of building a neural network model using at least one processor, according to various embodiments of the present invention. The method 100 comprising: obtaining (at 106) a neural network model (e.g., a trained neural network model) comprising a first convolutional layer, the first convolutional layer comprising a filter comprising a plurality of weights; and encoding (at 108) the filter of the first convolutional layer into a filter function block. The above-mentioned encoding (at 108) the filter of the first convolutional layer comprises: determining a truth table of the filter with respect to a subset of input variables amongst a set of input variables; and determining a filterfunction dependent on a plurality of input variables of the subset of input variables based on the truth table, the filter function block being configured to perform the filter function. The above-mentioned determining the truth table of the filter comprises: providing an input mask configured to select a subset of pixels of an input image kernel at a plurality of predetermined pixel positions thereof, respectively, for the filter of the first convolutional layer to perform a convolutional operation with respect to the input image kernel, wherein the plurality of predetermined pixel positions of the input image kernel corresponds to the subset of input variables, respectively; and determining, for each possible input variables combination of a set of possible input variables combinations based on the subset of input variables, a filter output of the filter based on the possible input variables combination.
[0015] Accordingly, the method 100 of building a neural network model advantageously improves or enhances the flexibility in building the neural network model and / or the practicality in the neural network model built. In particular, an input mask is provided which is configured to select a subset of pixels of an input image kernel at a plurality of predetermined pixel positions thereof, respectively, for the filter of the first convolutional layer to perform a convolutional operation with respect to the input image kernel. Therefore, the filter input size is advantageously flexible (e.g., not limited to 9 or up to 16 input variables as in the Benamira reference, and for example, may be greater than 16 input variables), and more particularly, the input mask enables the flexibility to control or set the number of input variables (e g , corresponding to the above-mentioned subset of input variables) actually inputted to (or processed by) the filter to perform convolutional operation as desired or as appropriate regardless of the original / initial number of input variables (e.g., corresponding to the above- mentioned set of input variables, i.e., the filter input size) provided to the filter, such as up to a maximum size according to a predetermined condition / criteria. As a result, practical applications and / or performance (e.g., accuracy) of the neural network model built can be improved. For example, by having the flexibility to increase the original / initial size of the inputs provided to the filter (which may be referred to as increasing the maximum filter input size), the accuracy of the neural network model built can be increased, as well as improving the filter function that the filter function block can approximate (e.g., capable of approximating a bigger function). For example, by relaxing such an architectural constraint, the filter function block can better approximate a bigger function. These advantages or technical effects, and / or other advantages or technical effects, will become more apparent to a person skilled in the art as the method 100 of building a neural network model, as well as the corresponding system 200 forbuilding a neural network model, is described in more detail according to various embodiments and example embodiments of the present invention.
[0016] In various embodiments, the number of input variables in the subset of input variables and the number of bits of each input variable of the subset of input variables satisfies a predetermined condition. In this regard, the predetermined condition is the number of input variables in the subset of input variables multiplied by the number of bits of each input variable of the subset of input variables is a maximum of 32 or 64 (i.e., the maximum may be set as 32 or 64 according to various embodiments). In various embodiments, such a maximum may be set at greater than 16. In various embodiments, the number of input variables in the subset of input variables is based on the hamming weight of the input mask. In this regard, the hamming weight of the input mask controls or sets the number of input variables (e g., corresponding to the above-mentioned subset of input variables) actually inputted to (or processed by) the filter to perform convolutional operation from the original / initial number of input variables (e.g., corresponding to the above-mentioned set of input variables, i.e., the filter input size) provided to the filter.
[0017] In various embodiments, the input mask is configured to have a predetermined value at the plurality of predetermined pixel positions thereof for selecting the subset of pixels of the input image kernel at the plurality of predetermined pixel positions thereof. In various embodiments, the plurality of predetermined pixel positions of the input mask configured to have the predetermined value may be determined based on machine learning.
[0018] In various embodiments, the predetermined value is a value of 1.
[0019] In various embodiments, each input variable of the subset of input variables is a multi-bit input variable.
[0020] In various embodiments, the above-mentioned determining the truth table of the filter further comprises quantizing, for the above-mentioned each possible input variables combination of the set of possible input variables combinations based on the subset of input variables, the filter output of the filter to produce a quantized output corresponding to the possible input variables combination using an activation function so as to obtain a set of quantized outputs with respect to the set of possible input variables combinations. In this regard, the activation function is a multi-bit activation function, and each quantized output of the set of quantized outputs is a multi -bit quantized output For example, in contrast to limiting the input / output variables of the filter to 1 -bit (i.e., 0 or I) as in the Benamira reference, according to various embodiments, each input / output variable may be a multi-bit variable, for example,which has been found to enable better training, resulting in the neural network model built having a better performance (e.g., better accuracy).
[0021] In various embodiments, the first convolutional layer comprises a plurality of filters, each filter comprising a plurality of weights. In this regard, in the case of encoding a plurality of filters of a layer into a plurality of filter function blocks, respectively, the method 100 comprises performing, for each of the plurality of filters of the first convolutional layer, the above-mentioned encoding (at 108) the filter of the first convolutional layer into a filter function block to obtain a plurality of filter function blocks respectively corresponding to the plurality of filters of the first convolutional layer.
[0022] In various embodiments, in the case of encoding filters of two layers into one filter function block, the first convolutional layer of the neural network model obtained comprises one or more filters, each filter comprising a plurality of weights, and the neural network model obtained further comprises a second convolutional layer, the second convolutional layer comprising a filter comprising a plurality of weights. In this regard, the above-mentioned encoding (at 108) the filter of the first convolutional layer into the filter function block comprises encoding the one or more filters of the first convolutional layer and the filter of the second convolutional layer into the filter functional block. Furthermore, the above-mentioned determining the truth table of the filter comprises determining the truth table of the one or more filters of the first convolutional layer and the filter of the second convolutional layer with respect to the subset of input variables amongst the set of input variables, and the above- mentioned providing the input mask comprises providing the input mask for the one or more filters of the first convolutional layer to respectively perform the convolutional operation with respect to the input image kernel. Furthermore, the above-mentioned determining the filter output of the filter comprises determining, for each possible input variables combination of the set of possible input variables combinations based on the subset of input variables, one or more first filter outputs of the one or more filters of the first convolutional layer based on the possible input variables combination, and a second filter output of the filter of the second convolutional layer based on the one or more first filter outputs.
[0023] In various embodiments, the filter function is a Boolean satisfiability (SAT) function. For example, the SAT function (or formula) is a Boolean function capable of being verified to determine whether the Boolean function is satisfiable or not according to the Boolean satisfiability problem known in the art (e.g., using a SAT solver). For example, the SAT function may be in CNF (conjunctive normal form), DNF (disjunctive normal form), NNF(negation normal form), ANF (algebraic normal form) or other forms of Boolean function (or circuit) as desired or as appropriate.
[0024] FIG. 2 depicts a schematic block diagram of a system 200 for building a neural network model according to various embodiments of the present invention, corresponding to the above-mentioned method 100 of building a neural network model as described hereinbefore according with reference to FIG. 1 according to various embodiments of the present invention. The system 200 comprises: at least one memory 202; and at least one processor 204 communicatively coupled to the at least one memory 202 and configured to perform the method 100 of building a neural network model as described hereinbefore according to various embodiments of the present invention. Accordingly, the at least one processor 204 is configured to: obtain a neural network model comprising a first convolutional layer, the first convolutional layer comprising a filter comprising a plurality of weights; and encode the filter of the first convolutional layer into a filter function block. The above-mentioned encode the filter of the first convolutional layer comprises: determining a truth table of the filter with respect to a subset of input variables amongst a set of input variables; and determining a filter function dependent on a plurality of input variables of the subset of input variables based on the truth table, the filter function block being configured to perform the filter function. The above-mentioned determining the truth table of the filter comprises: providing an input mask configured to select a subset of pixels of an input image kernel at a plurality of predetermined pixel positions thereof, respectively, for the filter of the first convolutional layer to perform a convolutional operation with respect to the input image kernel, wherein the plurality of predetermined pixel positions of the input image kernel corresponds to the subset of input variables, respectively; and determining, for each possible input variables combination of a set of possible input variables combinations based on the subset of input variables, a filter output of the filter based on the possible input variables combination.
[0025] It will be appreciated by a person skilled in the art that the at least one processor 204 may be configured to perform various functions or operations through set(s) of instructions (e.g., software modules) executable by the at least one processor 204 to perform various functions or operations. Accordingly, as shown in FIG. 2, the system 200 may comprise a neural network model obtaining module (or a neural network model obtaining circuit) 206 configured to perform the above-mentioned obtain a neural network model comprising a first convolutional layer, the first convolutional layer comprising a filter comprising a plurality of weights; and afilter encoding module (or a filter encoding circuit) 208 configured to perform the above- mentioned encode the filter of the first convolutional layer into a filter function block.
[0026] It will be appreciated by a person skilled in the art that the above-mentioned modules are not necessarily separate modules, and two or more modules may be realized by or implemented as one functional module (e g., a circuit or a software program) as desired or as appropriate without deviating from the scope of the present invention. For example, the neural network model obtaining module 206 and the filter encoding module 208 may be realized (e.g., compiled together) as one executable software program (e.g., software application or simply referred to as an “app”), which for example may be stored in the at least one memory 202 and executable by the at least one processor 204 to perform the corresponding functions or operations as described herein according to various embodiments.
[0027] In various embodiments, the system 200 for building a neural network model corresponds to the method 100 of building a neural network model as described hereinbefore with reference to FIG. 1, therefore, various operations, functions or steps configured to be performed by the least one processor 204 may correspond to various operations, functions or steps of the method 100 described hereinbefore according to various embodiments, and thus need not be repeated with respect to the system 200 for clarity and conciseness. In other words, various embodiments described herein in context of methods (e g., the method 100 of building a neural network model) are analogously valid for the corresponding systems or devices (e g , the system 200 for building a neural network model), and vice versa. For example, in various embodiments, the at least one memory 202 may have stored therein the neural network model obtaining module 206 and / or the filter encoding module 208, which respectively correspond to various operations, functions or steps of the method 100 of building a neural network model as described hereinbefore according to various embodiments, which are executable by the at least one processor 204 to perform the corresponding operations, functions or steps as described herein.
[0028] A computing system, a controller, a microcontroller or any other system providing a processing capability may be provided according to various embodiments in the present invention. Such a system may be taken to include one or more processors and one or more computer-readable storage mediums. For example, the system 200 described hereinbefore may include at least one processor (or controller) 204 and at least one computer-readable storage medium (or memory) 202 which are for example used in various processing carried out therein as described herein. A memory or computer-readable storage medium used in variousembodiments may be a volatile memory, for example a DRAM (Dynamic Random Access Memory) or a non-volatile memory, for example a PROM (Programmable Read Only Memory), an EPROM (Erasable PROM), EEPROM (Electrically Erasable PROM), or a flash memory, e.g., a floating gate memory, a charge trapping memory, an MRAM (Magnetoresistive Random Access Memory) or a PCRAM (Phase Change Random Access Memory).
[0029] In various embodiments, a “circuit” may be understood as any kind of a logic implementing entity, which may be special purpose circuitry or a processor executing software stored in a memory, firmware, or any combination thereof. Thus, in an embodiment, a “circuit” may be a hard-wired logic circuit or a programmable logic circuit such as a programmable processor, e g , a microprocessor (e g , a Complex Instruction Set Computer (CISC) processor or a Reduced Instruction Set Computer (RISC) processor). A “circuit” may also be a processor executing software, e.g., any kind of computer program, e.g., a computer program using a virtual machine code, e.g., lava. Any other kind of implementation of various functions or operations may also be understood as a “circuit” in accordance with various other embodiments. Similarly, a “module” may be a portion of a system according to various embodiments of the present invention and may encompass a “circuit” as above, or may be understood to be any kind of a logic-implementing entity therefrom.
[0030] Some portions of the present disclosure may be explicitly or implicitly presented in terms of algorithms and functional or symbolic representations of operations on data within a computer memory. For example, these algorithmic descriptions and functional or symbolic representations are the means used by those skilled in the data processing arts to convey most effectively the substance of their work to others skilled in the art. It can be understood by a person skilled in the art that an algorithm is generally conceived to be a self-consistent sequence of steps leading to a desired result. For example, the steps require physical manipulations of physical quantities, such as electrical, magnetic or optical signals capable of being stored, transferred, combined, compared, and otherwise manipulated.
[0031] The present specification also discloses a system (e.g., which may also be embodied as one or more devices or apparatuses), such as the system 200, for performing various operations, functions or steps of various methods described herein. Such a system may be specially constructed for the required purposes or may comprise a general purpose computer system selectively activated or reconfigured by a computer program stored in the computer system. In general, various algorithms that may be presented herein are not limited to being implemented or executed by any particular computer system Alternatively, the construction ofmore specialized computer system to perform various operations, functions or steps of various methods described herein may be provided as desired or as appropriate without going beyond the scope of the present invention.
[0032] In addition, the present specification also at least implicitly discloses computer program(s) or software / functional module(s), in that it would be apparent to a person skilled in the art that various operations, functions or steps of various methods described herein may be put into effect by computer code. The computer program(s) is not intended to be limited to any particular programming language and implementation thereof, and it will be appreciated by a person skilled in the art that a variety of programming languages and coding thereof may be used to implement the computer program(s). Moreover, the computer program(s) is not intended to be limited to any particular control flow as there are a variety of programming languages which can use different control flows. It will be appreciated by a person skilled in the art that a computer program may be stored on any computer-readable storage medium (non- transitory computer-readable storage medium), such as but not limited to, a magnetic disk, an optical disk or a memory chip. For example, a computer program stored on a computer-readable storage medium may be loaded and executed on a computer system to implement various operations, functions or steps of various methods described herein according to various embodiments of the present invention.
[0033] Accordingly, in various embodiments, there is provided a computer program product, embodied in one or more computer-readable storage mediums (non-transitory computer-readable storage medium), comprising instructions (e.g., the neural network model obtaining module 206 and / or the filter encoding module 208) executable by one or more computer processors to perform a method 100 of building a neural network model as described hereinbefore with reference to FIG 1 according to various embodiments of the present invention. Accordingly, various computer programs or software modules described herein may be stored in a computer program product receivable by a system therein, such as the system 200 as shown in FIG. 2, for execution by at least one processor 204 of the system 200 to perform various operations, functions or steps of various methods described herein according to various embodiments of the present invention.
[0034] It will be appreciated by a person skilled in the art that various modules described herein (e g., the neural network model obtaining module 206 and / or the filter encoding module 208) may be software module(s) realized by computer program(s) or set(s) of instructions executable by a computer processor to perform various functions or operations.Various modules described herein (e.g., the neural network model obtaining module 206 and / or the filter encoding module 208) may also be implemented as hardware module(s) being functional hardware unit(s) designed to perform various functions or operations. More particularly, in the hardware sense, a module is a functional hardware unit designed for use with other components or modules For example, a module may be implemented using discrete electronic components, or it can form a portion of an entire electronic circuit such as an Application Specific Integrated Circuit (ASIC). Numerous other possibilities exist. It will also be appreciated by a person skilled in the art that a combination of hardware and software modules may be implemented. Furthermore, various operations, functions or steps of various methods described herein may be performed in parallel rather than sequentially as desired or as appropriate (e.g., as long as it does not render the method(s) inoperable or unsatisfactory for its intended purpose).
[0035] In various embodiments, the system 200 for building a neural network model may be realized by any computer system (e.g., desktop or portable computer system) including at least one processor and at least one memory, such as an example computer system 300 as schematically shown in FIG. 3 as an example only and without limitation. Various methods / steps or functional modules may be implemented as software, such as a computer program being executed within the computer system 300, and instructing the computer system 300 (in particular, one or more processors therein) to conduct various functions or operations as described herein according to various embodiments. The computer system 300 may comprise a system unit 302, one or more input devices 304 such as a keyboard, a touchscreen and / or a mouse, and a plurality of output devices such as a display 308. The system unit 302 may be connected to a computer network 312 via a suitable transceiver device 314, to enable access to e g., the Internet or other network systems such as Local Area Network (LAN) or Wide Area Network (WAN). The system unit 302 may include a processor 318 for executing various instructions, a Random Access Memory (RAM) 320 and a Read Only Memory (ROM) 322. The system unit 302 may further include a number of Input / Output (I / O) interfaces, for example VO interface 324 to the display device 308 and I / O interface 326 to the one or more input devices 304. The components of the system unit 302 typically communicate via an interconnected bus 328 and in a manner known to a person skilled in the art.
[0036] In various embodiments, there is provided a method of performing neural network operations using a neural network model built according to the method 100 as described herein according to various embodiments of the present invention It will be appreciated by a personskilled in the art that the present invention is not limited to any type of neural network operations that may be performed using the neural network model built. In other words, any type of neural network operations may be performed as desired or as appropriate, as long as they use the neural network model built.
[0037] Tn various embodiments, there is provided a system for performing neural network operations, the system comprising: at least one memory; and at least one processor communicatively coupled to the at least one memory and configured to perform neural network operations using the neural network model built according to the method 100 as described herein according to various embodiments of the present invention. It will be appreciated by a person skilled in the art that such a system for performing neural network operations may be realized by any computer system (e.g., desktop or portable computer system) including at least one processor (configured to perform neural network operations using the neural network model built) and at least one memory, such as the example computer system 300 as schematically shown in FIG. 3 as an example only and without limitation.
[0038] In various embodiments, there is provided a computer program product, embodied in one or more non-transitory computer-readable storage mediums, comprising instructions executable by at least one processor to perform neural network operations using the neural network model built according to the method 100 as described herein according to various embodiments of the present invention.
[0039] It will be appreciated by a person skilled in the art that the terminology used herein is for the purpose of describing various embodiments only and is not intended to be limiting of the present invention. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and / or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0040] Any reference to an element or a feature herein using a designation such as “first”, “second” and so forth does not limit the quantity or order of such elements or features, unless stated or the context requires otherwise. For example, such designations may be used herein as a convenient way of distinguishing between two or more elements or instances of an element. Thus, a reference to first and second elements does not necessarily mean that only two elements can be employed, or that the first element must precede the second element, unless stated or thecontext requires otherwise. In addition, a phrase referring to “at least one of’ a list of items refers to any single item therein or any combination of two or more items therein.
[0041] In order that the present invention may be readily understood and put into practical effect, various example embodiments of the present invention will be described hereinafter by way of examples only and not limitations It will be appreciated by a person skilled in the art that the present invention may, however, be embodied in various different forms or configurations and should not be construed as limited to the example embodiments set forth hereinafter. Rather, these example embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the present invention to those skilled in the art
[0042] Deep Neural Network (DNN) systems offer exceptional performance in a variety of difficult domains and these results far outstrip the current ability to secure and analyze those DNNs. As DNNs are becoming widely integrated in a variety of applications, several concerns have emerged, such as lack of robustness emphasized by a lack of explainability, difficulty of integrating human knowledge in post-processing and impossibility to formally verify their behavior due to their large complexity. Under these circumstances and especially when these systems are deployed in applications where safety and security are critical, the formal verification of DNN systems is under intense research efforts.
[0043] So far, the DNNs architectures proposed by the community have generally been evolving towards increasing performance. Improving performance is obviously desirable, however the resulting architectures are currently very hard to verify because of their intrinsic complexity. In this regard, the Benamira reference proposed TTnet having a convolutional architecture that is, by design, readily verifiable.
[0044] As application, the Benamira reference studied Deep Convolutional Neural Networks (DCNNs) from the standpoint of their complete and sound formal verification, in other words, knowing a certain property, it is desirable to confirm whether this property holds or not for a specific DNN. Conventionally, DNNs complete and sound verification property methods are mainly based either on Satisfiability Modulo Theory (SMT) or Mixed-Integer Programming (MIP) which are not yet scalable to real-valued DNNs. Some recent publications approached the problem of complete verification from the well-known Boolean SATisfiability (SAT) point of view where BNNs are first converted into SAT formulas and then formally verified using SAT. This pipeline is computationally efficient, enables security verification and more generally can answer a large range of questions including how many adversarial attacksexist for a given BNN, image and noise level. However, prior to the Benamira reference, only BNNs can be transformed into a SAT formula and, as they were not designed for this application, their corresponding SAT conversion method intrinsically leads to formulas with a large number of variables and clauses, impeding formal verification scalability.
[0045] For example, a well-known example of property to verify on image classification datasets is the robustness to adversarial attacks. The performance of formal DNN robustness verification methods may be evaluated against two main characteristics, namely, verified accuracy (i.e., the ratio of images that are correctly predicted and that do not have any adversarial attacks) and verification time (i.e., the duration to verify that one correctly predicted image in the test set does / does not have an adversarial attack) The verification time is the sum of the problem construction time and its resolution time. The latter is intimately related to the quality of the solver and the complexity of the DNN encoding, for example, a less efficient encoding and the solver will lead to a longer time to verify an image. Most robustness improvements in the literature have been in the form of new trainings, new testing method to increase robustness, new certification method to guarantee robustness properties or new formal verification methods.
[0046] The Benamira reference described a new convolutional architecture, encodable by construction into SAT formulas. The convolutional architecture can for example be trained with a certification method to further increase robustness. Tn addition, while the Benamira reference may focus on the well-studied robustness to adversarial attacks property, the new convolutional architecture generally allows a more compact symbolic encoding, leading to networks that are more amenable to verify most properties. Accordingly, the Benamira reference essentially offer three main contributions:(1) defined a new family of real-valued DCNNs that can be compactly encoded into SAT formulas, namely, TTnet. The TTnet simplifies its 2D-CNN filter formulation in the form of a truth table to allow weights and certain intermediate values to be real. Accordingly, a real- valued DCNN is encoded into SAT, while achieving sufficient natural accuracy for practical use;(2) showed that TTnet offers two main valuable conversion properties over BNNs:(2a: Post-tuning) - The first conversion property allows the integration of human knowledge in the post-processing: a DCNN filter activation can be manually modified towards a desired goal. For example, it may be decided to focus on reducing overfitting and, to this end, TTnet logic rules resulting from overfitting may be characterised and a filtering approach maybe proposed. The latter increased the verified accuracy without decreasing the natural accuracy: +0.43% and +0.29% for high noise MNIST and CIFAR-10, respectively;(2b: Tractability) - The second property enables to compute all possible model inputs / outputs prior to deployment in production. In an adversarial setting, it can be assessed whether the input noise will propagate to the output. Filters with no impact on the output can therefore be disregarded. This leads to a lower number of clauses and variables in the SAT formulas compared to BNNs, thus enabling the usage of a generic SAT solver. Comparing to the previous BNN / SAT method, the SAT formulas in the Benamira reference are 5 and 9 times more compact for clauses number for high noise MNIST and CIFAR-10 respectively;(3) the TTnet model may be applied to complete robustness verification The TTnet model is the first complete and sound verification method allowing real-valued weights with competitive speed and no timeout. Besides, focusing on the robustness property, TTnet improves the verified accuracy over all BNN-based methods and more generally proposes a competitive trade-off between verified accuracy and verification time over various conventional complete verification methods. The Benamira reference discloses that the goal is to propose a competitor to BNN for SAT complete formal verification (using robustness as an example property), and is not limited to a competitive robustness method. That is, robustness is merely one example property that the TTnet can verify, and the TTnet can be applied to a wide variety of other strategic properties.
[0047] The SAT problem is that of deciding / determining whether there exists a variable assignment to satisfy a given Boolean expression <!’ For example, a Boolean expression may be expressed in a Conjunctive Normal Form (CNF) or in a Disjunctive Normal Form (DNF). They are both defined over a set of Boolean variab . A literal is defined as avariable xtor its complement xt. A CNF is a conjunction of a set of clauses: = ), where each clause Cj is a disjunction of some literals Cj =ADNF is a disjunction of a set of clauses:= (cxV V cm), where each clause c7is a conjunction of some literals Cj — A A ljr. A pseudo-Boolean constraint has the form: hich can be mapped to a SAT formula.However, conventionally, such a conversion generally leads to a tremendous number of clauses and literals compared to the number of variables in the original pseudo-Boolean form, making it impractical to comprehend.
[0048] Prior to the Benamira reference, the sole published method of converting a DNN into a SAT formula is limited to BNNs and involves recomposing a block formed of a 2D-CNNlayer, a batch normalization layer and a step function into an inequality in order to apply the pseudo-Boolean constraint. This approach was further refined using a different training method and a specific SAT solver, resulting in a significantly reduced verification time. Although the proposed inequality rewriting may be elegant, the corresponding SAT formula still contained a large number of clauses and literals compared to the number of variables in the pseudo-Boolean constraint. This prevents the tractability of those SAT / BNNs formulas. The Benamira reference only focused on comparison with DNN models, and not other machine learning family. For example, the main feature of DNNs is that there are more parameters in the model than samples in the dataset. This is not the case with decision trees. Their learning capacity is very different and for example, the TTnet model is able to learn on ImageNET, contrary to them
[0049] Complete and sound property verification of SAT-convertible DNNs has been previously presented as follows: given a precondition prec on the inputs x, a property prop on the outputs o and a SAT relation given by a DNN between inputs / outputs denoted as DN'N(x, o), it is checked whether the following statement is valid: prec(x) A DNN(x, o) => prop(o). In order to seek a counterexample to this property, a satisfying assignment of prec(x) A DNN(x, o) => prop(p) may be sought. An application example of property verification is to check for the existence of an adversarial perturbation in a trained DNN. In this case, prec defines an e-ball of valid perturbations around the original image and prop states that the classification should not change under these small perturbations. Therefore, the traditional “natural accuracy” is distinguished from the “verified accuracy”, the latter measuring the fraction of the predictions which remains correct for all adversarial attacks within the perturbation constraints The Benamira reference explained that their goal is not to propose a new state-of-the-art formal method dedicated to robustness, but to propose a new architecture that can scale and be used for any formal complete and sound property verification. The TTnet was then applied to verify robustness against adversarial attack, a well-studied property.
[0050] A Boolean function has the form {0,1}" -> {0,1} and its corresponding truth table lists the filter outputs for all 2" possible inputs combinations (easy to set up when n (the number of input variables) is not too large). The 2D-CNN was considered as a Boolean function ^(f,s,p,k.c) which, for a given filter / takes n — k2c / g inputs at position (ij) with k denoting the kernel size, c denoting the number of input channels, s denoting the stride, p denoting the padding and g denoting the group parameter. The outputs may be written asd>^(x^1J\ , x^). For a multi-layer network, a similar truth table can be constructed, except for the kernel size k that may be replaced by a patch function, which may also be referred to asthe size of a receptive field. The vector obtained after the flatten operation and before the final classifier layer may be denoted as the vector of features V.Truth Table Deep Convolution Neural Network (TTnet)
[0051] In an attempt to address the drawbacks of the high encoding complexity of the SAT formulas obtained from BNN’ s transformation process, the Benamira reference designed a new DNN architecture that admits a more compact symbolic encoding. Real-weighted convolutions and aggregations were used that were further binarized with step-functions. In the Benamira reference, these convolutions can be fully represented with truth tables, as long as the number of inputs provided to the filter is low-dimensional (limited to a maximum of 9 or up to 16 input variables).
[0052] FIG. 4A depicts a schematic drawing of an example general architecture of a TTnet model with one-channel input. As shown, an image may undergo binarization through processing a floating input (F), followed by two LTT (learning truth table) layers (e g., referred to as layer 1 and layer 2), and then a flatten and linear layer to produce an output. Accordingly, LTT blocks (which may also be referred to as LTT filters) may be integrated into the neural network, just as CNN filters are integrated into a deep convolutional neural network, whereby each LTT layer may comprise multiple LTT filters and there may be multiple LTT layers in the TTnet. The TTnet further comprises a pre-processing layer and a final layer (e g , a final classification layer which is a linear layer), which provide flexibility in adapting to various applications, such as scalability, formal verification and logic circuit design. Each LTT block of layer 2 may not take as input from outputs of all the filters of layer 1. In this regard, each LTT block of layer 2 may only take as input from output of the corresponding LTT block of layer 1 (i.e , the LTT block in layer 1 in the same group as the LTT block in layer 2). As will be described later below, an LTT block may be formed by encoding a filter of a convolutional layer, which may include determining a truth table of the filter and determining a filter function (a Boolean function) based on the truth table. In this regard, the LTT block may thus be configured to perform the filter function. The LTT layers may be interconnected in any manner as desired or as appropriate, such as based on the particular application or the use case.SAT encoding of a one-layer 2D-CNN
[0053] The SAT encoding of a 2D-CNN layer with a single filter will now be described. In this regard, a binary image with one channel is considered as input and a trained DCNN withonly one layer is considered as a model. For simplicity, the encoding of one filter in a 2D-CNN layer will first be described, which may then be expanded by adding more filters to the 2D- CNN layer and then more channels to the inputs to increase the complexity of the 2D-CNN layer.
[0054] The case of encoding one filter in a 2D-CNN layer will now be described. The main idea is to fix the number of possible outputs of the 2D-CNN layer by fixing the number of its possible inputs (input variables), which will subsequently allow the testing of all possible combinations (all possible input variables combinations). Following notations introduced hereinbefore, denotes the output for filter f and n denotes the number of inputs(number of input variables):(Equation 1) with Bin denoting the Heaviside step function, defined as input Xj G{0,1}, the truth table of the 2D-CNN’ s filter f can be established by trying all the possible inputs, for a total of 2" operations. In the Benamira reference, n is limited to n < 9. Hence, with 29= 512 operations, the truth table may then be generated accordingly. Then, the truth table is converted into a simplified SAT formula and by doing so Equation (1) above may be rewritten as:(Equation 2) with being the formal expression of the filter in the DNF form (resp.CNF form). It is noted that unlike previous works, the approach in the Benamira reference is not limited to binary weights but allows for arbitrary real-valued weights within the 2D-CNN layer.
[0055] By way of an example, a 2D-CNN layer with one filter and a kernel size of 2 is considered, with the weights and the 16 possible inpu ♦t en ♦tn •es i (i-.e., al ili possi kblie i •nput varia kbiles com kbi-na+ti-ons r) areF°rthe 16 possible input variables combinations, the filter outputsare y = [0, — 5, 3, — 2, — 1, —5 , 3, —2, 10, 5, 13, 8, 9, 4, 12, 7] . After binarization with the Heaviside step function, y binary — [0, 0, 1, 0, 0, 0 , 1, 0, 1, 1, 1, 1, 1, 1, 1, 1] (corresponding tothe truth table of the filter). A filter function for the filter may then be determined (e.g., based on the Quine-McCluskey algorithm) based on the truth table to obtain, for example, SATf^17= (x2x0)A x0) (i.e., a SAT function). The filter function block corresponding to the filter may thus be configured to perform this filter function, which is a SAT function.
[0056] The cases of encoding multiple filters in a 2D-CNN layer and with multiple channels will now be described. In the case of encoding multiple filters in a 2D-CNN layer, the above described method for encoding one filter may simply be repeated for each individual filter, thus yielding a corresponding expression (filter function) per filter As convolutional networks may take several channels as input, the number of input variables may rise substantially. For example, a 2D-CNN layer that takes 32 input channels with a kernel size of 2 yields an input of size 128 (i.e., 128 input variables), well above the above-mentioned limit of n = 9. In order to overcome this effect, the input channels may be grouped using a group parameter g. Grouped convolutions divide the input channels into a number (g) of groups, and then apply separate convolutions within each group. This effectively decreases the number of inputs (i.e., input variables) provided to each individual filter by a factor of g, and the number of inputs may be expressed as n = k2c / g. For example, by using 16 groups, the number of inputs for the filters (and thus32 o the truth tables) becomes — X 2 — 8.Learning Truth Table (LTT) block (or LTT filter) and TTnet
[0057] In order to improve the performance of the model, an amplification layer may be added to increase the learning capacity of the DCNN without augmenting the size of the patches seen by the DCNN. As previously described, only the 2D-CNN input size matters when establishing the 2D-CNN SAT expression (filter function). Therefore, a second layer may be added as long as the patch size is not increased. This may be achieved by adding a layer with kernel size 1. It is noted that the intermediate values from the first layer do not need to be binary anymore. FIG. 4B depicts a schematic drawing showing an example LTT overview in one dimension, and more particularly, an example architecture of a LTT block in one dimension. The LTT block (which may be referred to as a LTT filter) may be configured to perform a filter function that is comparable to traditional CNN filters in terms of computational efficiency but differs in complexity For example, the computational efficiency in binary operations (denoted as OPs) may be defined as the total number of binary gates (NAND / NOR / AND / OR / XOR / XNOR) required to represent the entire DNN in Boolean logic gate format; and the floating-point operations counterpart are denoted as FLOPs. The LTT filtermay be designed such that one of its main characteristics is to be a grouped CNN fdter, which will be sparser in connectivity than a classical CNN filter. For example, the LIT filter may have the following criteria: (A) the LTT filter distribution must be entirely computable in practical time, independently of the overall DNN architecture; and (B) Once LTT filters are assembled into a layer and layers are assembled into a DNN, the latter should be scalable, especially on large datasets such as ImageNet. To achieve the above criteria, the following three LTT filter design rules may be defined. Rule 1 : Force the input bit size n of the LTT filter to be n < 16, independently of the architecture. Rule 2: Use binary inputs / outputs, but with real-valued weights and intermediate values. Rule 3: Ensure that the LTT filter uses nonlinear functions in between the Heaviside activations. As a result, each LTT filter becomes a truth table with a maximum input bit size of 16, leading to a compact DNN represented as a Boolean logic gate circuit that is easy to train and verify. Accordingly, the LTT filters may each be both a neural network-based function and a small-sized truth table that can be computed within a practical time frame. This characteristic guarantees, by design and independently of the overall architecture, the ability to practically extract an efficient (e.g., in terms of the number of logical gates) and functionally equivalent filter function (e.g., CNF). Accordingly, the LTT filter serves as the fundamental building block function of the TTnet. For example, the LTT filter may comprise two layers of grouped 2D-CNN with an expanding factor of 8, and thus can be seen as an expanding auto-encoder. The intermediate values are real and the input / output values are binary. In particular, the LTT filter may comprise two 2D-CNN layers with a so-called amplification parameter which corresponds to the ratio between the number of filters of the first layer and the number of filters of the second layer. For example, the amplification parameter value may be set at 8.
[0058] For better understanding, a traditional or regular 2D-Convolutation filter will now be defined. Let an input X G pc<'nxHxlvwhere Cm, / / , IT represent the number of channels, height and width of a channel, respectively. If a regular convolution filter is applied on X with kernel size k x k, group G, stride 5= 1, padding p = 0, the output is denoted aswhere every output(Equation 3) whereby U denotes the concatenation operation and uni represents the output ingroup y at position i, j Namely:convolution filter weights
[0059] Given that the set of inputs (x7-, ... , x^+k-1 j+k-1') is encoded on q bits, the complete distribution of one 2D-CNN filter of functioncan be computed in 2qxkxkx(Cin'G)operations. Furthermore, the weights OJ7are real and learnable using gradient descent. As an example illustration, FIG. 4C depicts a schematic drawing illustrating the linear layer DNN structure of the LTT filter followed by an activation function at training time, and FIG. 4D depicts a schematic drawing illustrating the linear layer DNN of the LTT filter of FIG. 4C at testing time. In this regard, the fixed learned function (shaded region in FIG. 4D) is a function for which one can compute the complete distribution in 2qxCin, but is not fully computable when the input size of the function is too large.100601 The complexity of the 2D-CNN filter may be significantly reduced by designing a filter function whose input bit size q X k X k X (Qn / G) is smaller than 16. The LTT filter may be defined as follows. Let an input X G {0, ±ycin^nxww^ereQn, H, W represent the number of channels, height, and width of a channel, respectively. Let the group and the kernel size parameters be such that G = CirJn and fc2< 16 / n, n G {1, 4, 16}. Two convolutions filter weights may be defined as followsG ]^feixfeix(cin / G)x(“xCout / G) and6)7gpadding and such that k±+ k2— 1 = k and a denotes the amplification ratio. In addition, 0 is defined to be a nonlinear function. The LTT output is denoted as O G MCul!, xHxM / where every output unit otj Gis defined as in Equation (3). Unit o[j Gthe output in group y at position i, / , is given by:(Equation 5) with M^y defined as in Eq(Equation 6) where i G {1, ... , H], j G {1, ... , W}, y G {1, ... , G} and with the input
[0061] By definition, the described LTT filters validate the above-mentioned three LTT filter design rules. FIG. 4E depicts a schematic drawing illustrating an example LTT computation in one dimension for fc1= 3, k2= 2 , k = kr+ k2— 1 = 4, a = 4, Qn= 1, Cout= 1 and 0 = ReLU Tn particular, FIG. 4E illustrates an example LTT filter 4> computation and transformation into a truth table. The LTT filter is characterized by weights nq with parameters (input channel, output channel, kernel size, stride) = (1, 4, 3, 1), and a>2with parameters (input channel, output channel, kernel size, stride) = (4, 1, 2, 1). The input bit size of the LTT filter is 4 since the output feature requires four input entries (shown as diagonally hashed boxes in FIG. 4E). Equation (5) above provides the formal definition. As described above, FIG. 4B shows an example architecture of the LTT filter. For example, the intermediate values and the weights (tOj, m2) are real and the input / output values are binary In FIG. 4B, binactdenotes a Heaviside step function defined as binact(x) = (1 + sgn(xy) / 2 with x G HL
[0062] The LTT filter has a number of properties. As a first property, the LTT filter weights(uq, m2) are trainable with gradient descent and the Straight-Through Estimator (STE) to handle the input / output binarization. As a second property, the LTT filter preserves real -valued weights (oq, OJ2) and intermediate values a. As a third property, the entire distribution of the LTT filter can be calculated in 2n< 216— 65,536 operations (less than 1 ms on a standard PC). Truth table input bit size n is independent of the architecture. As a fourth property, the Quine- McCluskey algorithm can be used to compute the optimal CNF (in terms of Boolean logic gates) from the LTT truth table if n < 12. For 12 < n < 16 a compact CNF can be computed. As a fifth property, the LTT filter may have two forms: neural network weights (oq, m2) or a small Boolean circuit (as a truth table or as Boolean logic gates). As a sixth property, under truth table or CNF form, an LTT evaluation does not need to compute any activation function. For example, the above-mentioned first and second properties offer practical benefits, including fast and scalable filter training. Meanwhile, the above-mentioned third, fourth and sixth properties lead to the development of compact LTT filters and efficient verification techniques.
[0063] FIG. 4F shows an example truth table of an LTT filter Cty. which may be denotedas^>co1,a>2since it is characterized by weights (nq, m2)) determined based on example weights (uq, m2) thereof, along with the two example forms of expression (filter function, e.g., DNF and CNF) obtained based on the truth table.
[0064] An example of processing LTT weights of an LTT filter to obtain a truth table of the LTT filter and then obtaining a filter function (e g , CNF) based on the truth table will nowbe described. Consider a trained 1D-LTT <t>c,iiW2with input size n = 4, a stride of size 1 and no padding. The example architecture of <h6>1 / 6J2is shown in FIG. 4A as described hereinbefore, which comprises two CNN filter layers, namely, a first layer having with parameters (input channel, output channel, kernel size, stride) = (1, 4, 3, 1), while the second layer having o>2with parameters (input channel, output channel, kernel size, stride) (4, 1, 2, 1). Example values of the weights (to-p <u2) are shown in FIG. 4F. The inputs and outputs of / (02are binary, and the inputs are denoted as [x0 / x1 / x2,x3]. To compute the entire distribution of, all 24= 16 possible input / output pairs are generated as shown in FIG. 4E to obtain the truth table as shown in FIG. 4F, which fully characterizes the behavior ofThe truth table obtained may then be transformed into, for example, an optimal CNF using the Quine-McCluskey (QMC) algorithm. This optimal CNF fully characterizes the behavior ofas well and is exactly equivalent.
[0065] As described hereinbefore, FIG. 4A depicts a schematic drawing of an example general architecture of the TTnet model with one-channel input. Accordingly, FIG. 4A shows how LTT blocks (LTT filters) may be integrated in the TTnet. In particular, each LTT layer may be positioned like a 2D-CNN layer except that its filters are not linear, they are expanding auto-encoders. Regarding the pre-processing layer, DCNNs inputs are usually floating points, however, encoding floating points into SAT typically implies high complexity. In order to simplify the verification process and to improve the network robustness, a three-step first-layer or pre-processing procedure may be applied: (1) quantification of inputs (binary); (2) Batch normalization, and (3) Step function. Regarding the final layer, the TTnet may use a single linear layer as a classifier block. It may be encoded into SAT using pseudo-Boolean constraint as described hereinbefore as long as the weights are integers.
[0066] However, as explained in the background, in the Benamira reference, the maximum filter input size (i.e., the number of input variables that may be provided to the filter) is relatively small (e.g., limit of 9 or up to 16 input variables). Furthermore, the input / output variables of the filter are each limited to 1 -bit (i.e., 0 or 1). As a result, the TTnet disclosed in the Benamira reference suffers from various limitations, such as only being implemented to represent an expanding auto encoder (i.e., limited to an expanding auto encoder function) and the size of the truth table (based on which the filter function block is formed) having limited flexibility. In this regard, various example embodiments provide a method of building a neural network model comprising filter function block(s), and a system thereof, that seeks to overcome, or at least ameliorate, one or more deficiencies in existing method(s), and more particularly, to improveor enhance the flexibility in building the neural network model and / or the practicality in the neural network model built, thereby improving practical applications and / or performance (e.g., accuracy) of the neural network model built.
[0067] For example, various example embodiments seek to amplify the scope (filter input size) accessible to each filter (or the function functional block, e g., corresponding to the LTT block or LTT filter described herein) without compromising its ability to compute all outcomes (i.e., all outputs for all possible input variables combinations, respectively). In addition, various example embodiments seek to enhance performance metrics while still ensuring the computation of all outcomes (i.e., all outputs for all possible input variables combinations, respectively).
[0068] Various example embodiments note that the study of cipher security and deep neural networks has revealed a remarkable similarity between the two, namely, both are black box functions that require analysis to ensure their effectiveness. While cryptanalysis experts can reduce the size of a cipher and compute its complete distribution, deep learning neural networks present a unique challenge. Due to the large number of samples (e.g., 228x28) required to compute the complete distribution of a neural network that processes, for example, images of size 28x28 as input, it is currently infeasible. To address this issue, various example embodiments provide a method to create or build a tractable neural network in order to facilitates its interpretation. In particular, various example embodiments provide a filter neural network operator, which is both tractable and learnable, along with the resulting family of tractable and learnable neural networks that employ the filter neural network operator. Such an approach revolutionizes the elementary operation in CNNs by enabling the computation of the total filter distribution and, by transitivity, the entire neural network prior to production. This elementary operation, while being tractable, preserves the property of effective training. Accordingly, various example embodiments advantageously provide a scalable family of neural networks that is both tractable and learnable.
[0069] Accordingly, various example embodiments provide a CNN model that is both tractable and learnable while preserving the desirable properties of high performance, scalability and plasticity for large-scale applications. This paves the way for more compact CNN models, complete and sound formal verification of CNNs, and global exact explainability by design for CNNs, with applications in fairness concept shifting mitigation, among other areas. The filter neural network operator and the resulting network offer a powerful solution tothe challenge of efficiently analyzing deep neural networks, enabling researchers to unlock new possibilities for understanding and improving these complex artificial intelligence (Al) systems.
[0070] Al is expected to be the next technological revolution for the coming decades, but two main issues are hindering its growth, namely, lack of explainability of the predictions (deep neural networks are essentially black boxes) and lack of privacy of the user data The later prevents many data to be used in Al solutions, greatly reducing the scope of applicability of these Al technologies. The former reduces the trust users place in Al and forbids any human interaction during the inference process, which strongly limits its widespread adoption. In addition, a lot of very valuable information is not passed to the users because the inference process cannot be interpreted, which prevents desirable outcomes such as better model performances, model verification and improved insights on the studied problem. In addition, strong regulations are coming for Al technologies in all leading regions. For example, explainability measures and strong data privacy may be mandated in the future all over the world for all entities using Al. Accordingly, companies may eventually have to adapt and embrace new interpretable and privacy-preserving models in the near future. Unfortunately, the eXplainability of Al (XAI) remains a difficult task and current solutions may either provide a good scalability with low explainability, or a low scalability with good explainability. Regarding existing privacy-preserving Al solutions (based on Homomorphic Encryption, or HE), they have a very large cost in terms of computation time, latency, and memory, and thus they remain far from being practical. eXplainability of Al (XAI)
[0071] Al is a new technological revolution that will be impacting every aspect of our lives. The emergence of XAI is driven by several strong factors, such as:• it addresses regulatory pressures such as Al regulation, and facilitates good practices around accountability, ethics and fairness;• it builds trust by providing greater visibility over unknown vulnerabilities and flaws and can assure stakeholders that the system is operating as desired;• it helps to improve performance: understanding why and how your model works enables you to fine tune and optimise it;• it allows to rapidly identify and correct mistakes, improve decision making; and• it provides better insights into studied problem.
[0072] For example, the threat of regulation is becoming more and more real for Al practitioners, such as the U.S. White House Al Bill of Rights Blueprint, the Al Act by the European Commission and the Singapore Model Al Governance Framework. For example, a goal is to make organizations responsible if they deploy a rogue model that they did not make sure they understand or ensure that it is safe.
[0073] There are many potential customers for XAI, from entities that need to explain their inference to users as value added (trust in the inference) or as compliance, entities that need a better understanding of the underlying problem, entities seeking improved performances and more accurate decisions, entities that would like to use external / human knowledge to improve the inference, such as:• Healthcare: improved clinical workflow, predicting ICU transfers, etc.• Data analytics: improved models, pricing optimization, etc.• Marketing companies: better content personalization, lead scoring, etc.• Research teams and academia (DNA, health, environment, energy): better understanding of the inference to increase chances of new treatment or new technical solution discovery• Banking: explainable and fair credit scoring, customer chum, anti-money laundering, etc.• Insurance: claims management, fraud mitigation, etc.• Autonomous cars and critical systems: verified Al for autonomous driving / inference from critical sensors data• Energy: smart grids management• Security / Military: private, safe, verified Al• Governmental agencies / Customs: responsible and fair Al that impacts citizens• Manufacturing, logistics, supply chain: predictive maintenance, transportation optimization, etc.• Individual users: data analysts, Al professionals
[0074] For example, there has been a report on explainable Al in banking which noted that the “black-box” conundrum is one of the biggest roadblocks preventing banks from executing their artificial intelligence (Al) strategies and that despite recent advancements in XAI research, banks still face many technical challenges implementing explainability into the Al pipeline. The report also remarked that banks should continue researching new techniques for developing deep learning applications that are transparent by design, and do not require post-hocexplainability. This is exactly what the TTnet technology according to various example embodiments seeks to address, namely, to provide a neural network family architecture that is transparent by design and that provides direct and global explainability.
[0075] Regarding private inference, it is clear that data protection is becoming a growing concern for governments and also citizens in general. Many data protection efforts are being imposed, for example, General Data Protection Regulation (GDPR) in EU, California Consumer Privacy Act (CCPA) in US, Personal Data Protection Act (PDPA) in Singapore. Manipulating data without any guarantee on its privacy will not be possible anymore. This poses an existential threat to Al practitioners (e.g., how can they infer data if its privacy needs to be maintained?). Private inference technologies have recently appeared to solve this pressing issue, by ensuring that data remains completely private during inference. Yet, private inference is an emerging market as current solutions are still mostly unpractical, despite the heavy investments in these technologies by large tech companies.
[0076] Enabling private inference can:• help in maintaining business for all entities using Al, when new regulations about data privacy is imposed, and• enable new markets, as some sensitive data (such as medical data) that was previously unusable (regardless of regulations) will now become usable.
[0077] Thus, the TTnet according to various example embodiments has practical applications for virtually all entities that use or intend to use Al with sensitive data or data covered by regulations.Fully Homomorphic Encryption (FHE)
[0078] DNNs have achieved remarkable results in various fields, including image recognition, natural language processing or medical diagnostics, Machine Learning as a Service (mLaaS) became a popular DNN-based business use-case, where clients pay for predictions from a service provider. However, this approach requires trust between the client and the service provider. In cases where the data is sensitive, such as military, financial, or health information, clients may be hesitant (or are simply not allowed) to share their data with the service provider for privacy reasons. On the service provider’s side, training DNNs requires large amounts of data, technical expertise, and computer resources, which can be expensive and time-consuming. As a result, service providers may hesitate to give the model directly to the client, as it may be easily reverse engineered (or at least make the attacker’s task much easier), hindering thegrowth of mLaaS activity. Allowing the clients to perform the inference locally is also not very practical as any model update would have to be pushed to all clients, not to mention the complex support of the various client hardware / software configurations, etc.
[0079] Homomorphic Encryption (HE) and Fully Homomorphic Encryption (FHE) is an ideal technology to address Privacy-Preserving in Machine Learning (PPML) as it allows the computations to be performed directly on encrypted data. By encrypting its data before sharing it with the service provider, the client ensures that it remains private while the service provider can still provide accurate predictions. This solves the trust issue and also gives a competitive advantage in regions where data regulations are stricter, such as Europe’s General Data Protection Regulation (GDPR). There are several existing HE schemes, such as BGV / BFV, CKKS, and Torus-FHE (TFHE). Yet, the security and flexibility provided by HE come at an important cost, as the computation, communication, and memory overheads are significant, especially for complex functions such as DNNs. For example, one single logic gate computation in FHE can be million times costlier than a normal logic gate, communication and memory overhead are tremendous (can be up to hundreds of GBs) and implementations are highly technical and require rare expertise. As of today, no private inference solution can be really considered practical, even for simple tabular datasets or small image datasets. For example, they would either require too much time or too much memory / communication to perform the inferenceTTnet -a Tractable A Learnable Neural Network (T LNN)
[0080] Various example embodiments disclose a TTnet (truth table deep convolutional neural network), which is a Tractable and Learnable Neural Network ( TNN), that disrupts both domains. The TTnet provides excellent explainability of the inferences while maintaining a high prediction accuracy, even for image datasets. This sweet spot is a trade-off that is not reachable with existing XAI solutions. Regarding private inference, the TTnet is capable of producing very small models that are transformable by design into compact Boolean circuits, leading to drastic performance improvements when using HE. For example, various example embodiments provide practical solution of privacy-preserving inference for tabular datasets (largely prevalent in industry) and small image datasets.
[0081] Accordingly, the TTnet according to various example embodiments has a wide range of practical applications. For example, for private inference, the TTnet may be employed by companies using Al that manipulate sensitive data as well as HE-solution providers. Forexplainable Al, for example, the TTnet may be employed by companies that would like to improve their models’ performances, to extract better insight from their models, to allow human knowledge addition, to ensure fairness, etc. In addition, incoming data-privacy and XAI regulations will greatly increase our market scope.
[0082] In particular, the TTnet according to various example embodiments of the present invention improves the TTnet disclosed in Benamira reference, such that, for example, the maximum filter input size (i.e., the number of input variables that may be provided to the filter) is not limited to a relatively small size (e.g., limit of 9 or up to 16 input variables). Furthermore, the input / output variables of the filter are not limited to 1 -bit (i.e., 0 or 1). In this regard, various example embodiments provide a method of building a neural network model (TTnet) comprising filter function block(s) that improves or enhances the flexibility in building the neural network model and / or the practicality in the neural network model built, thereby improving practical applications and / or performance (e.g., accuracy) of the neural network model built. In other words, the method is based on the TTnet disclosed in Benamira reference and makes a number of improvements thereto so as to improve or enhance the flexibility in building the neural network model and / or the practicality in the neural network model built, which may herein be referred to as the improved TTnet. In various example embodiments, the improvements include one or more of: (1) enabling flexibility in the filter function; (2) enabling flexibility in input / output quantization; (3) enabling flexibility in filter input size; and (4) enabling flexibility in the size of the truth table.
[0083] For a better understanding of the improved TTnet, convolutional neural networks (CNNs) and how they are organized will now be described according to various example embodiments of the present invention. In particular, a CNN filter is defined as well as describing how a CNN filter is organized in a CNN layer and how a CNN layer is deployed in a DCNNs.
[0084] In mathematical terms, a 2D CNN filter can be defined as follows (the definitions can be extended to ID and 3D): Let Xklbe a k \ -bit input (i.e., a set of input variables each having Ari -bit) of the filter with dimensions (kF X H X C), where Wis the width of the input, H is the height of the input, and C is the number of channels of the input.
[0085] Let W _gamma* be a learnable set of real weights with dimensions (14^, x Whx C / g X l; / g), where Wwis the width of the weights, Whis the height of the weights, C is the number of channels of the input, g is the group size (C and F can be divided by g and gamma in [1; g]), and F is the number of output feature maps. For example, letXki,ww,wh,c / g(i> h gamma) refer to the restriction of Xklto the kernel of size WwX WKX C / g starting from the position (i, j, gamma).
[0086] Let B* be a learnable bias vector with dimensions Eg. In various example embodiments, the group size g is not limited to being 1 and may have a size greater than 1 as appropriate
[0087] The output Kiinear filter of the convolutional layer may be calculated as: linear fiiter(t;J) = linear(Xfel VKw,wh,c / g(ij, gamma), W* , B*)(Equation 7) where linear denotes the linear operation (i.e., the convolution operation).
[0088] The output Knoniin of the convolutional layer after the non-linear activation function activ / <2(for example, kl = 1 corresponds to the step function) characteristic of DNNs is:quation 8)
[0089] According to various example embodiments, a general Learning Table (LT ) function parameterized by (W*, B*, kl, k2, Ww, Wh, C / g) may be defined as follows:LT(W*, B*, kl, k2)\ Xkl Ww,wh,c(j,j) activk2(linear ((Equation 9) Accordingly, Equation (5) describes how a LTT block is defined, which comprises a linear layer followed by a non-linear layer (an activation function).
[0090] Note that conventionally, a learning table function is not tractable, for example, it is not possible or practical to compute the 2klxWwXWhXC^ginputs since, for example, k \ = 32, Ww= Wh = 3, C = 32, g=l.
[0091] In various example embodiments, a CNN layer may be made up of multiple CNN filters, each of which may perform a specific type of convolution on an input image. These filters may be organized in parallel to analyze different features of the input image simultaneously. A deep CNN (DCNN) comprises stacked CNN layers. As the input passes through each layer, it is convolved with a series of filters to extract increasingly complexfeatures. The output of each layer may be passed as input to the next layer until the final output layer, which produces the classification output.
[0092] By way of an example and without loss of generality, the improved TTnet will be described herein focusing on DCNNs. Various example embodiments seek to make the CNN filter function a tractable operation. A tractable operation is, for example, an operation that can be performed in practice (e.g., computing time is not too large). In various example embodiments, a limit for an operation to be considered tractable may be computing 264inputs. To do so, various example embodiments developed and add constraints on the model architecture. Furthermore, to mitigate or overcome a potential drop in performance due to these constraints, various example embodiments change the definition of the convolution filter. Techniques for making the CNN filter function tractable and for enhancing performance will now be described below according to various example embodiments of the present invention. These techniques can be extended to ID, 2D and 3D CNN filters and therefore CNN layers and model architectures.Making the CNN Filter Function Tractable
[0093] According to various example embodiments, the traditional learning table (TT) function is transformed into a learning tractable table (£TT) function Specifically, an architectural constraint is imposed on the £T function to make it tractable. The depth of a kernel is defined as nd redefine the £T function into a £TT function asfollows:(Equation 10) and the following inequality constraint (or architectural constraint) is added(Equation 11) or(Equation 12) directly in the architecture design by fixing the group parameter g.|0094| Accordingly, in various example embodiments, the number of input variables (e.g., based on Ww, 14^, Wc) and the number of bits (e.g., kl) of each input variable satisfies apredetermined condition / constraint, whereby the predetermined condition is the number of input variables multiplied by the number of bits of each input variable is a maximum of 32 or 64. In the case where the input channels are grouped into multiple groups, the number of input variables may further be based on a channel group parameter g, namely, based on Cig.
[0095] Accordingly, this technique makes the LTT function tractable, that is, the function is able to compute all of the 2klxWivXWfiXWcpossible inputs to the filter so as to produce respective outputs to incorporate into a truth table associated with the filter. For example, the truth table may be transformed into various forms, such as CNF / DNF, compact Boolean gate circuit, Rules, Boolean decisions trees.
[0096] Accordingly, this technique advantageously extends the applicability of truth tables to various types of neural network architectures. For example, in the Benamira reference as explained hereinbefore, an Expanding Auto Encoder function was defined within the context of the LTT family. In contrast, various example embodiments provide the above technique for making the CNN filter function tractable by adding the above architectural constraint which advantageously extends the filter function to encompass a broader range of DNN families for LTT, where the input size (n) adheres to the above architectural constraint. For example, this expansion encompasses diverse architectures such as Linear models, Variational Autoencoders, Diffusion models, Transformers, LSTMs, GRUs, Attention-based modules, Capsule Nets and so on.Making the CNN Filter Function Scalable
[0097] According to various example embodiments, there is provided a technique for making the LTT function scalable, which is by replacing the linear weights W* and the linear operator linear with a non-linear operator / function NN. In this regard, various example embodiments introduce a non-linear filter parameterized by NN*, which can be trained using any family of non-linear functions, such as autoencoders, variational autoencoders, residual networks, transformers, diffusion models, and so on.
[0098] For example, let Xklwh,wc(i>j> refer to the restriction of Xklto the kernel of size WwX WhX Wc(where Wc= C / g) starting from the position (z, j, k). In this regard, x Wcare given by the receptive field / patch of the trainable non-linear function NN* .
[0099] The resulting function, denoted SLTT, can be expressed as:SLTT (NN* , kl, k2, Ww, Wh, Wc)\ Xkl>WwiWluWc(i,j, k) -> activfc2(NN (Xkl WwiWliiWc(i, j , k)))(Equation 13)and the following example inequality constraint (or architectural constraint) is added fcl x Wwx Whx Wc< 32(Equation 14) or fcl x Wwx Whx Wc< 64(Equation 15) directly in the architecture design to ensure tractability. In this regard, NN* is the non-linear filter parameterized by a neural network function that can be trained using various families of non-linear functions. Accordingly, various example embodiments advantageously combine the above-mentioned inequality constraint and the use of a non-linear function NN* . For example, in contrast, the Benamira reference only covers a linear function and an expanding auto encoder function. Therefore, various example embodiments advantageously expand into all other families of neural networks, thus enabling flexibility in the filter function.
[0100] Various example embodiments enable flexibility in input / output quantization. In particular, while the Benamira reference only considered binary inputs and outputs, various example embodiments provide input / output quantization where inputs are quantized into ql bits and outputs are quantized into q2 bits. Accordingly, in various example embodiments, each input variable is a multi-bit (ql-bit) input variable. Furthermore, when determining the truth table of a filter, for each possible input variables combination of the set of possible input variables combinations (i.e., all possible input variables combinations), the filter output of the filter is quantized to produce a quantized output corresponding to the possible input variables combination using an activation function so as to obtain a set of quantized outputs with respect to the set of possible input variables combinations. Accordingly, the activation function is a multi-bit activation function, and each quantized output of the set of quantized outputs is a multi-bit quantized output.Relaxing the Channel Dimension Constraint with a Learnable Indicatrice Function
[0101] Various example embodiments enable flexibility in filter input size. In this regard, there is provided a technique for relaxing the constraint on the filter input size in CNNs by introducing a learnable Boolean indicatrice function / matrix (which may simply be referred to as an input mask), / *, of size (H^vXX Wc). In this regard, Wc= C since g = 1. The matrix I* is used to multiply the input tensor Nfel w h(i,j) (which may also be referred to as the inputimage patch or the input image kernel), which serves to select a subset of channels (or a subset of pixels of the input tensor) to use in the convolutional operation by a filter. The number of ones in I* (i.e., Hamming( I* )) may be denoted by n{* and O denotes element-wise multiplication. For example, the above S£TT further improved with this generalisation may be denoted by GS£TT and may be defined as follows:QS£TT(NN*, r, kl, k2, Ww, Why. XkliWwWh(,i,j) activk2(W*( / * o XkliWwWhCi,j^(Equation 16) Accordingly, before computing the convolution, elementwise multiplication may be performed to reduce the original / initial filter input size. In various example embodiments, the matrix I* may be learned by machine learning.
[0102] The following example inequality constraint (or architectural constraint) may then be added kl X nr< 32(Equation 17) or kl X n, < 64(Equation 18) Accordingly, in Equation (18), the number of input variables is based on the hamming weight of the input mask. In this regard, the hamming weight of the input mask (the number of ones in the input mask) controls or sets the number of input variables (e.g., corresponding to the subset of input variables described herein) actually inputted to (or processed by) the filter from the original / initial number of input variables (e.g., corresponding to the set of input variables described herein, i.e., the filter input size) provided to the filter.
[0103] Accordingly, the above constraint ensures that the number of parameters in the model remains tractable. Overall, this technique allows for a more flexible and adaptable CNN filter, where the importance of each input channel can be learned and adjusted during training, while keeping the unique tractability property.
[0104] Accordingly, this technique advantageously accommodates larger filter input sizes using a learnable input binary mask. For example, in contrast to the Benamira reference which imposes a maximum filter input size of 9 (and thus a maximum kernel size of 3 X 3) or up to 16, this technique removes such a limitation and allows any filter input size (and thus any kernel size of K X K) by using an input mask. In various example embodiments, the input mask may be learned during training to ensure that the number of ‘ 1’ value in the input mask is configuredso that the number of input variables selected by the input mask for the filter to perform the convolutional operation satisfies the above inequality constraint.
[0105] For illustration purpose, FIG. 5A shows a schematic drawing illustrating an example input image kernel with a size of 6 X 6 and FIG. 5B shows schematic drawings illustrating an example input mask along with the correspondence between the ‘ 1’ s and the input variables (xTto x6) illustrated For example, the number of ‘1 ’ in the example input mask is 6 and the number of bits of each input variable is 2 (i.e., 2 -bits (3 possible values)). Therefore, this satisfies the inequality constraint according to Equation (17) whereby 2 X 6 — 12 < 32. Accordingly, in various example embodiments, an input mask is provided and configured to select a subset of pixels of an input image kernel at a plurality of predetermined pixel positions thereof, respectively, for the filter to perform a convolutional operation with respect to the input image kernel. In this regard, as shown in FIG. 5B, the plurality of predetermined pixel positions of the input image kernel corresponds to input variables (xtto x6), respectively. To determine the truth table for the filter, for each possible input variables combination of a set of possible input variables combinations (based onto x6), a filter output of the filter is determined based on the possible input variables combination. Accordingly, the input mask is configured to have a predetermined value (e.g., value of 1) at a plurality of predetermined pixel positions thereof for selecting the subset of pixels of the input image kernel at the plurality of predetermined pixel positions thereof. Furthermore, the plurality of predetermined pixel positions of the input mask configured to have the predetermined value (e.g., value of 1) may be determined based on machine learning.
[0106] Following on from the example shown in FIGs. 5A and 5B, FIG. 5C shows a schematic drawing illustrating the truth table determined for the filter for the set of possible input variables combinations (based on input variablesto x6). For illustration purpose only, each possible input variables combination (whereby each input variable is a multi-bit variable (e.g., possible value of 0, 1 or 2)) based on the input variables (xtto x6) to the filter according to the input mask (which may thus be referred to as the final input variables) is shown along a row in the truth table. In addition, for each possible input variables combination, the filter output of the filter based on the possible input variables combination is shown at the last column of the truth table shown in FIG. 5C, which may thus complete the truth table for the filter. The truth table may then be transformed or converted into a SAT function for the filter.
[0107] FIG. 5D shows an example truth table whereby the number of input variables (xtto x32) is 32 and the number of bit of the input variable is 1 (i.e., 1-bit). As can be seen, for example,the number of input variables can be increased to 32, thus advantageously expands the size of the truth table.Overall Architecture for Tractable Neural Networks
[0108] FIG. 6 depicts a schematic drawing of a deep tractable and learnable neural network model or architecture 600 (e.g., the improved TTnet model) according to various example embodiments of the present invention. Each tractable and learnable layer comprises one or more £TT filters (e.g., GS£TT filters) (e.g., in the same or similar manner as one or more CNN filters in a CNN layer), each £TT filter configured to perform a respective convolution operation on an input image. For example, as shown in FIG. 6, the £TT filters may be organized in parallel to analyze different features of the input image simultaneously. The improved TTnet model 600 comprises one or more tractable and learnable layers (e.g., stacked tractable and learnable layers). In the same or similar manner as a CNN, the output(s) of each layer is passed as input(s) to the next layer until the final output layer, which produces a classification output.
[0109] In various example embodiments, the initial neural network is trained with a specific architecture that ensures that the architectural constraint described hereinbefore according to various example embodiments is satisfied. For example, the number of filters and the filter input size are predetermined before training. For example, if the input size is the same as the kernel size, and there is only one filter, the CNN layer is essentially the same as a linear layer. This is also the case for layers in the middle of the neural network. The operations of the first and last layers have been described hereinbefore.
[0110] FIG. 7 depicts a schematic flow diagram of a method 700 of building a neural network model according to various example embodiments of the present invention. The method 700 comprises obtaining (at 706) a neural network model; and encoding (at 708) the filter(s) of the neural network model into filter function block(s), such as described hereinbefore according to various example embodiments of the present invention.
[0111] Tn various example embodiments, the neural network model comprises one or more convolutional layers, each convolutional layer comprising one or more filters, each filter comprising a plurality of weights. In various example embodiments, the above-mentioned obtaining (at 706) the neural network model comprises training a neural network model and post-training the trained neural network model for model reduction. In various example embodiments, as shown in FIG. 7, the above-mentioned obtaining (at 706) the neural network model may include fixing or setting a model size based on requirements as appropriate, such asthe number of layers, the number of LTT blocks / filters in each layer and the LTT size. The above-mentioned training the neural network model may be performed based on the applications as appropriate, such as robustness, sparsity or scalability. FIG. 8A depicts a schematic flow diagram of the post-training of the trained neural network for model reduction according to various example embodiments of the present invention, including quantifying activation function and pruning; changing two linear layers with polynomial activation function in between into one linear function; and retraining for approximating LTT block of size n into two LTT layers of size p and q with n > p and n < q. In various example embodiments, a grid search method (with different next step selection, e.g., greedy or Bayesian) may be employed to search among a set of possible parameters for the best parameters. By way of an example only and without limitation, an example grid search may be implemented as follows: optimization method [Adam, AdamW, SGD (stochastic gradient descent), etc.]; kernel size = [3 to 16], stride = [3 to 16]; padding = [0 to 16], filter size = [3 to 32], embed size = 50; batch_size = [16, 32, 64, 128]; dropout_value_class = [0.0, 0.1, 0.2]; dropout_value_cnn = [0. 1., 0.1, 0.2]; family_LTT = [LR, AE]; learning_rate = [0.005, 0.001, 0.05, 0.01, 0.1], For example, three different types of trainings may be defined, namely, a normal training may be defined without any constraints (providing the best performance with the maximum complexity), a sparse training (providing minimal performance with minimal complexity), and a robust training (providing an intermediate tradeoff between performance and complexity) with optimization based on a third metric such as robustness or fairness, etc. For the sparse training, for example, a binarization constraint may be added on the last linear layer. For the robust training, for example, a training-specific method such as PGD (projected gradient descent), IBP (interval bound propagation) or Lipschitz training (all available in open source) may be incorporated. In this regard, the post-training of the trained neural network for model reduction shown in FIG. 8A corresponds to the robust training.
[0112] In various example embodiments, with the trained neural network model (including the above-mentioned post-training if performed), the method 600 may then proceed to encode (at 708) the filters of the trained neural network model into filter function blocks. In this regard, for each filter, all possible input variables combinations to the filter are determined or generated. The filter outputs are then determined or produced using the filter for each possible input variables combination of all possible input variables combination to the filter. The filter outputs determined may then be collected or incorporated in a truth table associated with the filter. The truth table may then be converted into a filter function (a SAT function), such as NNF, ANF,DNF, CNF or other Boolean circuit. In particular, as described hereinbefore according to various embodiments, the truth table is determined with respect to a subset of input variables amongst a set of input variables to the filter. In this regard, an input mask is provided and configured to select a subset of pixels of an input image kernel at a plurality of predetermined pixel positions thereof, respectively, for the filter to perform a convolutional operation with respect to the input image kernel, whereby the plurality of predetermined pixel positions of the input image kernel corresponds to the subset of input variables, respectively. Thereafter, for each possible input variables combination of the set of possible input variables combinations (i.e., all possible input variables combinations) based on the subset of input variables, a filter output of the filter based on the possible input variables combination is determined The filter outputs determined may then be collected or incorporated in a truth table associated with the filter.
[0113] The method 700 may further comprise optimizing (at 710) the neural network model built, including size optimization space independent and size optimization space dependent as illustrated in FIGs. 8B and 8C, respectively. FIG. 8B depicts a schematic flow diagram of the optimization space independent according to various example embodiments of the present invention, including injecting don’t care terms (DCTs) based on inputs and activation function for each filter function; simplifying truth tables / filter functions by reducing the sizes of clauses, the number of clauses and / or the number of input variables used; and simplifying the overall set of truth tables by deleting redundant / correlated truth tables. FIG. 8C depicts a schematic flow diagram of the optimization space dependent according to various example embodiments of the present invention, including injecting don’t care terms (DCTs) based on inputs and activation function for each rule; simplifying truth tables / filter functions by reducing the sizes of clauses, the number of clauses and / or the number of input variables used; and creating the overall circuit and simplify the redundant gate with optimization solver.
[0114] In various example embodiments, in the case of a convolutional layer comprises a plurality of filters, the method 700 may comprises performing, for each of the plurality of filters of the convolutional layer, the above-mentioned encoding (at 708) the filter of the convolutional layer into a filter function block to obtain a plurality of filter function blocks respectively corresponding to the plurality of filters of the convolutional layer.
[0115] In various example embodiments, in the case of encoding filters of two convolutional layers into one filter function block (e g., the first convolutional layer comprises one or more filters and the second convolutional layer comprises a filter), the above-mentionedencoding (at 708) the filter of the convolutional layer into the filter function block comprises encoding the one or more filters of the first convolutional layer and the filter of the second convolutional layer into the filter functional block. In this regard, the above-mentioned determining the truth table of the filter comprises determining the truth table of the one or more filters of the first convolutional layer and the filter of the second convolutional layer with respect to the subset of input variables amongst the set of input variables, the above-mentioned providing the input mask comprises providing the input mask for the one or more filters of the first convolutional layer to respectively perform the convolutional operation with respect to the input image kernel, and the above-mentioned determining the filter output of the filter comprises determining, for each possible input variables combination of the set of possible input variables combinations based on the subset of input variables, one or more first filter outputs of the one or more filters of the first convolutional layer based on the possible input variables combination, and a second filter output of the filter of the second convolutional layer based on the one or more first filter outputs.
[0116] Accordingly, the family of improved TTnet models according to various example embodiments of the present invention is highly versatile and is capable of accommodate any type of input data, such as time series, tabular, image, graphs data and so on. Furthermore, the improved TTnet models can be applied to a wide range of problem types, including classification and regression. One of the key strengths of the improved TTnet models is their scalability, as they have been tested on datasets with a large number of features, with up to 153,228 features and hundreds of gigabytes of data (e.g., the ImageNet dataset). This flexibility and scalability demonstrate the plasticity of the improved TTnet models and their ability to handle a broad range of applications. They are also as fast as traditional neural network to train and very compact. Accordingly, the improved TTnet models according to various example embodiments of the present invention have high scalability and plasticity.
[0117] Various example embodiments can compute all the distribution: there are several forms: rules-based models, sum of Boolean decision truths, CNF / DNF and Boolean circuit. Interpretability is crucial for understanding the decision-making process of the trained model, particularly in security-sensitive applications. Decision trees are widely used in scenarios requiring high interpretability as they produce all the rules (i.e., the global nature of interpretability) that permit the exact computation of the output model result (i.e., the exact nature of interpretability). In other words, local interpretability (e.g., popular solutions such as SHAP or LIME) means that the user will be able to know what features were important for theinference of a given input, while global interpretability (e.g., decision trees or rule-based models) means that the actual rules for the decision (regardless of the input value) are known to the user. In recent years, there has been a growing interest in developing DNNs that are as globally and exactly interpretable as rule-based models. Yet, to date, there is no family of convolutional DNNs that are globally and exactly interpretable as decision trees by design, without the need for an explainer (which often offers local and inexact explanations).
[0118] The interpretability of the improved TTnet according to various example embodiments comes from the fact that it is encodable by construction into Boolean formulas, while achieving sufficient and scalable accuracy for practical use. For comparison, decision trees are very interpretable, but suffer from very low accuracy as soon as the dataset is not very small (on the very standard CIFAR10 image dataset, decision trees would not reach more than 30% accuracy, while T£NN can easily reach 80% and more). On the other hand, typical DNNs can reach high accuracy, but are not interpretable at all.
[0119] Accordingly, global and exact interpretability provided by the improved TTnet are advantageous and provide important practice applications, such as:• It provides an advantage against competitors, as users may prefer models that explain precisely how a certain decision was made. For example, for drug discovery, where a precise explanation can lead to a faster understanding of the inherent biological mechanisms involved in certain medicine. Another typical scenario is disease detection, where the doctor typically have to precisely understand why a certain anomaly was detected and be able to explain that to the patient. Yet another example is image control at customs, where an agent may need precise explanations of why a certain warning was triggered.• It allows businesses to be conducted in certain specific areas, for security-sensitive situations, where a precise understanding of the inference rules is an absolute requirement (e g., self-driving cars, biometry, etc.).• It facilitates businesses to be compliant with future governments guidelines for Al around the world. For example, governments are gradually establishing explainability requirements for Al, as can be seen from various efforts from US, Europe and Singapore.
[0120] Yet, the improved TTnet interpretability leads to even more practical applications. An example is the complete and sound formal verification, that is, knowing a certain property, it can be confirmed whether this property holds or not for a specific DNN. A well-known example of property to verify on image classification datasets is the robustness to adversarialattacks (i.e., a scenario where an adversary tries to modify the inputs to change the inference result). Usually, the performance of formal DNN robustness verification methods is evaluated against two main characteristics, namely, verified accuracy (i.e., the ratio of images that are correctly predicted and that do not have any adversarial attacks) and verification time (i.e., the duration to verify that one correctly predicted image in the test set does / does not have an adversarial attack). The improved TTnet solution according to various example embodiments provides excellent verified accuracy with very fast verification time. As robustness is merely one example property that our model can verify, it will be appreciated by a person skilled in the art that the improved TTnet can also be competitive on a variety of other strategic properties.
[0121] Another application is the possibility to directly integrate human knowledge and fairness into a model. For example, using the improved TTnet, the inherent rules of the trained model can be easily extracted while maintaining a good accuracy. A very clean, compact, and interpretable set of rules can thus be obtained. By extracting the rules of the model, human knowledge can be directly and trivially integrated in the model in post-processing, for example, to ensure fairness of the inference (e.g., with regards to sex, race, religion, etc.). This is of particular importance as explainability and accountability of neural nets is becoming a crucial challenge for the Al industry. Another example is if a business analytics company has frequent and dynamic internal knowledge about certain inputs to the model (e.g., some trading company may have certain special insight every other day on the future movement of certain class of stocks), that may modify the inference result. Such insight is impossible to integrate into existing DNN models, while this is easy to do with the improved TTnet. Therefore, the improved TTnet leads to more user-friendly models and more accurate predictions.
[0122] An example use case illustrating exact and global interpretability will now be described according to various example embodiments of the present invention. For global and exact interpretability, it can be observed in FIG. 9 that the resulting decision mechanism is small and easily understandable. Tn particular, FIG. 9 depicts a schematic diagram showing an example of the improved TTnet model according to various example embodiments of the present invention trained on an Adult database in the form of Boolean decision trees. The output of the DNN and the output of these decision trees are the same, reaching 83.6% accuracy. In FIG. 9, added conditions are represented in shaded rectangles. By modifying existing rules and incorporating Human Added Rule (rs), 84.6% accuracy was obtained. On the same test set, Random Forest reached 85.1% accuracy and Decision Tree reached 84.4% with depth 10. There is no contradiction to the rules, for example, one person cannot be bom in both Mexico andNicaragua. In FIG. 9, the term YoE refers to the Years of Education and the Capital Gains (or Losses) refer to the amount of capital gained (or lost) over the year. Each rule (n) is a function r^. {0, l}ni— > {—1, 0, 1}, i.e., for each data sample T (an individual’s feature input ‘I’), each rule n is associated with a score which is in {—1, 0, 1}.
[0123] In the Adult dataset, the goal is to predict whether an individual ‘I’ will earn more than $50,000 per year in 1994. Given an individual’s feature inputs T, the first rule (n) shown in FIG. 9 can be read as follows: if individual ‘I’ has completed more than 11 years of education, then the rule is satisfied. If not, then the rule is satisfied if individual ‘I’ earn more than $4,200 in investments per month or loses more than $258. If the rule is satisfied, individual ‘I’ earn one positive point. If individual ‘I’ has more positive points than negative points, the model predicts that individual ‘I’ will earn more than $50,000 per year.
[0124] FIG. 10 shows a table (Table 1) with a comparison of verification strategies, namely, usage of a general DCNN to verify with state-of-the-art verifiers «- / i-Crown or using the improved TTnet (referred to as T£NN in Table 1) according to various example embodiments of the present invention with a general SAT verification method. Accordingly, Table 1 presents a comparison of a verification strategy, which utilizes the improved TTnet architecture, according to various example embodiments of the present invention and classical verification tools, against the state-of-the-art rz- / LC'rown method (the winner of the Verification of Neural Networks (VNN) competition 2021). From Table 1, it can be observed that the verification approach according to various example embodiments of the present invention demonstrates a significant improvement in verification time, with an average speedup of 1250x for CIFAR-10 and 1600x for MN1ST, at the same noise level.
[0125] Regarding private inference with FHE, as the improved TTnet model leads to a very compact sets of rules while maintaining a good accuracy, FHE can be applied to provide private inference with excellent performances. Indeed, performance of such technology is highly dependent on the compactness of the model and experimental results show that the improved TTnet model leads to very competitive speed and memory / communication requirement compared to the state-of-the-art. As can be observed, the improved TTnet model is by far the most efficient for tabular datasets (while only requiring a few MBs of memory) and small image datasets. Accordingly, the improved TTnet model represents the very first truly practical solution for private inference (inference time runs in a few seconds, with very small memory and communication requirements), enabling for the first time a fully practical deployment in industrial / real-world scenarios, where tabular datasets are prevalent.
[0126] While embodiments of the invention have been particularly shown and described with reference to specific embodiments, it should be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the scope of the invention as defined by the appended claims. The scope of the invention is thus indicated by the appended claims and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced.
Claims
CLAIMS1. A method of building a neural network model using at least one processor, the method comprising: obtaining a neural network model comprising a first convolutional layer, the first convolutional layer comprising a filter comprising a plurality of weights; and encoding the filter of the first convolutional layer into a filter function block, wherein said encoding the filter of the first convolutional layer comprises: determining a truth table of the filter with respect to a subset of input variables amongst a set of input variables; and determining a filter function dependent on a plurality of input variables of the subset of input variables based on the truth table, the filter function block being configured to perform the filter function, wherein said determining the truth table of the filter comprises: providing an input mask configured to select a subset of pixels of an input image kernel at a plurality of predetermined pixel positions thereof, respectively, for the filter of the first convolutional layer to perform a convolutional operation with respect to the input image kernel, wherein the plurality of predetermined pixel positions of the input image kernel corresponds to the subset of input variables, respectively; and determining, for each possible input variables combination of a set of possible input variables combinations based on the subset of input variables, a filter output of the filter based on the possible input variables combination.
2. The method according to claim 1, wherein the number of input variables in the subset of input variables and the number of bits of each input variable of the subset of input variables satisfies a predetermined condition, and the predetermined condition is the number of input variables in the subset of input variables multiplied by the number of bits of each input variable of the subset of input variables is a maximum of 32 or 64.
3. The method according to claim 2, wherein the number of input variables in the subset of input variables is based on the hamming weight of the input mask.
4. The method according to any one of claims 1 to 3, wherein the input mask is configured to have a predetermined value at the plurality of predetermined pixel positions thereof for selecting the subset of pixels of the input image kernel at the plurality of predetermined pixel positions thereof.
5. The method according to claim 4, wherein the predetermined value is a value of 1.
6. The method according to any one of claims 1 to 5, wherein each input variable of the subset of input variables is a multi-bit input variable.
7. The method according to any one of claims 1 to 6, wherein said determining the truth table of the filter further comprises quantizing, for said each possible input variables combination of the set of possible input variables combinations based on the subset of input variables, the filter output of the filter to produce a quantized output corresponding to the possible input variables combination using an activation function so as to obtain a set of quantized outputs with respect to the set of possible input variables combinations, the activation function is a multi-bit activation function, and each quantized output of the set of quantized outputs is a multi-bit quantized output.
8. The method according to any one of claims 1 to 7, wherein the first convolutional layer comprises a plurality of filters, each filter comprising a plurality of weights, and the method comprises performing, for each of the plurality of filters of the first convolutional layer, said encoding the filter of the first convolutional layer into a filter function block to obtain a plurality of filter function blocks respectively corresponding to the plurality of filters of the first convolutional layer.
9. The method according to any one of claims 1 to 7, wherein the first convolutional layer of the neural network model obtained comprises one or more filters, each filter comprising a plurality of weights, the neural network model obtained further comprises a second convolutional layer, the second convolutional layer comprising a filter comprising a plurality of weights, andsaid encoding the filter of the first convolutional layer into the filter function block comprises encoding the one or more filters of the first convolutional layer and the filter of the second convolutional layer into the filter functional block, wherein said determining the truth table of the filter comprises determining the truth table of the one or more filters of the first convolutional layer and the filter of the second convolutional layer with respect to the subset of input variables amongst the set of input variables, said providing the input mask comprises providing the input mask for the one or more filters of the first convolutional layer to respectively perform the convolutional operation with respect to the input image kernel, and said determining the filter output of the filter comprises determining, for each possible input variables combination of the set of possible input variables combinations based on the subset of input variables, one or more first filter outputs of the one or more filters of the first convolutional layer based on the possible input variables combination, and a second filter output of the filter of the second convolutional layer based on the one or more first filter outputs.
10. The method according to any one of claims 1 to 9, wherein the filter function is a Boolean satisfiability (SAT) function.1 1. A system for building a neural network model, the system comprising: at least one memory; and at least one processor communicatively coupled to the at least one memory and configured to: obtain a neural network model comprising a first convolutional layer, the first convolutional layer comprising a filter comprising a plurality of weights; and encode the filter of the first convolutional layer into a filter function block, wherein said encode the filter of the first convolutional layer comprises: determining a truth table of the filter with respect to a subset of input variables amongst a set of input variables; and determining a filter function dependent on a plurality of input variables of the subset of input variables based on the truth table, the filter function block being configured to perform the filter function, wherein said determining the truth table of the filter comprises:providing an input mask configured to select a subset of pixels of an input image kernel at a plurality of predetermined pixel positions thereof, respectively, for the filter of the first convolutional layer to perform a convolutional operation with respect to the input image kernel, wherein the plurality of predetermined pixel positions of the input image kernel corresponds to the subset of input variables, respectively; and determining, for each possible input variables combination of a set of possible input variables combinations based on the subset of input variables, a filter output of the filter based on the possible input variables combination.
12. The system according to claim 11, wherein the number of input variables in the subset of input variables and the number of bits of each input variable of the subset of input variables satisfies a predetermined condition, and the predetermined condition is the number of input variables in the subset of input variables multiplied by the number of bits of each input variable of the subset of input variables is a maximum of 32 or 64.
13. The system according to claim 12, wherein the number of input variables in the subset of input variables is based on the hamming weight of the input mask.
14. The system according to any one of claims 11 to 13, wherein the input mask is configured to have a predetermined value at the plurality of predetermined pixel positions thereof for selecting the subset of pixels of the input image kernel at the plurality of predetermined pixel positions thereof.
15. The system according to claim 14, wherein the predetermined value is a value of 1.
16. The system according to any one of claims 11 to 15, wherein each input variable of the subset of input variables is a multi-bit input variable.
17. The system according to any one of claims 11 to 16, wherein said determining the truth table of the filter further comprises quantizing, for said each possible input variables combination of the set of possible input variables combinations based on the subset of input variables, the filter output of the filter to produce a quantized outputcorresponding to the possible input variables combination using an activation function so as to obtain a set of quantized outputs with respect to the set of possible input variables combinations, the activation function is a multi-bit activation function, and each quantized output of the set of quantized outputs is a multi-bit quantized output.
18. The system according to any one of claims 11 to 17, wherein the first convolutional layer comprises a plurality of filters, each filter comprising a plurality of weights, and the at least one processor is configured to perform, for each of the plurality of filters of the first convolutional layer, said encode the filter of the first convolutional layer into a filter function block to obtain a plurality of filter function blocks respectively corresponding to the plurality of filters of the first convolutional layer.
19. The system according to any one of claims 11 to 17, wherein the first convolutional layer of the neural network model obtained comprises one or more filters, each filter comprising a plurality of weights, the neural network model obtained further comprises a second convolutional layer, the second convolutional layer comprising a filter comprising a plurality of weights, and said encode the filter of the first convolutional layer into the filter function block comprises encoding the one or more filters of the first convolutional layer and the filter of the second convolutional layer into the filter functional block, wherein said determining the truth table of the filter comprises determining the truth table of the one or more filters of the first convolutional layer and the filter of the second convolutional layer with respect to the subset of input variables amongst the set of input variables, said providing the input mask comprises providing the input mask for the one or more filters of the first convolutional layer to respectively perform the convolutional operation with respect to the input image kernel, and said determining the filter output of the filter comprises determining, for each possible input variables combination of the set of possible input variables combinations based on the subset of input variables, one or more first filter outputs of the one or more filters of the first convolutional layer based on the possible input variables combination, and a second filter output of the filter of the second convolutional layer based on the one or more first filter outputs.
20. The system according to any one of claims 11 to 19, wherein the filter function is a Boolean satisfiability (SAT) function.
21. A computer program product, embodied in one or more non-transitory computer- readable storage mediums, comprising instructions executable by at least one processor to perform the method of building a neural network model according to any one of claims 1 to 10.
22. A method of performing neural network operations using a neural network model built according to the method of any one of claims 1 to 10.
23. A system for performing neural network operations, the system comprising: at least one memory; and at least one processor communicatively coupled to the at least one memory and configured to perform neural network operations using the neural network model built according to the method of any one of claims 1 to 10.
24. A computer program product, embodied in one or more non-transitory computer- readable storage mediums, comprising instructions executable by at least one processor to perform neural network operations using the neural network model built according to the method of any one of claims 1 to 10.
Citation Information
Cited By
Test scheme management method and device based on AI vision
CN121169871A