Image classification system, method, device, and medium based on fuzzy inference network
An image classification system combining fuzzy inference networks and quantum parameterization circuits solves the problems of difficult deployment of deep learning on resource-constrained devices and insufficient adaptability to uncertainty, achieving efficient image classification and uncertainty representation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHWESTERN POLYTECHNICAL UNIV
- Filing Date
- 2026-02-04
- Publication Date
- 2026-06-09
AI Technical Summary
Existing deep learning-based image classification technologies are difficult to deploy on resource-constrained devices, require a large amount of computation, and lack sufficient classification accuracy when faced with uncertainties such as noise and occlusion, making it difficult to express the adaptability to uncertainties and complex environmental changes.
An image classification system based on fuzzy inference network is adopted, which combines quantum parameterization circuit and fuzzy rule inference. Through quantum membership estimation, rule inference and defuzzification, a tightly coupled end-to-end network is formed to realize the collaborative work of feature representation, membership calculation and rule reasoning.
It improves the accuracy of image classification and the ability to characterize uncertainty under resource-constrained conditions, reduces model size and computational overhead, and enhances adaptability to complex environments.
Smart Images

Figure CN122176363A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and computer vision technology, specifically relating to an image classification system, method, device and medium based on fuzzy inference networks. Background Technology
[0002] Image classification is one of the fundamental tasks in computer vision. Its goal is to determine the semantic category of an input digital image and output the corresponding category label or category probability distribution. This task typically uses a pixel matrix as input and learns representations of information such as shape, texture, edges, and spatial structure in the image through feature extraction and discriminative models to distinguish categories. With the development of deep learning, end-to-end classification methods based on convolutional neural networks and their improved structures have been widely adopted. Their general process includes preprocessing and normalizing the input image, learning multi-level feature representations using the network structure, and outputting the prediction results in the final classification module. Because these methods can automatically learn discriminative features from data, reducing reliance on manual feature design, they are widely used in scenarios such as industrial quality inspection, medical image-assisted diagnosis, intelligent transportation, and security monitoring, and are particularly suitable for the automated, batch-based category recognition of large-scale image data.
[0003] However, existing deep network-based image classification techniques still have several shortcomings in practical applications. First, in pursuit of higher classification accuracy, many models rely on deeper network layers, wider channel sizes, or more complex module combinations, resulting in a high number of parameters and computational load. The training phase consumes significant computing power, GPU memory, and time, and the inference phase may also generate high latency and energy consumption, thus limiting their deployment and real-time application on edge devices or resource-constrained platforms. Even with methods such as model compression, pruning, or quantization to reduce complexity, it is often necessary to repeatedly weigh accuracy, robustness, and resource consumption. Second, the output of deep models is usually based on deterministic decisions, commonly classifying based on output scores or maximum probabilities. However, such scores do not necessarily accurately reflect the degree of uncertainty of the samples. Under conditions of noise interference, occlusion, lighting changes, scale changes, cluttered backgrounds, and inconsistent training and testing distributions, the model may exhibit high confidence but make incorrect predictions, leading to insufficient risk perception of abnormal or difficult samples. For applications with high security or reliability requirements, the aforementioned overconfident erroneous predictions may reduce the controllability and credibility of the system. Therefore, it is necessary to enhance the model's adaptability to uncertainty and complex environmental changes while ensuring classification performance.
[0004] To enhance the model's ability to express and reason about uncertainty, fuzzy inference and fuzzy neural networks are used to map features to membership degrees, perform aggregation inference through rule layers, and then defuzzify to obtain deterministic output values that can be used for classification. This type of method has advantages in characterizing gradual boundaries, expressing uncertainty, and providing a certain degree of interpretability. However, when dealing with high-dimensional visual features, existing fuzzy systems still face scalability issues. For example, when the membership function form or initialization method is limited, it is difficult to adapt to complex image distributions; the number of rules and computational complexity tend to increase rapidly with the feature dimension; and defuzzification and rule aggregation often employ relatively simple linear or heuristic structures, limiting end-to-end optimization effects and expressive power.
[0005] Meanwhile, quantum machine learning methods such as parameterized quantum circuits map classical inputs to high-dimensional Hilbert spaces through mechanisms such as angle encoding, quantum state superposition, and entanglement, demonstrating certain expressive potential with a relatively small parameter scale. However, due to limitations in the number of available qubits, circuit depth, noise, and measurement costs, existing quantum models typically require additional feature compression or hybrid structures when processing high-dimensional image inputs, and the overall training chain and module co-optimization remain challenging.
[0006] In recent years, hybrid methods combining quantum computing and fuzzy inference have emerged, attempting to utilize quantum circuits for membership estimation or feature enhancement, and then combining them with fuzzy rule inference for classification tasks. However, in existing quantum-fuzzy fusion schemes, rule aggregation and defuzzification are often placed in classical post-processing modules. The quantum and fuzzy inference links have failed to form a consistent end-to-end trainable closed loop, resulting in limited gradient propagation and joint optimization. Furthermore, there is still room for improvement in terms of model lightweighting and engineering deployment. Summary of the Invention
[0007] To address the problems existing in the prior art, this invention provides an image classification system, method, device, and medium based on fuzzy inference networks, enabling key components such as feature representation, membership calculation, rule reasoning, and defuzzification to work collaboratively in a more tightly coupled manner, while balancing classification accuracy, model size, and the ability to characterize uncertainty under resource-constrained conditions.
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] In a first aspect, embodiments of this disclosure provide an image classification system based on a fuzzy inference network, comprising:
[0010] The data loading module is used to read image samples from the local dataset and output the image samples and their corresponding calibration labels in batches.
[0011] The feature extraction module is used to perform initial feature characterization on the image samples and output optimized feature representations;
[0012] The quantum membership estimation module is used to receive the optimized feature representation, perform quantum encoding and parameterized quantum circuit calculations on the optimized feature representation to obtain the measurement result, and map the measurement result to the initial multi-membership representation.
[0013] The fuzzy rule inference module is used to receive the initial multi-membership representation, perform soft maximum normalization on the initial multi-membership representation based on trainable rule antecedent weights, and perform aggregation and normalization processing to obtain the rule inference output.
[0014] The quantum defuzzing module is used to receive the rule inference output, perform input mapping, quantum encoding, entanglement evolution and measurement reconstruction, and generate clear values;
[0015] The fusion and classification module is used to fuse the sharpness value with the optimized feature representation to obtain a fused representation, and output the image classification result based on the fused representation;
[0016] It also includes a loss calculation module and a parameter update module applied in the training scenario. The loss calculation module is used to calculate the loss value based on the image classification result and the real label. The parameter update module is used to jointly optimize the trainable parameters in the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module and fusion and classification module through backpropagation.
[0017] Furthermore, the data loading module includes a training data loading submodule and a test data loading submodule that are independent of each other. The training data loading submodule is used to provide image samples and corresponding labels iteratively according to a preset batch size during the training phase, and the test data loading submodule is used to provide image samples and corresponding labels iteratively according to a preset batch size during the evaluation phase.
[0018] The feature extraction module employs a convolutional neural network.
[0019] Furthermore, the quantum membership estimation module includes multiple parallel and independent quantum membership estimation units. Each quantum membership estimation unit processes each scalar feature of the feature vector using a single qubit as the carrier, including the following steps:
[0020] Step A1: For the optimized feature representation vector of the input sample, take the first... scalar characteristics and scalar features Regarding the first The quantum membership degree of a membership function is defined as:
[0021] ;
[0022] In the formula, This represents the parameterized quantum circuit corresponding to the membership function; The computational ground state represents the initialization state of a quantum bit; for The conjugate transpose of; For the training parameter set; For Pauli- The observable measurement, by changing the measurement expectation from Linear mapping to Obtain membership degree;
[0023] Step A2: Scalar features for each input Quantum encoding is performed using angle-coded injection of quantum states, and the quantum encoding process involves orbital insertion. axis, shaft or The rotating door of the axis realizes input mapping, using a revolving mechanism. When it comes to a revolving door with an axle, it is represented as:
[0024] ;
[0025] In the formula, This refers to a single-qubit quantum state obtained after angular encoding of the input scalar features. To bypass A revolving door with an axle;
[0026] When performing parameterization transformations on quantum states, the method of revolving around axis, shaft or Trainable rotating gates on axes are connected in series to form variable layers, and these variable layers are stacked in multiple layers to form a depth of... A quantum membership estimation circuit;
[0027] Step A3: The end of the quantum membership estimation circuit performs Pauli-... The range of values obtained from the baseline measurement is: initial expected value To satisfy the membership domain requirement, the initial expected value is... Mapping to the expected value :
[0028] ;
[0029] Wherein, the expected value of the mapping for Output the membership degree within the range;
[0030] Step A4: Merge the membership outputs of multiple quantum membership estimation units to form a multi-membership set representation:
[0031] ;
[0032] ;
[0033] In the formula, To optimize the feature representation vector, ; Number of quantum membership estimation units , ; Output membership degree; This is for the transpose operation.
[0034] Furthermore, the fuzzy rule inference module performs the following steps:
[0035] Step B1: Perform value constraint processing on the initial multi-membership representation until... Within the range, an optimized multi-membership representation is obtained;
[0036] Step B2: Set the first Rule number 1 The corresponding feature dimension is the first The trainable parameters of each membership function are Temperature parameters are This yields trainable rule antecedent weights;
[0037] Step B3: Based on the trainable rule antecedent weights and the initial multi-membership representation, calculate the first... Rule number 1 Matching values on each feature dimension;
[0038] Step B4: Aggregate the matching values of each feature dimension using the trigonometric norm in product form to obtain the first... The activation strength of the rule;
[0039] Step B5: Normalize the activation strength of all rules to obtain the rule inference output.
[0040] Furthermore, the value constraint processing includes mapping using an S-shaped function. ,include:
[0041] ;
[0042] In the formula, To represent in terms of natural constants An exponential function with base 0; This is the input scalar of the Sigmoid function;
[0043] The trainable rule-based antecedent weights include:
[0044] ;
[0045] In the formula, The number of membership functions;
[0046] The matching value include:
[0047] ;
[0048] In the formula, For the first The membership function for the th... Features The membership degree output, and ;
[0049] The activation intensity include:
[0050] ;
[0051] In the formula, The number of feature dimensions; Indexed by feature dimensions, ;
[0052] The rule inference output include:
[0053] ;
[0054] In the formula, For rule indexing, , Indicates all Activation strength of the rule The sum of these is used as a normalization factor; The number of rules.
[0055] Furthermore, the quantum deblurring module performs the following steps:
[0056] Step C1: Expand the rule inference output according to a preset order to obtain an expanded representation. Map the expanded representation to a circuit input sequence with the same number of preset qubits through a linear mapping. include:
[0057] ;
[0058] In the formula, This is the expanded representation of the rule inference output; and These are trainable mapping parameters;
[0059] Step C2: Perform quantum encoding based on the encoding operator. During the quantum encoding process, each component of the circuit input sequence is loaded onto the corresponding qubit to obtain the encoded quantum state. Using a loop The rotating gate of the axis inputs the circuit sequence Each component is loaded onto its corresponding qubit, including:
[0060] ;
[0061] In the formula, This represents the tensor product operation. To preset the number of qubits, Input sequence for the circuit The One component;
[0062] Step C3: Perform entanglement evolution based on a fully connected controlled NOT gate on the encoded quantum state to fuse the multi-bit information and obtain the entangled quantum state.
[0063] Step C4: Perform Pauli-Z basis measurements on the entangled quantum state to obtain the measurement vector composed of the measurement expectations of each qubit;
[0064] Step C5: Divide the measurement vector into two parts according to a preset method, perform linear transformations on each part, take the average, and reconstruct a clear value. :
[0065] ;
[0066] In the formula, and These represent the two parts of the measurement vector partition; , , and All of these are trainable parameters.
[0067] Furthermore, in the fusion and classification module, the clear values and optimized feature representations are combined into a fusion representation by splicing.
[0068] The fused representation is processed using a fully connected neural network to output classification scores for each category, and the category with the highest score is taken as the final image classification result.
[0069] In a second aspect, embodiments of this disclosure provide an image classification method based on a fuzzy inference network, comprising the following steps:
[0070] Step S1: Select a dataset of image samples for the target image classification task, set training parameters, build a data loading module for the training and testing phases, divide the dataset into training data and testing data, and initialize the image classification model and parameters based on the fuzzy inference network.
[0071] Step S2: During the training phase, the following steps are executed cyclically: The data loading module outputs image samples and corresponding labels in batches; the image samples are input into the feature extraction module for initial feature representation, and optimized feature representation is output; the optimized feature representation is input into the quantum membership estimation module to obtain an initial multi-membership representation; the initial multi-membership representation is input into the fuzzy rule inference module to obtain a rule inference output; the rule inference output is input into the quantum defuzzification module to generate a sharp value; the sharp value and the optimized feature representation are input into the fusion and classification module to obtain an image classification result; the loss calculation module calculates the loss value based on the image classification result and the true label, and the parameter update module updates the trainable parameters in the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module, and fusion and classification module through backpropagation.
[0072] Step S3: After each round of training, the data loading module is called to output image samples and corresponding labels from the test data. The image samples are then sequentially input into the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module, and fusion and classification module to obtain the image classification results.
[0073] Step S4: Determine whether the number of training rounds has reached the preset value. If not, return to step S2; otherwise, end the training and output the trained model. Based on the trained model, input the image to be classified into the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module, and fusion and classification module in sequence, and output the corresponding image classification result.
[0074] In a third aspect, embodiments of this disclosure provide an electronic device, characterized in that the electronic device comprises:
[0075] At least one processor; and,
[0076] The memory is communicatively connected to the at least one processor; wherein,
[0077] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the image classification method based on fuzzy inference networks.
[0078] In a fourth aspect, embodiments of this disclosure provide a non-transitory computer-readable storage medium, characterized in that the non-transitory computer-readable storage medium stores computer instructions for causing the computer to execute the image classification method based on a fuzzy inference network.
[0079] Compared with the prior art, the present invention has the following beneficial technical effects:
[0080] This invention provides an image classification system, method, device, and medium based on fuzzy inference networks. This system embeds the representational capabilities of quantum parameterized circuits and fuzzy rule inference mechanisms into an end-to-end classification network. While maintaining the overall trainability of the process, it achieves membership degree modeling, rule matching, and defuzzification fusion of image features, thereby outputting more stable classification results. The system takes image samples as its object. First, it extracts initial feature representations of fixed dimensions from the image, transforms these initial feature representations into optimized feature representations, and then introduces a quantum embedded fuzzy inference branch into the feature space. This maps the features to multi-membership degree representations and completes rule inference and membership degree numerical fusion. Finally, it combines these with the original features to form a fused representation for classification, which is then input into the classification module to output the classification result. This addresses the problems of large model parameter scale, high training and inference computational costs, and insufficient fine-grained feature boundary characterization and difficulty in explicitly expressing sample category membership relationships and inference processes when facing uncertainties such as image noise, occlusion, and blurring, which are commonly used in existing image classification tasks.
[0081] Furthermore, the quantum membership estimation module optimizes the feature representation of the preprocessed network output, loads each feature dimension onto the qubit using methods such as angle encoding, and forms a variable quantum circuit through multi-layer parameterized quantum rotation gates. Subsequently, the quantum state is measured and the measurement results are mapped to the numerical domain to obtain the membership degree of each feature on multiple membership functions, forming a multi-membership representation that includes the correspondence between multiple membership functions and each feature dimension, providing input for subsequent rule inference.
[0082] Furthermore, after obtaining the multi-membership representation through the fuzzy rule inference module, the contribution of different membership functions on each feature dimension is modeled using trainable rule antecedent parameters. The matching degree of each feature dimension is aggregated according to a preset triangular norm to obtain the matching weight of each rule for the current sample. Subsequently, the matching weights are normalized to obtain the inference output reflecting the rule activation distribution. The output is the result after normalizing the weights of each rule. In the implementation, the trainable antecedent weights are normalized using a soft maximum normalization function at the corresponding rule layer to complete the antecedent selection. The membership degrees of each feature dimension are multiplicatively aggregated and normalized to output the rule weight vector.
[0083] Furthermore, the quantum deblurring module outputs rule-based inference. It obtains a low-dimensional quantum measurement vector through input mapping, quantum encoding, fully connected entanglement operations, and measurement. It then obtains a sharp value in the form of a single scalar through linear reconstruction. The sharp value is concatenated with the optimized feature representation to form a fused feature, which is then input into the fusion and classification module. The module outputs classification scores for each category to complete image classification.
[0084] Furthermore, in the training scenario, based on the loss calculation module and the parameter update module, a loss function is constructed using supervised learning objectives, and gradient backpropagation is used to jointly optimize the parameters of the data loading module, the rule layer, and the quantum circuit to improve the accuracy of the image classification system. Attached Figure Description
[0085] Figure 1 A schematic diagram of an image classification system based on a fuzzy inference network according to an embodiment of the present disclosure is shown;
[0086] Figure 2 A flowchart of an image classification method based on a fuzzy inference network according to an embodiment of the present disclosure is shown;
[0087] Figure 3 A diagram of an image classification method based on a fuzzy inference network according to an embodiment of the present disclosure is shown. Detailed Implementation
[0088] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0089] To address the problems of large model parameter size, high training and inference computational costs, and insufficient fine-grained feature boundary characterization and difficulty in explicitly expressing sample class membership and inference processes when facing uncertainties such as image noise, occlusion, and blur, this disclosure provides an image classification system based on a fuzzy inference network, such as... Figure 1 As shown, it includes:
[0090] The data loading module is used to read image samples from the local dataset and output the image samples and their corresponding calibration labels in batches.
[0091] Specifically, the data loading module includes a training data loading submodule and a test data loading submodule that are independent of each other. The training data loading submodule is used to provide image samples and corresponding labels iteratively according to a preset batch size during the training phase, and the test data loading submodule is used to provide image samples and corresponding labels iteratively according to a preset batch size during the evaluation phase.
[0092] The feature extraction module is used to perform initial feature representation on the image samples and output optimized feature representations. Specifically, the feature extraction module employs a convolutional neural network, which can be described as a mapping function from the image space to the feature space, and its output can be expressed as:
[0093] ;
[0094] In the formula, Indicates the input image. This indicates the feature extraction module. This represents the trainable parameters of the feature extraction module. This represents a compact feature representation of the output, and serves as an optimized feature representation.
[0095] The above mapping process provides the basis for the subsequent quantum defuzzification module and fuzzy rule inference module in optimizing feature representation. The calculations are performed within the corresponding feature space, thus avoiding the computational burden of directly constructing quantum inference links in high-dimensional pixel space.
[0096] The quantum membership estimation module is used to receive the optimized feature representation, perform quantum encoding and parameterized quantum circuit calculations on the optimized feature representation to obtain the measurement result, and map the measurement result to the initial multi-membership representation.
[0097] Specifically, the quantum membership estimation module includes multiple parallel and independent quantum membership estimation units. Each quantum membership estimation unit processes each scalar feature of the feature vector using a single quantum bit as the carrier, including the following steps:
[0098] Step A1: For the optimized feature representation vector of the input sample, take the first... scalar characteristics and scalar features Regarding the first The quantum membership degree of a membership function is defined as:
[0099] ;
[0100] In the formula, This represents the parameterized quantum circuit corresponding to the membership function; The computational ground state represents the initialization state of a quantum bit; for The conjugate transpose of; For the training parameter set; For Pauli- The observable measurement, by changing the measurement expectation from Linear mapping to Obtain membership degree; where Pauli- The range of expected values obtained from the baseline measurement is as follows: To ensure that the measurement result meets the domain requirement of membership degree and serves as the multi-membership set representation in subsequent step A4, as well as the input to the fuzzy rule inference module, this embodiment uses the expected measurement value through... Linear mapping transformation to The interval is consistent with the mapping process for the initial expected value in step A3.
[0101] Step A2: For the optimized feature representation vector, the first... scalar features Quantum encoding is performed using angle-coded injection of quantum states, and the quantum encoding process involves orbital insertion. , or The input mapping is achieved through a rotating door on the axis. In this embodiment, a rotating door is preferably used. A rotating door on an axis implements input mapping:
[0102] ;
[0103] In the formula, This refers to a single-qubit quantum state obtained after angular encoding of the input scalar features. To bypass A revolving door with an axle.
[0104] When performing parameterization transformations on quantum states, the method of revolving around axis, shaft or Trainable rotating gates on axes are connected in series to form variable layers, and these variable layers are stacked in multiple layers to form a depth of... A quantum membership estimation circuit; in this embodiment, we take... This constitutes a typical data re-upload structure, that is, the combination of input encoding and variational rotation layer is repeatedly executed in each layer to enhance the separability and fit of a single quantum bit to the input interval.
[0105] Step A3: The end of the quantum membership estimation circuit performs Pauli-... The range of values obtained from the baseline measurement is: initial expected value To satisfy the membership domain requirement, the initial expected value is... Mapping to the expected value :
[0106] ;
[0107] Wherein, the expected value of the mapping for The membership degree output within the range; this mapping is implemented in one way as... This is directly reflected in the method. In the formula, This indicates that the range of values obtained by performing observable measurements on a quantum state is... The expected value. To ensure that this measurement output meets the domain requirements of the membership degree and can participate in subsequent fuzzy inference calculations, it needs to be transformed to... Interval. Therefore, this embodiment adopts... The linear mapping will Normalization to the membership output allows it to be directly used as input for membership combination, rule activation strength calculation, and normalization processing in subsequent rule layers, thereby ensuring that the membership degree is consistent with the numerical domain of subsequent modules of fuzzy inference and improving computational stability.
[0108] Step A4: Merge the membership outputs of multiple quantum membership estimation units to form a multi-membership set representation. Specifically, to obtain the multi-membership representation, this embodiment configures multiple independent quantum membership estimation units in parallel within the quantum membership estimation module, assuming the number of membership functions is... In other words, configuration Each quantum membership estimation unit corresponds to For the same input feature vector Each quantum membership estimation unit for each scalar feature Output membership degree one by one This leads to the initial multi-membership set representation:
[0109] ;
[0110] ;
[0111] In the formula, To optimize the feature representation vector, ; Number of quantum membership estimation units , ; Output membership degree; This is for the transpose operation.
[0112] At the implementation level, the quantum membership estimation module is stored in parallel through a module list. Each quantum membership estimation unit is used, and the quantum membership estimation unit is called element by element for the input optimized feature vector. Finally, the outputs of each quantum membership estimation unit are stacked on the membership function dimension to obtain the initial multi-membership representation for use by the fuzzy rule inference module.
[0113] The fuzzy rule inference module is used to receive the initial multi-membership representation, perform soft maximum normalization on the initial multi-membership representation based on trainable rule antecedent weights, and perform aggregation and normalization processing to obtain the rule inference output.
[0114] Specifically, the fuzzy rule inference module performs the following steps:
[0115] Step B1: Perform value constraint processing on the initial multi-membership representation until... Within the specified range, an optimized multi-membership representation is obtained. Specifically, to ensure that the membership values meet the value range requirements of fuzzy inference, it is preferable to perform value constraint processing on the input multi-membership representation, making it fall within the range of 0 to 1. In one implementation, the value constraint processing uses a sigmoid function for mapping. ,include:
[0116] ;
[0117] In the formula, To represent in terms of natural constants An exponential function with base 0; This is the input scalar of the Sigmoid function.
[0118] Step B2: Set the first Rule number 1 The corresponding feature dimension is the first The trainable parameters of each membership function are Temperature parameters are This yields trainable rule antecedent weights. Specifically, in this embodiment, a set of trainable antecedent weight parameters is set for each feature dimension of each rule, and the set of parameters is normalized using a soft maximum normalization function to obtain differentiable antecedent selection weights. The trainable rule antecedent weights... include:
[0119] ;
[0120] In the formula, The number of membership functions; the temperature parameter This is used to adjust the sharpness of the antecedent selection, thereby balancing between continuous and approximately discrete selection.
[0121] Step B3: Based on the trainable rule antecedent weights and the initial multi-membership representation, calculate the first... Rule number 1 Matching values on each feature dimension. The matching values include:
[0122] ;
[0123] In the formula, For the first The membership function for the th... Features The membership degree output, and ;
[0124] This yields a set of matching values for each rule across all feature dimensions, which serves as the input for step B4.
[0125] Step B4: Aggregate the matching values of each feature dimension using the trigonometric norm in product form to obtain the first... The activation strength of the rule. Specifically, the activation strength include:
[0126] ;
[0127] In the formula, The number of feature dimensions; Indexed by feature dimensions, ;
[0128] It should be noted that, in some embodiments, in order to improve numerical stability, multiplicative aggregation is performed in the logarithmic domain and then restored to the original domain, and the resulting rule activation strength is mathematically equivalent to the above product aggregation.
[0129] Step B5: To facilitate use by the subsequent quantum defuzzification module and fusion classification module, the activation strength of all rules is normalized to obtain the rule inference output. Specifically, the rule inference output... include:
[0130] ;
[0131] In the formula, For rule indexing, , Indicates all Activation strength of the rule The sum of these is used as a normalization factor; The number of rules.
[0132] The quantum defuzzification module receives the rule inference output, performs input mapping, quantum encoding, entanglement evolution, and measurement reconstruction, and generates a sharp value. It should be noted that in this embodiment, the quantum defuzzification module converts the rule inference result output by the fuzzy rule inference module into a sharp value, so that it can be fused with the feature representation output by the feature extraction module and used for classification decisions.
[0133] Specifically, the quantum deblurring module performs the following steps:
[0134] Step C1: Expand the rule inference output according to a preset order to obtain an expanded representation. Map the expanded representation to a circuit input sequence with the same number of preset qubits through a linear mapping. include:
[0135] ;
[0136] In the formula, This is the expanded representation of the rule inference output. and For trainable mapping parameters, the circuit input sequence The length is consistent with the preset number of qubits.
[0137] Step C2: Perform quantum encoding based on the encoding operator. During the quantum encoding process, each component of the circuit input sequence is loaded onto the corresponding qubit to obtain the encoded quantum state. Using a loop The rotating gate of the axis inputs the circuit sequence Each component is loaded onto its corresponding qubit, including:
[0138] ;
[0139] In the formula, This represents the tensor product operation. The preset number of qubits; Input sequence for the circuit The One component; To bypass A revolving door with an axle.
[0140] Step C3: Perform entanglement evolution based on fully connected controlled NOT gates on the encoded quantum state to fuse multi-bit information and obtain the entangled quantum state. Specifically, the entanglement evolution based on fully connected controlled NOT gates is as follows: using a fully connected entanglement structure, a controlled NOT gate is applied between any two qubits to form entanglement correlation, thereby improving the joint expression capability of the rule inference output.
[0141] Step C4: Perform Pauli-Z basis measurements on the entangled quantum state to obtain the measurement vector composed of the measurement expectations of each qubit. , where the measurement vector Each component corresponds to the measurement result of one qubit, which is used to reconstruct the clear value later.
[0142] Step C5: To enhance reconstruction capabilities and maintain structural lightweighting, the measurement vector is divided into two parts according to a preset method, and after performing linear transformations on each part, the average is taken to reconstruct a clear value. :
[0143] ;
[0144] In the formula, and These represent the two parts of the measurement vector partition; , , and All of these are trainable parameters.
[0145] In this way, the quantum defuzzification module can compress the rule inference results into clear value representations that can be used for subsequent fusion and classification. Furthermore, the mapping parameters, quantum encoding and entanglement evolution related parameters, and reconstruction parameters of the quantum defuzzification module can all be jointly optimized through backpropagation during the training process.
[0146] The module also includes a fusion and classification module, used to fuse the sharpness value and the optimized feature representation to obtain a fused representation, and output an image classification result based on the fused representation. Specifically, in the fusion and classification module, the sharpness value and the optimized feature representation are combined into a fused representation by concatenation; a fully connected neural network is used to process the fused representation, outputting classification scores for each category, and the category corresponding to the highest score is taken as the final image classification result.
[0147] It should be noted that when processing the fused representation using a fully connected neural network, nonlinear activation and regularization may be included to improve classification and generalization capabilities. Additionally, in some embodiments, the classification scores may be normalized to obtain a category probability distribution, without affecting the basic process of determining the category based on the maximum score. Through the fusion and classification module, the sharpness value, as a compressed representation of the fuzzy rule inference result, participates in the classification decision together with the optimized feature representation output by the feature extraction module. Specifically, the sharpness value and the optimized feature representation are concatenated to form a fused representation, which is then input into the fully connected neural network to output classification scores for each category. This allows the quantum embedded fuzzy inference information to act on the final classification output in a compact form.
[0148] It also includes a loss calculation module and a parameter update module applied in the training scenario. The loss calculation module is used to calculate the loss value based on the image classification result and the real label. The parameter update module is used to jointly optimize the trainable parameters in the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module and fusion and classification module through backpropagation.
[0149] Specifically, the loss function of the loss calculation module adopts a form suitable for multi-class classification tasks, such as cross-entropy loss, expressed as:
[0150] ;
[0151] in, For the number of categories, Indicates the amount of the actual label. The model represents the first The predicted value of the class.
[0152] The parameter update strategy in the parameter update module can employ a gradient-based first-order optimization method. Specifically, in this embodiment, the Adam optimizer is used, combined with a learning rate scheduling strategy to adjust the learning rate during training, thereby improving training stability and convergence performance.
[0153] The evaluation phase can calculate classification performance metrics, such as accuracy, on the test or validation set to characterize how correctly the model classifies data, and can also record and analyze the training process in conjunction with changes in loss.
[0154] The selection of the above training and evaluation phases is merely an example. Those skilled in the art can replace or combine the loss form, optimization strategy, and evaluation index according to the task scale and computing resources, without affecting the core technical solution of the present invention.
[0155] The second embodiment of the present invention also provides an image classification method based on a fuzzy inference network, such as... Figure 2 As shown, it includes the following steps:
[0156] In step S101, a dataset of image samples is selected for the target image classification task, and training parameters are set. A data loading module for the training and testing phases is constructed, the dataset is divided into training data and testing data, and the image classification model and parameters based on the fuzzy inference network are initialized.
[0157] Next, proceed to step S102.
[0158] In step S102, the training phase is performed cyclically as follows: the data loading module outputs image samples and corresponding labels in batches; the image samples are input into the feature extraction module for initial feature representation, and optimized feature representation is output; the optimized feature representation is input into the quantum membership estimation module to obtain an initial multi-membership representation; the initial multi-membership representation is input into the fuzzy rule inference module to obtain a rule inference output; the rule inference output is input into the quantum defuzzification module to generate a sharp value; the sharp value and the optimized feature representation are input into the fusion and classification module to obtain an image classification result; the loss calculation module calculates the loss value based on the image classification result and the true label, and the parameter update module updates the trainable parameters in the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module, and fusion and classification module through backpropagation.
[0159] Next, proceed to step S103.
[0160] In step S103, after each round of training, the data loading module is called to output image samples and corresponding labels from the test data. The image samples are then sequentially input into the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module, and fusion and classification module to obtain the image classification result.
[0161] Next, proceed to step S104.
[0162] At step S104, it is determined whether the number of training rounds has reached a preset value. If not, the process returns to step S102; otherwise, the training ends and the trained model is output. Based on the trained model, the image to be classified is sequentially input into the feature extraction module, the quantum membership estimation module, the fuzzy rule inference module, the quantum defuzzification module, and the fusion and classification module, and the corresponding image classification result is output.
[0163] Table 1 shows the classification performance of the proposed method in this embodiment and existing related technologies such as Pattern Parallel Hierarchical Fuzzy Neural Network (PP-HFNN), Quantum Convolutional Neural Network (QCNN), Quantum Fuzzy Neural Network (QFNN), Quantum Neural Network (QNN), Quantum Fuzzy Federated Learning (QFFL), and Quantum Assisted Hybrid Fuzzy Neural Network (QA-HFNN) on the MNIST and Fashion-MNIST datasets. The percentage figures in the table represent the classification accuracy.
[0164] Table 1
[0165] MNIST Fashion-MNIST Parallel hierarchical fuzzy neural networks 89.33% 85.21% Quantum Convolutional Neural Networks 90.32% 87.23% Quantum fuzzy neural network 95.87% 89.92% Quantum Neural Networks 98.70% 88.30% Quantum fuzzy federated learning 98.85% 90.52% Quantum-assisted hybrid fuzzy neural network 99.13% 90.70% The method proposed in this implementation 99.40% 92.81%
[0166] As can be seen from the table, compared with the image classification methods in the prior art, the method proposed in this embodiment has the highest classification accuracy and the strongest classification performance.
[0167] The third embodiment of the present invention also provides an electronic device, the electronic device comprising:
[0168] At least one processor; and,
[0169] The memory is communicatively connected to the at least one processor; wherein,
[0170] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the image classification method based on fuzzy inference networks of any of the foregoing embodiments.
[0171] The fourth embodiment of the present invention also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the image classification method based on fuzzy inference networks described in any of the foregoing embodiments.
[0172] The fifth embodiment of the present invention also provides a computer program product, which includes a computing program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the image classification method based on fuzzy inference networks of any of the foregoing embodiments.
[0173] Figure 3 The illustration shows a method or device 1000 implementing an embodiment of the present invention. In some embodiments, more or fewer devices may be included than illustrated. In some embodiments, it may be implemented using a single or multiple devices. In some embodiments, it may be implemented using cloud-based or distributed devices.
[0174] like Figure 3As shown, device 1000 includes a processor 1001 for performing various appropriate operations and processes based on programs and / or data stored in read-only memory (ROM) 1002 or programs and / or data loaded from storage portion 1008 into random access memory (RAM) 1003. Processor 1001 may be a multi-core processor or may contain multiple processors. In some embodiments, processor 1001 may include a general-purpose main processor and one or more special coprocessors, such as a central processing unit (CPU), graphics processing unit (GPU), neural network processor (NPU), digital signal processor (DSP), etc. Various programs and data required for the operation of device 1000 are also stored in RAM 1003. Processor 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Input / output (I / O) interface 1005 is also connected to bus 1004.
[0175] The processor and memory described above are used together to execute a program stored in the memory. When the program is executed by a computer, it can implement the methods, steps, or functions described in the above embodiments.
[0176] The following components are connected to I / O interface 1005: an input section 1006 including a keyboard, mouse, touchscreen, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to I / O interface 1005 as needed. A removable medium 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 1010 as needed so that computer programs read from it can be installed into storage section 1008 as needed. Figure 3 The diagram only shows a portion of the components and does not imply that the device 1000 only includes... Figure 3 The components shown.
[0177] The systems, devices, modules, or units described in the above embodiments can be implemented by a computer or its associated components. The computer may be, for example, a mobile terminal, smartphone, personal computer, laptop computer, in-vehicle human-machine interface device, personal digital assistant, media player, navigation device, game console, tablet computer, wearable device, smart TV, Internet of Things system, smart home, industrial computer, server, or a combination thereof.
[0178] Although not shown, in this embodiment of the invention, a computer-readable storage medium is provided having a computer program / instructions stored thereon, which, when executed by a processor, implements the image classification method based on a fuzzy inference network as described in the embodiment.
[0179] Storage media in embodiments of the present invention include articles that are permanent and non-permanent, removable and non-removable, capable of storing information by any method or technology. Examples of storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0180] Although not shown, embodiments of the present invention also provide a computer program product, including: a computer program / instructions that, when executed by a processor, implement the image classification method based on a fuzzy inference network as described in the embodiments.
[0181] The methods, programs, systems, apparatuses, etc., in embodiments of the present invention can be executed or implemented in one or more networked computers, or practiced in a distributed computing environment. In the embodiments of this specification, in these distributed computing environments, tasks can be performed by remote processing devices connected via a communication network.
Claims
1. An image classification system based on fuzzy inference networks, characterized in that, include: The data loading module is used to read image samples from the local dataset and output the image samples and their corresponding calibration labels in batches. The feature extraction module is used to perform initial feature characterization on the image samples and output optimized feature representations; The quantum membership estimation module is used to receive the optimized feature representation, perform quantum encoding and parameterized quantum circuit calculations on the optimized feature representation to obtain the measurement result, and map the measurement result to the initial multi-membership representation. The fuzzy rule inference module is used to receive the initial multi-membership representation, perform soft maximum normalization on the initial multi-membership representation based on trainable rule antecedent weights, and perform aggregation and normalization processing to obtain the rule inference output. The quantum defuzzing module is used to receive the rule inference output, perform input mapping, quantum encoding, entanglement evolution and measurement reconstruction, and generate clear values; The fusion and classification module is used to fuse the sharpness value with the optimized feature representation to obtain a fused representation, and output the image classification result based on the fused representation; It also includes a loss calculation module and a parameter update module applied in the training scenario. The loss calculation module is used to calculate the loss value based on the image classification result and the real label. The parameter update module is used to jointly optimize the trainable parameters in the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module and fusion and classification module through backpropagation.
2. The image classification system based on fuzzy inference networks according to claim 1, characterized in that, The data loading module includes a training data loading submodule and a test data loading submodule that are independent of each other. The training data loading submodule is used to provide image samples and corresponding labels iteratively according to a preset batch size during the training phase, and the test data loading submodule is used to provide image samples and corresponding labels iteratively according to a preset batch size during the evaluation phase. The feature extraction module employs a convolutional neural network.
3. The image classification system based on fuzzy inference networks according to claim 1, characterized in that, The quantum membership estimation module includes multiple parallel and independent quantum membership estimation units. Each quantum membership estimation unit processes each scalar feature of the feature vector using a single quantum bit as the carrier, including the following steps: Step A1: For the optimized feature representation vector of the input sample, take the first... scalar characteristics and scalar features Regarding the first The quantum membership degree of a membership function is defined as: ; In the formula, This represents the parameterized quantum circuit corresponding to the membership function; The computational ground state represents the initialization state of a quantum bit; for The conjugate transpose of; For the training parameter set; For Pauli- The observable measurement, by changing the measurement expectation from Linear mapping to Obtain membership degree; Step A2: Scalar features for each input Quantum encoding is performed using angle-coded injection of quantum states, and the quantum encoding process involves orbital insertion. axis, shaft or The rotating door of the axis realizes input mapping, using a revolving mechanism. When it comes to a revolving door with an axle, it is represented as: ; In the formula, This refers to a single-qubit quantum state obtained after angular encoding of the input scalar features. To bypass A revolving door with an axle; When performing parameterization transformations on quantum states, the method of revolving around axis, shaft or Trainable rotating gates on axes are connected in series to form variable layers, and these variable layers are stacked in multiple layers to form a depth of... A quantum membership estimation circuit; Step A3: The end of the quantum membership estimation circuit performs Pauli-... The range of values obtained from the baseline measurement is: initial expected value To satisfy the membership domain requirement, the initial expected value is... Mapping to the expected value : ; Among them, the expected value of the mapping for Output the membership degree within the range; Step A4: Merge the membership outputs of multiple quantum membership estimation units to form a multi-membership set representation: ; ; In the formula, To optimize the feature representation vector, ; Number of quantum membership estimation units , ; Output membership degree; This is for the transpose operation.
4. The image classification system based on fuzzy inference networks according to claim 1, characterized in that, The fuzzy rule inference module performs the following steps: Step B1: Perform value constraint processing on the initial multi-membership representation until... Within the range, an optimized multi-membership representation is obtained; Step B2: Set the first Rule No. The corresponding feature dimension is the th The trainable parameters of each membership function are Temperature parameters are This yields trainable rule antecedent weights; Step B3: Based on the trainable rule antecedent weights and the initial multi-membership representation, calculate the first... Rule No. Matching values on each feature dimension; Step B4: Aggregate the matching values of each feature dimension using the trigonometric norm in product form to obtain the first... The activation strength of the rule; Step B5: Normalize the activation strength of all rules to obtain the rule inference output.
5. The image classification system based on fuzzy inference networks according to claim 4, characterized in that, The value constraint processing includes mapping using a sigmoid function. ,include: ; In the formula, To represent in terms of natural constants An exponential function with base 0; This is the input scalar of the Sigmoid function; The trainable rule-based antecedent weights include: ; In the formula, The number of membership functions; The matching value include: ; In the formula, For the first The membership function for the th... Features The membership degree output, and ; The activation intensity include: ; In the formula, The number of feature dimensions; Indexed by feature dimensions, ; The rule inference output include: ; In the formula, For rule indexing, , Indicates all Activation strength of the rule The sum of these is used as a normalization factor; The number of rules.
6. The image classification system based on fuzzy inference networks according to claim 1, characterized in that, The quantum deblurring module performs the following steps: Step C1: Expand the rule inference output according to a preset order to obtain an expanded representation. Map the expanded representation to a circuit input sequence with the same number of preset qubits through a linear mapping. include: ; In the formula, This is the expanded representation of the rule inference output; and These are trainable mapping parameters; Step C2: Perform quantum encoding based on the encoding operator. During the quantum encoding process, each component of the circuit input sequence is loaded onto the corresponding qubit to obtain the encoded quantum state. Using a loop The rotating gate of the axis inputs the circuit sequence Each component is loaded onto its corresponding qubit, including: ; In the formula, This represents the tensor product operation. To preset the number of qubits, Input sequence for the circuit The One component; Step C3: Perform entanglement evolution based on a fully connected controlled NOT gate on the encoded quantum state to fuse the multi-bit information and obtain the entangled quantum state. Step C4: Perform Pauli-Z basis measurements on the entangled quantum state to obtain the measurement vector composed of the measurement expectations of each qubit; Step C5: Divide the measurement vector into two parts according to a preset method, perform linear transformations on each part, take the average, and reconstruct a clear value. : ; In the formula, and These represent the two parts of the measurement vector partition; , , and All of these are trainable parameters.
7. The image classification system based on fuzzy inference networks according to claim 1, characterized in that, In the fusion and classification module, the clear value and the optimized feature representation are combined into a fusion representation by splicing. The fused representation is processed using a fully connected neural network to output classification scores for each category, and the category with the highest score is taken as the final image classification result.
8. An image classification method based on fuzzy inference networks, characterized in that, The image classification system based on fuzzy inference networks according to any one of claims 1-7 includes the following steps: Step S1: Select a dataset of image samples for the target image classification task, set training parameters, build a data loading module for the training and testing phases, divide the dataset into training data and testing data, and initialize the image classification model and parameters based on the fuzzy inference network. Step S2: During the training phase, the following steps are executed cyclically: The data loading module outputs image samples and corresponding labels in batches; the image samples are input into the feature extraction module for initial feature representation, and optimized feature representation is output; the optimized feature representation is input into the quantum membership estimation module to obtain an initial multi-membership representation; the initial multi-membership representation is input into the fuzzy rule inference module to obtain a rule inference output; the rule inference output is input into the quantum defuzzification module to generate a sharp value; the sharp value and the optimized feature representation are input into the fusion and classification module to obtain an image classification result; the loss calculation module calculates the loss value based on the image classification result and the true label, and the parameter update module updates the trainable parameters in the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module, and fusion and classification module through backpropagation. Step S3: After each round of training, the data loading module is called to output image samples and corresponding labels from the test data. The image samples are then sequentially input into the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module, and fusion and classification module to obtain the image classification results. Step S4: Determine whether the number of training rounds has reached the preset value. If not, return to step S2; otherwise, end the training and output the trained model. Based on the trained model, input the image to be classified into the feature extraction module, quantum membership estimation module, fuzzy rule inference module, quantum defuzzification module, and fusion and classification module in sequence, and output the corresponding image classification result.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, The memory is communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the image classification method based on fuzzy inference network as described in claim 8.
10. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions for causing the computer to perform the image classification method based on a fuzzy inference network as described in claim 8.