Random Mask Attention Layer for Image Classification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing image classifiers, especially those using self-attention layers, often misclassify images, leading to unsafe device behavior in applications like autonomous vehicles due to suboptimal performance.

Innovation Solution

The method enhances image classification performance by using a second layer with intermediate representations and weight normalization techniques, such as random masking and softmax normalization, to focus on relevant image parts and prevent overfitting, thereby improving classification accuracy and robustness.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If self-attention layers are used for image classification, then processing capability is improved, but classification accuracy deteriorates due to misclassification

Engineering Contradiction:
Improveprocessing capabilityVSAvoidclassification accuracy
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent applies local quality by introducing spatial attention mechanisms that allow different regions of the image to be processed with different levels of attention. The attention map is computed based on spatial relationships between pixels, enabling the model to focus on relevant local regions while downweighting less important areas, thereby improving classification accuracy while maintaining processing capability.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent implements preliminary action through pre-computed attention maps and feature representations that are generated before the final classification decision. The self-attention layer computes attention weights and processed features in advance, which are then used for classification, allowing the model to make more accurate predictions without requiring complex real-time computations during the classification step.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If image classification is performed with high accuracy, then device safety is improved, but computational complexity increases

Engineering Contradiction:
Improvedevice safetyVSAvoidcomputational complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent extracts and separates the attention computation from the main classification pipeline by using pre-computed attention maps and feature representations. This extraction allows the model to achieve high accuracy through sophisticated attention mechanisms while reducing the computational complexity of the main classification process, as the attention-related computations are performed in advance and stored for later use.

Inventive Principle:
Principle #2Taking out (Extraction)

3Reliability

If more image features are processed, then classification performance is improved, but training time increases

Engineering Contradiction:
Improveclassification performanceVSAvoidtraining time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by pre-computing attention maps and feature representations during training, which are then stored and reused during inference. This allows the model to achieve high classification performance by processing multiple image features while reducing training time, as the computationally intensive attention computations are performed once during training and then quickly retrieved during deployment.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentEP3866067A1Device and method for classifying images using a random mask attention layer
Publication Date: 2021.08.18 ROBERT BOSCH GMBH
  • EP3866067A1 patent drawingFigure 1
  • EP3866067A1 patent drawingFigure 2
  • EP3866067A1 patent drawingFigure 3

AI summary

A computer-implemented method for classifying images using an image classifier (107), wherein the image classifier (107) receives an input image (106) and outputs a classification (110), further wherein the classification depends on a second layer output of a second layer of the image classifier (107) comprising second layer output components, wherein computing the output of the second layer comprises the following steps: • Receive a second layer input (X) from a first layer; • Determine a first representation (Q) of the second layer input (X); • Determine a second representation (K) of the second layer input (X); • Determine a third representation (V) of the second layer input (X), wherein the third representation (V) comprises a plurality of third representation components; • Determine a set of weights for each second layer output component based on the first representation (Q) and the second representation (K), wherein each set of weights comprises one weight for each third representation component; • For each set of weights, randomly determine a subset of the corresponding set of weights, set the weights in the subset to a predefined or random value and normalize all other weights such that they sum to a second predefined value; • Determine the second layer output (O) by multiplying each third representation component with its respective weight from the second layer output component's set of weights.