A LED display screen fault detection method and system
Through the convolutional gated recurrent deep learning model and hybrid effect analysis, the problems of low efficiency, insufficient accuracy and weak positioning ability of LED display screen fault detection are solved, and efficient and accurate fault detection and positioning are achieved to adapt to different environmental conditions.
Patent Information
- Application Number
- CN202411500590.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-10-25
AI Technical Summary
Existing LED display screen fault detection technology has low efficiency, insufficient accuracy, weak positioning capabilities, and lacks consideration of environmental factors, resulting in false alarms and missed alarms.
A convolutional gated recurrent deep learning model is used in combination with multiple optimization techniques, including data augmentation, transfer learning, multi-task learning, attention mechanism, and confounding effect analysis, to detect, classify, and locate faults, and evaluate the impact of environmental factors.
It achieves efficient and accurate fault detection and positioning, reduces false alarms and missed alarms, adapts to different environmental conditions, and improves maintenance efficiency and detection accuracy.
Smart Images

Figure CN119478431B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of display technology and artificial intelligence, and specifically relates to a method and system for real-time fault detection and diagnosis of LED display screens using a deep learning model. BACKGROUND
[0002] LED display screens are widely used in advertising, sports venues, traffic indication and other fields due to their high brightness, low power consumption and long service life. However, as the scale of LED display screens continues to expand and the application scenarios become increasingly complex, fault detection and maintenance have become an important technical challenge.
[0003] Currently, fault detection of LED display screens mainly relies on manual inspection or simple hardware monitoring. For example, by regularly observing the display effect to identify faults, or by monitoring driving current and temperature parameters to determine whether there is an anomaly. These methods, although simple and direct, have low efficiency, high false alarm rate and other problems.
[0004] In recent years, with the development of computer vision and deep learning technology, some researchers have attempted to apply image processing and machine learning methods to LED display screen fault detection. For example, some studies have proposed using convolutional neural networks to analyze LED display screen images to identify pixel failure and other faults. This method has improved the automation and accuracy of fault detection to some extent.
[0005] However, existing LED display screen fault detection techniques still have the following problems:
[0006] 1. Low detection efficiency: Existing methods are difficult to achieve real-time, comprehensive monitoring of large-scale LED display screens.
[0007] 2. Insufficient detection accuracy: Difficult to accurately identify and classify various fault types, especially early signs of failure.
[0008] 3. Weak positioning ability: Unable to accurately locate the fault area, increasing the difficulty and time of repair.
[0009] 4. Lack of consideration of environmental factors: The impact of environmental factors and operating parameters on faults is not fully considered, leading to false positives and false negatives. SUMMARY
[0010] In view of this, the present application provides an LED display screen fault detection method and system, which solves the problems of low detection efficiency, insufficient accuracy, weak positioning ability and lack of consideration of environmental factors in the prior art.
[0011] The present application provides an LED display screen fault detection method, comprising:
[0012] acquire a display image of an LED display screen;
[0013] preprocess the display image;
[0014] input the preprocessed display image into a pre-trained convolutional gated recurrent deep learning model to detect whether the LED display screen has a fault;
[0015] if a fault is detected, classify and locate the fault;
[0016] perform a mixed effect analysis to evaluate the influence of environmental factors and operating parameters on the fault.
[0017] The preprocessing of the display image comprises denoising the acquired display image, enhancing the denoised display image, and standardizing the enhanced display image.
[0018] The convolutional gated recurrent deep learning model comprises a convolutional layer group for extracting spatial features of the display image, a gated recurrent unit layer for capturing temporal features, and a fully connected layer for integrating spatial and temporal features; wherein the convolutional layer group comprises a plurality of convolutional blocks, each comprising a 2D convolutional layer, a batch normalization layer, a ReLU activation function layer, and a max-pooling layer, and the 2D convolutional layer uses different sizes of convolutional kernels to extract multi-scale features.
[0019] Before inputting the preprocessed display image into the pre-trained convolutional gated recurrent deep learning model, the method further comprises training the convolutional gated recurrent deep learning model, including: obtaining training data, performing data augmentation on the training data, including random rotation, scaling, brightness and contrast adjustment; using a pre-trained ResNet50 model on an ImageNet dataset as a feature extractor to extract initial features of the LED display image; inputting the extracted initial features into the convolutional gated recurrent deep learning model while optimizing three sub-tasks of fault detection, classification and location.
[0020] The method further comprises adding L1 and L2 regularization terms in the loss function to suppress the complexity of the convolutional gated recurrent deep learning model; using a ReLU6 activation function to limit the activation value within the range of [0, 6] to achieve sparse activation; using an initial module inception to apply 1x1, 3x3 and 5x5 convolutional kernels in parallel to achieve multi-scale feature extraction; introducing an attention mechanism to dynamically adjust the importance of different scale features according to the input to achieve dynamic weight adjustment.
[0021] The classifying and locating the faults comprises: classifying the detected faults, including at least one or a combination of pixel point failure, color anomaly, brightness unevenness, flicker, image tearing and module failure; accurately locating the position and range of the fault area by using attention mechanism and heat map technology; quantitatively evaluating the severity of the fault based on the fault type, area and duration; dynamically adjusting the sensitivity and threshold of fault detection based on the fault detection result.
[0022] The confounding effect analysis comprises: performing variable confounding detection to analyze the confounding relationship between environmental factors and operation parameters and fault occurrence; using causal inference technology to distinguish and quantify the influence of observable variables and potential unobservable variables on the fault; calculating the relative strength of confounding bias between different variable sets to identify key influencing factors; optimizing the operation environment and parameter settings of the LED display screen based on the confounding effect analysis result; wherein the variable confounding detection comprises calculating the Pearson correlation coefficient matrix between variables, calculating the variance inflation factor for each independent variable, and performing partial correlation analysis to identify direct and indirect relationships.
[0023] The distinguishing and quantifying the influence of observable variables and potential unobservable variables on the fault is achieved by using structural equation modeling, comprising: constructing a structural equation model specification containing latent variables, defining the relationship between observed variables and latent variables; estimating the structural equation model parameters using maximum likelihood estimation method; evaluating the structural equation model fitting degree, including chi-square test, comparison fitting index CFI and root mean square error approximation RMSEA; analyzing path coefficients and effect size to quantify the influence of observed variables and latent variables on the fault; the calculation of the relative strength of confounding bias between different variable sets is achieved by using partial R-square analysis, comprising: constructing a complete linear regression model containing all predictor variables; calculating the R-square value of the complete linear regression model; removing each predictor variable one by one to construct a reduced model; calculating the R-square value of each reduced model; calculating the partial R-square value of each predictor variable, including the difference between the complete model R-square and the corresponding reduced model R-square; comparing the partial R-square values of different predictor variables to determine the unique contribution of each variable to the fault frequency.
[0024] The method further comprises: using LSHADE algorithm with restart and local search mechanism to optimize model hyperparameters and system configuration, the specific steps comprising: initializing population and algorithm parameters; evaluating the objective function value for each individual; applying differential evolution operation to generate trial vectors; adaptively adjusting the scaling factor and crossover probability according to the success rate history; performing local search to improve the current optimal solution; updating the population and archive; checking the restart condition and reinitializing the population if necessary; repeating the above steps until the termination condition is reached.
[0025] The embodiment of the application further provides an LED display screen fault detection system, comprising:
[0026] A collection module is configured to collect a display image of the LED display screen.
[0027] A preprocessing module is configured to pre-process the display image.
[0028] A detection module is configured to input the pre-processed display image into a pre-trained convolution gate recurrent deep learning model to detect whether the LED display screen has a fault.
[0029] A classification and positioning module is configured to classify and position the fault if the fault is detected.
[0030] An analysis module is configured to perform a mixed effect analysis to evaluate the influence of environmental factors and operation parameters on the fault.
[0031] The embodiment of the application further provides a computer device, comprising:
[0032] at least one processor; and
[0033] a memory connected to the at least one processor in communication; wherein
[0034] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the LED display screen fault detection method.
[0035] The embodiment of the application further provides a computer readable storage medium storing computer instructions for causing a computer to perform the LED display screen fault detection method.
[0036] The embodiment of the application further provides a computer program product comprising computer instructions for implementing the steps of the LED display screen fault detection method when executed by a processor.
[0037] The application has the following technical effects:
[0038] The application realizes efficient and accurate detection of LED display screen faults by adopting a convolution gate recurrent deep learning model combined with various optimization techniques. The model can capture both spatial and temporal features of the image, greatly improving the accuracy and real-time performance of fault detection.
[0039] The application introduces a mixed effect analysis, which deeply analyzes the influence of environmental factors and operating parameters on faults through variable mixing detection, causal inference and bias strength evaluation. This innovation makes fault diagnosis more comprehensive and accurate, which helps to reduce false positives and false negatives.
[0040] The application adopts attention mechanism and heat map technology to realize accurate positioning of faults, greatly improving maintenance efficiency. At the same time, by dynamically adjusting the detection sensitivity and threshold, the method can adapt to different operating environments and conditions, and maintain long-term detection performance. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0042] Figure 1 A flowchart of the LED display screen fault detection method provided by the embodiment of the present application is provided.
[0043] Figure 2 A structural schematic diagram of the convolution gate recurrent deep learning model provided by the embodiment of the present application is provided.
[0044] Figure 3 A flowchart of the mixed effect analysis provided by the embodiment of the present application is provided.
[0045] Figure 4 An LED display screen fault detection heat map provided by the embodiment of the present application is provided. DETAILED DESCRIPTION
[0046] Embodiment 1
[0047] The embodiments of the present disclosure will be described in detail below with reference to the drawings.
[0048] Embodiment 1
[0049] The core of the present application is to provide an efficient and accurate LED display screen fault detection method and system. The present application will be further described in detail below with reference to the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0050] Please refer to Figure 1 which shows a flowchart of the LED display screen fault detection method provided by the embodiment of the present application. The method comprises the following steps:
[0051] S1: Collect the display image of the LED display screen.
[0052] The system uses a high-resolution camera to capture the display image of the LED display in real time. The resolution and frame rate of the camera should be high enough to capture subtle changes on the LED display. For example, a 4K resolution (3840x2160 pixels) and 60 frames per second camera can be used. To cover the entire LED display, multiple cameras are needed to work together to form a camera array.
[0053] S2: Preprocess the display image.
[0054] This step includes the following sub-steps:
[0055] S2.1: Denoising the captured display image.
[0056] Denoising aims to reduce random noise in the image and improve image quality. This embodiment uses the Non-Local Means (NLM) denoising algorithm. The basic idea of the NLM algorithm is to use the redundant information in the image to find similar blocks in the search window for denoising. The specific implementation is as follows:
[0057] ```python
[0058] import cv2
[0059] import numpy as np
[0060] def nlm_denoising(image, h=10, templateWindowSize=7, searchWindowSize=21):
[0061] return cv2.fastNlMeansDenoisingColored(image, None, h, h, templateWindowSize, searchWindowSize)
[0062] # Usage example
[0063] denoised_image = nlm_denoising(original_image)
[0064] ```
[0065] Where h is the filter strength, templateWindowSize is the template window size, and searchWindowSize is the search window size. These parameters can be adjusted according to the specific image characteristics and noise level.
[0066] S2.2: Perform enhancement processing on the denoised display image.
[0067] The purpose of image enhancement is to improve the contrast and clarity of the image, making the fault features more obvious. This embodiment uses the Adaptive Histogram Equalization (AHE) algorithm for image enhancement. The advantage of AHE algorithm is that it can locally improve the contrast of the image, avoiding the problem of over-enhancement caused by global histogram equalization. The specific implementation is as follows:
[0068] ```python
[0069] import cv2
[0070] def enhance_image(image):
[0071] lab = cv2.cvtColor(image, cv2.COLOR_BGR2LAB)
[0072] l, a, b = cv2.split(lab)
[0073] clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8, 8))
[0074] cl = clahe.apply(l)
[0075] limg = cv2.merge((cl, a, b))
[0076] enhanced = cv2.cvtColor(limg, cv2.COLOR_LAB2BGR)
[0077] return enhanced
[0078] # Usage example
[0079] enhanced_image = enhance_image(denoised_image)
[0080] ```
[0081] In this implementation, the present embodiment first converts the image from the BGR color space to the LAB color space, and then applies the CLAHE (Contrast Limited Adaptive Histogram Equalization) algorithm only to the L channel (luminance channel). This avoids changing the color information of the image and only enhances the luminance contrast.
[0082] S2.3: Perform normalization processing on the enhanced display image.
[0083] The purpose of normalization is to scale the image pixel values to a fixed range, usually [0, 1] or [-1, 1]. This helps improve the training efficiency and generalization ability of deep learning models. This embodiment uses the MinMax normalization method, which is specifically implemented as follows:
[0084] ```Python
[0085] def normalize_image(image):
[0086] normalized=(image-np.min(image)) / (np.max(image)-np.min(image))
[0087] return normalized
[0088] #Example
[0089] normalized_image=normalize_image(enhanced_image)
[0090] ```
[0091] Through the above preprocessing steps, the embodiment of the present application obtains a denoised, enhanced and standardized LED display screen image, providing high-quality input data for subsequent fault detection.
[0092] S3: Input the preprocessed display image into the pre-trained convolutional gated recurrent deep learning model to detect whether there is a fault in the LED display.
[0093] Please refer to Figure 2 , which shows a schematic diagram of the structure of the convolutional gated recurrent deep learning model (CGRDLM) provided by an embodiment of the present invention. This model combines a convolutional neural network (CNN) and a gated recurrent unit (GRU) to simultaneously capture the spatial and temporal features of an image. The specific structure and training process of the model are as follows:
[0094] S3.1: Model structure
[0095] The CGRDLM model includes the following main components:
[0096] 1. Convolutional layer group:
[0097] Contains multiple convolutional blocks, each consisting of a 2D convolutional layer, a batch normalization layer, a ReLU activation function layer, and a max pooling layer.
[0098] The 2D convolutional layer uses different sizes of convolutional kernels (such as 3x3, 5x5, 7x7) to extract multi-scale features.
[0099] The batch normalization layer is used to accelerate the training process and improve model stability.
[0100] The ReLU activation function introduces nonlinearity and enhances the model's expression ability.
[0101] The max pooling layer is used to reduce the size of the feature map and extract significant features.
[0102] 2. Gated recurrent unit (GRU) layer:
[0103] Used to capture temporal features and handle the relationship between consecutive frames.
[0104] Includes update gate and reset gate to control the flow and forgetting of information.
[0105] 3. Fully connected layer:
[0106] Integrates spatial and temporal features for final fault detection and classification.
[0107] 4. Output layer:
[0108] Uses the Softmax activation function to output the probability distribution of various fault types.
[0109] 5. Low-entropy design:
[0110] L1 / L2 regularization: Add L1 and L2 regularization terms to the loss function to suppress model complexity.
[0111] For example: loss = cross_entropy + λ1 * L1_norm + λ2 * L2_norm
[0112] Where λ1 and λ2 are adjustable hyperparameters.
[0113] Sparse activation: Use ReLU6 activation function after the convolutional layer to limit the range of activation values to [0, 6].
[0114] ReLU6(x) = min(max(0, x), 6)
[0115] 6. Heterogeneous spectrum dynamics:
[0116] Multi-scale convolution: Use Inception modules to apply different size convolution kernels in parallel.
[0117] For example:
[0118] 1x1 convolution: Capture point-level features
[0119] 3x3 convolution: Capture local features
[0120] 5x5 convolution: Capture larger range of features
[0121] Dynamic weight adjustment: Introduce attention mechanism to dynamically adjust the importance of different scale features according to input.
[0122] attention_weights = softmax(FC(concat([1x1_conv, 3x3_conv, 5x5_conv])))
[0123] output = attention_weights[0] * 1x1_conv + attention_weights[1] * 3x3_conv + attention_weights[2] * 5x5_conv
[0124] Python code implementation example of the model as follows:
[0125] ```python
[0126] import tensorflow as tf from tensorflow.keras import layers,models
[0127] def create_cgrdlm_model(input_shape,num_classes):
[0128] inputs = layers.Input(shape=input_shape)
[0129] # Convolutional layer group
[0130] x = layers.Conv2D(32, (3, 3), activation='relu', padding='same')(inputs) x = layers.BatchNormalization()(x)
[0131] x = layers.MaxPooling2D((2, 2))(x)
[0132] x = layers.Conv2D(64, (3, 3), activation='relu', padding='same')(x) x = layers.BatchNormalization()(x)
[0133] x = layers.MaxPooling2D((2, 2))(x)
[0134] x = layers.Conv2D(128, (3, 3), activation='relu', padding='same')(x) x = layers.BatchNormalization()(x)
[0135] x = layers.MaxPooling2D((2, 2))(x)
[0136] # Reshape the convolutional output to fit the GRU layer
[0137] x = layers.Reshape((-1, x.shape[-1]))(x)
[0138] # GRU layer
[0139] x = layers.GRU(256, return_sequences=True)(x)
[0140] x = layers.GRU(128)(x)
[0141] # Fully connected layer
[0142] x = layers.Dense(128, activation='relu')(x)
[0143] x = layers.Dropout(0.5)(x)
[0144] # Output layer
[0145] outputs = layers.Dense(num_classes, activation='softmax')(x)
[0146] model = models.Model(inputs=inputs, outputs=outputs)
[0147] return model
[0148] # Using example
[0149] input_shape = (224, 224, 3) # Assuming input image size is 224x224 with 3 color channels num_classes = 6 # Assuming there are 6 types of faults
[0150] model = create_cgrdlm_model(input_shape, num_classes)
[0151] ```
[0152] S3.2: Model training
[0153] The model training process includes the following steps:
[0154] 1. Data augmentation:
[0155] Use various image transformation techniques to expand the training dataset and improve the model's generalization ability. The specific implementation is as follows:
[0156] ```python
[0157] from tensorflow.keras.preprocessing.image import ImageDataGenerator def create_data_generator():
[0158] return ImageDataGenerator(
[0159] rotation_range = 20,
[0160] width_shift_range = 0.2,
[0161] height_shift_range = 0.2,
[0162] shear_range = 0.2,
[0163] zoom_range = 0.2,
[0164] horizontal_flip = True,
[0165] fill_mode = 'nearest' )
[0167] # Using example
[0168] train_datagen = create_data_generator()
[0169] train_generator = train_datagen.flow(x_train, y_train, batch_size=32)
[0170] ```
[0171] 2. Transfer Learning:
[0172] Use a pre-trained ResNet50 model on the ImageNet dataset for feature extraction to speed up model convergence.
[0173] Implementation details:
[0174] ```python
[0175] from tensorflow.keras.applications import ResNet50
[0176] from tensorflow.keras.models import Model
[0177] def create_feature_extractor(input_shape):
[0178] base_model = ResNet50(weights='imagenet', include_top=False, input_shape=input_shape)
[0179] for layer in base_model.layers:
[0180] layer.trainable = False
[0181] return base_model
[0182] # Usage example
[0183] feature_extractor = create_feature_extractor(input_shape)
[0184] features = feature_extractor.predict(normalized_image) ```
[0185] ```
[0186] 3. Multi-task learning:
[0187] Simultaneously optimize fault detection, classification, and localization subtasks to improve the overall performance of the model. The implementation is as follows:
[0188] ```python
[0189] def multi_task_loss(y_true, y_pred):
[0190] detection_loss = tf.keras.losses.binary_crossentropy(y_true[0], y_pred[0])
[0191] classification_loss = tf.keras.losses.categorical_crossentropy(y_true[1], y_pred[1])
[0192] localization_loss = tf.keras.losses.mean_squared_error(y_true[2], y_pred[2])
[0193] return detection_loss + classification_loss + localization_loss
[0194] # Usage example
[0195] model.compile(optimizer='adam', loss=multi_task_loss, metrics=['accuracy'])
[0196] ```
[0197] Exemplarily, data augmentation includes:
[0198] Random rotation: Randomly rotate the image within the range of [-10°, 10°].
[0199] Random scaling: Randomly scale the image within the range of [0.9, 1.1].
[0200] Random brightness and contrast adjustment: Simulate different lighting conditions.
[0201] Add Gaussian noise: Enhance the model's robustness to noise.
[0202] In addition, in transfer learning, the first few layers of ResNet50 are frozen, and only the latter layers are fine-tuned.
[0203] For example:
[0204] ```python
[0205] base_model = ResNet50(weights='imagenet', include_top=False)
[0206] for layer in base_model.layers[:100]:
[0207] layer.trainable = False
[0208] x = base_model.output
[0209] x = GlobalAveragePooling2D()(x)
[0210] x = Dense(1024, activation='relu')(x)
[0211] output = Dense(num_classes, activation='softmax')(x)
[0212] model = Model(inputs=base_model.input, outputs=output)
[0213] ```
[0214] Exemplarily, multi-task learning needs to optimize three related tasks at the same time:
[0215] 1. Fault detection (binary classification): judge whether there is a fault.
[0216] 2. Fault classification (multi-classification): identify the specific fault type.
[0217] 3. Fault location (regression): predict the coordinates and size of the fault area.
[0218] Loss function design:
[0219] ```python
[0220] total_loss = w1 * binary_crossentropy(y_true_detection, y_pred_detection) + w2 * categorical_crossentropy(y_true_classification, y_pred_classification) + w3 * mean_squared_error(y_true_localization, y_pred_localization)
[0221]
[0222]
[0223] ```
[0224] where w1, w2, w3 are the weights of each task, which can be tuned by the validation set.
[0225] Training strategy:
[0226] Adam optimizer is used, with an initial learning rate of 0.001.
[0227] Learning rate decay strategy is used, reducing by 10% every 10 epochs.
[0228] Early stopping strategy is applied, stopping training when the validation set loss does not improve for 5 consecutive epochs.
[0229] Mini-batch gradient descent with a batch size of 32 is used.
[0230] 4. Low entropy design:
[0231] By introducing regularization techniques and sparse activation functions, the information entropy of the model is reduced, improving the generalization ability and robustness of the model.
[0232] Low entropy design is a method aimed at improving the generalization ability and robustness of the model. In information theory, entropy is a measure of uncertainty in a system. In deep learning, low entropy design means reducing the complexity of the model through various technical means to reduce the risk of overfitting, thereby improving the performance of the model on unseen data.
[0233] In this invention, low entropy design is mainly achieved in the following two ways:
[0234] a) Regularization techniques:
[0235] Regularization is a method to limit the complexity of the model by adding a penalty term to the loss function. This invention uses a combination of L1 and L2 regularization, also known as elastic net regularization.
[0236] L1 regularization (Lasso) adds an absolute value penalty term, which tends to produce sparse solutions, i.e., some feature weights become zero. This helps with feature selection, removing unimportant features.
[0237] L2 regularization (Ridge) adds a squared penalty term, which tends to make all feature weights small but non-zero. This helps with multicollinearity problems.
[0238] By combining these two regularization methods, the embodiments of the present application can strike a balance between feature selection and weight decay, effectively reducing model complexity.
[0239] For example, when detecting color abnormalities in LED displays, L1 regularization may reduce some less important color channel weights to zero, while L2 regularization will smoothly reduce all color channel weights. This combination can help the model focus on the most critical color features while maintaining sensitivity to all color information.
[0240] b) Sparse activation function:
[0241] The present application adopts ReLU6 (Rectified Linear Unit 6) as the activation function. The definition of ReLU6 is as follows:
[0242] f(x) = min(max(0, x), 6)
[0243] ReLU6 limits the activation value to the range [0, 6], which has several advantages:
[0244] 1. Sparsity: Negative inputs produce zero outputs, leading to sparse network activations, which helps reduce overfitting.
[0245] 2. Nonlinearity: Retains the nonlinearity of ReLU, allowing the model to learn complex nonlinear relationships.
[0246] 3. Boundedness: The upper limit of 6 prevents activation values from becoming too large, helping numerical stability.
[0247] In LED display fault detection, ReLU6 can help the model better handle brightness information. For example, when detecting brightness unevenness, ReLU6 can effectively capture subtle changes in brightness while preventing extremely high brightness values from having a large impact on the model.
[0248] The specific implementation is as follows:
[0249] ```python
[0250] from tensorflow.keras import regularizers
[0251] def add_regularization(model,weight_decay=1e-4):
[0252] for layer in model.layers:
[0253] if isinstance(layer,tf.keras.layers.Conv2D)or isinstance(layer,tf.keras.layers.Dense):
[0254] layer.add_loss(lambda:
[0255] tf.keras.regularizers.l2(weight_decay)(layer.kernel))
[0256] if hasattr(layer,'bias_regularizer')and layer.use_bias:
[0257] layer.add_loss(lambda:
[0258] tf.keras.regularizers.l2(weight_decay)(layer.bias))
[0259] return model
[0260] def relu6(x):
[0261] return tf.keras.backend.relu(x,max_value=6)
[0262] #Usage Example
[0263] model=add_regularization(model)
[0264] model.add(tf.keras.layers.Activation(relu6))
[0265] ```
[0266] 5. Heterogeneous spectrum dynamics:
[0267] The use of multi-scale convolution kernels and dynamic weight adjustment mechanism enables the model to capture fault characteristics of different frequencies and scales.
[0268] Heterogeneous spectral dynamics is a technique designed to capture fault features at different frequencies and scales. In LED display fault detection, different types of faults can manifest at different spatial scales and temporal frequencies. For example, a single pixel fault can be a small-scale high-frequency feature, while a whole module fault can be a large-scale low-frequency feature.
[0269] The invention implements heterogeneous spectral dynamics in two ways:
[0270] a) Multi-scale convolution kernels:
[0271] The idea of the initial Inception module is adopted, using different sizes of convolution kernels (such as 1x1, 3x3, 5x5) in parallel. This allows the model to extract features at different receptive field sizes simultaneously.
[0272] For example, in detecting LED display faults:
[0273] 1x1 convolution can capture single pixel-level faults, such as dead pixels.
[0274] 3x3 convolution can detect small-range fault patterns, such as dark or bright areas composed of a few pixels.
[0275] 5x5 convolution can identify larger-scale faults, such as abnormal rows or columns of LEDs.
[0276] By combining these features at different scales, the model can comprehensively understand the state of the LED display, from micro to macro levels, for fault detection.
[0277] b) Dynamic weight adjustment mechanism:
[0278] An attention mechanism is introduced to dynamically adjust the importance of features at different scales based on input. This allows the model to adaptively focus on the most relevant feature scales.
[0279] In practical applications, the working principle of dynamic weight adjustment is as follows:
[0280] 1. Calculate a global average pooling value for the convolution output of each scale to obtain global features for each scale.
[0281] 2. Concatenate these global features together and calculate the weight of each scale through a small neural network (usually a fully connected layer plus a softmax activation).
[0282] 3. Use these weights to weight the sum of features at different scales to obtain the final feature representation.
[0283] For example, when a large area of brightness anomaly is detected, the model may automatically increase the weight of the 5x5 convolution kernel to better capture this large-scale fault. When encountering subtle color deviations, the model may increase the weight of the 1x1 and 3x3 convolution kernels to capture finer color changes.
[0284] Through this dynamic adjustment mechanism, the model can adaptively adjust its receptive field according to different types of LED display faults, thereby improving the accuracy and flexibility of fault detection.
[0285] This heterogeneous spectral dynamics design enables the model in this application embodiment to simultaneously process fault signatures of different scales and frequencies, significantly improving the comprehensiveness and accuracy of LED display screen fault detection. Whether it's a minor single-point fault or a large-scale systemic problem, it can be effectively captured and identified.
[0286] The specific implementation is as follows:
[0287] ```Python
[0288] def inception_module(x,filters):
[0289] #1x1 convolution
[0290] conv1x1=tf.keras.layers.Conv2D(filters,(1,1),padding='same',activation='relu')(x)
[0291] #3x3 convolution
[0292] conv3x3=tf.keras.layers.Conv2D(filters,(3,3),padding='same',activation='relu')(x)
[0293] #5x5 convolution
[0294] conv5x5=tf.keras.layers.Conv2D(filters,(5,5),padding='same',activation='relu')(x)
[0295] #Attention Mechanism
[0296] concat=tf.keras.layers.Concatenate()([conv1x1,conv3x3,conv5x5])
[0297] attention = tf.keras.layers.Dense(3, activation='softmax')(tf.keras.layers.GlobalAveragePooling2D()(concat))
[0298] # Dynamic weight adjustment
[0299] output = tf.keras.layers.Add()([
[0300] tf.keras.layers.Multiply()([conv1x1, tf.keras.layers.Reshape((1, 1, 1))(attention[:, 0])]),
[0301] tf.keras.layers.Multiply()([conv3x3, tf.keras.layers.Reshape((1, 1, 1))(attention[:, 1])]),
[0302] tf.keras.layers.Multiply()([conv5x5, tf.keras.layers.Reshape((1, 1, 1))(attention[:, 2])]) ])
[0304] return output
[0305] # Usage example
[0306] x = inception_module(input_layer, 64)
[0307] ```
[0308] Through the above training strategy, the application embodiment can obtain an efficient and accurate convolution gating recurrent deep learning model for LED display screen fault detection.
[0309] S4: If a fault is detected, classify and locate the fault.
[0310] This step includes the following sub-steps:
[0311] S4.1: Fault classification
[0312] The detected fault is classified, including pixel point failure, color abnormality, brightness unevenness, flicker, image tearing, and module failure, etc. The specific implementation is as follows:
[0313] ```Python
[0314] def classify_fault(model_output):
[0315] fault_types = ['Pixel Failure', 'Abnormal Color', 'Uneven Brightness', 'Flickering', 'Image Tearing', 'Module Failure']
[0316] predicted_class=np.argmax(model_output)
[0317] confidence=model_output[predicted_class]
[0318] return fault_types[predicted_class],confidence
[0319] #Example
[0320] fault_type,confidence=classify_fault(model.predict(preprocessed_image))
[0321] ```
[0322] S4.2: Fault location
[0323] Using attention mechanism and heat map technology, the location and scope of the fault area are accurately located. The specific implementation is as follows:
[0324] ```Python
[0325] import tensorflow as tf
[0326] import cv2
[0327] import numpy as np
[0328] def generate_heatmap(model,img_array,last_conv_layer_name):
[0329] #Create a model that only outputs the last convolutional layer
[0330] grad_model=tf.keras.models.Model(
[0331] [model.inputs], [model.get_layer(last_conv_layer_name).output, model.output] )
[0333] # Calculate gradients
[0334] with tf.GradientTape() as tape:
[0335] conv_output, predictions = grad_model(img_array)
[0336] loss = predictions[:, np.argmax(predictions[0])]
[0337] # Extract relevant conv. output
[0338] output = conv_output[0]
[0339] grads = tape.gradient(loss, conv_output)[0]
[0340] # Global average pooling
[0341] weights = tf.reduce_mean(grads, axis=(0, 1))
[0342] # Generate class activation map
[0343] cam = np.dot(output, weights)
[0344] cam = cv2.resize(cam, (img_array.shape[1], img_array.shape[2]))
[0345] cam = np.maximum(cam, 0) / np.max(cam)
[0346] return cam
[0347] # Usage example
[0348] heatmap = generate_heatmap(model, preprocessed_image, 'last_conv_layer_name')
[0349] # Overlay heatmap on original image
[0350] def overlay_heatmap(image,heatmap,alpha=0.4):
[0351] heatmap=np.uint8(255*heatmap)
[0352] heatmap=cv2.applyColorMap(heatmap,cv2.COLORMAP_JET)
[0353] superimposed_img=heatmap*alpha+image
[0354] return superimposed_img
[0355] overlay=overlay_heatmap(original_image,heatmap)
[0356] ```
[0357] In this implementation, the Grad-CAM (Gradient-weighted Class Activation Mapping) technique is used by the embodiments of the present application to generate heat maps, as shown in Figure 4 This method can highlight the most important image regions for model decision-making, helping the embodiments of the present application to accurately locate fault areas.
[0358] S4.3: Fault Severity Assessment
[0359] Based on the fault type, area and duration, the severity of the fault is quantitatively evaluated. The implementation is as follows:
[0360] ```python
[0361] def assess_fault_severity(fault_type,fault_area,duration):
[0362] # Define the base weight of each fault type
[0363] type_weights={
[0364] 'pixel failure':0.5,
[0365] 'color anomaly':0.6,
[0366] 'brightness unevenness':0.7,
[0367] 'flickering': 0.8,
[0368] 'picture tearing': 0.9,
[0369] 'module failure': 1.0
[0370] }
[0371] # Calculate area factor (assuming total area is 1)
[0372] area_factor = min(fault_area, 1)
[0373] # Calculate duration factor (assuming maximum duration is 24 hours)
[0374] time_factor = min(duration / 24, 1)
[0375] # Calculate overall severity
[0376] severity = type_weights[fault_type] * area_factor * (1 + time_factor)
[0377] return min(severity, 1) # Limit severity to 0-1
[0378] # Usage example
[0379] severity = assess_fault_severity(fault_type, 0.1, 2) # Assume fault area is 10% and duration is 2 hours
[0380] ```
[0381] This assessment function takes into account the inherent severity of the fault type, the area affected by the fault, and the duration of the fault, resulting in a severity score between 0 and 1.
[0382] S4.4: Dynamic Adjustment of Detection Sensitivity and Thresholds
[0383] Based on the results of fault detection, dynamically adjust the sensitivity and thresholds of fault detection. Implementation as follows:
[0384] ```python
[0385] class DynamicThresholdAdjuster:
[0386] def __init__(self, initial_threshold=0.5, adjust_rate=0.05):
[0387] self.threshold = initial_threshold
[0388] self.adjust_rate = adjust_rate
[0389] self.false_positive_count = 0
[0390] self.false_negative_count = 0
[0391] def adjust_threshold(self, prediction, ground_truth):
[0392] if prediction > self.threshold and ground_truth == 0:
[0393] # False positive
[0394] self.false_positive_count += 1
[0395] self.threshold += self.adjust_rate
[0396] elif prediction <= self.threshold and ground_truth == 1:
[0397] # False negative
[0398] self.false_negative_count += 1
[0399] self.threshold -= self.adjust_rate
[0400] # Ensure threshold is between 0-1
[0401] self.threshold = max(0, min(1, self.threshold))
[0402] def get_threshold(self):
[0403] return self.threshold
[0404] # Usage example
[0405] adjuster = DynamicThresholdAdjuster()
[0406] # Call after each prediction
[0407] adjuster.adjust_threshold(model_prediction, true_label)
[0408] current_threshold = adjuster.get_threshold()
[0409] ```
[0410] This dynamic threshold adjuster can adaptively adjust the detection threshold based on the model's prediction results and the true labels. If there are more false positives, the threshold will be raised; if there are more false negatives, the threshold will be lowered. This way, better detection performance can be maintained under different operating environments and conditions.
[0411] S5: Perform a confounding effect analysis to assess the impact of environmental factors and operating parameters on the faults.
[0412] Please refer to Figure 3 , which shows the confounding effect analysis flowchart provided by the embodiments of the present application. The analysis includes the following steps:
[0413] S5.1: Variable confounding detection
[0414] The purpose of variable confounding detection is to analyze the complex relationship between environmental factors (such as temperature, humidity, and light) and operating parameters (such as brightness settings and refresh rate) and the occurrence of faults. This step is crucial for understanding and controlling the root causes of LED display screen faults. The embodiments of the present application use three main methods for variable confounding detection:
[0415] a) Correlation analysis:
[0416] Calculate the Pearson correlation coefficient matrix between all variables. This provides a preliminary understanding of the linear relationship between variables. For example, the embodiments of the present application may find that there is a strong positive correlation between environmental temperature and fault occurrence frequency, while there may be a weak correlation between display screen brightness settings and fault frequency.
[0417] b) Variance Inflation Factor (VIF) analysis:
[0418] VIF is used to detect multicollinearity problems. Calculate VIF for each independent variable, if the VIF value is greater than 5 or 10 (depending on specific standards), it is considered that the variable may have serious multicollinearity with other variables. For example, the embodiments of the present application may find that the VIF value of the ambient temperature and humidity is very high, indicating that there may be a strong correlation between the two variables, which needs special attention in subsequent analysis.
[0419] c) Partial correlation analysis:
[0420] Calculate the partial correlation coefficient of each pair of variables, controlling the influence of other variables. This helps to identify direct and indirect relationships. For example, the embodiments of the present application may find that the correlation between humidity and failure frequency is greatly reduced after controlling temperature, which implies that temperature may be an important intermediate variable.
[0421] Through the comprehensive application of the three methods, the embodiments of the present application can comprehensively understand the complex relationship between variables, and lay a foundation for subsequent causal inference and confounding effect quantification.
[0422] Exemplarily, analyze the confounding relationship between environmental factors (such as temperature, humidity, light) and operating parameters (such as brightness setting, refresh rate) and failure occurrence. The implementation is as follows:
[0423] ```python
[0424] import pandas as pd
[0425] import numpy as np
[0426] from statsmodels.stats.outliers_influence import variance_inflation_factor
[0427] def detect_multicollinearity(X):
[0428] vif_data=pd.DataFrame()
[0429] vif_data["Variable"]=X.columns
[0430] vif_data["VIF"]=[variance_inflation_factor(X.values,i)for iin range(X.shape[1])]
[0431] return vif_data
[0432] def partial_correlation(X,y):
[0433] corr_matrix=np.corrcoef(X.T)
[0434] inv_corr_matrix=np.linalg.inv(corr_matrix)
[0435] partial_corr=-inv_corr_matrix / np.sqrt(np.outer(np.diag(inv_corr_matrix),np.diag(inv_corr_matrix)))
[0436] np.fill_diagonal(partial_corr,1)
[0437] return pd.DataFrame(partial_corr,columns=X.columns,index=X.columns)
[0438] #使用示例
[0439] X=pd.DataFrame({
[0440] 'temperature':temp_data,
[0441] 'humidity':humidity_data,
[0442] 'brightness':brightness_data,
[0443] 'refresh_rate':refresh_rate_data
[0444] })
[0445] y=fault_frequency_data
[0446] vif_results=detect_multicollinearity(X)
[0447] partial_corr_results=partial_correlation(X,y)
[0448] ```
[0449] This implementation includes two main parts: multicollinearity detection (using Variance Inflation Factor, VIF) and partial correlation analysis. VIF greater than 5 is generally considered as significant multicollinearity, while partial correlation analysis can help the embodiments of the present application understand the relationship between each pair of variables while controlling for other variables.
[0450] S5.2: Causal Inference
[0451] Using causal inference techniques, the embodiments of the present application aim to distinguish and quantify the impact of observable and latent unobservable variables on failures. This step employs Structural Equation Modeling (SEM) to achieve this goal:
[0452] a) Model Building:
[0453] A structural equation model containing latent variables is built. For example, the embodiments of the present application might define two latent variables: "environmental factors" (composed of temperature, humidity, light) and "operational factors" (composed of brightness setting, refresh rate). Then, the embodiments of the present application assume that these two latent variables jointly affect failure frequency.
[0454] b) Parameter Estimation:
[0455] Model parameters are estimated using maximum likelihood estimation methods. This includes path coefficients from latent variables to observed variables, as well as relationship coefficients between latent variables.
[0456] c) Model Evaluation:
[0457] Model fit is evaluated, including indicators such as chi-square test, comparative fit index (CFI), and root mean square error approximation (RMSEA). These indicators help the embodiments of the present application determine whether the model explains the observed data well.
[0458] d) Path Analysis:
[0459] Path coefficients and effect sizes are analyzed to quantify the direct and indirect effects of observed and latent variables on failures. For example, the embodiments of the present application might find that "environmental factors" have a greater total effect on failure frequency than "operational factors," but "operational factors" have a greater direct effect.
[0460] Through SEM analysis, the embodiments of the present application can reveal complex causal networks and understand the mechanisms by which different factors affect LED display screen failures.
[0461] Exemplarily, using causal inference techniques, the embodiments of the present application distinguish and quantify the impact of observable and latent unobservable variables on failures. The embodiments of the present application use Structural Equation Modeling (SEM) to achieve this goal:
[0462] ```python
[0463] from semopy import Model
[0464] def causal_inference_sem(data):
[0465] model_spec="""
[0466] # Latent variables
[0467] EnvironmentalFactor=~temperature+humidity+illumination
[0468] OperationalFactor=~brightness+refresh_rate
[0469] #Structural model
[0470] FaultFrequency~EnvironmentalFactor+OperationalFactor
[0471] #Residual correlation (unobserved confounding)
[0472] temperature~~brightness
[0473] """
[0474] model = Model(model_spec)
[0475] model.fit(data)
[0476] results = model.inspect()
[0477] return results
[0478] #Example
[0479] sem_results=causal_inference_sem(collected_data)
[0480] ```
[0481] This SEM model defines two latent variables (environmental factors and operational factors) and assumes that they jointly affect the fault frequency. By analyzing the model parameters and fit, the embodiment of the present application can quantify the impact of the observed variables and latent variables on the fault.
[0482] S5.3: Assessment of strength of confounding bias
[0483] The relative strength of confounding bias between different sets of variables is calculated, identifying key influencing factors. This step is achieved using partial R-squared analysis:
[0484] a) Full model construction:
[0485] A complete linear regression model containing all predictor variables is constructed, and its R-squared value is calculated. This represents the degree to which all variables collectively explain the variation in the failure.
[0486] b) Variable removal:
[0487] Each predictor variable is removed one by one, and reduced models are constructed. The R-squared value of each reduced model is calculated.
[0488] c) Partial R-squared calculation:
[0489] The partial R-squared value of each predictor variable is calculated, which is the difference between the full model R-squared and the corresponding reduced model R-squared. This represents the unique contribution of each variable.
[0490] d) Contribution comparison:
[0491] The partial R-squared values of different predictor variables are compared to determine the unique contribution of each variable to the frequency of failure occurrence. For example, the example embodiment of the present application may find that the partial R-squared value of the ambient temperature is the highest, indicating that it is the single most critical factor affecting the frequency of failure.
[0492] Through this analysis, the example embodiment of the present application can quantify the unique influence of each factor on the failure of the LED display screen, providing precise guidance for failure prevention and system optimization.
[0493] Exemplarily, the relative strength of confounding bias between different sets of variables is calculated, identifying key influencing factors. The example embodiment of the present application uses partial R-squared analysis to achieve this goal:
[0494] ```python
[0495] from sklearn.linear_model import LinearRegression
[0496] def partial_r_squared(X,y):
[0497] full_model=LinearRegression().fit(X,y)
[0498] full_r2=full_model.score(X,y)
[0499] partial_r2 = {}
[0500] for i, col in enumerate(X.columns):
[0501] X_reduced = X.drop(col, axis=1)
[0502] reduced_model = LinearRegression().fit(X_reduced, y)
[0503] reduced_r2 = reduced_model.score(X_reduced, y)
[0504] partial_r2[col] = full_r2 - reduced_r2
[0505] return partial_r2
[0506] # Usage example
[0507] partial_r2_results = partial_r_squared(X, y)
[0508] ```
[0509] Partial R-square analysis can help the embodiments of the present application understand the unique contribution of each variable to the frequency of failure. A higher partial R-square value indicates that the variable has a stronger explanatory power on the failure frequency.
[0510] S5.4: Optimizing operating environment and parameter settings
[0511] Based on the results of confounding effect analysis, the embodiments of the present application can optimize the operating environment and parameter settings of the LED display screen. This step includes:
[0512] a) Environmental control recommendations:
[0513] According to the results of SEM analysis, if the environmental factors have a significant impact on the failure frequency, the embodiments of the present application may suggest strengthening the temperature and humidity control, or adjusting the operating parameters of the display screen under specific environmental conditions.
[0514] b) Operating parameter optimization:
[0515] Based on the results of partial R-square analysis, the embodiments of the present application can determine which operating parameters have the greatest impact on failure, and accordingly make optimization recommendations. For example, if it is found that the brightness setting has a great impact, the embodiments of the present application may suggest reducing the maximum brightness or adjusting the brightness curve under certain conditions.
[0516] c) Interaction effect treatment:
[0517] By using the results of the variable confounding test, embodiments of the present application can identify important interaction effects. For example, if a significant interaction is found between temperature and brightness settings, embodiments of the present application may recommend automatically reducing the maximum brightness in high temperature environments.
[0518] d) Preventive maintenance strategy:
[0519] Based on the causal inference results, embodiments of the present application can develop more targeted preventive maintenance strategies. For example, if certain factors are identified as early indicators of failure, embodiments of the present application can establish an early warning system based on these factors.
[0520] e) Adaptive control system:
[0521] Ultimately, the embodiments of the present application can design an adaptive control system that can monitor key environmental and operating parameters in real time and dynamically adjust the operating parameters of the display screen based on the results of the confounding effect analysis to minimize the risk of failure and optimize performance.
[0522] Through this data-driven and causal analysis-based optimization approach, the present invention significantly improves the reliability and performance of LED displays while reducing maintenance costs and downtime. This approach not only solves current problems but also provides valuable insights for future product design and system optimization.
[0523] For example, based on the results of the mixed effect analysis, the operating environment and parameter settings of the LED display are optimized. Based on the previous analysis results, specific optimization suggestions are given. For example:
[0524] ```Python
[0525] def optimize_settings(sem_results,partial_r2_results):
[0526] recommendations=[]
[0527] #Suggestions based on SEM results
[0528] if sem_results['EnvironmentalFactor']['FaultFrequency']>0.5:
[0529] recommendations.append("Consider improving environmental conditions, especially temperature and humidity control")
[0530] if sem_results['OperationalFactor']['FaultFrequency']>0.5:
[0531] recommendations.append("Optimize operating parameters, especially brightness and refresh rate settings")
[0532] # Recommendations based on partial R-squared results
[0533] most_important_factor=max(partial_r2_results,key=partial_r2_results.get)
[0534] recommendations.append(f"Focus on the {most_important_factor} factor, which has the greatest impact on failure frequency")
[0535] return recommendations
[0536] #Usage Example
[0537] optimization_recommendations=optimize_settings(sem_results,partial_r2_results)
[0538] ```
[0539] This function generates a series of optimization suggestions based on the results of SEM analysis and partial R-squared analysis. These suggestions can help operation and maintenance personnel adjust the operating environment and parameters of the LED display to reduce the frequency of failures.
[0540] Specifically, taking a certain LED factory as an example, it is necessary to analyze the mixed relationship between variables such as environmental factors and operating parameters and the occurrence of faults.
[0541] Assume that the following variable data are collected:
[0542] X1: Ambient temperature (°C)
[0543] X2: Ambient humidity (%)
[0544] X3: Display brightness setting (%)
[0545] X4: running time (hours)
[0546] Y: Failure frequency (times / day)
[0547] The following methods can be used to detect confounding between these variables:
[0548] a) Correlation analysis:
[0549] Calculate the Pearson correlation coefficient matrix between variables. If the absolute value of the correlation coefficient between two independent variables is greater than 0.7, it is considered that they may exist confounding.
[0550] b) Variance Inflation Factor (VIF) analysis:
[0551] Calculate the VIF for each independent variable. If VIF > 5, it is considered that the variable may exist confounding with other variables.
[0552]
[0553] c) Partial correlation analysis:
[0554] Calculate the partial correlation coefficient of each pair of variables, controlling the influence of other variables. This helps to identify direct and indirect relationships.
[0555] Observed and unobserved confounding separation: In this sub-step, try to distinguish and quantify the impact of observed variables and potential unobserved variables on failure.
[0556] Illustration:
[0557] Use Structural Equation Modeling (SEM) to separate observed and unobserved confounding effects.
[0558]
[0559]
[0560] Through this model, you can: quantify the direct impact of observed environmental factors and operational factors on failure, and estimate potential unobserved confounding effects through residual correlation.
[0561] Confounding bias strength evaluation: Calculate the relative strength of confounding bias between different variable sets, identify key influencing factors.
[0562] Specifically, use partial R-square analysis to evaluate the strength of confounding bias.
[0563]
[0564] This analysis can understand: the unique contribution of each variable to the frequency of failure, which variables have the strongest confounding effect, and need to focus on.
[0565] Based on the above analysis, the following example conclusions can be drawn:
[0566] 1. There is a strong confounding effect between ambient temperature (X1) and display screen brightness setting (X3), with a correlation coefficient of 0.75. This might be because the system automatically reduces brightness to protect hardware in high-temperature environments.
[0567] 2. The VIF for runtime (X4) is 6.2, indicating that it might have multicollinearity with other variables. Effects related to runtime need to be interpreted with caution in the context of this application.
[0568] 3. The structural equation model shows that the effect of environmental factors on failure frequency (standardized coefficient of 0.6) is greater than that of operational factors (standardized coefficient of 0.4).
[0569] 4. Partial R-square analysis indicates that ambient humidity (X2) has the largest unique contribution, explaining 20% of the variation in failure frequency.
[0570] S6: Multi-Operator Integrated Optimization
[0571] In this invention, the LSHADE (Linear Success-History-based Adaptive Differential Evolution) algorithm with restart and local search mechanisms is employed to optimize model hyperparameters and system configurations. LSHADE is an advanced evolutionary algorithm particularly suited for high-dimensional optimization problems. Here are the key technical details of the LSHADE algorithm:
[0572] 1. Population Initialization:
[0573] An initial population is randomly generated within a predefined search space. Each individual represents a set of possible model hyperparameters or system configurations. The population size is typically set to 2-4 times the problem dimension.
[0574] 2. Adaptive Parameter Control:
[0575] The scaling factor F and crossover probability CR are dynamically adjusted. Success rate history is used to guide parameter adjustment. F values are sampled from a Cauchy distribution, and CR values are sampled from a normal distribution. The parameter adjustment strategy considers historical success rates to balance exploration and exploitation.
[0576] 3. Differential Evolution Operation:
[0577] For each target vector, three different individuals are randomly selected for differential mutation. The mutation vector is generated by adding the base vector to the weighted difference vector. A binomial crossover operation is used to generate trial vectors.
[0578] 4. Linear Population Size Reduction: As iterations progress, the population size is linearly reduced. This helps to concentrate the search in the most promising regions during the later stages of optimization.
[0579] 5. Archive mechanism:
[0580] Maintain an external archive that stores replaced elite solutions. During the generation of trial vectors, individuals from the archive can be used to increase population diversity.
[0581] 6. Local search mechanism:
[0582] Perform local search on the current best solution after each iteration. Use gradient-based methods or pattern search techniques for local optimization. This helps fine-tune the discovered good solutions.
[0583] 7. Restart mechanism:
[0584] Trigger a restart when population diversity falls below a predefined threshold. Preserve a portion of the best individuals and reinitialize the rest of the population. Restarting helps escape local optima and increases the chances of finding the global optimum.
[0585] 8. Fitness evaluation:
[0586] Build and train the model for each individual (i.e., parameter configuration). Use the validation set performance as the fitness metric. Consider model complexity as a penalty term to prevent overfitting.
[0587] 9. Selection operation:
[0588] Implement an elitist selection strategy. If a trial vector is better than the target vector, replace the target vector. This ensures that the population quality improves monotonically over time.
[0589] 10. Termination conditions:
[0590] Reach a predefined maximum number of evaluations. The improvement in the best solution is below a threshold for consecutive generations. Population diversity falls below a certain threshold and the number of restarts reaches an upper limit.
[0591] 11. Multi-objective optimization extension:
[0592] Handle multiple optimization objectives using the Pareto dominance concept. Maintain a set of non-dominated solutions to balance the trade-offs between different objectives.
[0593] 12. Parallel implementation:
[0594] Evaluate individuals in parallel using multi-core processors or distributed systems. Use master-slave or island modes for parallelization to improve optimization efficiency.
[0595] 13. Constraint handling:
[0596] Use penalty functions or repair strategies to handle parameter constraints. Ensure that generated solutions always lie within the valid parameter space.
[0597] 14. Dynamic parameter encoding:
[0598] Different encoding strategies are employed for different types of parameters (continuous, discrete, categorical). Gray coding is used to represent integer parameters, improving the similarity of adjacent values.
[0599] In the LED display screen fault detection system, the LSHADE algorithm is used to optimize the following aspects:
[0600] 1. Deep learning model hyperparameters:
[0601] Number of convolutional layers, number of filters, and filter size
[0602] Number of units in GRU layers
[0603] Number of neurons in fully connected layers
[0604] Learning rate, batch size, activation function selection, etc.
[0605] 2. Feature extraction and preprocessing parameters:
[0606] Parameters of image enhancement algorithms
[0607] Selection and parameters of data augmentation strategies
[0608] 3. Fault detection thresholds:
[0609] Detection sensitivity for different types of faults
[0610] Quantitative parameters of fault severity
[0611] 4. System operation parameters:
[0612] Display screen brightness and contrast settings
[0613] Refresh rate and color settings
[0614] Environmental control parameters (such as refrigeration system settings)
[0615] Through this multi-operator integrated optimization method, the embodiments of the present application can efficiently search for the optimal configuration in a complex parameter space, significantly improving the performance and reliability of the LED display screen fault detection system. This method not only applies to the initial system configuration, but also can be used for continuous optimization and adaptive adjustment of the system, ensuring that the system always maintains the best state under different environments and use conditions.
[0616] Exemplarily, the LSHADE (Linear Success-History-based Adaptive Differential Evolution) algorithm with restart and local search mechanisms is used to optimize model hyperparameters and system configurations. The implementation of the LSHADE algorithm is as follows:
[0617] ```python
[0618] import numpy as np
[0619] from scipy.stats import cauchy
[0620] class LSHADE:
[0621] def__init__(self,func,bounds,pop_size=100,max_evals=10000,p=0.11,H=6):
[0622] self.func=func
[0623] self.bounds=bounds
[0624] self.dim=len(bounds)
[0625] self.pop_size=pop_size
[0626] self.max_evals=max_evals
[0627] self.p=p
[0628] self.H=H
[0629] self.memory_size=self.H*self.dim
[0630] def init_population(self):
[0631] return np.random.uniform(self.bounds[:,0],self.bounds[:,1],size=(self.pop_size,self.dim))
[0632] def mutation(self,x,F):
[0633] return x[0]+F*(x[1]-x[2])
[0634] def crossover(self,x,v,CR):
[0635] mask=np.random.rand(self.dim)<=CR
[0636] y = np.where(mask, v, x)
[0637] return y
[0638] def selection(self, population, offspring):
[0639] return np.where(self.func(offspring) < self.func(population), offspring, population)
[0640] def adapt_parameters(self, memory_f, memory_cr, memory_pos, success_f, success_cr):
[0641] if len(success_f) > 0:
[0642] memory_f[memory_pos] = np.mean(success_f)
[0643] memory_cr[memory_pos] = np.mean(success_cr) if np.mean(success_cr) > 0 else 0.5
[0644] memory_pos = (memory_pos + 1) % self.memory_size
[0645] return memory_f, memory_cr, memory_pos
[0646] def optimize(self):
[0647] population = self.init_population()
[0648] memory_f = np.ones(self.memory_size) * 0.5
[0649] memory_cr = np.ones(self.memory_size) * 0.5
[0650] memory_pos = 0
[0651] for_in range(self.max_evals / / self.pop_size):
[0652] offspring=np.empty_like(population)
[0653] success_f,success_cr=[],[]
[0654] for iin range(self.pop_size):
[0655] idx_r=np.random.choice(self.memory_size)
[0656] F=cauchy.rvs(loc=memory_f[idx_r],scale=0.1)
[0657] F=np.clip(F,0,1)
[0658] CR=np.random.normal(loc=memory_cr[idx_r],scale=0.1)
[0659] CR=np.clip(CR,0,1)
[0660] x=population[i]
[0661] v=self.mutation(population[np.random.choice(self.pop_size,3,replace=False)],F)
[0662] u=self.crossover(x,v,CR)
[0663] if self.func(u)<self.func(x):
[0664] offspring[i]=u
[0665] success_f.append(F)
[0666] success_cr.append(CR)
[0667] else:
[0668] offspring[i]=x
[0669] population = self.selection(population, offspring)
[0670] memory_f, memory_cr, memory_pos = self.adapt_parameters(memory_f, memory_cr, memory_pos, success_f, success_cr)
[0671] # Local search
[0672] best_idx = np.argmin([self.func(ind) for ind in population])
[0673] population[best_idx] = self.local_search(population[best_idx])
[0674] # Restart mechanism
[0675] if np.std([self.func(ind) for ind in population]) < 1e-6:
[0676] population = self.init_population()
[0677] best_idx = np.argmin([self.func(ind) for ind in population])
[0678] return population[best_idx], self.func(population[best_idx])
[0679] def local_search(self, x):
[0680] step_size = 0.01
[0681] for i in range(self.dim):
[0682] x_new = x.copy()
[0683] x_new[i] += np.random.uniform(-step_size, step_size)
[0684] x_new[i] = np.clip(x_new[i], self.bounds[i, 0], self.bounds[i, 1])
[0685] if self.func(x_new) < self.func(x):
[0686] x = x_new
[0687] return x
[0688] # Usage example
[0689] def objective_function(x):
[0690] return np.sum(x**2) # Using a simple sphere function as an example
[0691] bounds = np.array([[-5, 5]] * 10) # 10-dimensional problem with each dimension ranging from -5 to 5
[0692] lshade = LSHADE(objective_function, bounds)
[0693] best_solution, best_fitness = lshade.optimize()
[0694] print("Best solution:", best_solution)
[0695] print("Best fitness:", best_fitness)
[0696] ```
[0697] This LSHADE algorithm implementation achieves the following key features:
[0698] 1. Adaptive parameter control: Dynamically adjust the scaling factor F and crossover probability CR using success history.
[0699] 2. Linear population size reduction: Although not explicitly implemented in this example, it can be achieved by modifying the `optimize` method.
[0700] 3. Local search: Perform a local search on the current best solution to improve its quality.
[0701] 4. Restart mechanism: Reinitialize the population when the population diversity decreases to a certain level.
[0702] In practical applications, the embodiments of the present application can use the LSHADE algorithm to optimize the hyperparameters of the convolutional gated recurrent deep learning model of the embodiments of the present application, such as learning rate, convolution kernel size, GRU unit number, etc. The following is a specific application example:
[0703] ```python
[0704] import tensorflow as tf
[0705] def create_model(params):
[0706] model=tf.keras.Sequential([
[0707] tf.keras.layers.Conv2D(int(params[0]),(int(params[1]),int(params[1])),activation='relu',input_shape=(224,224,3)),
[0708] tf.keras.layers.MaxPooling2D((2,2)),
[0709] tf.keras.layers.Conv2D(int(params[2]),(3,3),activation='relu'),
[0710] tf.keras.layers.MaxPooling2D((2,2)),
[0711] tf.keras.layers.Flatten(),
[0712] tf.keras.layers.Dense(int(params[3]),activation='relu'),
[0713] tf.keras.layers.Dense(6,activation='softmax') ])
[0715] return model
[0716] def objective_function(params):
[0717] model = create_model(params)
[0718] model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=params[4]),
[0719] loss='categorical_crossentropy',
[0720] metrics=['accuracy'])
[0721] history = model.fit(x_train, y_train, epochs=10, validation_split=0.2, verbose=0)
[0722] return 1 - history.history['val_accuracy'][-1] # Minimize validation set error
[0723] # Define parameter bounds
[0724] bounds = np.array([
[0725] [16, 64], # Number of filters in the first convolutional layer
[0726] [3, 7], # Kernel size in the first convolutional layer
[0727] [32, 128], # Number of filters in the second convolutional layer
[0728] [64, 256], # Number of neurons in the fully connected layer
[0729] [1e-4, 1e-2] # Learning rate ])
[0731] lshade = LSHADE(objective_function, bounds)
[0732] best_params, best_fitness = lshade.optimize()
[0733] print("Best hyperparameters:", best_params)
[0734] print("Best validation accuracy:",1-best_fitness)
[0735] ```
[0736] In this example, the embodiments of the present application use the LSHADE algorithm to optimize the hyperparameters of a simple convolutional neural network model. The objective_function creates and trains the model, returning the error rate (1-accuracy) on the validation set. The LSHADE algorithm tries to minimize this error rate, thus finding the best combination of hyperparameters.
[0737] The embodiments of the present application also provide an LED display screen fault detection system, comprising:
[0738] The acquisition module is configured to acquire a display image of the LED display screen.
[0739] The preprocessing module is configured to preprocess the display image.
[0740] The detection module is configured to input the preprocessed display image into a pre-trained convolutional gated recurrent deep learning model to detect whether the LED display screen has a fault.
[0741] The classification and positioning module is configured to classify and position the fault if the fault is detected.
[0742] The analysis module is configured to perform a mixed effect analysis to evaluate the influence of environmental factors and operating parameters on the fault.
[0743] The above is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present application, and these modifications or replacements shall be encompassed within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for detecting LED display screen faults, characterized in that: The following steps are involved: Collect the display image of the LED display; Preprocessing the display image; Inputting the pre-processed display image into a pre-trained convolutional gated recurrent deep learning model to detect whether the LED display screen has a fault; If a fault is detected, classifying and locating the fault; Conduct confounding effect analysis to assess the impact of environmental factors and operating parameters on failures; The confounding effect analysis includes: Conduct variable confounding detection to analyze the confounding relationship between environmental factors and operating parameters and fault occurrence; Use causal inference techniques to distinguish and quantify the impact of observable and potential unobserved variables on failures; Calculate the relative strength of confounding bias between different sets of variables and identify key influencing factors; Based on the results of the mixed effect analysis, the operating environment and parameter settings of the LED display were optimized; The variable confounding test includes calculating the Pearson correlation coefficient matrix between variables, calculating the variance inflation factor for each independent variable, and performing partial correlation analysis to identify direct and indirect relationships; The differentiation and quantification of the impact of observable variables and potential unobserved variables on failures are achieved using a structural equation model, including: Construct a structural equation model specification that includes latent variables and defines the relationship between observed and latent variables; Structural equation model parameters were estimated using the maximum likelihood estimation method; The goodness of fit of the structural equation model was assessed, including the chi-square test, comparative fit index (CFI), and root mean square error of approximation (RMSEA); Analyze path coefficients and effect sizes to quantify the influence of observed and latent variables on failures; The calculation of the relative strength of confounding bias between different sets of variables is achieved using partial R-squared analysis, including: Construct a full linear regression model including all predictor variables; Calculate the R-squared value of the complete linear regression model; Remove each predictor variable one by one to build a reduced model; Calculating the R-squared value for each of the reduced models; Calculate the partial R-squared value for each predictor variable, including the difference between the full model R-squared and the corresponding reduced model R-squared; Compare the partial R-squared values of different predictor variables to determine the unique contribution of each variable to the frequency of failure.
2. The method according to claim 1, characterized in that The preprocessing of the display image includes: performing denoising processing on the collected display image; performing enhancement processing on the denoised display image; The enhanced display image is normalized.
3. The method according to claim 1, characterized in that The convolutional gated recurrent deep learning model includes: A convolutional layer group, configured to extract spatial features of the displayed image; Gated recurrent unit layer to capture temporal features; Fully connected layer, used to integrate spatial and temporal features; The convolutional layer group includes multiple convolution blocks, each convolution block includes a 2D convolution layer, a batch normalization layer, a ReLU activation function layer and a maximum pooling layer, and the 2D convolution layer uses convolution kernels of different sizes to extract multi-scale features.
4. The method according to claim 3, characterized in that Before inputting the pre-processed display image into the pre-trained convolutional gated recurrent deep learning model, the method further includes: training the convolutional gated recurrent deep learning model, including: Acquire training data, and perform data augmentation processing on the training data, including random rotation, scaling, brightness and contrast adjustment; The ResNet50 model pre-trained on the ImageNet dataset is used as a feature extractor to extract the initial features of the LED display image; The extracted initial features are input into a convolutional gated recurrent deep learning model to simultaneously optimize the three subtasks of fault detection, classification, and localization.
5. The method according to claim 4, characterized in that The method further comprises: Adding L1 and L2 regularization terms to the loss function to suppress the complexity of the convolutional gated recurrent deep learning model; Use the ReLU6 activation function to limit the activation value to the range of [0, 6] to achieve sparse activation; The initial module inception is used, and 1x1, 3x3 and 5x5 convolution kernels are applied in parallel to achieve multi-scale feature extraction; The attention mechanism is introduced to dynamically adjust the importance of features of different scales according to the input and realize dynamic weight adjustment.
6. The method according to claim 1, characterized in that The classifying and locating the fault includes: Classifying the detected faults into at least one or more combinations of pixel failure, color anomaly, uneven brightness, flicker, image tearing, and module failure; Use attention mechanism and heat map technology to accurately locate the location and scope of the fault area; Quantitatively assess the severity of the fault based on fault type, area, and duration; Based on the fault detection results, the sensitivity and threshold of fault detection are dynamically adjusted.
7. The method according to claim 1, characterized in that The method further comprises: The LSHADE algorithm with restart and local search mechanisms is used to optimize model hyperparameters and system configuration. The specific steps include: Initialize the population and algorithm parameters; Evaluate the objective function value for each individual; Apply differential evolution operations to generate test vectors; Adaptively adjust the scaling factor and crossover probability based on the success rate history; Perform local search to improve the current optimal solution; Update populations and archives; Check the restart condition and reinitialize the population when the population diversity is lower than the predetermined threshold; Repeat the above steps until the termination condition is reached.
8. A LED display screen fault detection system, characterized in that: include: An acquisition module is used to acquire the display image of the LED display screen; A preprocessing module, configured to preprocess the display image; A detection module is used to input the preprocessed display image into a pre-trained convolutional gated recurrent deep learning model to detect whether the LED display screen has a fault; A classification and location module, configured to classify and locate a fault if one is detected; An analysis module for performing confounding effect analysis to assess the impact of environmental factors and operating parameters on faults; The confounding effect analysis includes: Conduct variable confounding detection to analyze the confounding relationship between environmental factors and operating parameters and fault occurrence; Use causal inference techniques to distinguish and quantify the impact of observable and potential unobserved variables on failures; Calculate the relative strength of confounding bias between different sets of variables and identify key influencing factors; Based on the results of the mixed effect analysis, the operating environment and parameter settings of the LED display were optimized; The variable confounding test includes calculating the Pearson correlation coefficient matrix between variables, calculating the variance inflation factor for each independent variable, and performing partial correlation analysis to identify direct and indirect relationships; The differentiation and quantification of the impact of observable variables and potential unobserved variables on failures are achieved using a structural equation model, including: Construct a structural equation model specification that includes latent variables and defines the relationship between observed and latent variables; Structural equation model parameters were estimated using the maximum likelihood estimation method; The goodness of fit of the structural equation model was assessed, including the chi-square test, comparative fit index (CFI), and root mean square error of approximation (RMSEA); Analyze path coefficients and effect sizes to quantify the influence of observed and latent variables on failures; The calculation of the relative strength of confounding bias between different sets of variables is achieved using partial R-squared analysis, including: Construct a full linear regression model including all predictor variables; Calculate the R-squared value of the complete linear regression model; Remove each predictor variable one by one to build a reduced model; Calculating the R-squared value for each of the reduced models; Calculate the partial R-squared value for each predictor variable, including the difference between the full model R-squared and the corresponding reduced model R-squared; Compare the partial R-squared values of different predictor variables to determine the unique contribution of each variable to the frequency of failure.
Citation Information
Patent Citations
Method and ssytem for determining causal effects between multiple variables, and media
CN110750570A
Wafer defect detection method and device, electronic equipment and storage medium
CN116596875A
Display screen detection method and system
CN117542301A