Multi-sensor anomaly detection method and system based on few-sample statistics
By establishing sensor response mapping relationships and fitting residual verification, the problem of unstable multi-sensor fusion weights when launching new products was solved, achieving high stability and high accuracy anomaly detection under conditions of few samples.
Patent Information
- Application Number
- CN202611334761.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-24
AI Technical Summary
When new products, new batches, or new defect types are launched, existing multi-sensor fusion methods are easily affected by individual samples due to the small number of samples, which leads to fusion weight shifts, resulting in unstable detection results and false or missed detections. There is a lack of stability verification mechanism for statistical results with few samples.
By acquiring a small sample support set and multi-sensor detection data for the target product category, an effective response mapping relationship between sensors is established. The fusion weights are adjusted based on the normal response fluctuation range, and the mapping relationship is verified using the fitted residuals to generate anomaly detection results.
It improves the stability and accuracy of abnormal response determination under small sample conditions, reduces the impact of individual samples on statistical results, ensures the consistency and adaptability of test results, and is suitable for rapid detection of new products, new batches or new defect types.
Smart Images

Figure CN123155533A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial visual inspection and intelligent inspection technology, and in particular to a multi-sensor anomaly detection method and system based on few-sample statistics. Background Technology
[0002] In industrial product appearance inspection, structural inspection, and quality sorting scenarios, multiple inspection devices such as RGB cameras, thermal infrared sensors, and 3D point cloud sensors are typically used simultaneously to acquire information on the product's appearance texture, temperature distribution, and geometric shape. Compared to single-vision inspection, multi-sensor inspection can cover various anomaly types such as scratches, dirt, dents, warping, thermal anomalies, and internal defects. Therefore, it is widely used in the inspection of precision parts, composite materials, electronic connectors, automotive parts, injection molded parts, and metal stamping parts.
[0003] A common approach is to extract features from data collected by different sensors separately, and then obtain the final anomaly detection result through feature concatenation, weighted fusion, multi-expert models, or neural network fusion models. For product types with sufficient samples, the fusion model can be trained with a large number of normal and defective samples, allowing the model to learn the importance of different sensors under different defect types.
[0004] However, in actual industrial production lines, when new products, batches, or defect types are introduced, it is often impossible to obtain a large number of labeled samples. Initially, the production line typically has only a small number of normal samples and a small number of defect samples, or even just a few samples for each type of defect. In this case, to quickly adapt the detection model, existing methods usually calculate statistical differences between different modalities based on limited sample data. These statistical differences include the mean difference between normal and defect samples, inter-class distance, intra-class variance, Fisher's discriminant ratio, KL divergence, and L2 distance. The fusion weights for sensors such as RGB, thermal infrared, and point cloud are then determined based on these statistical measures.
[0005] Because the sample size is extremely small, the statistics themselves are easily affected by individual samples. For example, a defective sample may be very obvious in an RGB image, leading the system to consider the RGB sensor the most reliable and assign a higher weight to the RGB mode. However, this sample may only have an obvious surface mark by chance, and subsequent similar defects may actually manifest as slight geometric deformation or abnormal thermal response. In this case, the erroneous statistical results from a small number of samples will cause the fusion weights to shift, resulting in missed or false detections.
[0006] The Fisher discriminant ratio, KL divergence, L2 distance, and other statistics calculated from a small number of normal and defective samples may not be reliable. Existing methods make it difficult to determine whether the high discriminant performance of a certain sensor mode is a real pattern or caused by a single random sample.
[0007] Existing multi-sensor fusion methods typically generate fusion weights directly based on the magnitude of statistical quantities, which can easily lead to the problem of one mode being over-amplified while another mode is incorrectly suppressed.
[0008] In the early stages of a new product launch, the number of samples is small and the defect morphology is unstable. If the fusion weights are frequently affected by a small number of samples, the test results will fluctuate significantly between different batches.
[0009] Existing few-sample anomaly detection methods typically focus on how the model adapts to new categories, but lack a mechanism to verify the stability of few-sample statistical results, and also lack technical means to feed back statistical stability to the fusion weight generation process. Summary of the Invention
[0010] To address the technical problems existing in the prior art, embodiments of the present invention provide a multi-sensor anomaly detection method and system based on few-sample statistics. The technical solution is as follows:
[0011] Multi-sensor anomaly detection methods based on few-sample statistics include:
[0012] Acquire a small sample support set for the target product category and multi-sensor detection data for the same product to be tested within a preset acquisition time window. The small sample support set includes normal samples and abnormal samples, and each sample includes data collected by at least two types of sensors.
[0013] Based on a small sample support set and multi-sensor detection data, the sensor response values corresponding to each sensor are obtained, and the normal response fluctuation range of each sensor is determined according to the sensor response values corresponding to normal samples.
[0014] Under the constraint of normal response fluctuation range, an effective response mapping relationship between the first sensor and the second sensor is established based on the response value sequence of the first sensor and the response value sequence of the second sensor in the abnormal sample.
[0015] Based on the mapping relationship between the first sensor response value and the effective response of the product under test, the predicted response value of the second sensor of the product under test is obtained.
[0016] The residual is obtained based on the difference between the predicted response value of the second sensor and the response value of the second sensor of the product to be tested.
[0017] Based on the comparison between the residual and the normal response fluctuation range of the second sensor, the fusion weights of the first and second sensors in anomaly detection are adjusted, and the anomaly detection results of the product to be detected are generated according to the adjusted fusion weights.
[0018] A multi-sensor anomaly detection system based on few-sample statistics specifically includes:
[0019] The detection data acquisition module is used to acquire a small sample support set of the target product category and multi-sensor detection data of the same product to be tested within a preset acquisition time window. The small sample support set includes normal samples and abnormal samples, and each sample includes data collected by at least two types of sensors.
[0020] The fluctuation range determination module is used to obtain the sensor response value corresponding to each sensor based on a small sample support set and multi-sensor detection data, and to determine the normal response fluctuation range of each sensor based on the sensor response value corresponding to the normal sample.
[0021] The response mapping relationship establishment module is used to establish an effective response mapping relationship between the first sensor and the second sensor based on the response value sequence of the first sensor and the response value sequence of the second sensor in the abnormal sample, under the constraint of the normal response fluctuation range.
[0022] The predicted response value generation module is used to obtain the predicted response value of the second sensor of the product under test based on the mapping relationship between the first sensor response value and the effective response of the product under test.
[0023] The residual calculation module is used to obtain the residual based on the difference between the predicted response value of the second sensor and the response value of the second sensor of the product to be tested.
[0024] The anomaly detection module is used to adjust the fusion weights of the first and second sensors in anomaly detection based on the comparison results between the residual and the normal response fluctuation range of the second sensor, and to generate anomaly detection results of the product to be detected based on the adjusted fusion weights.
[0025] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:
[0026] 1. The multi-sensor anomaly detection method based on few-sample statistics provided by this invention establishes normal response benchmarks for each type of sensor and determines the normal response fluctuation range based on the response differences among a small number of normal samples. This allows sensor detection results with different physical dimensions and data formats to be uniformly converted into the degree of anomaly deviation relative to their respective normal states. Compared to directly using the mean, variance, or inter-class distance of a small number of samples to determine the degree of anomaly, this invention reduces the impact of individual normal samples, acquisition disturbances, or labeling biases on the statistical results, and avoids the normal fluctuation range being amplified by abnormal samples, thereby improving the stability and accuracy of anomaly response determination under few-sample conditions.
[0027] 2. This invention filters out cross-sensor anomalous responses that simultaneously exceed the corresponding normal response fluctuation range, establishes candidate response mapping relationships based on the response values of the same anomalous sample, and then verifies the validity of the candidate response mapping relationships by comparing the fitting residuals with the normal response fluctuation range. This ensures that the system retains only mapping relationships that can stably characterize the correlation between anomalous responses from different sensors. This avoids mistaking accidental surface marks, local temperature disturbances, or geometric measurement errors for stable cross-sensor anomalous patterns, reducing the risk of overfitting mapping relationships or distorting statistical regularities due to a small number of anomalous samples.
[0028] 3. This invention establishes a continuous data processing chain, encompassing the determination of normal fluctuation range, cross-sensor mapping verification, prediction residual calculation, and fusion weight adjustment. This allows statistical results from a small sample size to be dynamically verified by the product data during actual testing, and the verification results are fed back to the multi-sensor fusion judgment process. This approach enables the rapid establishment of anomaly detection capabilities even when new products, batches, or defect types are launched and the number of labeled samples is limited. It achieves adaptive fusion of multi-source detection data, such as RGB images, thermal infrared images, and 3D point clouds, without relying on large-scale training samples. This improves the adaptability and consistency of detection results in industrial product anomaly detection under different batches, different defect manifestations, and sensor state changes. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a schematic diagram of a multi-sensor anomaly detection method module based on few-sample statistics provided in an embodiment of the present invention.
[0031] Figure 2 This is a schematic diagram of the trajectory analysis process provided in an embodiment of the present invention. Detailed Implementation
[0032] Embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that embodiments of the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention.
[0033] It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. In the description of the embodiments of the present invention, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "this embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects.
[0034] To make the technical problems, solutions, and advantages of this invention clearer, a detailed description will be provided below with reference to the accompanying drawings and specific embodiments. To facilitate direct implementation by those skilled in the art, unless otherwise specified, the response values, residuals, fluctuation boundaries, residual ratios, fused response values, and fused weights involved in this embodiment are all based on normalized dimensionless data. Dimensional data such as the original image grayscale values and spatial coordinate values are first calibrated, registered, feature extracted, and scaled before being used in subsequent calculations.
[0035] Please see Figure 1 As shown, the multi-sensor anomaly detection method based on few-sample statistics specifically includes:
[0036] Acquire a small sample support set for the target product category and multi-sensor detection data for the same product to be tested within a preset acquisition time window. The small sample support set includes normal samples and abnormal samples, and each sample includes data collected by at least two types of sensors.
[0037] This implementation uses the detection of anomalous few samples in industrial products as an application scenario. The target product category refers to the category to which the product to be tested belongs in the testing task. It can be determined by the product model issued by the production management system, the product number read by the barcode scanner, the batch number in the testing work order, the process route recorded by the workstation control system, or the category label pre-configured in the testing software. The target product category can be any industrial product requiring appearance, temperature, or geometric shape inspection, such as injection molded parts, stamped parts, welded parts, electronic connectors, ceramic parts, composite material plates, lithium battery casings, and precision mechanical parts. After the target product category is determined, the corresponding few-sample support set is retrieved from the sample database. If no corresponding support set exists in the sample database, an initial support set is generated by manual re-inspection, first-article inspection, downstream quality inspection records, or temporary calibration workstations, and then bound and stored with the target product category.
[0038] A small sample support set refers to a small set of labeled samples used to provide a testing reference for a target product category, including normal samples and abnormal samples. Normal samples are product samples that have been confirmed by manual re-inspection, historical quality inspection records, standard part comparison, or downstream quality inspection to have no target anomalies; abnormal samples are product samples that have been confirmed by manual labeling, re-inspection, or defect database records to have target anomalies. The number of normal samples in the small sample support set is preferably 2 to 20, and the number of abnormal samples is preferably 1 to 20. When new products are launched or defective samples are scarce, the number of normal samples can be 3 to 8, and the number of abnormal samples can be 2 to 8. These ranges are derived from the initial sample availability on the production line and the minimum statistical basis required for establishing subsequent normal fluctuation boundaries and cross-sensor mapping relationships.
[0039] Each sample includes data collected by at least two types of sensors, preferably RGB images, thermal infrared images, and 3D point cloud data. RGB images are used to characterize appearance information such as color, texture, scratches, stains, and cracks; thermal infrared images are used to characterize temperature distribution, localized overheating, abnormal heat conduction, or material inhomogeneity; and 3D point cloud data is used to characterize geometric anomalies such as depressions, protrusions, warping, deformation, and dimensional deviations. In practice, the resolution of each sensor, the number of point clouds, and the acquisition accuracy can be determined based on the required detection accuracy, sensor model, and production line cycle time.
[0040] The system collects multi-sensor detection data for the same product under inspection within a preset acquisition time window. The preset acquisition time window refers to the time range within which the system allows multiple sensors to complete data acquisition for the same product. It is derived from factors such as production line cycle time, product dwell time at the inspection station, sensor exposure or scanning time, trigger delay, and data transmission delay. This time window is preferably 0.2s to 5s; for online conveyor belt inspection, it can be set to the time from when the product enters the inspection field of view to when it leaves, for example, 0.5s to 1.5s; for static station inspection, it can be set to a fixed time after trigger acquisition, for example, 1s to 3s. The preset process is as follows: during the calibration phase, multi-sensor timestamps of several normal products are collected, the upper limit of the time required for each sensor to complete acquisition is calculated, and a trigger jitter margin is added to obtain the preset acquisition time window.
[0041] To ensure that data collected by different sensors can characterize abnormal responses of the same product under the same detection state, time synchronization and spatial registration checks are performed on the multi-sensor detection data after acquisition. Time synchronization check determines whether the data from each sensor belongs to the same acquisition time window. Its parameters include a common trigger time, timestamps of each sensor, and a synchronization tolerance limit. The common trigger time can be provided by photoelectric sensors, encoders, PLC trigger signals, or software trigger commands. The synchronization tolerance limit is preferably between 1ms and 100ms, and its value is determined based on the timestamp deviation and product movement speed during calibration. If the deviation between the timestamp of the m-th type of sensor and the common trigger time is not greater than the synchronization tolerance limit, the corresponding data frame is retained; if it exceeds this limit, adjacent frame interpolation, replacement of the most recent valid frame, or re-acquisition is used.
[0042] Spatial registration verification is used to determine whether data from different sensors correspond to the same product area. Its parameters include the product reference coordinate system, sensor intrinsic parameters, sensor extrinsic parameters, upper limit of registration error, and spatial overlap ratio. The product reference coordinate system can be determined by fixture positioning holes, product boundaries, calibration plates, robot gripper coordinates, or stable geometric structures in a 3D point cloud. Homography transformation can be established between RGB images and thermal infrared images using calibration plates, contour points, or corresponding feature points. A correspondence can be established between 3D point clouds and 2D images using camera extrinsic parameters and projection matrices. The upper limit of registration error is preferably 0.1 to 3 pixels or 0.01 mm to 0.5 mm, and the spatial overlap ratio is preferably 0.70 to 0.95. When the spatial overlap ratio is lower than the preset range, it is determined that the regions of interest corresponding to different sensors are insufficient to represent the same product area, and registration or acquisition is re-performed.
[0043] Based on a small sample support set and multi-sensor detection data, the sensor response values corresponding to each sensor are obtained, and the normal response fluctuation range of each sensor is determined according to the sensor response values corresponding to normal samples.
[0044] In this embodiment, the m-th type of sensor is uniformly represented by m, where m = 1, 2, ..., M; the first and second sensors used to establish the mapping relationship are respectively denoted as the u-th type sensor and the v-th type sensor.
[0045] Based on a small-sample support set and multi-sensor detection data, the sensor response values for each sensor are obtained, specifically including:
[0046] Normal response feature data is extracted from normal sample acquisition data corresponding to the same sensor, and normal response benchmark data corresponding to the sensor is generated based on the normal response feature data.
[0047] Normal sample acquisition data refers to data collected from samples with a small sample size supporting the "normal" state label under the corresponding sensor. Normal response feature data refers to data obtained by extracting features from normal sample acquisition data, used to characterize the typical performance of the target product category under normal conditions in this sensor. Normal response benchmark data is benchmark data generated by statistically analyzing the normal response feature data of multiple normal samples under the same sensor, used as a comparison object for subsequent abnormal samples and products to be tested.
[0048] The normal response baseline data is sourced from normal samples corresponding to the target product category, rather than from other product categories or a general sample library. This is because different product categories have inherent differences in appearance texture, thermal distribution, and geometry. Using cross-category normal baseline data would cause subsequent sensor response values to fail to accurately reflect the degree of abnormal deviation of the current target product category.
[0049] In practical implementation, the system can first filter out normal samples corresponding to the target product category from a small sample support set; then, it reads RGB images, thermal infrared images, and 3D point cloud data according to sensor type; and then calls the corresponding feature extraction processing to obtain RGB normal response feature data, thermal infrared normal response feature data, and point cloud normal response feature data, respectively. The response features of the RGB image can include color histogram, local binary mode, gradient direction histogram, edge density, defect candidate region area, defect candidate region grayscale contrast, and the embedding vector output by the pre-trained visual model. The response features of the thermal infrared image can include the highest temperature deviation, average temperature deviation, temperature gradient, hotspot area ratio, thermal diffusion non-uniformity, and thermal image embedding vector within the region of interest. The response features of the 3D point cloud can include local curvature, normal variation, flatness deviation, cross-sectional height difference, point cloud density variation, local concave / convex area, and point cloud network embedding vector. All of the above features can be obtained through traditional image processing, deep neural networks, or physical model inversion methods.
[0050] RGB features can be obtained from pre-trained visual models such as DINOv2, Swin Transformer, ResNet, ConvNeXt, or MobileNet; thermal infrared features can be obtained by concatenating temperature statistical features with convolutional network features; and 3D point cloud features can be obtained from PointNet, PointNet++, DGCNN, or geometric statistical features. It should be noted that the above models are only used to convert data from different sensors into feature vectors.
[0051] ;
[0052] in, Let h(i,m) be the sensor response value of sample i under the m-th type of sensor, and h(i,m) be the dimensionless response feature vector of sample i under the m-th type of sensor, which is derived from the result of preprocessing, registration, feature extraction and scaling of the sensor data; μ(m) be the normal response reference vector of the m-th type of sensor, which is derived from the median, truncated mean or quality-weighted mean of the component features vector of the same sensor in the normal sample set SN; s(m) be the normal feature scale of the m-th type of sensor, which is derived from the distance statistics from the normal sample feature vector to the normal response reference vector, preferably the median distance. This is a stabilizing term used to prevent excessive amplification of the response value due to an excessively small s(m). 10 are preferred -6 Up to 10 -3 The preset process can be as follows: based on the minimum non-zero value of the sensor's historical normal feature scale, the feature change corresponding to the device's minimum resolution, or 10 of the historical scale mean. -3 Sure.
[0053] As shown in the above equation, the sensor response value r(i,m) is determined by both the deviation of the sample feature from the normal reference and the scale of the normal sample itself. If the sample feature is far from the normal response reference, and the sensor itself has very little fluctuation in the normal sample, the response value will be large; if the sample feature deviates from the normal reference, but the sensor naturally has large fluctuations in the normal sample, the response value will be reduced due to the cancellation of the normal scale. This correlation means that different sensors no longer directly compare the original physical quantities, but rather compare the degree of abnormal deviation under their respective normal fluctuation backgrounds.
[0054] When the normal characteristic scale of a certain type of sensor is close to zero, the system does not directly set the denominator to zero, but treats it as a stable term. If historical data of similar products exist for this sensor, then... Take 10 of the historical average -3 If historical data is unavailable, the feature scale is taken from the manufacturer's nominal resolution or the feature scale converted from repeated acquisition error of the calibration board. If neither of the above data is available, the minimum resolvable feature change is calculated using normal standard samples acquired at least three times during the system initialization phase. The above preset process ensures that the response value will not be abnormally amplified due to the complete consistency of normal samples in the support set.
[0055] Establish an independent normal state reference for each type of sensor, so that the response values of subsequent sensors can reflect the degree of deviation of the sensor's collected data from the normal state, and avoid errors caused by direct comparison of different sensors due to differences in data scale and physical meaning.
[0056] Response feature data are extracted from abnormal sample data collected from the same sensor and sensor detection data of the product to be tested.
[0057] Abnormal sample acquisition data refers to the data collected by the corresponding sensor for samples with a small number of samples supporting the anomalous status label. Sensor detection data of the product under test refers to the data collected by the corresponding sensor for the same product under test within a preset acquisition time window.
[0058] The response feature data corresponding to the abnormal samples are used to subsequently establish the first sensor response value sequence and the second sensor response value sequence, thereby establishing an effective response mapping relationship; the response feature data corresponding to the product to be tested is used to generate the sensor response value of the product to be tested, thereby obtaining the second sensor predicted response value and residual.
[0059] In practice, RGB images can be normalized in size, corrected for illumination, and have texture features extracted to obtain RGB response feature data; thermal infrared images can be normalized in temperature, corrected for background temperature, and have local temperature difference extracted to obtain thermal infrared response feature data; and three-dimensional point clouds can be aligned in coordinates, downsampled in point clouds, estimated in normal vectors, and have local geometric features extracted to obtain point cloud response feature data.
[0060] The differences between the response feature data corresponding to the abnormal sample, the response feature data corresponding to the product to be tested, and the normal response baseline data are calculated separately to obtain the sensor response value corresponding to the abnormal sample and the sensor response value corresponding to the product to be tested.
[0061] Difference refers to the degree of deviation between the response characteristic data of abnormal samples or products under test and the normal response baseline data under the same sensor. This difference can be represented by distance, similarity difference, reconstruction error, regional bias, or statistical bias. To facilitate subsequent comparison and fusion of response values corresponding to different sensors, the difference calculation results can be converted into dimensionless or normalized sensor response values.
[0062] In one specific implementation, if the response feature data is in vector form, the sensor response value can be calculated using normalized distance; if the response feature data is regional data, the sensor response value can be calculated using regional difference ratio, local maximum deviation, or weighted regional deviation. The specific difference calculation method can be pre-configured according to the sensor type.
[0063] Sensor response values are stored in association according to sensor type and sample identifier.
[0064] Sensor type is used to distinguish the source of sensor response values, such as RGB image sensors, thermal infrared sensors, and 3D point cloud sensors. Sample identifier is used to distinguish different samples or different products to be tested. The sample identifier can be derived from sample numbers in the sample database, product barcodes, inspection task numbers, workstation inspection numbers, or temporary numbers generated by the system. Associating and storing sensor response values according to sensor type and sample identifier ensures that subsequent steps can accurately read the first and second sensor response values for the same abnormal sample, as well as the first and second sensor response values for the same product to be tested.
[0065] In practice, the system can store sensor response values along with the target product category, sample identifier, sample status, sensor type, and acquisition time.
[0066] The normal response fluctuation range of each sensor is determined based on the sensor response values corresponding to normal samples, specifically including:
[0067] By performing pairwise differences on the sensor response values corresponding to different normal samples under the same sensor, a sequence of response differences among normal samples is obtained.
[0068] When determining the normal response fluctuation range of each sensor based on the sensor response values corresponding to normal samples, pairwise differences are performed on the response values corresponding to different normal samples under the same sensor to obtain a sequence of response differences between normal samples. This sequence originates from the response value differences within the normal sample set SN; its purpose is to describe how much difference is normally allowed between normal samples. For n normal samples, pairwise differences can generate multiple response difference values, allowing a small number of normal samples to still form an orderable sequence of differences.
[0069] ;
[0070] ;
[0071] Where c(m) is the center value of the normal response value of the m-th type of sensor, preferably the median of the response value of the normal sample; b(m) is the normal fluctuation boundary value of the m-th type of sensor, which is derived from the quantile of the response difference sequence between normal samples. Let q represent the q-th quantile, where q is preferably between 0.75 and 0.95, and more preferably 0.90; α and β represent different normal sample indices; Ω(m) is the normal response fluctuation range corresponding to the m-th type of sensor. The upper and lower boundaries of r, c, b, and Ω are all dimensionless response quantities, so their magnitudes can be directly compared.
[0072] For new product categories that lack historical data, q can be initially set to 0.90 and adjusted after the results of subsequent manual re-inspections are accumulated.
[0073] In practice, the sensor response values of multiple normal samples are sequentially read under the same sensor, and the absolute value of the difference between the sensor response values of any two different normal samples is calculated to form a response difference sequence among normal samples. For example, for an RGB image sensor, an appearance response difference sequence is calculated based on the RGB sensor response values of different normal samples; for a thermal infrared sensor, a thermal response difference sequence is calculated based on the thermal infrared sensor response values of different normal samples; and for a 3D point cloud sensor, a geometric response difference sequence is calculated based on the point cloud sensor response values of different normal samples.
[0074] The response difference sequences among normal samples are sorted according to their numerical values, and the response difference values corresponding to a predetermined number of positions are extracted as the normal fluctuation boundary values.
[0075] After obtaining the response difference sequence among normal samples, the sequence is sorted from smallest to largest value. The sorted response difference sequence reflects the distribution of differences among normal samples under the same sensor from smallest to largest. The predetermined percentile refers to the positional parameter used to extract representative boundary values from the sorted sequence; it can be expressed as percentile, ranking, or proportion. The normal fluctuation boundary value refers to the boundary data extracted from the sorted response difference sequence among normal samples, used to determine the normal response fluctuation range of the sensor.
[0076] When the maximum difference value in the response difference sequence among normal samples exceeds the preset discrete threshold, the normal sample that generates the maximum difference value is removed and the normal fluctuation boundary value is obtained again.
[0077] Under limited sample conditions, the normal sample set may contain issues such as data acquisition anomalies, labeling errors, minor product anomalies that are mistakenly labeled as normal, and short-term sensor interference. Directly using data containing such abnormal normal samples to determine the normal fluctuation boundary value would abnormally amplify the normal response fluctuation range, thereby affecting subsequent effective response mapping relationships and residual judgments.
[0078] A preset discrete threshold is used to remove normal samples that may have been mislabeled as normal, exhibited abnormalities, or been interfered with. The preset discrete threshold can be determined by adding a certain multiple of the interquartile range to the median of the response difference sequence among normal samples, preferably between 1.5 and 3.0; alternatively, it can be determined by the maximum permissible difference of historical normal samples, equipment repeatability error, or empirical values from manual calibration. When the maximum difference value exceeds the preset discrete threshold, the system locates the two normal samples that generated this maximum difference value, calculates their average difference relative to other normal samples, removes the normal sample with the larger average difference, and then re-obtains the normal fluctuation boundary value. This process prevents the normal fluctuation range from being amplified by a single abnormal normal sample.
[0079] For example, if the normal response values of an RGB sensor are 0.08, 0.10, 0.11, and 0.13, then the normal response center is 0.105. After pairwise difference, the normal fluctuation boundary value is approximated by the 90th quantile, which is 0.05. Therefore, the normal response fluctuation range is 0.055 to 0.155. If another normal sample response value is 0.40, causing the maximum difference value to be much larger than the discrete threshold, the system identifies it as a discrete normal sample candidate and removes it when recalculating the normal fluctuation range to avoid including obviously abnormal response values within the normal range.
[0080] The normal response fluctuation range of the sensor is determined based on the normal fluctuation boundary value.
[0081] Under the constraint of normal response fluctuation range, an effective response mapping relationship between the first sensor and the second sensor is established based on the response value sequence of the first sensor and the response value sequence of the second sensor in the abnormal sample.
[0082] The first sensor and the second sensor refer to any two different types of sensors in multi-sensor detection data. For example, the first sensor can be an RGB image sensor and the second sensor can be a thermal infrared sensor; alternatively, the first sensor can be a thermal infrared sensor and the second sensor can be a 3D point cloud sensor. The first sensor and the second sensor are not limited to specific physical types, but are used to represent two different sensors participating in the establishment of the response mapping.
[0083] Establishing an effective response mapping relationship between the first sensor and the second sensor specifically includes:
[0084] From the sensor response values corresponding to abnormal samples, filter out sensor response values that exceed the corresponding normal response fluctuation range.
[0085] Under the constraint of normal response fluctuation range, the system establishes an effective response mapping relationship based on the response value sequences of the u-th and v-th sensors in the abnormal samples. The u-th and v-th sensors are any two different types of sensors in the multi-sensor set. For example, the u-th sensor can be a thermal infrared sensor, and the v-th sensor can be an RGB image sensor; or it can be an RGB image sensor pointing to a 3D point cloud sensor.
[0086] Abnormal samples need to undergo effective abnormal response screening before being included in the mapping. If the response value of an abnormal sample under the m-th type of sensor falls outside Ω(m), it is determined that the abnormal sample produces an effective abnormal response under that sensor; if it still falls within Ω(m), it means that the sensor does not show sufficient abnormal deviation for the abnormal sample and is not used to construct the response mapping of that sensor pair. The parameters of this screening rule are derived from the aforementioned normal response fluctuation range, and its purpose is to avoid forcibly including the response of sensors that are not sensitive to a certain type of defect into the mapping training.
[0087] The system pairs the response values of the same anomalous sample only when both the u-th and v-th type sensors produce valid anomalous responses, and the overlap ratio of their acquisition time windows is no less than 80% and the overlap ratio of their spatial regions of interest is no less than 70%. The temporal overlap ratio is derived from the ratio of the intersection to the union of the acquisition windows of the two types of sensors, while the spatial overlap ratio is derived from the ratio of the overlapping area to the union area of the registered regions of interest. The preset process for these two ratio thresholds is as follows: during the calibration phase, the same product is repeatedly acquired to determine the minimum overlap ratio that can maintain a consistent representation of the defect area; if the product's moving speed is high or the defect size is small, the overlap ratio threshold should be increased.
[0088] The sensor response values of the same abnormal sample and corresponding to the first sensor and the second sensor are paired to obtain the first sensor response value sequence and the second sensor response value sequence.
[0089] The first sensor response value sequence refers to the data sequence formed by arranging the sensor response values of multiple abnormal samples under the first sensor according to the sample identifier; the second sensor response value sequence refers to the data sequence formed by arranging the sensor response values of the same batch of abnormal samples under the second sensor according to the same sample identifier.
[0090] For example, for abnormal sample A1, the system extracts its RGB image sensor response value and thermal infrared sensor response value to form a set of response value pairs; for abnormal sample A2, the same method is used to extract its RGB image sensor response value and thermal infrared sensor response value to form another set of response value pairs. The first sensor response values corresponding to multiple abnormal samples are arranged in the order of sample identifiers to form a first sensor response value sequence; the second sensor response values corresponding to the same batch of abnormal samples are arranged in the order of the same sample identifiers to form a second sensor response value sequence.
[0091] A candidate response mapping relationship is established based on the response value sequence of the first sensor and the response value sequence of the second sensor.
[0092] A candidate response mapping relationship refers to a data relationship initially established based on the response value sequences of the first and second sensors, used to deduce the response value of the second sensor from the response value of the first sensor. This relationship is called candidate because it has not yet undergone fitting residual verification and cannot be directly identified as a valid response mapping relationship.
[0093] In practice, candidate response mapping relationships can be established using methods such as linear mapping, piecewise mapping, monotonic mapping, or lookup table mapping. For scenarios with few samples, it is preferable to use a mapping method with fewer parameters and stronger interpretability to avoid overfitting when the number of samples is insufficient.
[0094] A candidate response mapping relationship refers to a preliminary data relationship established based on the response value sequences of the u-th and v-th sensors, used to deduce the response value of the v-th sensor from the response value of the u-th sensor. This relationship is only determined to be a valid response mapping relationship after passing the fitting residual verification. The reason for this setting is that a small number of outlier data may only reflect occasional defect manifestations. If the mapping relationship is used directly without residual verification, the subsequent weight adjustment will be affected by unstable statistics.
[0095] ;
[0096] in, For abnormal samples The fitted response value of the v-th sensor obtained by predicting the response value under the u-th sensor; Abnormal sample The response value under the u-th type of sensor; a(u,v) is the mapping slope, and d(u,v) is the mapping bias. a(u,v) and d(u,v) are derived from paired outlier samples and can be obtained through least squares, least squares with regularization, or robust regression. Since both the input response value and the output fitted response value are dimensionless, a(u,v) is the dimensionless scaling factor, and d(u,v) is the dimensionless bias.
[0097] The mapping slope a(u,v) represents the proportion of the transmission of the change in the response value of the u-th sensor to the change in the response value of the v-th sensor; the mapping bias d(u,v) represents the fixed difference between the two types of sensors at the starting point of the abnormal response. Their relationship to the normal fluctuation boundary is as follows: after obtaining the candidate mapping, it is not directly adopted. Instead, the normal fluctuation boundary b(v) of the v-th sensor is used to determine whether the fitting residual is acceptable. If the mapping fitting error exceeds the normal fluctuation boundary of the v-th sensor, it indicates that the mapping cannot stably explain the response of the v-th sensor and should be marked as invalid.
[0098] When the sample size is small, such as 2 or 3, to avoid a single extreme outlier dominating the mapping slope, a range constraint can be set for a(u,v), for example, 0.05 to 20; and a range constraint can be set for d(u,v), for example, -5 to 5. The preset sources for these ranges can be historical mapping parameters of similar products, empirical upper limits of sensor response values, and the distribution range of outlier sample response values. When the solution result exceeds the range, the excess portion is truncated to the boundary value, and the candidate mapping is marked as a low-confidence mapping; a low-confidence mapping is only considered a valid mapping if the proportion of the fitted residuals meets more stringent conditions.
[0099] Linear mapping is preferred for candidate response mapping because it has fewer parameters, better interpretability, and is less prone to overfitting under conditions of few samples. When the number of outliers increases or the response shows saturation, it can be replaced by piecewise linear mapping, monotonic regression, support vector regression, Gaussian process regression, or a small multilayer perceptron.
[0100] Based on the candidate response mapping relationship and the first sensor response value sequence, a second sensor fitted response value sequence is generated.
[0101] The fitted response value sequence of the second sensor is not data actually collected by the second sensor, but rather data calculated based on the mapping relationship between the response value of the first sensor and the candidate response. Its purpose is to serve as reference data for the second sensor response value sequence, used in subsequent calculations of the fitted residual sequence. If the candidate response mapping relationship is reliable, the fitted response value of the second sensor should be close to the second sensor response value corresponding to the same anomalous sample; if the difference is too large, it indicates that the candidate response mapping relationship cannot stably characterize the correspondence between anomalous responses of the two sensors.
[0102] Based on the difference between the fitted response value sequence of the second sensor and the response value sequence of the second sensor, determine whether the candidate response mapping relationship is a valid response mapping relationship.
[0103] Based on the difference between the fitted response value sequence of the second sensor and the response value sequence of the second sensor, it is determined whether the candidate response mapping relationship is a valid response mapping relationship. The specific process includes:
[0104] The difference between the fitted response value sequence of the second sensor and the response values at the same position in the second sensor response value sequence is calculated to obtain the fitted residual sequence.
[0105] The same ordinal position indicates the position of the same outlier sample in the sequence of fitted response values of the second sensor and the sequence of response values of the second sensor. The difference between the fitted response values of the second sensor with the same ordinal position and the corresponding response values of the second sensor is calculated to obtain the fitting residual corresponding to the outlier sample. The fitting residuals of multiple outlier samples are arranged in sample order to form a sequence of fitting residuals.
[0106] Each fitted residual in the fitted residual sequence is compared with the normal response fluctuation range corresponding to the second sensor.
[0107] The normal response fluctuation range corresponding to the second sensor is derived from the statistical results of the sensor response values of normal samples under the second sensor, and is used to represent the natural response deviation that the second sensor can tolerate under normal conditions. If a certain fitting residual is within this range, it means that the fitting error of the candidate response mapping relationship on the abnormal sample does not exceed the acceptable fluctuation of the second sensor; if a certain fitting residual exceeds this range, it means that the fitting error of the candidate response mapping relationship on the abnormal sample is too large and should not be directly used as valid support.
[0108] In practical implementation, if the normal response fluctuation range corresponding to the second sensor is from zero to the normal fluctuation boundary value, the system determines whether the fitting residual is not greater than the normal fluctuation boundary value; if the normal response fluctuation range corresponding to the second sensor is a bidirectional range, the system determines whether the deviation value corresponding to the fitting residual falls within the bidirectional range.
[0109] The number of fitting residuals within the normal response fluctuation range corresponding to the second sensor is counted to obtain the number of effective residuals.
[0110] The number of effective residuals refers to the number of fitted residuals in the fitted residual sequence that fall within the normal response fluctuation range corresponding to the second sensor.
[0111] When the number of effective residuals meets the preset quantity condition, the candidate response mapping relationship is determined as the effective response mapping relationship.
[0112] The validity determination process for candidate mapping relationships is as follows: For each paired abnormal sample, calculate the fitting residual between the fitted response value and the actual response value of the v-th sensor; compare the fitting residual with the normal fluctuation boundary b(v) of the v-th sensor; count the number of fitting residuals not greater than b(v) to obtain the number of effective residuals; when the proportion of the number of effective residuals to the number of paired abnormal samples reaches the effective residual proportion threshold, the candidate mapping is determined as a valid response mapping relationship. The effective residual proportion threshold is preferably between 0.60 and 0.90, and its preset process can be determined according to the number of abnormal samples in the support set. The fewer the abnormal samples, the higher the proportion threshold should be.
[0113] When a candidate mapping relationship does not meet the validity criteria, the abnormal sample itself is not deleted; instead, only the mapping relationship of that sensor pair is marked as invalid. This invalid mapping does not participate in the cross-sensor prediction and residual weighting of the product under test, but the response values of each sensor can still participate in the final fusion. In this way, the abnormal detection of other sensors can be avoided when the lack of a stable correspondence between a certain sensor pair affects the detection of other sensors.
[0114] For example, in the anomalous samples, the thermal infrared response value sequence is 0.40, 0.60, and 0.90, while the RGB response value sequence is 0.36, 0.56, and 0.74. From paired anomalous samples, a textual mapping rule can be obtained: the RGB fitted response value equals 0.8 times the thermal infrared response value plus 0.05; the corresponding fitted values are 0.37, 0.53, and 0.77. If the normal fluctuation boundary value for RGB is 0.06, and the above three fitted residuals do not exceed this boundary, then this thermal infrared to RGB mapping relationship can be considered a valid response mapping relationship.
[0115] Based on the mapping relationship between the first sensor response value and the effective response of the product under test, the predicted response value of the second sensor of the product under test is obtained.
[0116] Based on the mapping relationship between the first sensor response value and the effective response of the product under test, the predicted response value of the second sensor of the product under test is obtained. The specific process includes:
[0117] Extract the first sensor response value from the sensor response values corresponding to the product to be tested.
[0118] The sensor response value corresponding to the product under test refers to the set of dimensionless response values generated by the product under various sensors. The source of the first sensor response value is the aforementioned response value calculation step.
[0119] When multiple candidate response values exist for the same product under a type u sensor, such as multiple defect candidate regions, multiple detection surfaces, or multiple local windows corresponding to different response values, the first sensor response value that determines the final effective response mapping relationship can be determined according to preset response value extraction rules. Preset response value extraction rules may include the maximum response value rule, the area-weighted average rule for the region of interest, the priority rule for the overlap ratio of defect candidate regions, or the priority rule for quality scores. The preset process for these rules is as follows: during the calibration phase or in historical re-inspection data, the consistency between the anomaly judgment results under different extraction rules and the manual re-inspection results is compared, and the extraction rule with the lowest false positive rate and false negative rate is selected as the default rule for the target product category.
[0120] The first sensor response value is input into the effective response mapping relationship to obtain the second sensor predicted response value.
[0121] An effective response mapping relationship refers to the data relationship in which the response value of a type u sensor is used to deduce the response value of a type v sensor. Its direction is deterministic; that is, the mapping relationship from type u sensor to type v sensor is not the same as the mapping relationship from type v sensor to type u sensor. These relationships need to be established and verified separately. The parameters of the effective response mapping relationship are derived from the paired response values of the same sample identifier in the abnormal sample set. Specifically, only when an abnormal sample exceeds the corresponding normal response fluctuation range under both type u and type v sensors, and the acquisition time windows and spatial regions of interest of both meet the preset overlap requirements, are the two response values of that abnormal sample used as a pair of response values for mapping training. The time overlap and spatial overlap requirements are derived from the aforementioned time synchronization verification and spatial registration verification. Their purpose is to ensure that the two response values participating in the mapping training do indeed correspond to the same abnormal sample, the same detection time period, and the same product area. After the candidate mapping is established, its validity needs to be judged based on the fitting residual between the fitted response value of type v sensor and the actual response value of type v sensor. Only candidate mappings that meet the effective residual quantity condition or the effective residual ratio condition are determined as effective response mapping relationships.
[0122] For scenarios with few samples, effective response mapping relationships preferably employ linear mapping, piecewise linear mapping, single-questionnaire mapping, or low-order regression mapping with slope constraints. To reduce the number of formulas and ensure interpretability, this implementation uses linear mapping as an example to illustrate how the predicted response value of the second sensor is obtained:
[0123] ;
[0124] in, For abnormal samples The fitted response value of the v-th sensor obtained by predicting the response value under the u-th sensor; Abnormal sample The response value under the u-th type sensor; The slope of the mapping. The values represent the mapping bias. a(u,v) and d(u,v) are derived from paired outlier samples and can be obtained using least squares, least squares with regularization, or robust regression. Since both the input and output fitted responses are dimensionless, a(u,v) is the dimensionless scaling factor, and d(u,v) is the dimensionless bias.
[0125] The mapping slope a(u,v) represents the proportion of the transmission of the change in the response value of the u-th sensor to the change in the response value of the v-th sensor; the mapping bias d(u,v) represents the fixed difference between the two types of sensors at the starting point of the abnormal response. Their relationship to the normal fluctuation boundary is as follows: after obtaining the candidate mapping, it is not directly adopted. Instead, the normal fluctuation boundary b(v) of the v-th sensor is used to determine whether the fitting residual is acceptable. If the mapping fitting error exceeds the normal fluctuation boundary of the v-th sensor, it indicates that the mapping cannot stably explain the response of the v-th sensor and should be marked as invalid.
[0126] When the sample size is small, such as 2 or 3, to avoid a single extreme outlier dominating the mapping slope, a range constraint can be set for a(u,v), for example, 0.05 to 20; and a range constraint can be set for d(u,v), for example, -5 to 5. The preset sources for these ranges can be historical mapping parameters of similar products, empirical upper limits of sensor response values, and the distribution range of outlier sample response values. When the solution result exceeds the range, the excess portion is truncated to the boundary value, and the candidate mapping is marked as a low-confidence mapping; a low-confidence mapping is only considered a valid mapping if the proportion of the fitted residuals meets more stringent conditions.
[0127] Extract the second sensor response value from the sensor response value corresponding to the product to be tested.
[0128] The second sensor response value refers to the actual response value calculated for the product T under the type v sensor. It is derived from the difference between the data collected by the product under the type v sensor and the normal response baseline data of the type v sensor. The second sensor response value is not a predicted value, but rather the detection result obtained from the actual data collected by the second sensor. For example, when the type u sensor is an RGB image sensor and the type v sensor is a thermal infrared sensor, the second sensor response value is the abnormal temperature distribution response value of the product under test in the thermal infrared image; when the type u sensor is a thermal infrared sensor and the type v sensor is a 3D point cloud sensor, the second sensor response value is the abnormal geometric shape response value of the product under test in the 3D point cloud. The extracted second sensor response value should correspond to the same product identifier, the same acquisition time window, the same region of interest, or the same product region after spatial registration as the second sensor's predicted response value; otherwise, the difference between the two cannot be considered a valid residual.
[0129] The difference between the predicted response value of the second sensor and the response value of the second sensor is calculated to obtain the residual corresponding to the product to be tested.
[0130] The residual is obtained based on the difference between the predicted response value of the second sensor and the response value of the second sensor of the product to be tested.
[0131] After obtaining the effective response mapping relationship, the predicted response value of the type v sensor is obtained based on the response value of the type u sensor and the effective response mapping relationship of the product T to be tested. The predicted response value is not the actual acquisition result of the type v sensor, but rather the response that the type v sensor should have, calculated based on the response of the type u sensor. Subsequently, the difference between the predicted response value and the actual response value of the type v sensor is calculated to obtain the residual corresponding to the product to be tested.
[0132] ;
[0133] in, Let p(T,v|u) be the prediction deviation of the u-th sensor for the v-th sensor, p(T,v|u) be the predicted response value of the product T to be tested based on the response value of the u-th sensor for the v-th sensor, r(T,v) be the actual response value of the product T to be tested under the v-th sensor, and b(v) be the normal fluctuation boundary value of the v-th sensor. For stability, a value of 10 is preferred. -6 Up to 10 -3 ρ(T,u,v) is the residual ratio. The origin and Consistent.
[0134] The physical meaning of the residual ratio ρ(T,u,v) is: how many times the prediction deviation of the u-th sensor to the v-th sensor corresponds to the normal fluctuation boundary of the v-th sensor. When ρ is close to 0, it indicates that the responses of the two sensors on the current product under test are highly consistent; when ρ is close to 1, it indicates that the prediction deviation is close to the normal allowable fluctuation boundary of the v-th sensor; when ρ is significantly greater than 1, it indicates that there is a mismatch between the responses of the u-th sensor and the v-th sensor. This parameter directly determines whether the subsequent fusion weights are maintained, increased, or decreased.
[0135] It's important to note that a large residual does not directly equate to a product being normal or abnormal. Rather, it indicates a decrease in the interpretability of the type u sensor for the type v sensor. If the type u sensor has a high response but cannot predict the actual response of the type v sensor, it may be due to the type u sensor being affected by noise, reflection, partial occlusion, or accidental surface marks; it could also be that the anomaly is only visible under the type u sensor. This will not directly negate the sensor, but rather reduce its weight in the fusion determination or require corroborating evidence from other sensors.
[0136] If a product under test lacks data from sensor u, the mapping relationship with sensor u as input will not be executed; if data from sensor v is missing, residual verification pointing to sensor v will not be executed. Missing data can be determined by acquisition failure flags, quality scores below a threshold, registration failures, or timestamps exceeding the synchronization tolerance limit. Missing sensors do not participate in the corresponding mapping relationship, while non-missing sensors still participate in fusion according to their own response values. Finally, the weights of available sensors are renormalized.
[0137] Based on the comparison between the residual and the normal response fluctuation range of the second sensor, the fusion weights of the first and second sensors in anomaly detection are adjusted, and the anomaly detection results of the product to be detected are generated according to the adjusted fusion weights.
[0138] Adjusting the fusion weights of the first and second sensors in anomaly detection specifically includes:
[0139] Residual ratio data is generated based on the ratio between the residual and the normal response fluctuation range of the second sensor.
[0140] When the residual ratio data is less than the first preset threshold, the fusion weight of the first sensor and the second sensor in anomaly detection is maintained or increased.
[0141] The first preset threshold is used to distinguish between the consistent response region and the slight mismatch region across sensors, preferably between 0.8 and 1.2, more preferably 1.0. Its source can be the residual ratio distribution in historical normal products, calibrated normal products, or manually verified samples. The preset process can be as follows: during the calibration or trial operation phase, calculate the residual ratio of confirmed normal products and stable abnormal products under each effective response mapping relationship, and statistically analyze the upper limit or near-upper limit quantile of the residual ratio of stable response relationships, using this as the first preset threshold; if historical data is lacking, a threshold of 1.0 can be initially used, indicating that when the predicted residual does not exceed the normal fluctuation boundary of the second sensor, the responses of the two sensors are considered basically consistent.
[0142] When the residual ratio data is greater than or equal to the first preset threshold and less than the second preset threshold, the fusion weight of the first sensor in anomaly detection is reduced, while the fusion weight of the second sensor in anomaly detection is maintained.
[0143] The second preset threshold is used to distinguish between mild mismatch areas and significant mismatch areas, preferably between 1.5 and 3.0, more preferably 2.0, and the second preset threshold is greater than the first preset threshold. The source of the second preset threshold can be the residual ratio distribution in historical abnormal products, false detection samples, missed detection samples, or manually re-confirmed samples. In this embodiment, it is set to 2.0, which means that when the predicted residual reaches about twice the normal fluctuation boundary of the second sensor, the cross-sensor response is considered to have entered a significantly unstable state.
[0144] When the residual ratio data is between the first and second preset thresholds, it indicates that the u-th type sensor still has a certain anomaly indication function, but its response can no longer fully explain the actual response of the v-th type sensor. In this case, the weight of the first sensor is reduced while the weight of the second sensor is maintained because the residual is obtained by comparing the actual response value of the v-th type sensor. The deviation mainly reflects the decreased interpretability of the u-th type sensor for the v-th type sensor, and does not necessarily indicate that the v-th type sensor itself is unreliable. For example, an RGB image may have a high response due to local reflections, but the thermal infrared response does not increase synchronously. In this case, the weight of RGB as the first sensor should be reduced, rather than directly reducing the weight of the thermal infrared sensor. The reduction factor of the first sensor weight is preferably between 0.70 and 0.95.
[0145] When the residual ratio data is greater than or equal to the second preset threshold, the fusion weight of at least the first sensor in the anomaly detection is reduced.
[0146] When the residual ratio is greater than or equal to the second preset threshold, it indicates that the predicted result obtained from the response value of the u-th sensor through the effective response mapping relationship deviates significantly from the actual response value of the v-th sensor, and the cross-sensor response relationship on the product under test is clearly mismatched. At this point, the weight of the first sensor should be reduced because the response of the u-th sensor, as the prediction input, can no longer reasonably explain the response of the v-th sensor; maintaining its high weight may lead to the final abnormal detection result being dominated by unstable or accidental single-sensor responses. Whether to reduce the weight of the second sensor can be further determined based on whether the response value of the v-th sensor itself falls within the normal response fluctuation range: if the response value of the v-th sensor itself significantly exceeds the normal response fluctuation range, it indicates that the second sensor still provides independent evidence of anomalies, and its weight can be retained; if the response value of the v-th sensor itself is within the normal response fluctuation range, but the residual is large due to the mapping prediction, it indicates that the mapping relationship itself is unreliable, and the confidence level of the evidence corresponding to the mapping relationship can be reduced simultaneously.
[0147] The weight reduction factor for the significant mismatch region is preferably between 0.05 and 0.50, and its sources can include the proportion of false positives or false negatives caused by the first sensor in historical significantly mismatched samples, sensor quality scores, defect type sensitivity, and manual re-inspection results. When the response relationship between the two sensors is already significantly inconsistent, by reducing the weight of at least the first sensor, the final result relies more on evidence from non-mismatched sensors or other effective mapping relationships, thereby improving the robustness of anomaly detection under few sample conditions.
[0148] When the product to be detected corresponds to multiple valid response mapping relationships, adjusting the fusion weights of the first and second sensors in anomaly detection also includes:
[0149] The corresponding second sensor predicted response value and residual are obtained based on each effective response mapping relationship.
[0150] Based on the comparison results between each residual and the normal response fluctuation range of the corresponding second sensor, residual ratio data corresponding to each effective response mapping relationship are generated.
[0151] The residual ratios of each effective response mapping are calculated using the normal fluctuation boundary of its output sensor. For example, the residual ratio from the RGB image sensor to the thermal infrared sensor uses the normal fluctuation boundary of the thermal infrared sensor; the residual ratio from the thermal infrared sensor to the 3D point cloud sensor uses the normal fluctuation boundary of the 3D point cloud sensor.
[0152] The weighting priority of each effective response mapping relationship is determined according to the order of the residual ratio data from smallest to largest.
[0153] Weight adjustment priority refers to the order in which multiple valid response mapping relationships participate in weight adjustment when they may all affect sensor weights. If the difference in the residual ratio of two mapping relationships is less than a preset minor difference threshold, the priority is further determined according to data quality scores from high to low, spatial overlap ratios from high to low, and historical valid counts from high to low. The preset minor difference threshold is preferably 0.01 to 0.05, and its source is the natural fluctuation range of the residual ratio when the same product is repeatedly collected.
[0154] Prioritize adjusting the fusion weights of corresponding sensors in anomaly detection based on the effective response mapping relationship with smaller residual ratio data.
[0155] When adjusting weights based on priority, the temporary weights of the corresponding sensors are adjusted first according to the mapping relationships with smaller residual ratios, and then the mapping relationships with larger residual ratios are processed sequentially. If the same sensor is repeatedly adjusted by multiple mapping relationships, an upper limit for the adjustment amplitude in a single round can be set to avoid the weight being continuously amplified or continuously depressed. The upper limit for the adjustment amplitude in a single round is preferably 30% of the temporary weight of the previous round.
[0156] The anomaly detection results for the product to be tested are generated based on the adjusted fusion weights. The specific process includes:
[0157] Based on the adjusted fusion weights, the response values of each sensor corresponding to the product to be tested are weighted to obtain the fused response value.
[0158] The fusion response value is compared with the preset anomaly detection threshold.
[0159] When the fusion response value reaches the preset anomaly detection threshold, an anomaly detection result is generated.
[0160] When the fusion response value does not reach the preset anomaly judgment threshold, a normal detection result is generated.
[0161] ;
[0162] In the formula, F(T) is the fusion response value of the product T to be tested; w′(m) is the fusion weight adjusted by the m-th type of sensor; r(T,m) is the response value of the product T to be tested under the m-th type of sensor; and τ is the preset anomaly judgment threshold. The preset anomaly judgment threshold τ can be derived from the 95th quantile of the fusion response value of normal samples plus a safety margin, preferably 0 to 0.2; or it can be derived from the results of manual re-inspection of historical products, customer quality standards, cost constraints for false alarms and omissions, or migration thresholds of products in the same family. F(T), r(T,m) and τ are all dimensionless quantities, and w′(m) is a dimensionless weight.
[0163] The process for setting the preset anomaly detection threshold τ can be as follows: During the calibration phase, calculate the distribution of fused response values using normal samples and select the high quantile as the initial threshold; if a small number of abnormal samples exist, combine the fused response values of the abnormal samples to select a threshold that can separate normal samples from abnormal samples; if the distributions of normal and abnormal samples overlap, prioritize determining the threshold based on business objectives, for example, using a lower threshold for safety-critical products to reduce missed detections, and a higher threshold for non-critical appearance inspections to reduce false detections. Subsequently, the false alarm rate and missed detection rate can be statistically analyzed based on the results of manual re-inspection, and τ can be updated according to a set period.
[0164] For example, the effective mapping relationship from thermal infrared to RGB is that the predicted RGB response value equals 0.8 times the thermal infrared response value plus 0.05. If the thermal infrared response value of the product to be detected is 0.72 and the actual RGB response value is 0.60, then the predicted RGB response value is 0.626, and the residual is 0.026. If the normal fluctuation boundary value of RGB is 0.05, then the residual ratio is approximately 0.52, which is less than the first preset threshold of 1.0, indicating that the thermal infrared and RGB responses are consistent, and their weights can be maintained or slightly increased. If the thermal infrared response value of the product to be detected is still 0.72, but the actual RGB response value is 0.20, then the predicted RGB response value is still 0.626, the residual is 0.426, and the residual ratio is approximately 8.52, which is greater than the second preset threshold of 2.0, thus at least reducing the fusion weight when thermal infrared is used as the first sensor.
[0165] Please see Figure 2 As shown, the multi-sensor anomaly detection system based on few-sample statistics specifically includes:
[0166] The detection data acquisition module is used to acquire a small sample support set of the target product category and multi-sensor detection data of the same product to be tested within a preset acquisition time window. The small sample support set includes normal samples and abnormal samples, and each sample includes data collected by at least two types of sensors.
[0167] The fluctuation range determination module is used to obtain the sensor response value corresponding to each sensor based on a small sample support set and multi-sensor detection data, and to determine the normal response fluctuation range of each sensor based on the sensor response value corresponding to the normal sample.
[0168] The response mapping relationship establishment module is used to establish an effective response mapping relationship between the first sensor and the second sensor based on the response value sequence of the first sensor and the response value sequence of the second sensor in the abnormal sample, under the constraint of the normal response fluctuation range.
[0169] The predicted response value generation module is used to obtain the predicted response value of the second sensor of the product under test based on the mapping relationship between the first sensor response value and the effective response of the product under test.
[0170] The residual calculation module is used to obtain the residual based on the difference between the predicted response value of the second sensor and the response value of the second sensor of the product to be tested.
[0171] The anomaly detection module is used to adjust the fusion weights of the first and second sensors in anomaly detection based on the comparison results between the residual and the normal response fluctuation range of the second sensor, and to generate anomaly detection results of the product to be detected based on the adjusted fusion weights.
[0172] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the above functions can be divided into different functional modules to complete all or part of the functions described above.
[0173] In the embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0174] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions within the technical scope disclosed in the present invention should be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A multi-sensor anomaly detection method based on few-sample statistics, characterized in that, include: Acquire a small sample support set for the target product category and multi-sensor detection data of the same product to be detected within a preset collection time window. The small sample support set includes normal samples and abnormal samples, and each sample includes data collected by at least two types of sensors. Based on the few-sample support set and the multi-sensor detection data, the sensor response value corresponding to each sensor is obtained, and the normal response fluctuation range of each sensor is determined according to the sensor response value corresponding to the normal sample. Under the constraint of the normal response fluctuation range, an effective response mapping relationship between the first sensor and the second sensor is established based on the first sensor response value sequence and the second sensor response value sequence in the abnormal sample; Based on the first sensor response value of the product to be tested and the effective response mapping relationship, the second sensor predicted response value of the product to be tested is obtained; The residual is obtained based on the difference between the predicted response value of the second sensor and the response value of the second sensor of the product to be tested; Based on the comparison between the residual and the normal response fluctuation range of the second sensor, the fusion weights of the first and second sensors in anomaly detection are adjusted, and the anomaly detection result of the product to be detected is generated according to the adjusted fusion weights.
2. The multi-sensor anomaly detection method based on few-sample statistics as described in claim 1, characterized in that: The step of obtaining the sensor response value corresponding to each sensor based on the few-sample support set and the multi-sensor detection data specifically includes: Normal response feature data is extracted from normal sample acquisition data corresponding to the same sensor, and normal response benchmark data corresponding to the sensor is generated based on the normal response feature data. Response feature data are extracted from the abnormal sample data collected from the same sensor and the sensor detection data of the product to be tested, respectively. The differences between the response feature data corresponding to the abnormal sample, the response feature data corresponding to the product to be tested, and the normal response baseline data are calculated respectively to obtain the sensor response value corresponding to the abnormal sample and the sensor response value corresponding to the product to be tested. The sensor response values are associated and stored according to sensor type and sample identifier.
3. The multi-sensor anomaly detection method based on few-sample statistics as described in claim 1, characterized in that: The step of determining the normal response fluctuation range of each sensor based on the sensor response values corresponding to the normal samples specifically includes: By performing pairwise differences on the sensor response values corresponding to different normal samples under the same sensor, a sequence of response differences among normal samples is obtained. The response difference sequence among the normal samples is sorted according to its numerical value, and the response difference value corresponding to a predetermined number of bits is extracted as the normal fluctuation boundary value. When the maximum difference value in the response difference sequence among normal samples exceeds a preset discrete threshold, the normal sample that generates the maximum difference value is removed and the normal fluctuation boundary value is obtained again. The normal response fluctuation range of the sensor is determined based on the normal fluctuation boundary value.
4. The multi-sensor anomaly detection method based on few-sample statistics as described in claim 1, characterized in that: The establishment of an effective response mapping relationship between the first sensor and the second sensor specifically includes: From the sensor response values corresponding to abnormal samples, filter out sensor response values that exceed the corresponding normal response fluctuation range; Pair the sensor response values that belong to the same abnormal sample and correspond to the first sensor and the second sensor respectively to obtain the first sensor response value sequence and the second sensor response value sequence. Establish a candidate response mapping relationship based on the first sensor response value sequence and the second sensor response value sequence; Based on the candidate response mapping relationship and the first sensor response value sequence, a second sensor fitted response value sequence is generated; Based on the difference between the fitted response value sequence of the second sensor and the response value sequence of the second sensor, it is determined whether the candidate response mapping relationship is a valid response mapping relationship.
5. The multi-sensor anomaly detection method based on few-sample statistics as described in claim 4, characterized in that: Based on the difference between the fitted response value sequence of the second sensor and the response value sequence of the second sensor, it is determined whether the candidate response mapping relationship is a valid response mapping relationship. The specific process includes: The difference between the fitted response value sequence of the second sensor and the response value at the same position in the second sensor response value sequence is calculated to obtain the fitted residual sequence; Each fitting residual in the fitted residual sequence is compared with the normal response fluctuation range corresponding to the second sensor. The number of fitting residuals within the normal response fluctuation range corresponding to the second sensor is counted to obtain the number of effective residuals. When the number of effective residuals meets the preset quantity condition, the candidate response mapping relationship is determined as an effective response mapping relationship.
6. The multi-sensor anomaly detection method based on few-sample statistics as described in claim 1, characterized in that: The process of obtaining the second sensor predicted response value of the product under test based on the mapping relationship between the first sensor response value and the effective response of the product under test includes: Extract the first sensor response value from the sensor response value corresponding to the product to be tested; The first sensor response value is input into the effective response mapping relationship to obtain the second sensor predicted response value; Extract the second sensor response value from the sensor response value corresponding to the product to be tested; The difference between the predicted response value of the second sensor and the response value of the second sensor is calculated to obtain the residual corresponding to the product to be detected.
7. The multi-sensor anomaly detection method based on few-sample statistics as described in claim 6, characterized in that: Adjusting the fusion weights of the first and second sensors in anomaly detection specifically includes: Based on the ratio between the residual and the normal response fluctuation range of the second sensor, residual ratio data is generated; When the residual ratio data is less than a first preset threshold, the fusion weight of the first sensor and the second sensor in anomaly detection is maintained or increased. When the residual ratio data is greater than or equal to the first preset threshold and less than the second preset threshold, the fusion weight of the first sensor in anomaly detection is reduced, while the fusion weight of the second sensor in anomaly detection is maintained. When the residual ratio data is greater than or equal to the second preset threshold, the fusion weight of at least the first sensor in the anomaly detection is reduced.
8. The multi-sensor anomaly detection method based on few-sample statistics as described in claim 7, characterized in that: When the product to be detected corresponds to multiple valid response mapping relationships, adjusting the fusion weights of the first and second sensors in anomaly detection further includes: The corresponding second sensor predicted response value and residual are obtained based on each effective response mapping relationship; Based on the comparison results between each residual and the normal response fluctuation range of the corresponding second sensor, residual ratio data corresponding to each effective response mapping relationship are generated; The weight adjustment priority of each effective response mapping relationship is determined according to the residual ratio data in ascending order; Prioritize adjusting the fusion weights of corresponding sensors in anomaly detection based on the effective response mapping relationship with smaller residual ratio data.
9. The multi-sensor anomaly detection method based on few-sample statistics as described in claim 7, characterized in that: The abnormal detection results of the product to be detected are generated based on the adjusted fusion weights. The specific process includes: Based on the adjusted fusion weights, the response values of each sensor corresponding to the product to be detected are weighted to obtain the fusion response value. The fusion response value is compared with a preset anomaly detection threshold. When the fusion response value reaches the preset anomaly determination threshold, an anomaly detection result is generated; When the fusion response value does not reach the preset anomaly determination threshold, a normal detection result is generated.
10. A multi-sensor anomaly detection system based on few-sample statistics, characterized in that: Specifically, it includes: The detection data acquisition module is used to acquire a small sample support set of the target product category and multi-sensor detection data of the same product to be detected within a preset acquisition time window. The small sample support set includes normal samples and abnormal samples, and each sample includes data collected by at least two types of sensors. The fluctuation range determination module is used to obtain the sensor response value corresponding to each sensor based on the few sample support set and the multi-sensor detection data, and to determine the normal response fluctuation range of each sensor based on the sensor response value corresponding to the normal sample. The response mapping relationship establishment module is used to establish an effective response mapping relationship between the first sensor and the second sensor based on the first sensor response value sequence and the second sensor response value sequence in the abnormal sample, under the constraint of the normal response fluctuation range. The predicted response value generation module is used to obtain the second sensor predicted response value of the product under test based on the first sensor response value of the product under test and the effective response mapping relationship; The residual calculation module is used to obtain the residual based on the difference between the predicted response value of the second sensor and the response value of the second sensor of the product to be tested. The anomaly determination module is used to adjust the fusion weights of the first and second sensors in anomaly detection based on the comparison result between the residual and the normal response fluctuation range of the second sensor, and to generate the anomaly detection result of the product to be detected according to the adjusted fusion weights.
