1. Introduction
Membrane computing studies computational models inspired by the organization and functioning of living cells. Its models, usually called P systems, describe computation through multisets of objects, compartments, evolution rules, communication mechanisms, and parallel rule application. The foundations of this area were established through the original membrane-computing model, the introductory monograph, and later handbook-level syntheses [
1,
2,
3]. Spiking Neural P systems (
systems) form a neural-like family of P systems in which information is represented by spikes and rule firing is controlled by spike multiplicities, regular expressions, delays, and communication along synapse-like connections [
4,
5,
6]. Kernel P systems (
systems) provide a more general membrane-computing framework based on compartments, typed objects, guarded rules, links, and execution strategies, and they have also been investigated from verification and testing perspectives [
7,
8]. Recent work on
systems and broader surveys of membrane computing show that rule-based membrane models remain relevant for formal computation, modeling, and algorithmic design [
9,
10]. In parallel, modern machine learning has shown the practical value of local feature extraction and trainable architectures. Convolutional models introduced local kernels as a central mechanism for extracting neighborhood-level patterns, while later deep architectures extended this idea through depth, residual connections, and attention-based representations [
11,
12,
13,
14]. Spiking neural networks have also developed as a trainable computational paradigm through surrogate-gradient learning, spike-based software frameworks, and links to neuromorphic computation [
15,
16,
17,
18]. These lines of work motivate the question addressed in this paper: whether local kernel-based feature computation can be integrated into the rule semantics of
systems while preserving a precise operational interpretation. This study brings together membrane computing, spiking neural P systems, local kernel-based computation, and reproducible biomedical signal classification. These areas are complementary: membrane computing provides explicit rule systems and formal transition semantics;
systems represent information through spikes and rule firing; local kernels capture neighborhood-level patterns in signals, images, and time series; and ECG beat classification offers a concrete setting in which local morphology, class imbalance, and patient-independent testing are critical. The proposed model connects these elements through a rule-level mechanism in which a local kernel response can influence the applicability of a spike rule.
We introduce
systems as a formal model that connects spiking membrane computation, kernel-P-style guarded rules, and local convolutional feature processing. In a classical
system, the applicability of a rule in a neuron depends mainly on the number of spikes available in that neuron and on the regular-expression condition associated with the rule. In a
system, the applicability of a rule may also depend on a local weighted pattern of spike multiplicities observed in an ordered neighborhood. This pattern is evaluated through a finite kernel, and the resulting response may enter the local guard of a spike rule. The objective is not to replace convolutional neural networks, recurrent neural networks, transformers, or existing biomedical classifiers, but to provide a rule-level formalism in which local filtering is expressed as an explicit predicate inside a spiking membrane-computing transition. In this setting, the neighborhood, the kernel, the threshold relation, the scenario label, and the spike rule remain visible in the model description. The motivation for this model is both formal and practical. Formally,
systems offer a compact rule-based semantics for spike evolution, while
systems show how guarded rules and execution strategies can be used in a broader membrane-computing setting. A CK–SN P rule preserves the symbolic spike-rule structure and extends its applicability condition with a local kernel response. Practically, many classifiers for signals, images, and time series rely on local filters because discriminative information is often expressed in short-range patterns. The proposed model follows this observation while placing local feature computation inside a transparent rule mechanism rather than treating it only as a hidden numerical layer. This perspective supports a formal definition of the model, a differentiable training route, and a reproducible biomedical classification protocol. The empirical context considered in this work is ECG beat classification. The MIT-BIH Arrhythmia Database and PhysioNet are widely used resources for arrhythmia analysis and reproducible physiological signal research [
19,
20]. The evaluation follows an AAMI-style three-class setting with normal beats (
), supraventricular ectopic beats (
), and ventricular ectopic beats (
), where patient-independent reporting is important because random beat-level splits may mix beats from the same patient across training and testing partitions [
21,
22,
23]. The
class is relevant because it has a smaller representation in the evaluation data and may share morphological characteristics with normal beats. For this reason, the evaluation cannot rely only on accuracy. It must also include macro-averaged and class-wise metrics. This evaluation choice is consistent with prior ECG classification work, including survey-level analyses, convolutional and transferable deep representations, ambulatory ECG classification, and time-series architectures used as comparison points [
24,
25,
26,
27,
28]. The implementation and reproducibility layer uses standard machine-learning tools and stochastic optimization procedures, including scikit-learn and gradient-based training [
29,
30].
The manuscript separates formal definitions, implementation choices, and empirical observations. Definitions are stated independently of the training procedure, algorithms are given in editable pseudocode, and empirical statements are tied to a patient-independent protocol, fixed preprocessing, declared random seeds, and class-wise metrics. Numerical results are computed under the declared full-mode experimental settings and are summarized in the corresponding tables. The complete-data experiment uses the DS1/DS2 protocol with two random seeds, while the reduced-data full-mode setting is reported separately as a complementary analysis. This structure supports a transparent distinction between the formal contribution, the implementation choices, and the reported empirical evidence.
The main contributions are as follows:
- –
Formal CK–SN P model. We define systems by adding ordered neighborhoods, finite kernels, local guards, convolutive guards, and scenario-controlled rule families to a spiking membrane-computing setting.
- –
Operational semantics. We specify rule applicability and transition behavior for delay-free and delayed variants, making explicit how local convolutive responses enter spike-rule activation.
- –
Relation to existing membrane models. We show that standard delay-free extended systems can be recovered as a special case and that finite delay-free CK–SN P systems can be represented through guards when the corresponding convolutive predicates are expressible in the guard language.
- –
Trainable realization. We provide a differentiable implementation of convolutional spike rules using surrogate activations, together with a discrete inference mode that preserves the connection with the symbolic rule interpretation.
- –
Reproducible ECG protocol. We provide a patient-independent MIT-BIH evaluation protocol with classical baselines, neural baselines, CK–SN P variants, ablation studies, class-imbalance-aware metrics, declared random seeds, full-mode settings, and implementation details summarized in the experimental tables.
The manuscript is organized to keep the formal construction, the trainable realization, and the empirical evaluation in the same reproducible account. This structure reflects the dual role of the proposed model: a rule-level formalism and a source of inspectable local descriptors for downstream classification.
The study is organized around four research questions. The first asks whether local convolutive predicates can be integrated into systems without losing a precise operational semantics. The second asks whether the resulting model can be related to systems under explicit guard-expressibility assumptions. The third asks whether the formal rule structure can be implemented as a trainable architecture while retaining a hard-rule interpretation at inference time. The fourth asks which implementation components influence minority-class detection and macro-averaged performance under a patient-independent ECG protocol. These questions delimit the scope of the paper and restrict empirical conclusions to the reported data, splits, metrics, baselines, and seeds. The contribution is not stated as a claim of increased computational power over existing spiking P-system variants. Rather, it is a structural and semantic contribution: local weighted responses are introduced as explicit, finite, inspectable predicates inside spike-rule applicability. This makes the local feature-computation mechanism part of the formal rule system instead of treating it as an external preprocessing step or as an opaque numerical layer. Under sufficiently expressive guard languages, some such predicates may be encoded indirectly in existing formalisms; the role of the CK–SN P formulation is to provide a direct operational semantics, a bounded guard structure, and a reproducible route from formal rule applicability to empirical local-feature descriptors. In summary, this study presents CK–SN P systems as a formal and trainable framework for integrating local kernel responses into spiking membrane-computing rules. The proposed model makes local feature computation explicit at the rule level while retaining a route to trainable implementation and reproducible empirical evaluation. The resulting contribution connects membrane-computing semantics, spike-based rule systems, local convolutive feature computation, and ECG classification under a reproducible full-mode experimental protocol.
The remainder of this paper is structured as follows.
Section 2 discusses related work at the intersection of membrane computing, spiking neural computation, local feature extraction, and ECG classification.
Section 3 introduces the notation, spike-rule conventions, local-kernel notation, ECG class mapping, patient-independent split, and evaluation measures used throughout the manuscript.
Section 4 defines the proposed
model, including ordered neighborhoods, kernel responses, model components, rule applicability, operational semantics, and illustrative method figures.
Section 5 presents finite-branching, determinism, boundedness, conservativity with respect to extended
systems, and behavior-preserving representation as
systems under explicit guard-expressibility assumptions.
Section 6 describes the differentiable realization, the audit map connecting formal and empirical claims, dataset preprocessing, patient-independent DS1/DS2 protocol, compared methods, ablation variants, metrics, training procedure, and table-regeneration workflow.
Section 7 reports the full-mode experimental results, the complementary reduced-data analysis, component ablation results, computational cost and reproducibility considerations, applicability and practical scope, limitations, and threats to validity.
Section 8 concludes the paper and outlines future work.
2. Related Work
This study relates to four research directions: spiking neural P systems and membrane-computing models, spiking neural computation, local kernel-based feature extraction, and reproducible biomedical signal classification. These directions are usually studied with different objectives. Membrane-computing models emphasize explicit rules and formal transition semantics. Spiking neural models emphasize event-based information processing and trainable spike dynamics. Kernel and convolutional methods emphasize local neighborhood responses. ECG beat classification provides a biomedical evaluation setting where local morphology, class imbalance, and patient-independent reporting must be handled carefully. The proposed CK–SN P model is positioned between these directions by introducing local kernel responses into the applicability predicates of spiking membrane-computing rules.
systems belong to the family of neural-like membrane systems. In these systems, identical objects called spikes are placed in neurons and evolve by means of firing and forgetting rules. A firing rule is usually written as
, where
E is a regular expression over the spike alphabet,
c spikes are consumed,
p spikes are emitted, and
d is a delay. This representation is useful because the computation is described through explicit symbolic conditions rather than only through numerical transformations. The proposed model keeps this rule-level interpretation and extends it with local predicates computed from ordered neighborhoods of spike multiplicities. This preserves the formal readability of
systems while allowing local feature tests that are common in signal and image processing. The broader literature on spiking neural networks provides an additional context for spike-based computation. Maass introduced networks of spiking neurons as a computational model in which temporal spike events play a central role in information processing [
31]. Gerstner et al. later developed a systematic account of neuronal dynamics, threshold mechanisms, synaptic interactions, and temporal coding [
32]. More recent surveys discuss spiking neural networks as a connection between biologically inspired computation, neuromorphic hardware, and machine learning [
33,
34]. These studies motivate the use of spike-based representations, but they do not formulate local feature extraction through membrane-computing rule semantics. CK–SN P systems address a different level of description: the spike mechanism remains rule-based, while local kernel responses are introduced as explicit conditions for rule applicability. Neuromorphic research also motivates the study of sparse and event-based computation. The Loihi processor illustrates how programmable spiking processors can support event-driven neural computation [
35], while mixed-signal neuromorphic circuits show that memory and information processing can be considered in hardware systems designed around spike-based principles [
36]. This paper does not propose a neuromorphic hardware implementation; its contribution is at the modeling and algorithmic level. The relevance of these works is that they show why sparse, local, and event-based computation remains an active research topic, while CK–SN P systems provide a formal-neural construction in which such local responses can be inspected through spike rules and guards.
systems provide a relevant formal comparison framework for the proposed construction. They define a flexible P-system setting based on compartments, types, guarded rules, links, and execution strategies. This connection is relevant because a local convolutive condition can be interpreted as a guard whenever the kernel response and the threshold relation are expressible in the selected guard language. For this reason, the relation between CK–SN P systems and systems is stated under explicit guard-expressibility assumptions, rather than as an unrestricted equivalence. The model can therefore be understood as a rule-based extension in which spike-rule applicability depends not only on the spike multiplicity of one neuron, but also on a local weighted response computed over an ordered neighborhood. Convolutional and local feature-processing methods have become central tools in modern signal and image analysis. Local kernels are useful because relevant structures are often expressed through short-range neighborhood patterns. The study does not aim to replace convolutional neural networks. Instead, it introduces a formal setting in which local weighted responses are attached to spike-rule applicability. The benefit is that the local activation condition remains explicit: the neighborhood, the kernel, the threshold relation, and the scenario label can be inspected as part of the rule mechanism. This differs from ordinary convolutional layers, where the numerical operation is effective but the link with a symbolic rule system is usually not part of the model definition.
In one-dimensional biomedical signals, local morphology is especially important. ECG beat classification depends on waveform structure around the QRS complex, pre-QRS information, and post-QRS behavior. For this reason, local temporal filters have been used in ECG classification. Kiranyaz et al. proposed one-dimensional convolutional neural networks for patient-specific ECG classification, showing the usefulness of temporal filters for arrhythmia recognition [
37]. Ince et al. used morphological and temporal descriptors for ECG beat classification, further supporting the role of local waveform information [
38]. Strodthoff et al. provided benchmark evidence and methodological insights for deep learning-based ECG analysis on the PTB-XL dataset [
39]. These studies motivate trainable ECG modeling, but they do not express local ECG feature extraction in terms of guarded spike rules or membrane-computing semantics.
The MIT-BIH Arrhythmia Database is a common benchmark for ECG beat classification. Patient-independent evaluation is important because random beat-level splitting may place beats from the same patient in both training and testing partitions. In the AAMI setting considered in this paper, the classes are normal beats (), supraventricular ectopic beats (), and ventricular ectopic beats (). The class requires explicit reporting because it has a smaller representation in the evaluation data and may share morphological characteristics with normal beats. For this reason, evaluation based only on accuracy is not sufficient. The experimental protocol therefore reports balanced accuracy, macro-F1, per-class F1, MCC, Cohen’s kappa, confusion-matrix summaries, and ablation results under the declared experimental settings. This reporting strategy makes the empirical behavior visible at the class level, especially for the supraventricular class.
Interpretability is also relevant for biomedical classification. Rudin argued that interpretable models should be preferred in high-stakes domains when their use is feasible [
40]. The proposed model follows this principle at the level of formal design. CK–SN P systems expose the local response, the guard condition, and the spike-rule activation mechanism instead of treating the local transformation only as a hidden numerical operation. The study is therefore positioned as an interdisciplinary contribution between membrane computing, spiking neural P systems, local kernel-based feature computation, and reproducible ECG classification. Its role is not to claim a universal replacement for existing neural architectures, but to provide a rule-level framework in which local feature computation can be defined, trained, inspected, and evaluated under an auditable experimental protocol.
3. Preliminaries and Problem Setting
This section introduces the notation used in the formal definition and in the experimental part of the paper. It separates general notation, spike-rule notation, local-kernel notation, and the ECG classification setting before the proposed
model is introduced.
Table 1 is used only as a notation guide. It does not define the CK–SN P system tuple; the formal model components are introduced later in Definition 4. This organization clarifies which elements are inherited from standard
systems and which elements are extended in
Section 4.
Let
A be a finite alphabet. The set of all finite strings over
A is denoted by
, and the empty string is denoted by
. A multiset over
A is a function
For an object , the value denotes the multiplicity of a in M. When the alphabet is unary, , the multiset containing n copies of a is denoted by . In the spiking setting considered in this paper, the object a is interpreted as a spike, and the exponent n denotes the number of spikes available in a neuron or compartment.
A regular expression E over the unary alphabet a defines a language . In a standard rule, a regular-expression condition tests whether the current number of spikes belongs to the language defined by E. A firing rule is written as , where is the number of consumed spikes, is the number of emitted spikes, and is a delay. Such a rule is applicable in a neuron containing x spikes when and . If , the rule is interpreted as a forgetting rule. In the proposed model, this standard applicability condition is preserved and extended by local and convolutive guards.
The structural support of a spike system is represented by a finite directed graph , where is the set of neurons or compartments and is the set of directed synaptic links. The symbol is used for graph edges to avoid confusion with the regular expression E in spike rules. A spike configuration is written as , where is the number of spikes in neuron i. When delays are considered, a configuration also stores the remaining closing time of each neuron, while the delay-free case is represented by the spike vector alone.
The extension studied in this paper uses ordered local neighborhoods. For a neuron , an ordered neighborhood is written as , with . The order is part of the notation because different positions may receive different weights, which is relevant for local contrast, temporal asymmetry, or oriented neighborhood tests. A finite kernel associated with is written as . Given a configuration X, the corresponding local response is denoted by and is computed as the weighted sum of the spike multiplicities in the ordered neighborhood.
A local kernel predicate is a Boolean condition built from comparisons between a local response and a threshold, for example , where and . Finite Boolean combinations of such atomic predicates can express local contrast, local dominance, burst-like activity, or neighborhood imbalance. The proposed model uses these predicates as guards for spike rules. This choice keeps the rule mechanism explicit because the neighborhood, the kernel weights, the threshold, and the affected rule are all specified as part of the model.
We also use scenario labels to separate rule families by computation stage. Let
be a finite set of labels. A scenario-control function has the form
where
denotes the set of rule families active at time
t. For example, an implementation may use labels such as
,
,
, and
to distinguish preprocessing-like spike normalization, local kernel activation, temporal aggregation, and output selection. Scenario labels are not introduced as an additional claim of computational power. They make rule families explicit and support ablation studies in which one stage can be removed or modified. For instance, a finite execution schedule may activate different rule families at different time steps:
Under this schedule, only rules carrying the active scenario labels are considered at each step. The same spike configuration and the same local guards may therefore lead to different enabled rule sets when the scenario-control function changes. In the empirical implementation, this mechanism is used as an explicit organizational device for rule families rather than as a separate source of experimental claims.
The experimental problem considered in this paper is patient-independent ECG beat classification on the MIT-BIH Arrhythmia Database. Each beat is represented by a one-dimensional window around an annotated R peak. The class set is
where
denotes normal and bundle branch block beats,
denotes supraventricular ectopic beats, and
denotes ventricular ectopic beats. The AAMI-style mapping used in the experiments is
Fusion beats and unknown or unclassifiable beats are excluded from training, validation, testing, confusion matrices, and metric computation. This restriction is made explicit so that all compared models use the same label space.
The evaluation setting is patient-independent. Let
denote the set of beats extracted from the training records and
the set of beats extracted from the held-out test records. The training and validation partitions are derived only from
, while
is used only for final testing:
This split reduces patient leakage, since beats from the same patient should not appear simultaneously in training and testing partitions. The full-mode evaluation reported in
Section 7 uses this same DS1/DS2 protocol, with DS1 used for training and validation and DS2 used only for final testing.
Class imbalance is part of the problem setting. The class
is usually less frequent and may be morphologically close to
. Therefore, the main empirical analysis cannot rely only on accuracy. For a confusion matrix
, with true class
i and predicted class
j, the class-wise quantities are
The corresponding sensitivity, precision, specificity, and F1-score are
The macro-F1 score and balanced accuracy used throughout the experimental section are
Additional agreement-oriented metrics, such as Matthews correlation coefficient and Cohen’s kappa, are reported in the experimental section when generated by the evaluation script. The problem addressed by the paper can now be stated as follows. Given a spike configuration derived from a local signal window, an ordered neighborhood system, a finite family of kernels, and a set of guarded spike rules, the goal is to define and evaluate a model whose rule applicability can depend both on standard spike conditions and on local kernel responses. Formally, the next section defines this model as a
system. Empirically,
Section 6 defines the trainable realization and the patient-independent ECG protocol, while
Section 7 reports the full-mode results, the complementary reduced-data analysis, ablation results, computational considerations, and validity limitations.
4. Convolutive Kernel-Guarded Spiking Neural P Systems
This section defines the proposed
model. The construction extends the rule applicability mechanism of
systems by adding ordered neighborhoods, finite kernels, local guards, convolutive guards, and scenario labels. This design keeps the spike-rule semantics explicit while allowing local kernel responses to influence rule firing. The definitions below are stated at the formal level; the differentiable implementation used in the ECG experiments is described later in
Section 6.
4.1. Ordered Spike Neighborhoods and Convolutive Kernel Responses
Let
be a finite directed graph, where
is the set of neurons or compartments and
is the set of directed synaptic links. A spike configuration is a vector
where
denotes the number of spikes in neuron
i. The proposed model associates selected neurons with ordered neighborhoods. The order is part of the model because the same multiset of neighbors may produce different responses when kernel weights are assigned to different positions.
Definition 1 (Ordered neighborhood)
. For each neuron , an ordered neighborhood is a tupleThe length may depend on i. Neighbors may represent spatial positions, temporal positions, graph-adjacent neurons, or implementation-specific local contexts.
Definition 2 (Convolutive kernel)
. A convolutive kernel associated with neuron i is a vectorGiven a configuration , the local kernel response is Since the ordered neighborhood is finite, the computation of one local response requires arithmetic operations for a fixed kernel representation. This cost is local to the rule-applicability test and does not change the finite-rule structure of the transition system. If several kernels are attached to neuron i, their set is denoted by The response in Equation (
14) is a local weighted sum over spike multiplicities. It can encode contrast, local dominance, burst-like activity, temporal asymmetry, or neighborhood imbalance, depending on the selected neighborhood and kernel. The response is not itself a firing rule. It becomes operational only when it is used inside a guard.
Definition 3 (Convolutive predicate)
. A convolutive predicate in neuron i is a finite Boolean formula built from atomic comparisons of the formThe set of convolutive predicates available in neuron i is denoted by .
This definition is deliberately finite and inspectable. The neighborhood, the kernel weights, the threshold relation, and the rule affected by the predicate are explicit components of the model. This is the main distinction between a CK–SN P guard and an ordinary hidden convolutional activation. The expressivity of a convolutive predicate is bounded by the selected neighborhoods, the finite kernel bank, the rational weights, the threshold relations, and the Boolean combinations allowed in the guard language. Such predicates can express finite local tests such as weighted dominance, local contrast, thresholded neighborhood activity, and combinations of these tests. They do not, by themselves, define arbitrary global properties of a configuration unless those properties are encoded through additional rule layers, additional neighborhoods, or scenario-controlled rule families. This bounded expressivity keeps local feature computation explicit and inspectable inside spike-rule applicability, rather than replacing the rule system with an unrestricted numerical layer.
Proposition 1 (Local dependence of finite convolutive guards). Let be a Boolean combination of atomic predicates of the form where each kernel K is defined on a finite ordered neighborhood, , and . Then there exists a finite set of neuron indices such that, for any two configurations X and Y, if for all , then .
Proof. Each atomic predicate depends only on the spike counts appearing in the finite ordered neighborhood on which K is defined. Let be the union of all neighborhood positions over all atomic predicates occurring in . This union is finite because the guard contains finitely many atomic predicates and each neighborhood is finite.
If two configurations X and Y agree on all indices in , then every kernel response appearing in the guard has the same value in both configurations. Hence every atomic predicate has the same truth value in X and Y, and the Boolean combination also has the same truth value. Therefore, . □
The boundedness and finiteness assumptions apply at the level of the CK–SN P guard language. A convolutive guard is finite because it is built from finitely many atomic comparisons, each atomic comparison uses a finite ordered neighborhood, and each kernel has finitely many rational coefficients. This gives an explicit and inspectable local predicate. It does not imply that the same predicate is automatically representable as a single ordinary SN P regular-expression condition, because ordinary spike-rule applicability is local to the spike multiplicity of the neuron applying the rule. Any indirect encoding in a different formalism must specify how neighborhood information is communicated or represented.
4.2. Formal Definition of the CK–SN P Model
A system combines the spike alphabet, the membrane or synaptic graph, the neuron rule sets, the ordered neighborhoods, the kernels, the scenario-control function, and the output neuron.
Definition 4 (Convolutive Kernel-Guarded Spiking Neural P system)
. A system of degree m is a tuplewhere:- (a)
is the spike alphabet;
- (b)
Σ is a finite set of scenario labels;
- (c)
is a finite directed graph with ;
- (d)
is neuron i, where is the initial spike count and is a finite rule set;
- (e)
is the operational synapse relation used for spike transmission; when no distinction is needed, ;
- (f)
is the family of ordered neighborhoods;
- (g)
is the family of kernel sets, where every has length and is evaluated on ;
- (h)
is the scenario-control function, assigning to each time the set of scenario labels active at that time;
- (i)
is the output neuron.
The scenario-control function indicates which rule families are active at a given computation time. For example, an ECG-oriented implementation may use
where
denotes preprocessing-like spike normalization,
denotes local kernel activation,
denotes short-range temporal aggregation, and
denotes class-output rules. These labels are not required for every application. They are included to make rule families explicit and to support ablation studies. If scenario control is not used, one may take a single default label
and set
for all
. Thus, the scenario mechanism is optional in the sense that it can be made trivial without changing the standard rule-applicability behavior. Since
, the active scenario set may also be empty; in that case, no rule whose only scenario label is inactive can be selected at that time.
Definition 5 (
rule)
. A rule in neuron i has the formwhere E is a regular expression over , is the number of consumed spikes, is the number of emitted spikes, is the delay, is a local guard over the spike count of neuron i, is a convolutive predicate, and is a scenario label. If , the rule is interpreted as a forgetting rule. The rule in Equation (
19) extends the standard
rule by adding two explicit applicability components: a local guard and a convolutive guard. The local guard can express conditions such as
, while the convolutive guard can express a local response condition such as
.
4.3. Rule Applicability and Transition Semantics
A configuration must store both spike counts and, when delays are used, the remaining closing time of each neuron.
Definition 6 (Configuration)
. A configuration of at time t iswhere is the number of spikes in neuron i, is its remaining closing time, and is the number of spikes scheduled to be emitted by neuron i when the current closing interval expires. If no delayed rule is pending in neuron i, then and . In delay-free systems, for all i, and the configuration is identified with Definition 7 (Rule applicability)
. Let be a CK–SN P rule written according to the CK–SN P rule form (19). The rule r is applicable in neuron i at time t, denoted by , if and only if Equation (
22) is the central operational condition of the model. It shows where the proposed extension enters the standard spike-rule mechanism: the regular-expression test and spike consumption requirement are preserved, while the local and convolutive guards add explicit tests over the current configuration. At each global step, every open neuron forms its set of applicable rules and then applies the local execution strategy. In deterministic settings, this strategy selects the unique applicable rule whenever such a rule exists; otherwise, the neuron remains idle. In the general case, if several rules are applicable in the same neuron, the local execution strategy resolves the local choice by selecting zero or one of them. This convention gives a slightly more general local-selection interface than the standard SN P convention, in which an enabled neuron typically applies one rule. When CK–SN P systems are compared with standard or extended SN P systems, the same local rule-selection policy is used on both sides, so that the comparison is made between matched transition systems. The strategy may be nondeterministic, priority-based, or fixed by an implementation policy. The transition relation of the formal model therefore contains all successor configurations induced by the allowed local selections. The deterministic case used in the decidability statement is the restricted case in which each reachable neuron-time pair has at most one applicable rule and the execution strategy selects it whenever it exists.
Table 2 summarizes the expository evaluation order used to describe one delay-free global CK–SN P step.
This order is expository. Rule applicability is defined by the conjunction of the regular-expression test, the consumption condition, the local guard, the convolutive guard, and the active scenario condition. Therefore, changing the order in which these Boolean tests are checked does not change the set of applicable rules. In the delay-free case, if the selected rule in neuron
i consumes
spikes and emits
spikes, the next spike count of neuron
j is
where
and
if no rule is selected in neuron
j. Algorithm 1 gives the corresponding global-transition procedure. The algorithm is included as editable text so that the formal transition can be inspected and reproduced.
The delayed case follows the usual interpretation of closing times. If a rule with delay
is selected in neuron
i, then the neuron consumes the required spikes at the selection time, sets
to the closing interval, and stores the pending emission amount in
. While
, the neuron is closed and cannot select a new rule. When the closing interval expires,
spikes are transmitted to the synaptic targets and the pending amount is reset to zero. The main formal comparisons and the trainable ECG implementation use the delay-free case, while the general definition records how delayed variants can be represented.
| Algorithm 1 One global transition of a delay-free system |
- Require:
Configuration , rule sets , synapses syn, active scenarios - Ensure:
Next configuration - 1:
for to m do - 2:
Compute all responses for - 3:
- 4:
Select zero or one rule according to the local execution strategy - 5:
end for - 6:
for to m do - 7:
- 8:
end for - 9:
for each selected delay-free rule in neuron i do - 10:
- 11:
for each j such that do - 12:
- 13:
end for - 14:
end for - 15:
return
|
4.4. Illustrative Example and Conceptual Overview
The following example illustrates how a local kernel can act as an explicit contrast test inside a spike rule.
Example 1 (Local contrast rule).
Consider three neurons arranged linearly and letFor a configuration , the local response is The rulefires only when the central neuron has a sufficiently larger spike count than its two neighbors. The rule can therefore be read as a discrete local contrast detector expressed in spike-rule form. Figure 1 summarizes the proposed processing flow. The input window is encoded as spike multiplicities, ordered neighborhoods define local contexts, kernels compute local responses, and guarded spike rules use these responses under scenario control.
Figure 2 details the local-kernel interface between neighborhood spike counts and rule applicability. It shows how contrast and context triplets can be transformed into a response used by local and convolutive guards.
5. Formal Properties and Connections with P-System Models
This section establishes basic formal properties of systems and clarifies their relation to two established membrane-computing models: extended systems and kernel P systems. Rather than giving an exhaustive complexity analysis, it states the minimal properties needed to delimit the proposed model. The results below record that the introduction of ordered neighborhoods, kernels, guards, and scenario labels preserves the finite-step operational character of the system. They also establish that the proposed construction extends standard delay-free systems and can be represented in a framework when the required guards are expressible. Unless stated otherwise, the formal results in this section are formulated for the delay-free fragment of the model. The general configuration definition records how delayed rules can be represented through closing times and pending emissions, but the conservativity result, the bounded-reachability statement, and the kernel-P representation are stated for delay-free systems. This convention matches the trainable realization and the ECG experiments reported later in the paper. Throughout this section, each formal statement is read under the hypotheses explicitly stated in its formulation. In particular, the conservativity result concerns finite delay-free systems and matching local rule-selection policies; the bounded-reachability statement assumes bounded spike counts and finite-state scenario control; and the representation result is conditional on the expressibility of the required regular-expression, local, scenario, and convolutive guards in the selected formalism. These assumptions are part of the formal scope of the results and delimit the transition behavior that is compared or represented.
5.1. Finite Branching, Determinism, and Boundedness
The first property concerns finite branching. Since each neuron has a finite rule set and each global transition is obtained by selecting at most one applicable rule per neuron, the set of possible successors of a configuration is finite. Scenario labels do not add new choices; they only restrict the set of rules that can be selected at a given time.
Proposition 2 (Scenario restriction preserves finite branching). Let be a system with finitely many neurons and finite rule sets. For every configuration , the set of successor configurations reachable from in one global step is finite.
Proof. For each neuron i, the rule set is finite. At time t, the set of applicable rules is Since , the set is finite. Scenario control can only remove rules whose labels are not active in ; it does not create additional rules. Hence the set of local choices for neuron i is finite. If no rule is selected in neuron i, this can be represented by an additional null choice ⊥, so the local choice set is . Because the number of neurons is finite, the set of global selections is contained in the finite product For a fixed global selection, the spike consumption and spike transmission effects are determined by the transition semantics. Therefore, each global selection determines at most one successor configuration. A finite set of global selections can generate only finitely many successor configurations. Hence the one-step successor set of is finite. □
Determinism can be obtained by imposing mutual exclusiveness of rule-applicability predicates inside each neuron. This is a sufficient condition, not a necessary one. This condition is useful because it can be checked at the level of rule guards, regular-expression tests, local spike conditions, scenario labels, and convolutive predicates.
Definition 8 (Determinism). A system is deterministic if, for every neuron i, every time t, and every reachable configuration , at most one rule in is applicable, and the local execution strategy is fixed so that the unique applicable rule is selected whenever it exists. If no rule is applicable, the neuron remains idle.
Proposition 3 (Sufficient condition for determinism). Assume that the local execution strategy selects the unique applicable rule whenever it exists. If, for every neuron i and every pair of distinct rules , the predicates and are mutually exclusive for all configurations and times, then the system is deterministic.
Proof. By Equation (
22), a rule can be selected only when its applicability predicate is true. If no two distinct rules in the same neuron can be applicable in the same configuration at the same time, then each neuron has at most one applicable rule. Together with the assumed local execution strategy, the unique applicable rule is selected whenever it exists, and the neuron remains idle otherwise. This is exactly the stated notion of determinism. □
Boundedness is useful when reachability or exhaustive state-space exploration is considered. The next statements are standard finite-state arguments, but they are included to clarify the role of kernel guards. Convolutive predicates restrict applicability; they do not by themselves create infinitely many spike counts in one transition. If the reachable spike counts are bounded, the reachable state space is finite.
Definition 9 (Bounded system)
. A system is B-bounded if there exists such that, for every reachable configuration and every neuron i, the spike count satisfies Proposition 4 (Finite state space under boundedness). If a delay-free system with m neurons is B-bounded, then it has at most spike configurations.
Proof. In a B-bounded system, each spike count can take only values in the finite set . Since there are m neurons, the set of possible delay-free spike configurations satisfies Thus, the reachable delay-free state space is a subset of a finite set. □
For reachability questions, the scenario-control mechanism is assumed to be finite-state. That is, there exists a finite set of control states , an initial control state , and a transition function on control states such that the active scenario set is determined by the current control state. Constant and periodic scenario schedules are special cases of this assumption. Under this convention, the explored state contains both the spike vector and the finite scenario-control state.
Corollary 1 (Bounded reachability). Reachability is decidable for bounded deterministic delay-free systems with finite-state scenario control.
Proof. By Proposition 4, the number of possible spike configurations is finite and bounded by . Since the scenario-control mechanism is finite-state, there is also a finite set of scenario-control states. The combined state space is therefore bounded by Starting from the initial combined state, one can iteratively compute the unique successor, when it exists, and store every visited combined state. If the target spike configuration is reached, the procedure returns a positive answer. If a combined state with no successor is reached, or if a previously visited combined state is encountered again, then no new combined states can be generated beyond those already examined. Since the combined state space is finite, this procedure terminates. Therefore, reachability is decidable. □
5.2. Extended SN P Systems as a Special Case
The next result records that the proposed model is conservative with respect to delay-free extended systems. In other words, adding ordered neighborhoods, kernels, convolutive guards, and scenario labels does not prevent the model from reproducing ordinary delay-free spike-rule computations when these additional components are chosen trivially. The construction uses a trivial neighborhood, a trivial kernel predicate, and a single scenario label that is always active. The comparison is made under the same local rule-selection policy in both systems. Thus, if the source system uses nondeterministic selection with at most one applicable rule per neuron, the constructed system uses the corresponding nondeterministic selection. If a fixed priority or deterministic policy is used, the same policy is transferred to the corresponding CK–SN P rules. This convention ensures that the comparison is between transition systems with matched local choices.
Theorem 1 (Delay-free extended systems are a special case). For every finite delay-free extended system Π and for every fixed local rule-selection policy, there exists a finite system such that the computations of Π and are in one-to-one correspondence under the corresponding local rule-selection choices, and the output behavior is preserved.
Proof. Let be a delay-free extended system with neuron set , synapse relation , initial spike vector , output neuron , and finite rule sets . Each rule in has either the firing form where E is a regular expression over , is the number of consumed spikes, and is the number of emitted spikes, or the forgetting form where . In the latter case, the forgetting rule is represented in the unified notation as a rule with and with the corresponding exact spike-count condition encoded in the regular-expression component, for instance by using and .
We construct a system with the same neuron set, the same synapse relation, the same initial spike vector, and the same output neuron. Let the scenario set be and define for every . For each neuron i, choose the ordered neighborhood and a trivial kernel . The corresponding local response is , but this response is not used to restrict rule applicability in the construction.
For every firing rule in , introduce in the CK–SN P rule set the rule For every forgetting rule in , introduce in the rule Thus, classical forgetting rules are represented as the case , with the exact spike-count condition encoded by the regular-expression component. Equivalently, each translated rule has the CK–SN P components , , , and scenario label , with for every . The local guard ⊤ and the convolutive guard ⊤ are true for every configuration, and the scenario label is active at every time step.
We next compare rule applicability. In the delay-free extended system, a firing rule is applicable in neuron i at configuration if and only if In the constructed system, the translated rule is applicable if and only if the same consumption and regular-expression conditions hold, and the two guards and the scenario condition are satisfied. By construction, the guards are always true and for all t. Therefore, every firing rule is applicable in if and only if its translated CK–SN P rule is applicable in .
For a forgetting rule , the rule is applicable in the source system exactly when the neuron contains s spikes. In the translated CK–SN P rule applicability requires and , which is equivalent to . Hence, the translated forgetting rule is applicable exactly in the same configurations as the original forgetting rule. Since , no spikes are emitted, and the consumption of s spikes has the same effect as the forgetting rule . Consequently, for every neuron, every time step, and every configuration, each rule in is applicable if and only if its translated rule is applicable in . Consider now any global rule selection in , containing at most one selected applicable rule per neuron according to the fixed local rule-selection policy. By the applicability equivalence above, the corresponding set of translated rules is a valid global selection in . Conversely, every global selection in corresponds to a global selection in . The two systems use the same local rule-selection policy, so the correspondence is between matched local choices.
For corresponding selections, the consumed spike numbers, emitted spike numbers, and synaptic targets are identical. Hence, for each neuron
j, the next spike count is computed in both systems by the delay-free transition update (
23), with
and
when no rule is selected in neuron
j, and with
for translated forgetting rules. By induction on
t, the two systems generate the same spike configuration after every finite number of steps under corresponding local selections. The base case holds because both systems have the same initial vector
. The induction step follows from the equality of applicable rule sets and from the shared delay-free transition update (
23). Since the output neuron is also the same, the output behavior is preserved. □
Remark 1 (Direction of the conservativity statement). The previous theorem is a one-directional embedding result: every delay-free extended system can be represented as a CK–SN P system by choosing trivial local guards, trivial convolutive guards, and a scenario label that is always active. The theorem does not assert that every CK–SN P system can be simulated step-by-step by a standard extended system without additional assumptions. Non-trivial CK–SN P guards may depend on ordered neighborhoods and finite kernel responses involving several neurons. Encoding such guards inside a standard extended formalism may require bounded-state assumptions, auxiliary control components, or an extended guard language. This distinction aligns with the role of CK–SN P systems as an explicit formalization of local guarded feature computation.
Remark 2 (Scope of the extension). The conservativity result shows that delay-free extended systems are contained in the CK–SN P framework when the local and convolutive guards are trivial. Conversely, finite local tests induced by CK–SN P kernels may be encoded indirectly in sufficiently expressive guarded variants of P systems, provided that the corresponding threshold and neighborhood conditions are available in the guard language or are represented by auxiliary objects and rules. The distinction is therefore not stated as an unconditional increase in computational power. Rather, the distinction lies in the modeling level: CK–SN P systems make the local weighted response an explicit component of rule applicability, whereas an indirect simulation may distribute the same condition across auxiliary encodings. This distinction is relevant for inspection, descriptional size, and reproducible feature extraction.
This result identifies the proposed construction as an extension rather than a replacement of the classical delay-free rule mechanism. The additional components become active only when non-trivial neighborhoods, kernels, guards, or scenarios are selected. Consequently, formal properties that depend only on the embedded delay-free transition structure are inherited by the trivial-guard subclass of CK–SN P systems.
5.3. Representation Within Kernel P Systems
The relation with kernel P systems is stated under explicit guard-expressibility assumptions. The representation result below is conditional on the ability of the selected formalism to express the required regular-expression, local, scenario, and convolutive guards. The statement does not claim that every possible numerical guard can be represented in every variant. When scenario labels vary with time, the active scenario set is treated as part of the encoded control state or is generated by a finite scenario-control mechanism. The term behavior-preserving is used in an operational sense: the translated system preserves the encoded spike configurations and the output behavior of the original delay-free CK–SN P system under the same initial configuration and corresponding rule-selection choices.
Definition 10 (
-guard-expressible predicate)
. A predicate g over encoded spike configurations is -guard-expressible if there exists a guard such that, for every encoded configuration C, Finite Boolean combinations of inequalities over spike multiplicities and finite weighted sums are directly expressible when arithmetic guards are available. If the target variant allows only simpler guards, auxiliary objects and compartments may be used to represent intermediate weighted sums. Predicates involving non-linear real-valued transformations, externally learned functions, or numerical procedures not encoded by finite guards are outside the direct -guard-expressible fragment unless an explicit discretization or auxiliary encoding is provided.
Theorem 2 (Behavior-preserving representation). Let be a finite delay-free system such that every regular-expression condition, local guard, scenario guard, and convolutive predicate used in is -guard-expressible. Then there exists a kernel P system that preserves the encoded spike configurations and the output behavior of under corresponding rule-selection choices.
Proof. For each neuron
of
, create a
compartment
whose initial multiset is
. The spike count of neuron
i is therefore represented by the multiplicity of
a in compartment
. For each delay-free
rule
create a corresponding
rule in compartment
with guard
Here, encodes the regular-expression condition , encodes the consumption condition , and encodes the scenario condition using the encoded scenario-control state. By assumption, the regular-expression condition, the local guard, the scenario guard, and the convolutive predicate are -guard-expressible; the finite consumption condition is also expressible as a multiplicity guard. The translated rule consumes from . For each synaptic target j such that , the rule produces in the compartment , using the communication mechanism of the selected formalism. If the formalism represents target-specific outputs by auxiliary rules or objects, these are introduced as part of the same finite rule-level encoding. For any configuration of , encode the spike vector as the corresponding multiset configuration of the system. A rule is applicable exactly when the corresponding guard is satisfied. Hence every global delay-free step of has a matching step with the same consumption and transmission effects. Conversely, every enabled translated rule satisfies the same regular-expression, consumption, local, convolutive, and scenario conditions, and therefore corresponds to an applicable rule. Thus, corresponding rule selections generate corresponding successor configurations. By induction over computation length, the translated system preserves the sequence of encoded spike configurations and the output behavior of . □
Example 2 (Three-neuron translation into a guarded rule). Consider a delay-free system with three neurons and one synapse . Let the spike configuration be For neuron 1, consider the ordered neighborhood and the finite kernel The associated local response is Thus, the convolutive predicate is equivalent to the finite local comparison .
Assume that neuron 1 contains the delay-free rule where E is a regular expression over . This rule is applicable at time t when
We now construct the corresponding guarded representation under the assumption that the selected variant can compare finite linear expressions over object multiplicities. Let be the compartments corresponding to neurons , and let denote the number of objects a in compartment . The encoded configuration satisfies The translated rule is placed in compartment . It consumes two copies of a from and sends one copy of a to , with guard Here, encodes the regular-expression condition , the second conjunct encodes the consumption condition, the third conjunct encodes the convolutive predicate , and the last conjunct encodes the active scenario label. For any encoded configuration, the CK–SN P rule r is applicable if and only if the guard is true. When the rule is applied, both systems perform the same local update: For example, if , , and , then so the CK–SN P rule is applicable. In the representation, the same local condition is captured by Thus, in this example, the finite convolutive predicate is represented as an explicit conjunct of the guard, while the spike consumption and synaptic transmission are represented by the corresponding rule action.
The example illustrates the rule-level mechanism of the translation. The general statement remains conditional on the guard-expressibility assumption: a CK–SN P convolutive predicate can be represented in the selected formalism only when the corresponding finite Boolean combination of linear multiplicity tests is available in, or encoded by, the target guard language. Thus, the theorem is a conditional representation result. When the guard language is sufficiently expressive, the CK–SN P transition can be mirrored at the rule level. When the guard language is not sufficiently expressive, an auxiliary encoding or a restricted predicate fragment must be specified before the representation can be applied.
Proposition 5 (Descriptional size of the direct representation)
. LetHere, denotes the set of atomic convolutive comparisons occurring in the guard of rule r. If convolutive predicates are encoded directly as guards, the representation introduces one rule for each rule, together with target information for the outgoing spike transmissions. If auxiliary objects or compartments are required to represent weighted sums, a direct non-optimized expansion of all atomic kernel terms and outgoing transmissions has size .
Proof. The rule-level translation maps each rule to one guarded rule, so the number of primary translated rules is R. For a rule r, the convolutive guard contains at most ℓ atomic comparisons. Each atomic comparison refers to a finite kernel response over at most q ordered neighborhood positions. A direct explicit representation of all atomic kernel terms therefore requires at most a constant number of auxiliary elements per kernel position and per atomic comparison. This gives a contribution of order . This bound refers to the direct non-optimized encoding in which each atomic comparison is expanded independently. In addition, the translated rule must represent the outgoing spike transmissions to the synaptic targets of the source neuron. The number of such targets is at most for each rule, giving an additional contribution of order when target-specific outputs are counted explicitly. Combining the two contributions gives . □
The formal results in this section clarify the scope of the model. Finite branching follows from finite rule sets and finite scenario-controlled selection. Determinism can be obtained by mutually exclusive applicability predicates. Bounded systems have finite reachable state spaces. Delay-free extended systems are recovered as a special case. Finally, finite delay-free systems can be represented through guards when the required predicates are expressible. These statements provide a formal basis for the differentiable realization and the experimental protocol introduced in the next section.
6. Materials and Methods: Trainable Realization and Reproducible Experimental Protocol
This section describes the trainable realization of the proposed
model and the experimental protocol used for ECG beat classification. The implementation remains close to the formal model while supporting a reproducible empirical comparison. The formal system is discrete, whereas supervised learning requires differentiable operations during optimization. For this reason, the implementation uses soft surrogate predicates during training and hard predicates during inference or ablation. The protocol records the dataset split, preprocessing, compared methods, ablation variants, metrics, checkpoint selection, and table-regeneration procedure.
Figure 3 summarizes how the formal and empirical parts of the paper are connected. The diagram separates the support for formal claims from the support for empirical claims: formal claims are based on definitions and representation results, whereas empirical claims are tied to fixed splits, declared metrics, and documented experimental settings.
6.1. Differentiable Realization of CK–SN P Rules
Let
X denote the spike-like representation of an input window. For a kernel
K and threshold
, the margin of a local convolutive predicate is written as
During training, the hard predicate
is replaced by a differentiable surrogate spike
where
controls the slope. A smaller value of
gives a smoother predicate and may support optimization, while a larger value approaches a crisp threshold. During hard-rule inference, the surrogate is replaced by
The surrogate form is used only during optimization, where a differentiable approximation is needed for gradient-based training. During validation and final testing, the saved model is evaluated through the declared inference mode. In hard-rule mode, the guard output is binarized and the rule applicability condition is evaluated as a Boolean predicate, matching the formal interpretation of guarded spike-rule activation. The surrogate slope and threshold parameters therefore affect the optimization trajectory, but the reported hard-rule predictions are generated from the corresponding discrete decision rule. Thus, the soft-to-hard transition is treated as a change in evaluation mode rather than as a change in the formal rule.
In this implementation, the trainable layer is a parameterized realization of the CK–SN P rule family. During optimization, surrogate gates provide differentiable approximations of the local and convolutive predicates. During hard-rule inference, the learned or selected local responses are evaluated through the declared threshold relations, and the resulting Boolean conditions determine rule activation in the sense of the formal CK–SN P applicability definition. The empirical architecture therefore instantiates the finite guarded-rule mechanism described in the formal model, while the downstream classifier operates on the descriptors generated by this mechanism. The differentiable realization also makes the sensitivity of kernel-based guards explicit.
A small perturbation of a kernel weight may change the value of the local kernel response (
14), and may therefore change the truth value of a threshold predicate when the response is close to its threshold. In the surrogate training phase, this effect is smoothed by the differentiable approximation of the guard. In the hard-rule inference mode, the same effect becomes discrete because the predicate is evaluated as a Boolean condition. For this reason, validation-based checkpoint selection and fixed saved predictions are used in the empirical reporting. A dedicated perturbation analysis of learned or selected kernels is left as a separate robustness study. In the ECG implementation, each beat is represented as a one-dimensional signal window. The trainable CK–SN P realization uses four stages. First, the beat is normalized and encoded into spike-like local features. Second, multi-scale one-dimensional kernels compute local responses over short temporal neighborhoods. Third, soft local predicates activate rule-like features under scenario control. Fourth, a compact classifier head maps the resulting representation to the three AAMI classes
,
, and
. The trainable realization is intentionally compact so that the effect of local kernels, guards, scenario control, and hard inference can be examined through ablations.
Figure 4 summarizes the empirical CK–SN P ECG classification architecture, showing how local descriptors, kernel responses, guard evaluation, and downstream classification are combined in the implemented pipeline.
The main neural CK–SN P variants used in the current implementation are defined by the following design dimensions:
The kernel type may be fixed, contrast-initialized, or learned. The guard type may be soft, hard, or removed. Scenario control may be active or ablated. The auxiliary
head is used only during training to support minority-class recognition. The inference mode can use soft surrogate outputs or crisp predicates. These dimensions define the ablation variants reported in
Section 7.
The training objective combines a class-imbalance-aware classification loss with regularization terms that discourage degenerate predictions. Let
be the logits produced for beat
and let
be the class label. The balanced empirical loss used during training has the form
where
B is the mini-batch size,
is the class weight,
ℓ is the classification loss,
is an auxiliary loss for
versus non-
detection when enabled, and
is a spike or activation regularization term. The coefficients
and
are stored in the configuration files. The auxiliary term is not used as a separate test-time classifier unless explicitly stated; its role is to guide representation learning during training. Algorithm 2 gives the training and evaluation sequence. The same procedure is used for the proposed models and for their ablation variants, with the appropriate configuration fields changed. The selected checkpoint is evaluated once on the held-out test partition.
Training stability is assessed through the validation-based checkpointing procedure rather than through a formal convergence guarantee. During training, each epoch updates the surrogate-guard realization on
and evaluates the current checkpoint on
. The stored checkpoint is the one selected by validation macro-F1, balanced accuracy, and class-wise stability criteria. This procedure is used to reduce the influence of transient optimization states on the final DS2 report. Since the model combines surrogate guards, class-imbalance-aware loss terms, and downstream classifier components, the reported experiment documents empirical training stability under the declared seeds and settings, but does not claim theoretical convergence of the non-convex training objective.
| Algorithm 2 Training and hard-rule evaluation of a differentiable classifier |
- Require:
Training set , validation set , test set , kernels K, thresholds , slope , model configuration - Ensure:
Test-set outputs, metrics, confusion-matrix summary, and run metadata - 1:
Initialize kernels, thresholds, classifier weights, scenario parameters, and regularization coefficients from - 2:
for epoch to E do - 3:
for mini-batch do - 4:
Encode each beat as spike-like local features - 5:
Compute local responses for all active kernels - 6:
Compute soft predicates using Equation ( 33) - 7:
Propagate through scenario-controlled rule layers - 8:
Compute the training loss in Equation ( 36) - 9:
Update trainable parameters by backpropagation - 10:
end for - 11:
Evaluate the checkpoint on - 12:
Store the checkpoint selected by validation macro-F1, balanced accuracy, and class-wise stability criteria - 13:
end for - 14:
Evaluate the selected checkpoint on - 15:
If hard inference is enabled, replace soft predicates by Equation ( 34) - 16:
Compute test-set outputs, confusion-matrix summary, class-wise metrics, runtime information, and configuration metadata - 17:
return Reported metrics and run metadata for tabular summary
|
6.2. Dataset, Preprocessing, and Patient-Independent Evaluation Setting
The empirical component uses the MIT-BIH Arrhythmia Database under a patient-independent DS1/DS2 protocol. The classification problem follows the three-class AAMI setting introduced in
Section 3. The ECG class set is defined by the ECG class set (
4), and the beat-symbol grouping is defined by the AAMI-style beat-symbol mapping (
5). This grouping follows the common AAMI-oriented evaluation practice in arrhythmia beat classification, where beat annotations are consolidated into clinically meaningful groups to reduce annotation granularity and to support patient-independent comparison. The mapping is used only for evaluation consistency and does not imply that all subclasses inside a group have identical morphology. Fusion beats and unknown or unclassifiable beats are excluded from training, validation, testing, confusion matrices, and metric computation. The dataset partition follows the patient-independent DS1/DS2 split (
6). DS1 is used for training and validation, while DS2 is reserved for testing. The record lists are
The final reported setting is the full-mode experiment. In this configuration, the training and validation subsets are derived from DS1, and the complete DS2 subset is used for patient-independent testing.
Table 3 reports the corresponding class distribution.
The DS1/DS2 split is record-based and patient-independent, not a random proportional beat-level split. Consequently, the number of beats in the held-out DS2 partition can be larger than the number of beats used for training. This distribution is kept intentionally because the evaluation prioritizes separation between training and test records over equal split sizes, thereby reducing patient leakage.
Each beat is represented by a fixed-length local waveform window together with RR-derived information. The CK–SN P representation used in the full-mode run contains 409 features after combining kernel-response descriptors with RR, Gaussian, and Fourier components. This configuration is used for the main experimental reporting.
A second full-mode configuration is included as a complementary reduced-data analysis. It uses
sampling for the majority-class components while preserving the supraventricular class through stratified S-safe sampling. The resulting reduced-data distribution is reported in
Table 4. This setting is not used as a replacement for the complete-data experiment or as a substitute for cross-validation. It is reported to describe the behavior of the same modeling pipeline under a controlled change in the class distribution. A standard beat-level 5-fold split is not used as the main protocol because such a split could weaken the patient-independent DS1/DS2 separation if beats from the same records were distributed across folds.
The distinction between the complete-data experiment and the reduced-data analysis is maintained throughout the reporting. The complete DS1/DS2 run is the main evaluation setting, while the 50% setting serves only as an additional view of the representation under a controlled change in the class distribution.
6.3. Compared Baselines and Ablation Variants
The comparison is organized into three groups. The first group contains raw RR baselines. These methods operate on the beat and RR representation without the proposed CK–SN P kernel-response descriptors. They include Logistic Regression, calibrated Linear SVM, k-Nearest Neighbors, Random Forest, and Extra Trees. The second group contains CK–SN P feature pipelines combined with classical classifiers. These models use the proposed local kernel-bank representation together with RR, Gaussian, and Fourier descriptors. The resulting features are evaluated with Logistic Regression, Random Forest, Extra Trees, and Histogram-based Gradient Boosting. These rows are denoted by CKSNP_RR_GaussFourier_*. The third group contains neural and S-aware CK–SN P variants. This group also includes a lightweight one-dimensional convolutional baseline, reported as Light_1D_CNN_RR_SAwareLoss. This model is evaluated under the same patient-independent DS1/DS2 protocol and the same two-seed reporting scheme as the other full-mode methods. Its role is to provide a direct lightweight 1D-CNN comparison within the declared experimental protocol, while broader comparisons with recent deep sequence architectures are left for future work. The remaining S-aware rows are retained for component analysis. They examine the contribution of RR information, Gaussian/Fourier descriptors, hard-slope variants, and S-aware loss shaping within the proposed representation. These rows are interpreted as component-level analyses of the implemented feature pipeline and classifier interaction, not as isolated causal estimates of each formal component. This organization separates the formal contribution from the downstream classifier choice. The CK–SN P model defines the local feature-computation mechanism, while the classifier placed on top of the extracted representation determines one possible empirical realization of that mechanism.
6.4. Evaluation Metrics, Training Procedure, and Reproducible Reporting
The evaluation reports accuracy, balanced accuracy, macro-F1, per-class F1 scores, sensitivity for the supraventricular class when available, Matthews correlation coefficient (MCC), Cohen’s kappa, and runtime. Macro-F1 and balanced accuracy are reported together with accuracy because the three-class ECG problem is imbalanced and because the class contains fewer samples than the class. Accuracy describes the global rate of correct predictions, while macro-F1, balanced accuracy, and per-class scores provide additional information about class-level behavior. For a given random seed, the selected checkpoint is chosen using validation metrics. In the CK–SN P implementation, the checkpoint criterion combines macro-F1, balanced accuracy, and class-wise information. This choice avoids reporting a model only through a single aggregate metric. The final test metrics are computed on DS2 after checkpoint selection. The final tables report mean values across seeds 2026 and 3170. The main experiment is executed in full mode with FAST_MODE=False and FULL_DATA_PERCENT=100.0. The complementary reduced-data setting is also executed in full mode, with FULL_DATA_PERCENT=50.0 and stratified_s_safe sampling. Bootstrap confidence intervals are reported for the selected full-mode artifacts when available.
The experiments were executed in Python 3.12.7 on Microsoft Windows 11 in CPU mode. The implementation uses NumPy and pandas for numerical and tabular processing, WFDB for access to the MIT-BIH records when available, scikit-learn for preprocessing, classical classifiers, and metric computation, and PyTorch 2.10.0+cpu for the S-aware neural components when enabled. The hardware platform was a workstation equipped with an AMD Ryzen 7 PRO 8700 G processor with 8 cores and 16 threads, integrated AMD Radeon 780 M graphics, 32 GB RAM, and a 512 GB SSD. The reported experiments are documented through the declared random seeds, command-line parameters, configuration fields, dataset distributions, kernel-bank description, feature-name information, runtime summaries, and the numerical tables included in the manuscript. The reporting keeps formal claims and empirical observations separated. The formal sections define the CK–SN P model and its semantics. The empirical sections describe how the resulting local responses behave under the specified DS1/DS2 protocol and under the reduced-data complementary setting. The numerical outcomes obtained under these settings are reported and discussed in
Section 7, where the complete-data full-mode experiment and the complementary reduced-data analysis are presented separately.
7. Results and Discussion
This section reports the full-mode experimental results obtained under the patient-independent MIT-BIH DS1/DS2 protocol. The complete-data setting serves as the main evaluation. The 50% full-mode setting is reported separately as a complementary reduced-data analysis. All aggregate values are means across seeds 2026 and 3170 unless otherwise specified. The reported tables summarize the metrics, confusion-matrix information, runtime records, and configuration settings for the declared experimental runs. The empirical objective is to evaluate whether CK–SN P local responses can serve as structured, finite, and reproducible descriptors under the declared ECG protocol. The experiments are not intended as a complete benchmark against all contemporary ECG architectures; rather, they assess how the proposed formal feature mechanism behaves when combined with tabular classifiers and S-aware neural variants.
7.1. Full-Mode Results on the Complete DS2 Test Set
Table 5 reports the complete-data full-mode comparison on DS2. Under macro-F1 as the primary summary metric,
CKSNP_RR_GaussFourier_HGB is the reference row for this table, with accuracy
, balanced accuracy
, macro-F1
,
,
, and
. The bootstrap 95% confidence interval for macro-F1, computed under the corresponding full-mode setting, is
.
The row Light_1D_CNN_RR_SAwareLoss gives the direct lightweight 1D-CNN baseline under the same DS2 test protocol. It provides a neural reference point for the proposed feature-based pipeline. The comparison should be read together with the class-wise metrics, since the methods differ in their accuracy, balanced-accuracy, macro-F1, and minority-class behavior.
The table shows several metric-dependent trade-offs. The raw tree baselines obtain higher accuracy values, whereas the CK–SN P Gaussian/Fourier rows highlight different behavior in macro-F1, balanced accuracy, and per-class F1 scores. Since macro-F1 is the primary summary metric in this study, the HGB row using CK–SN P RR Gaussian/Fourier features serves as the reference row for the complete-data experiment. The class-level values are relevant for interpretation. Several rows obtain higher F1 values for normal and ventricular beats. Supraventricular beats require explicit class-level reporting in the patient-independent evaluation. This observation is compatible with the class distribution and with the overlap that may occur between minority supraventricular patterns and other ECG morphologies in inter-patient evaluation. For this reason, the table reports
explicitly instead of relying only on accuracy or macro-F1. From the perspective of the proposed representation, the
class is relevant because its distinction from normal beats may depend on local waveform morphology together with RR context. The CK–SN P local responses expose finite neighborhood-level contrasts as explicit descriptors, while RR, Gaussian, and Fourier components provide complementary temporal and shape information. The reported
-class values should therefore be read as part of the class-level profile of the combined representation. They also indicate that supraventricular beat recognition remains a difficult component of the patient-independent setting and should not be interpreted as a standalone clinical assessment. The logistic-regression CK–SN P row has a higher balanced-accuracy value than the other rows in
Table 5. This indicates that different classifier choices lead to different metric profiles. For this reason, balanced accuracy and per-class scores are reported together with macro-F1 rather than treated as secondary observations.
The comparison with raw-RR baselines provides quantitative context for the added descriptor set. For example, the CK–SN P RR Gaussian/Fourier HGB row has a higher macro-F1 than the raw-RR tree baselines under the same complete DS2 protocol. This difference is interpreted as evidence for the usefulness of the combined descriptor representation in the declared setting, rather than as an isolated attribution to a single component.
7.2. Complementary 50% Full-Mode Analysis
Table 6 reports the reduced-data full-mode analysis. This setting preserves the supraventricular class and samples the remaining classes with a stratified S-safe strategy. It examines the same modelling choices under a modified class distribution.
The 50% analysis does not replace the complete-data evaluation. It provides an additional view of the same feature-generation pipeline under a sampling regime that preserves the minority class while reducing the number of majority-class samples. The numerical ordering in this table is close to that of the complete-data setting for the CK–SN P Gaussian/Fourier rows, but the interpretation remains tied to the modified distribution. Therefore, these results are reported as a complementary analysis rather than as the main experimental conclusion.
7.3. Ablation Study of CK–SN P Components
Table 7 reports the full-mode ablation of S-aware CK–SN P neural variants. This table examines how RR information, Gaussian/Fourier descriptors, and S-aware training affect the learned representation. The rows should therefore be read as component analyses rather than as a direct replacement for the classical-classifier comparison in
Table 5.
The ablation results should be interpreted as component-level evidence rather than as causal proof. In this patient-independent setting, RR information changes both aggregate metrics and -class values, supporting the expected role of temporal context in beat-class separability. The comparison between Gaussian/Fourier and no-Fourier variants indicates that the effect of these descriptors depends on the classifier and training formulation. These rows therefore describe how the implemented representation changes when RR information, Gaussian/Fourier descriptors, hard-slope variants, or S-aware loss shaping are modified under the same evaluation protocol. They are not intended to isolate the independent causal effect of each formal component. For this reason, both the classical CK–SN P feature pipeline and the S-aware neural variants are reported, as they address related but not identical modeling questions.
7.4. Computational Cost and Reproducibility
For the complete-data setting, we report the result tables, the CK kernel-bank description, feature-name information, and runtime summaries. The CK–SN P feature representation contains 409 features in this setting. The HGB row in the compact full-mode table has an average runtime of approximately s, while the neural S-aware ablation rows require longer training times. These values should be interpreted in relation to the different roles of the models: the classical classifiers evaluate the CK–SN P feature representation as tabular descriptors, whereas the neural variants examine differentiable training and class-aware objectives. From a computational perspective, the feature-extraction cost is governed by the number of beats, the number of kernels, and the maximum neighborhood length. For a fixed kernel bank and fixed beat-window length, the CK–SN P feature computation scales linearly with the number of evaluated beats.
Compared with a conventional delay-free SN P rule whose applicability depends only on the spike count of the current neuron and on the regular-expression condition, a CK–SN P rule adds the evaluation of a finite number of local kernel responses and Boolean guard tests. For a fixed finite kernel bank, this adds a bounded local arithmetic cost to rule applicability, while preserving the finite rule-set structure and the finite-branching transition relation.
The downstream classifier adds the remaining training or inference cost, depending on its model family. The reproducible reporting separates three elements: the formal CK–SN P model, the feature-extraction pipeline, and the classifier used on top of the extracted representation. This separation allows the formal contribution to be assessed independently of the empirical classifier choice.
7.5. Applicability and Practical Scope
The choice of kernels determines which local spike-count contrasts are exposed to the downstream classifier. Difference-like kernels emphasize local changes and neighborhood imbalance, smoothing-like kernels summarize short-range activity, and asymmetric kernels may capture direction-dependent temporal patterns. In the empirical realization, the finite kernel bank is kept fixed so that the extracted responses remain reproducible and inspectable. The reported results therefore evaluate one declared kernel-response design rather than an unrestricted search over possible kernel families.
The proposed CK–SN P construction is suitable for tasks in which local structure, explicit guard predicates, and inspectable feature computation are important. ECG beat classification is one such application, because local waveform morphology, RR context, and class imbalance interact in the prediction task. Accordingly, this implementation should be viewed as a reproducible research instantiation of the proposed formal model; clinical use would require additional validation and domain-specific assessment. The main practical value of the proposed framework lies not in replacing existing classifiers, but in providing a formal and reproducible mechanism for generating finite local descriptors. These descriptors can be combined with classical classifiers or neural components, allowing the local rule-based structure of CK–SN P systems to complement downstream learning models. The experimental results indicate that CK–SN P local responses can be used as structured descriptors for patient-independent ECG classification. Further work is required to assess how these descriptors behave across databases, acquisition settings, annotation conventions, and alternative class groupings. The interpretability analysis in this study is limited to structural inspectability. The kernel weights, ordered neighborhood positions, threshold relations, active scenario labels, and generated feature names are explicit components of the pipeline. As a result, a rule or feature response can be traced back to a finite local waveform neighborhood and to a declared guard condition. This study does not include a clinician-facing interpretability evaluation, visual case studies of selected errors, or a comparison with post hoc explanation methods. These elements are therefore left for future work and are not presented as completed empirical claims.
7.6. Limitations and Threats to Validity
Several limitations qualify the present findings. First, the empirical evaluation is based on MIT-BIH and on a three-class grouping of beats. Although the DS1/DS2 protocol is patient-independent, additional external validation is required before broader claims can be made. Second, the supraventricular class requires explicit class-level reporting because of its smaller representation and morphology-related overlap with other beat categories. The reported -class metrics are therefore included explicitly, so that the analysis does not depend only on aggregate accuracy. Third, the reference row under macro-F1 uses CK–SN P features combined with a classical HGB classifier. This choice supports the assessment of the feature representation and clarifies that the final predictive pipeline includes both formal CK–SN P computation and a downstream tabular classifier. The formal and empirical scopes are also intentionally bounded. The kernel guards used in the model are finite and inspection-oriented, and the main formal comparisons are stated for the delay-free fragment. The ECG implementation follows this delay-free setting and uses a fixed finite kernel bank. These choices make the reported pipeline reproducible and auditable, while leaving adaptive kernel selection, delayed-rule dynamics, and broader scenario-control variants for further study. Several analyses remain open for future work. First, because the final tables report two random seeds, formal paired significance testing would have limited interpretive value in the current setting; additional seeds would be needed before non-parametric paired tests could be reported in a stable manner. Second, the -class metrics are reported explicitly, but a dedicated error analysis with beat-level visual inspection is not included in the present version. Third, the ablation study evaluates RR information and Gaussian/Fourier components, while a separate ablation of the scenario-control function is not reported. These analyses extend naturally from the present full-mode evaluation.
The experimental scope is also limited by the use of a single ECG database and by the absence of external validation on additional databases such as INCART or PTB. The present results therefore support conclusions only for the declared MIT-BIH DS1/DS2 protocol. Broader claims about generalization across acquisition settings, patient populations, annotation conventions, and clinical environments would require multi-database evaluation, additional patient-independent splits, and a larger number of random seeds. The study also does not provide a complete benchmark against recent transformer-based ECG classifiers or a clinician-facing evaluation of interpretability. These elements are left for future work together with paired statistical testing over additional runs, visual error analysis for difficult beat classes, and possible extensions toward multimodal healthcare data. These limitations define the empirical scope of the study and identify directions for further evaluation of the model.
8. Conclusions
This paper has introduced systems as a formal and trainable framework for local feature computation in rule-based membrane-computing models. The proposed construction extends the operational view of Spiking Neural P systems by allowing spike-rule applicability to depend on kernel responses computed over ordered neighborhoods of spike multiplicities. In this way, the model combines guarded rule activation, local convolutive predicates, and an explicit transition semantics. The theoretical part of the paper defined the syntax and semantics of the model and related the construction to delay-free extended Spiking Neural P systems and kernel P systems under stated assumptions. The formal results are deliberately bounded: the conservativity result concerns the delay-free extended SN P fragment embedded through trivial guards, kernels, and scenarios, while the kernel-P representation is conditional on the expressibility of the required guards in the selected formalism. This delimitation keeps the formal contribution tied to finite, inspectable local predicates rather than to a claim of increased computational power. The empirical study instantiated the model for ECG beat classification under a patient-independent MIT-BIH DS1/DS2 protocol. The full-mode results indicate that CK–SN P local responses can be used as structured descriptors when combined with RR, Gaussian, and Fourier information. In the reported complete-data setting, the CK–SN P RR Gaussian/Fourier representation coupled with histogram-based gradient boosting serves as the reference row when macro-F1 is used as the primary summary metric. The neural S-aware variants provide a complementary view of component behavior and class-aware training.
The study positions CK–SN P systems as a structured mechanism for local feature computation. At the same time, the experimental findings should be interpreted within the limits of the present protocol, dataset, class grouping, finite kernel bank, and delay-free empirical realization. Future work should examine external ECG databases, adaptive or learned kernel-selection strategies, dynamic scenario-control mechanisms, delayed-rule variants, additional patient-independent splits, and closer integration between the formal guarded-rule model and trainable classifier architectures.