Cash register anti-fraud analysis method and system based on AI
By integrating an edge AI chip into the cash register, transaction data and physical images are collected and analyzed simultaneously to detect fraudulent behavior in real time. This solves the problem that traditional cash register systems cannot effectively prevent fraud and achieves efficient and accurate fraud prevention measures.
Patent Information
- Application Number
- CN202511932530.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional POS systems cannot detect fraud in real time, rely on manual review after the fact with low accuracy, and cannot effectively prevent fraudulent activities such as product swapping, missed product scanning, and fake scanning.
By integrating an edge AI chip into the cash register, transaction declaration data, product images, and cash register operation features are collected simultaneously. Through feature extraction and comprehensive calculation, the fraud risk level is determined and a real-time response is triggered, thus building a multi-dimensional protection system.
It enables real-time fraud detection, shortens fraud response time, improves the accuracy and robustness of fraud prevention, and protects the privacy and security of product images and operational data.
Smart Images

Figure CN121599671A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cash register fraud prevention technology, and in particular to an AI-based cash register fraud prevention analysis method and system. Background Technology
[0002] In the field of fraud prevention at retail checkouts, traditional POS systems rely solely on transaction declaration data for back-end auditing. They can only record whether a barcode scanner triggered a scan and the corresponding product barcode information, but cannot obtain the actual condition of the products in the scanning area. This means that when cashiers engage in fraudulent activities that rely on physical evidence, such as swapping products, missing scans, or fake scans, the back-end auditing system cannot detect them due to the lack of physical evidence. Existing back-end auditing methods handle suspected fraudulent transactions through manual review afterward, which is time-consuming and cannot intercept transactions in real time, allowing losses to occur after the fraud has already taken place. Furthermore, even when equipped with cameras, current technology only records and stores the images for later review, without real-time analysis of the image content. It cannot convert image information into calculable numerical features for automated verification, resulting in low accuracy in fraud prevention at current POS systems. Summary of the Invention
[0003] This invention provides an AI-based fraud prevention analysis method and system for cash registers. This invention shortens the fraud response time and effectively protects the privacy and security of product images and operational data.
[0004] In a first aspect, the present invention provides an AI-based fraud prevention analysis method for cash registers, the AI-based fraud prevention analysis method for cash registers comprising: When the barcode scanning device in the cash register triggers scanning, it simultaneously collects the transaction declaration data of the POS system, the actual product image from the camera, and the characteristics of the cash register operation. Feature extraction is performed on the physical image of the goods to obtain a physical feature vector of the goods, and a standard feature vector is obtained by querying the local product database based on the product barcode number in the transaction declaration data; A comprehensive score is calculated based on the physical feature vector of the goods, the standard feature vector, and the cashier operation features. The fraud risk level is determined based on the numerical range of the overall score, and a corresponding real-time response operation is triggered based on the fraud risk level.
[0005] In conjunction with the first aspect, in a first implementation of the first aspect of the present invention, the step of simultaneously collecting transaction declaration data from the POS system, product images from the camera, and cashier operation features when the barcode scanning device in the cash register triggers scanning includes: When the barcode scanning device in the cash register triggers scanning, it sends a barcode recognition success signal to the POS system. The edge AI chip monitors the data bus, detects the trigger signal, and records the trigger time as the scanning time. Read the transaction declaration data generated at the time of scanning from the transaction data buffer of the POS system. The transaction declaration data includes the product barcode number, the declared unit price and the declared quantity. Based on the scanning time, control the camera to capture an image of the actual product; Record the scanning trigger duration and scanning time interval corresponding to the scanning time, and determine whether the manual price change or discount rate modification function is called and generate a special permission call flag to obtain the cashier operation characteristics; The scanning time, the transaction declaration data, the physical image of the product, and the cashier operation features are packaged and stored in the memory buffer of the edge AI chip.
[0006] In conjunction with the first aspect, in a second implementation of the first aspect of the present invention, the step of extracting features from the physical image of the commodity to obtain a commodity feature vector, and querying the local commodity database based on the commodity barcode number in the transaction declaration data to obtain a standard feature vector, includes: In the edge AI chip, the physical image of the product is converted from the RGB color space to the HSV color space to construct a color feature vector; Extract the product outline from the product image and calculate the convex hull to obtain the circumscribed rectangle. Calculate the ratio of the width to the height of the circumscribed rectangle as the aspect ratio, calculate the ratio of the area enclosed by the outline to the square of the outline perimeter as the roundness, and calculate the ratio of the area enclosed by the outline to the area of the circumscribed rectangle as the rectangularity. A shape feature vector is constructed based on the aspect ratio, the circularity, and the rectangularity, and the product image is converted into a grayscale image and a texture feature vector is calculated. The color feature vector, the shape feature vector, and the texture feature vector are concatenated to form the product feature vector. The standard feature vector is obtained by querying the local product database based on the product barcode number in the transaction declaration data.
[0007] In conjunction with the first aspect, in a third implementation of the first aspect of the present invention, the step of querying the local commodity database based on the commodity barcode number in the transaction declaration data to obtain the standard feature vector includes: Based on the product barcode number in the transaction declaration data, a query is performed in the memory cache hash table of the edge AI chip to determine whether it matches the pre-loaded hot product feature vector; When the memory cache hash table is hit, the hot product feature vector is used as the corresponding standard feature vector; When the memory cache hash table is not found, the local product database in the eMMC memory of the edge AI chip is accessed according to the product barcode number, the standard reference image and pre-calculated feature vector in the corresponding product record are read, and the pre-calculated feature vector is used as the standard feature vector.
[0008] In conjunction with the first aspect, in the fourth implementation of the first aspect of the present invention, the step of calculating the comprehensive total score based on the physical feature vector of the goods, the standard feature vector, and the cashier operation features includes: The first score is calculated based on the physical feature vector of the commodity and the standard feature vector; Calculate the deviation of the scan trigger duration from the normal trigger duration, calculate the deviation of the scan time interval from the normal interval range, and calculate the discount deviation when the special permission call flag is 1 and the ratio of the declared unit price to the median of historical prices is less than the preset target value. The second score is calculated based on the duration deviation, the interval deviation, and the discount deviation. The absolute value of the difference between the number of outlines detected in the actual product image and the declared quantity is calculated and divided by the declared quantity to obtain the quantity deviation. A third score is calculated based on the quantity deviation and the duration deviation. The first score, the second score, and the third score are weighted and summed to obtain the overall total score.
[0009] In conjunction with the first aspect, in a fifth implementation of the first aspect of the present invention, the step of calculating the first score based on the physical feature vector of the commodity and the standard feature vector includes: The dot product value of the product is obtained by multiplying the physical feature vector of the commodity with the standard feature vector one by one and summing them. Calculate the sum of squares and take the square root of the product feature vectors to obtain the product feature vector norm. Calculate the sum of squares and take the square root of the standard feature vectors to obtain the standard feature vector norm. Multiply the product feature vector norm and the standard feature vector norm to obtain the norm product. The cosine similarity is obtained by dividing the dot product of the feature vectors by the norm product, and the cosine similarity is used as the first score.
[0010] In conjunction with the first aspect, in the sixth implementation of the first aspect of the present invention, the calculation of the deviation between the scanning trigger duration and the normal trigger duration, the calculation of the deviation between the scanning time interval and the normal interval range, and the calculation of the discount deviation when the special permission call flag is 1 and the ratio of the declared unit price to the median historical price is less than a preset target value, includes: Calculate the deviation of the scan trigger duration from the median of the normal trigger duration; Calculate the positive deviation of the scanning time interval from the upper limit of the normal interval range, calculate the negative deviation of the lower limit of the normal interval range from the scanning time interval, and sum the positive deviation and the negative deviation to obtain the interval deviation degree. Determine whether the special permission call flag is 1; When the special permission call flag is 1, the local product database is queried for the historical median price corresponding to the product barcode number, and the ratio of the declared unit price to the historical median price is calculated. When the ratio is less than a preset target value, the discount deviation is calculated based on the ratio.
[0011] In conjunction with the first aspect, in the seventh implementation of the first aspect of the present invention, the step of determining the fraud risk level based on the numerical range of the overall score and triggering a corresponding real-time response operation based on the fraud risk level includes: Determine the numerical range in which the overall score falls; When the total score is greater than or equal to the first threshold, the fraud risk level is determined to be normal transaction; when the total score is between the second threshold and the first threshold, the fraud risk level is determined to be low risk; when the total score is between the third threshold and the second threshold, the fraud risk level is determined to be medium risk; and when the total score is less than the third threshold, the fraud risk level is determined to be high risk. When the fraud risk level is normal, the normal release operation is performed. When the fraud risk level is low, a yellow prompt box instruction is sent to the cash register display controller through the edge AI chip. When the fraud risk level is medium, a buzzer instruction and an orange warning dialog box are sent, and the supervisor is required to swipe the card for authorization before the transaction can continue. When the fraud risk level is high, a transaction lock instruction is sent to the POS main control system to freeze the current transaction.
[0012] In conjunction with the first aspect, in the eighth implementation of the first aspect of the present invention, the AI-based POS machine fraud prevention analysis method further includes: When the fraud risk level is low, medium or high, the transaction declaration data, the physical image of the goods, the physical feature vector of the goods and the comprehensive score are packaged into a risk transaction record and stored in the eMMC memory of the edge AI chip and uploaded to the background audit database via the local area network.
[0013] Secondly, the present invention provides an AI-based fraud prevention analysis system for cash registers, the AI-based fraud prevention analysis system for cash registers comprising: The synchronous acquisition module is used to synchronously acquire transaction declaration data from the POS system, physical images of goods from the camera, and cashier operation characteristics when the barcode scanning device in the cash register triggers scanning. The feature extraction module is used to extract features from the physical image of the goods to obtain a physical feature vector of the goods, and to query the local product database based on the product barcode number in the transaction declaration data to obtain a standard feature vector; The comprehensive calculation module is used to calculate the comprehensive total score based on the physical feature vector of the goods, the standard feature vector, and the cashier operation features; The real-time response module is used to determine the fraud risk level based on the numerical range of the overall score, and to trigger the corresponding real-time response operation based on the fraud risk level.
[0014] The technical solution provided by this invention integrates an edge AI chip and a visual acquisition module into the cash register, constructing a triangular data source synchronous acquisition architecture that combines transaction declaration data, product images, and operational behavior features. This overcomes the limitations of traditional cash register systems that only collect transaction declaration data from a single dimension. The local real-time computing capability of the edge AI chip enables feature extraction and consistency verification instantly upon scanning each transaction, shifting from traditional post-event passive auditing to proactive in-event interception, effectively shortening fraud response time. A multi-dimensional appearance feature quantification algorithm for product images converts color, shape, and texture information into computable numerical feature vectors, upgrading the consistency verification between the product and the declaration from manual review to automatic quantitative comparison. The triangular cross-validation mechanism calculates and weights the consistency scores of the declaration and the product, the declaration and the behavior, and the product and the behavior, constructing a multi-dimensional protection system that is difficult to circumvent by a single fraudulent method. Compared to traditional single-dimensional detection, this improves the accuracy and robustness of fraud identification. Based on the overall score, different levels of processing are automatically triggered, which ensures the effectiveness of fraud prevention while also taking into account the smoothness of checkout and user experience. Moreover, all data processing is completed locally on the edge device without uploading to the cloud, effectively protecting the privacy and security of product images and operation data. Attached Figure Description
[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram illustrating the steps of the AI-based cash register anti-fraud analysis method in an embodiment of the present invention; Figure 2This is a schematic diagram of the AI-based anti-fraud analysis system for cash registers in an embodiment of the present invention. Detailed Implementation
[0017] This invention provides an AI-based fraud prevention analysis method and system for cash registers. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0018] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the AI-based fraud prevention analysis method for cash registers in this invention includes: Step S101: When the barcode scanning device in the cash register triggers scanning, the transaction declaration data of the POS system, the actual product image of the camera, and the cash register operation characteristics are collected simultaneously. Specifically, when the barcode scanner in the cash register triggers a scan, it sends a barcode recognition success signal to the POS system. The edge AI chip continuously monitors the data stream from the POS main control system via the SPI data bus. When it detects a barcode recognition success signal, it records the time of the trigger event as a unified reference timestamp T0 for the current scanning event. Simultaneously with the scanning signal trigger, the edge AI chip reads the latest transaction record from the POS system's transaction data buffer to obtain the transaction declaration data corresponding to the scanning event. The transaction declaration data includes structured fields such as the product barcode number, declared unit price, and declared quantity, used to represent the cashier's systematic declaration of the current product. Based on the recorded scanning time T0, the edge AI chip controls the connected industrial-grade RGB camera to enter a high frame rate acquisition mode, continuously acquiring images of the product within the scanning area at a frequency of 30 frames per second within a 1-second time window defined before and after T0, forming a set of raw image frames. An additional 3-second time window is defined before and after the scanning event. During this time window, the press and release times of the barcode scanner button are recorded to calculate the scanning trigger duration parameter. Simultaneously, the time interval between the current scanning event and the previous scanning event is calculated. It is then determined whether special permission functions such as manual price adjustment, discount rate modification, or return registration are invoked within this time window. If such operations exist, the permission invocation flag is set to 1; otherwise, it is set to 0. This generates the corresponding checkout operation characteristics for the current scanning event. The scanning time T0, structured transaction declaration data, product image frame, and checkout operation characteristic parameters are uniformly encapsulated into a scanning event data structure and written to the LPDDR4 memory buffer built into the edge AI chip.
[0019] Step S102: Extract features from the physical image of the goods to obtain the physical feature vector of the goods, and query the local product database according to the product barcode number in the transaction declaration data to obtain the standard feature vector; Specifically, after receiving the product image corresponding to the scanning event in the edge AI chip, a color space transformation operation is performed on the image. The original RGB image is converted to the HSV color space pixel by pixel to enhance the robustness of color distribution under different lighting conditions. The H channel is used to represent the dominant hue of the pixel, the S channel represents saturation, and the V channel represents the brightness component. The hue value of the H channel is divided into eight preset intervals, and the pixel proportion in each interval is counted to construct an 8-dimensional color histogram vector, which serves as a color feature vector to represent the dominant hue distribution pattern of the product. The Canny edge detection algorithm is applied to the original image to extract the product outline boundary, and the convex hull shape is calculated on the set of edge points to obtain the minimum bounding rectangle of the product. The ratio of the width to the height of the minimum bounding rectangle is calculated as the aspect ratio parameter. Then, the roundness parameter is obtained by the ratio between the area enclosed by the outline and the square of the outline perimeter. At the same time, the area of the outline and the area of the bounding rectangle are compared. The ratio serves as a rectangularity parameter, and together these three elements constitute a shape feature vector describing the geometric shape of the product. The RGB image is converted to grayscale, and a Local Binary Pattern (LBP) operator is applied to extract texture features. An LBP(1,8) configuration with a radius of 1 and 8 sampling points is used to calculate the local texture pattern for each pixel. The LBP encoding results of the entire image are then statistically analyzed into a 256-dimensional histogram, from which 59 rotation-invariant uniform patterns are extracted to form a texture frequency vector. Principal component analysis is then used for dimensionality reduction, retaining the first five principal components to form the texture feature vector. The color feature vector, shape feature vector, and texture feature vector are concatenated sequentially to obtain a unified format product feature vector, representing the multidimensional visual attributes of the product in the current scanning area. Simultaneously, the edge AI chip uses the product barcode number in the transaction declaration data as a query key to access the hash index structure of the local product database and search for the corresponding standard feature vector in the cache. The standard feature vector is a representation of the same-dimensional visual features extracted from the pre-stored corresponding product sample image.
[0020] Step S103: Calculate the overall score based on the product's physical feature vector, standard feature vector, and cashier operation features; Specifically, the cosine similarity between the physical feature vector of the product and the standard feature vector is calculated to assess the degree of consistency in appearance between the actual scanned product and the product declared by the system in dimensions such as color, shape, and texture. The cosine similarity value ranges from 0 to 1, with a value closer to 1 indicating a greater consistency between the physical product and the declared product. This value is defined as the first score. To identify suspicious features in the operation behavior, the trigger duration of the barcode scanner is compared with the median of the standard trigger duration, and a standardized deviation is constructed using the standard deviation as the denominator to obtain the duration deviation. At the same time, the time interval between the current scanning event and the previous event is compared with the normal interval range, and an interval deviation is constructed after upper and lower limit clipping. When the special permission call flag is detected as 1 and the ratio of the declared unit price to the median of the product's historical price is lower than the set lower price threshold, the discount deviation is introduced as an additional penalty factor. The above three deviation parameters are substituted into the exponential decay function to construct a behavior consistency scoring model. The calculated value is the second score, which is used to measure the degree of reasonable matching between the operation behavior and the declared price. A contour recognition algorithm is executed on the actual product image to determine the quantity of products in the actual scanning area. The number of contours identified in the image is counted and compared with the declared quantity field in the transaction declaration data. The absolute value of the difference between the two is calculated and divided by the declared quantity to construct a quantity deviation index. The quantity deviation index is used to reflect the degree of deviation between the actual quantity and the declared quantity. At the same time, combined with the time deviation, a product-behavior consistency scoring function is constructed to calculate a third score, which reflects whether there are suspicious behaviors such as quickly scanning large products or scanning one item multiple times. The first, second, and third scores are linearly weighted and fused according to preset weighting coefficients. The first score is given the highest weight because it provides evidence of product consistency, the second score is given a medium weight for analyzing operational anomalies, and the third score is given the lowest weight as an auxiliary evaluation indicator. The weighted value is the comprehensive total score.
[0021] Step S104: Determine the fraud risk level based on the numerical range of the overall score, and trigger the corresponding real-time response operation based on the fraud risk level.
[0022] Specifically, the overall score is used for range judgment, with three continuously decreasing judgment thresholds: the first threshold, the second threshold, and the third threshold. When the overall score is greater than or equal to the first threshold, the current transaction is judged to be at the "normal transaction" risk level. The edge AI chip does not take any intervention measures, and the control process directly enters the release channel, allowing the cashier to continue scanning the next item. When the overall score is between the second and first thresholds, the current transaction is judged to be "low risk." At this time, the edge AI chip sends a command to the cash register's display controller through the built-in bus control interface, and a prompt box with a yellow border pops up in the upper right corner of the cashier interface, prompting "Please verify product information." The prompt box automatically disappears after three seconds without interrupting the cashier process. At the same time, the transaction declaration data, product image, operation characteristics, and overall score of this transaction are packaged and recorded, and uploaded to the back-end server through the store's local area network. When the overall score is between the third and second thresholds, the current transaction is marked as "medium risk." At this time, the edge AI chip sends a command to the cash register's display controller through the built-in bus control interface. A buzzer sounds at a frequency of 2000Hz for 0.5 seconds to alert the cashier. Simultaneously, an orange warning dialog box pops up in the center of the checkout screen, displaying the message "Inconsistent product information detected; please have supervisor review." This dialog box blocks the checkout process, preventing further scanning or payment until the supervisor authenticates the transaction using their authorized card. The supervisor's employee ID and authentication time are recorded as an authorization log appended to the current transaction record. If the overall score is less than the third threshold, the transaction is deemed a "high-risk" fraud. The edge AI chip immediately sends a transaction lock command to the POS main control system, forcibly freezing the current transaction process. The checkout screen automatically switches to a red full-screen warning interface displaying "Serious fraud risk detected; transaction frozen." An alarm is also pushed to the store management system's real-time monitoring module via the local area network, notifying the store manager to conduct a manual verification. The verification result must be confirmed by the administrator's authorized card before system operation can resume. Simultaneously, the transaction data is permanently archived in both the edge AI chip and the backend database.
[0023] In one specific embodiment, the process of performing step S101 may specifically include the following steps: When the barcode scanning device in the cash register triggers scanning, it sends a barcode recognition success signal to the POS system. The edge AI chip listens to the data bus, detects the trigger signal, and records the trigger time as the scanning time. Read the transaction declaration data generated at the time of scanning from the transaction data buffer of the POS system. The transaction declaration data includes the product barcode number, the declared unit price and the declared quantity. Based on the scanning time, control the camera to capture images of the actual product; Record the scanning trigger duration and scanning time interval corresponding to the scanning time, and determine whether the manual price change or discount rate modification function is called and generate a special permission call flag to obtain the cashier operation characteristics; The scanning time, transaction declaration data, product images, and cashier operation features are packaged and stored in the memory buffer of the edge AI chip.
[0024] Specifically, when the barcode scanner in the cash register triggers a scan, it sends a barcode recognition success signal to the POS system after completing barcode recognition. This signal serves as a transaction-level trigger event, transmitted along the SPI data bus. The edge AI chip continuously monitors the communication flow on the data bus. When it detects this type of barcode recognition signal, it records the time of detection and uses this time as the unified reference time for this scanning event, i.e., scanning time T0. The edge AI chip extracts transaction record data matching T0 from the transaction data buffer shared with the POS system. This transaction record data consists of structured product information input by the cashier through the system, including three core fields: product barcode number, product unit price, and product quantity. Simultaneously, the edge AI chip triggers the camera control module to enter working mode based on scanning time T0. This drives a high-definition industrial RGB camera fixed above the scanning area to continuously capture several frames of product images at a rate of 30 frames per second. The image acquisition time window is limited to 0.5 seconds before and after T0 to cover the actual image of the cashier scanning the product, avoiding image content deviations caused by premature or delayed acquisition. While acquiring images, the edge AI chip monitors the scanning operation within a 3-second range before and after the scanning event, recording the time points when the barcode scanner button is pressed and released in real time. This allows the calculation of the scanning trigger duration, and the time interval of the current scanning event is derived by comparing it with the previous scanning time. Simultaneously, the chip reads operation log data to detect whether the cashier has called system function interfaces requiring supervisorial authority (such as manual price adjustment, discount rate adjustment, return registration, etc.) within the time window. If so, the special permission call flag is set to 1; otherwise, it is set to 0, thus constructing a cashier operation feature vector. The scanning time, transaction declaration data, product image, and cashier operation features are structurally integrated and encapsulated into a unified triangular data structure. This structure includes a synchronization timestamp, image data pointer, behavior parameter vector, and transaction record field, and is written into the chip's built-in high-speed LPDDR4 memory buffer.
[0025] The process involves controlling a camera to capture images of the product based on the scanning time. This includes: determining an image capture time window based on the scanning time, where the start time of the window is the scanning time minus a preset pre-scanning time, and the end time is the scanning time plus a preset post-scanning time; continuously capturing multiple frames of original images at a preset frame rate within the image capture time window to obtain an original image sequence containing at least 5 frames; performing Gaussian filtering on each frame in the original image sequence to remove motion blur, resulting in a deblurred image sequence, and calculating the mean grayscale value of each frame in the deblurred image sequence; calculating the median of the mean grayscale values of all frames in the deblurred image sequence as the target mean grayscale value; iterating through each frame in the deblurred image sequence, calculating the absolute value of the difference between the mean grayscale value of each frame and the target mean grayscale value, and selecting the frame with the smallest absolute difference as the representative image; using the representative image as the product image for feature extraction, and recording the frame position and corresponding capture time of the representative image in the original image sequence.
[0026] In one specific embodiment, the process of performing step S102 may specifically include the following steps: In edge AI chips, product images are converted from RGB color space to HSV color space to construct color feature vectors; Extract the product outline from the product image and calculate the convex hull to obtain the bounding rectangle. Calculate the ratio of the width to the height of the bounding rectangle as the aspect ratio, the ratio of the area enclosed by the outline to the square of the outline perimeter as the roundness, and the ratio of the area enclosed by the outline to the area of the bounding rectangle as the rectangularity. A shape feature vector is constructed based on aspect ratio, circularity, and rectangularity, and the product image is converted into a grayscale image and a texture feature vector is calculated. The color feature vector, shape feature vector, and texture feature vector are concatenated to form the product feature vector. The standard feature vector is obtained by querying the local product database based on the product barcode number in the transaction declaration data.
[0027] Specifically, the product images are preprocessed to enhance their stability under different lighting and color conditions. The product images are converted from the original RGB color space to the HSV color space. By applying the standard color transformation formula to each pixel, three color components—hue, saturation, and value—are extracted. The hue channel more sensitively captures the distribution of the dominant color on the product surface. After extracting the hue H channel from the HSV image, eight hue intervals are preset, corresponding to the dominant colors red, orange-yellow, green, cyan, blue, purple, and magenta. The hue values of all pixels in the image are statistically analyzed, and the proportion of pixels in each hue interval to the total number of pixels in the image is calculated. An 8-dimensional normalized color histogram vector is constructed as a color feature vector, effectively reflecting the visual dominant color pattern of the product. In the shape feature analysis stage, the Canny edge detection algorithm is applied to the image to extract the outer contour information of the product. Then, the convex hull algorithm is performed on the edge contour point set to construct the minimum closed circumscribed shape, and the bounding rectangle of the convex hull shape is calculated. The boundary is defined, and then the aspect ratio parameter is calculated based on the width and height of the circumscribed rectangle. The roundness index is derived by combining the ratio between the actual area of the region enclosed by the outline and the square of the boundary perimeter. At the same time, the ratio of the outline area to the area of the circumscribed rectangle is defined as the rectangularity index. A three-dimensional shape feature vector containing aspect ratio, roundness, and rectangularity is constructed to characterize the compactness and edge characteristics of the product's geometric structure. The RGB image is converted into a grayscale image for texture coding analysis. The Local Binary Pattern (LBP) texture operator is used to encode the local neighborhood of the image. With an LBP configuration of radius 1 and sampling points of 8, the local texture pattern of each pixel is calculated. The encoding result of the entire image is formed into a 256-dimensional LBP histogram. Then, 59 uniform pattern frequencies with rotation invariance are extracted from it. The dimensionality of the 59-dimensional vector is reduced using the principal component analysis algorithm. The top five principal components with a cumulative variance contribution rate of more than 90% are extracted as 5-dimensional texture feature vectors. After extracting the three types of features—color, shape, and texture—the three vectors are sequentially concatenated into a unified 16-dimensional product feature vector, which uniquely identifies the multi-dimensional appearance features of the product in the current image. The edge AI chip uses the product barcode number from the transaction declaration data as the primary key to retrieve the corresponding entry in the local product database and reads the product's standard feature vector. This standard feature vector is a 16-dimensional standard feature vector generated from a pre-set reference image through the same process.
[0028] In the edge AI chip, the product image is converted from RGB color space to HSV color space to construct a color feature vector. The product outline is extracted from the image, and the convex hull is calculated. A shape feature vector is constructed based on aspect ratio, roundness, and rectangularity. The product image is then converted to grayscale and a texture feature vector is calculated. This process includes: after the edge AI chip receives the product image, the color feature extraction task is assigned to the first CPU core, the shape feature extraction task to the second CPU core, and the texture feature extraction task to the third CPU core. Three independent threads are started to execute the feature extraction operations in parallel. In the first CPU core, the RGB to HSV color space conversion is performed, and the H channel is extracted and divided into eight tonal ranges to statistically analyze the pixel proportions, resulting in an 8-dimensional color feature vector. The completion time of feature extraction in the first CPU core is recorded. The execution time and duration of feature extraction are recorded as follows: In the second CPU core, Canny edge detection is performed to extract the product outline and calculate the convex hull to obtain the bounding rectangle. Based on the bounding rectangle, the aspect ratio, roundness, and rectangularity are calculated to obtain a 3D shape feature vector. The completion time and duration of feature extraction in the second CPU core are recorded. In the third CPU core, grayscale conversion and local binary mode LBP histogram calculation are performed, and rotation-invariant uniform mode frequencies are extracted. Principal component analysis is then performed to reduce the dimensionality and obtain the texture feature vector. The completion time and duration of feature extraction in the third CPU core are recorded. The execution status of the three CPU cores are monitored. After the first, second, and third CPU cores have all completed feature extraction, the product feature vector is concatenated in the order of color feature vector, shape feature vector, and texture feature vector. The total time of parallel feature extraction is recorded as the longest time among the three cores.
[0029] In one specific embodiment, the process of querying the local product database based on the product barcode number in the transaction declaration data to obtain the standard feature vector can specifically include the following steps: Based on the product barcode number in the transaction declaration data, a query is performed in the memory cache hash table of the edge AI chip to determine whether it matches the pre-loaded hot product feature vector; When the memory cache hash table is hit, the feature vector of the hot product is used as the corresponding standard feature vector; When the memory cache hash table is not found, the local product database in the eMMC memory of the edge AI chip is accessed according to the product barcode number. The standard reference image and pre-computed feature vector in the corresponding product record are read, and the pre-computed feature vector is used as the standard feature vector.
[0030] Specifically, during the initialization phase of the POS machine, the top-selling items with the highest frequency of sales in the store over the past 30 days are statistically analyzed. The standard feature vectors of these high-frequency transactions are preloaded into the LPDDR4 high-speed memory of the edge AI chip and organized using a hash table structure. The hash key is the product barcode number, and the value is the corresponding 16-dimensional standard feature vector. During actual scanning transactions, after the system extracts the product barcode number from the transaction declaration data, it uses the barcode number as the query key to quickly search the hash table to determine if the current product matches the preloaded hotspot cache data. If a match is found, the matched feature vector is directly used as the product's standard feature vector without accessing slow storage. If no matching barcode number is found in the hash table (a cache miss), the edge AI chip's built-in eMMC local product database is accessed based on the barcode number. The complete record entry for the corresponding product is retrieved from the persistent storage area, and the pre-generated and stored standard reference image and its corresponding standard feature vector are extracted. After retrieval, the standard feature vector is used as the baseline data for this comparison calculation.
[0031] In one specific embodiment, the process of executing step S103 may specifically include the following steps: The first score is calculated based on the physical feature vector of the commodity and the standard feature vector; Calculate the deviation between the scan trigger duration and the normal trigger duration, calculate the deviation between the scan interval and the normal interval range, and calculate the discount deviation when the special permission call flag is 1 and the ratio of the declared unit price to the median of historical prices is less than the preset target value. The second score is calculated based on the deviation in duration, the deviation in interval, and the deviation in discount. The absolute value of the difference between the number of outlines detected in the actual product image and the declared quantity is calculated and divided by the declared quantity to obtain the quantity deviation degree. A third score is calculated based on the quantity deviation degree and the duration deviation degree. The first, second, and third scores are weighted and summed to obtain the overall score.
[0032] Specifically, the first score is calculated based on the similarity between the physical feature vector of the commodity and the standard feature vector. This is achieved by using the cosine similarity algorithm, which performs a dot product operation on the two 16-dimensional vectors and divides them by their respective L2 norm products to obtain a normalized similarity index. The index ranges from 0 to 1. A higher value indicates that the physical commodity and the declared commodity are more consistent in terms of appearance features such as color, shape, and texture. The similarity value is defined as the first score, which is used to characterize the degree of consistency between the declared data and the visual object. The scanning trigger duration in the cashier operation characteristics is compared with the median duration of normal scanning behavior. The deviation is calculated using an empirical standard deviation parameter to determine if there is abnormal acceleration or delay in the scanning action. Simultaneously, the time interval between the current scanning event and the previous scanning event is analyzed. By cropping the interval to the upper and lower limits of the normal interval, timeout deviation and excessive speed deviation are calculated separately and merged into a unified interval deviation. This is then combined with the value of the permission call flag. If the flag is 1 and the ratio of the current declared unit price to the median historical price of the product is less than a preset discount threshold, it indicates that the current scanning is accompanied by suspicious pricing manipulation. Based on this, the discount deviation is calculated to reflect potential abnormal pricing. The duration deviation, interval deviation, and discount deviation are integrated into an exponential decay function structure. That is, by inputting each deviation as a decay factor into an exponential function, a behavior consistency score ranging from 0 to 1 is constructed. This behavior consistency score is the second score, representing the consistency level between the declared data and the operational behavior. Contour analysis is performed on the product images to identify the number of product outlines in the image. This number is then compared to the declared quantity in the transaction declaration data. The absolute value of the difference between the two is calculated and divided by the declared quantity to obtain the quantity deviation. A large deviation indicates a risk of fraudulent activities such as scanning multiple items or fewer items than required. Combined with the scan trigger time deviation, the quantity deviation and time deviation are substituted into a rule function or empirical model to calculate a third score, reflecting the consistency between the physical product and the behavior at the image level. Weighted coefficients are assigned to the scores of these three dimensions, and a linear weighted sum is performed. The first score, providing direct evidence of physical consistency, receives the highest weight; the second score, reflecting the reasonableness of the behavior and system declaration, receives a medium weight; and the third score, as supplementary evidence, receives a low weight. The combined result of these three scores is the overall score for this scan transaction.
[0033] The process involves multiplying the actual product feature vector and the standard feature vector one by one and summing the results to obtain the dot product value. Then, the square root of the sum of squares of the actual product feature vectors is calculated to obtain the norm of the actual product feature vector. The square root of the sum of squares of the standard feature vectors is also calculated to obtain the norm of the standard feature vector. The norm of the actual product feature vector is multiplied by the norm of the standard feature vector to obtain the norm product. The dot product value is divided by the norm product to obtain the cosine similarity, which is then used as the first score. This includes: calculating the dot product of the actual product feature vector and the standard feature vector and dividing it by the norm product to obtain the cosine similarity as the first score; determining whether the first score is less than a preset early cessation threshold; if the first score is less than the preset early cessation threshold, it is determined that the actual product and the declared product are seriously inconsistent, and the first score is directly used as the overall score, skipping the second and third scores. The calculation process immediately enters the fraud risk level determination process; when the first score is greater than or equal to the preset early stop threshold, the calculation of the deviation between the scanning trigger duration and the normal trigger duration, the deviation between the scanning time interval and the normal interval range, and the discount deviation are performed. The second score is calculated based on the deviation. The calculation of the quantity deviation between the number of outlines detected in the product image and the declared quantity is performed. The third score is calculated based on the quantity deviation and the duration deviation. The first, second, and third scores are weighted and summed to obtain the comprehensive total score. The total calculation time of this triangular comparison verification is recorded. When early stop is triggered, the total calculation time is the time for calculating the first score plus the time for determining the fraud risk level. When early stop is not triggered, the total calculation time is the cumulative time of the first, second, and third scores plus the weighted fusion.
[0034] In one specific embodiment, the process of calculating the first score based on the physical feature vector of the commodity and the standard feature vector can specifically include the following steps: The dot product value of the eigenvectors is obtained by multiplying the physical feature vector of the commodity with the standard feature vector one by one and summing them. Calculate the sum of squares and take the square root of the physical feature vectors of the goods to obtain the norm of the physical feature vectors. Calculate the sum of squares and take the square root of the standard feature vectors to obtain the norm of the standard feature vectors. Multiply the norm of the physical feature vectors and the norm of the standard feature vectors to obtain the norm product. The cosine similarity is obtained by dividing the dot product of the feature vectors by the norm product, and the cosine similarity is used as the first score.
[0035] Specifically, the 16-dimensional physical feature vector extracted from the product image is matched with the 16-dimensional standard feature vector retrieved from the local database using the product barcode number. Each corresponding element in each dimension is multiplied, and these 16 product values are summed one by one to obtain the dot product value of the feature vectors. The dot product value represents the total directional consistency between the two vectors in the same dimension. All elements in both the product feature vector and the standard feature vector are squared, and the sum of these 16 squares is then taken as the square root to obtain the L2 norm of the product feature vector and the L2 norm of the standard feature vector, respectively. These two norm values represent the magnitudes of the two feature vectors in the multidimensional feature space. The product of the two norm values is used as a standardization factor to eliminate the influence of magnitude differences caused by image brightness, size ratio, etc. Dividing the dot product of the feature vectors by the norm product yields the cosine similarity between the two vectors. The cosine similarity value ranges from 0 to 1, where 1 indicates that the two feature vectors are completely aligned, meaning that the actual product is highly consistent with the standard product in the database in terms of visual features. The closer the value is to 0, the greater the difference between the actual product and the declared product. The cosine similarity result is used as the first score in the consistency scoring model.
[0036] In one specific embodiment, the execution steps include calculating the deviation between the scan trigger duration and the normal trigger duration, and calculating the deviation between the scan time interval and the normal interval range. When the special permission call flag is 1 and the ratio of the declared unit price to the median historical price is less than a preset target value, the process of calculating the discount deviation may specifically include the following steps: Calculate the deviation between the scan trigger duration and the median normal trigger duration; Calculate the positive deviation of the scanning time interval from the upper limit of the normal interval range, calculate the negative deviation of the lower limit of the normal interval range from the scanning time interval, and sum the positive and negative deviations to obtain the interval deviation degree. Check if the special permission access flag is 1; When the special permission call flag is 1, the local commodity database is queried for the historical median price corresponding to the commodity barcode number. The ratio of the declared unit price to the historical median price is calculated. When the ratio is less than the preset target value, the discount deviation is calculated based on the ratio.
[0037] Specifically, the trigger duration of the barcode scanner corresponding to the current scanning event is extracted from the edge AI chip; that is, the time difference between pressing and releasing the barcode scanner button. This is compared with the median trigger duration of a preset normal scanning behavior, and the absolute difference between the two is taken as the initial degree of behavioral deviation. Then, the difference is standardized using a preset standard deviation parameter to obtain the duration deviation, which reflects whether the scanning action is abnormally rapid (such as false scanning) or abnormally delayed (such as hesitant operation). The time interval between the current scanning event and the previous scanning event is analyzed. The positive deviation value between the time interval and the upper limit of the normal scanning interval range, and the negative deviation value between the lower limit of the normal interval and the scanning interval are calculated. The positive deviation value is used to indicate excessively long pauses or interruptions during the checkout process, and the negative deviation value reflects the risk of missed scans caused by excessively fast and continuous operations during the checkout process. Both are pruned to zero boundaries and the max function is used to ensure that the deviation value is non-negative. The positive and negative deviation values are summed to obtain a unified interval deviation, which reflects the overall degree of abnormality of the current scanning interval relative to the checkout rhythm. The system checks if the special permission call flag for the current barcode scanning event is 1. If the flag is 0, the price analysis step is skipped. If the flag is 1, it indicates that the scanning process calls functions requiring supervisor authorization, such as manual price adjustment, discount adjustment, and return registration. The system then performs a detailed analysis of the price behavior. At this point, the system searches for the corresponding historical sales record in the local product database based on the product barcode number and calculates the historical median price based on the transaction unit price data of the same product over a period of time. The current declared unit price is divided by the historical median to obtain the ratio between the actual declared price and the regular price. Under normal circumstances, the ratio is close to 1. If the ratio is significantly less than the preset target lower limit (e.g., 0.7), it indicates that the current product is likely to be declared at a low price. Based on the ratio, a discount deviation index is constructed in reverse. The deviation magnitude index is obtained by subtracting the ratio from 1, or an exponential decay function is used to enhance the sensitivity to low-price behavior.
[0038] The process, after obtaining the overall score but before determining the fraud risk level, includes: extracting the overall score sequence and the product feature vector sequence of the N consecutive transactions preceding the current transaction from the memory buffer of the edge AI chip, where N ranges from 3 to 10; performing trend analysis on the overall score sequence, calculating the average overall score of the N consecutive transactions as the sequence benchmark value, calculating the sum of squared deviations between the overall score of each transaction and the sequence benchmark value and dividing by N to obtain the sequence volatility variance, and determining the transaction sequence as unstable when the sequence volatility variance is greater than a preset volatility threshold; calculating the deviation of the overall score of the current transaction from the sequence benchmark value, and when the deviation is greater than a preset deviation threshold and the transaction sequence is unstable, extracting the number of transactions with an overall score lower than a second threshold from the N consecutive transactions as the number of abnormal transactions in the sequence, and calculating the ratio of the number of abnormal transactions to N to obtain the sequence abnormality ratio; when the sequence abnormality ratio is greater than a preset sequence abnormality threshold, applying a threshold to the first, second, and third scores of the current transaction respectively. Sequence coupling correction is performed by calculating the first score correction coefficient as 1 minus the product of the sequence anomaly percentage and the first weighting factor, the second score correction coefficient as 1 minus the product of the sequence anomaly percentage and the second weighting factor, and the third score correction coefficient as 1 minus the product of the sequence anomaly percentage and the third weighting factor. The values of the first, second, and third weighting factors range from 0.1 to 0.3. The first score of the current transaction is multiplied by the first score correction coefficient to obtain the corrected first score, the second score is multiplied by the second score correction coefficient to obtain the corrected second score, and the third score is multiplied by the third score correction coefficient to obtain the corrected third score. The corrected first, second, and third scores are then weighted and summed to obtain the corrected overall score. The corrected overall score is used to replace the original overall score for subsequent fraud risk level determination. The overall score of the current transaction and the commodity physical feature vector are added to the end of the transaction sequence in the memory buffer to update the sequence data.
[0039] In one specific embodiment, the process of executing step S104 may specifically include the following steps: Determine the range of values for the overall score; When the total score is greater than or equal to the first threshold, the fraud risk level is determined to be normal transaction; when the total score is between the second threshold and the first threshold, the fraud risk level is determined to be low risk; when the total score is between the third threshold and the second threshold, the fraud risk level is determined to be medium risk; and when the total score is less than the third threshold, the fraud risk level is determined to be high risk. When the fraud risk level is normal, the normal release operation is performed. When the fraud risk level is low, a yellow prompt box instruction is sent to the cash register display controller through the edge AI chip. When the fraud risk level is medium, a buzzer instruction and an orange warning dialog box are sent, and the supervisor is required to swipe the card for authorization before the transaction can continue. When the fraud risk level is high, a transaction lock instruction is sent to the POS main control system to freeze the current transaction.
[0040] Specifically, the fraud risk level is determined by comparing the overall score with preset multi-level thresholds. The first threshold is set as the lower limit for a high-confidence normal transaction, the second threshold is the dividing line between low and medium risk, and the third threshold is the threshold between medium and high risk. The system checks if the current overall score is greater than or equal to the first threshold. If it is, the transaction is classified as a "normal transaction," indicating that there are no significant deviations in the declared data, physical image, and operational behavior. In this case, the edge AI chip does not intervene and directly executes a normal release operation, allowing the cashier to continue scanning the next item without any prompts or records. If the overall score is less than the first threshold but greater than or equal to the second threshold, it indicates a slight deviation in multi-dimensional consistency, such as unintentional negligence or non-critical anomalies. Based on this, the transaction is classified as "low risk," and the edge AI chip sends a yellow warning signal to the cash register display controller via control commands. A pop-up message appears in the upper right corner of the screen stating "Please verify product information." This message provides a visual reminder to the operator without interfering with the checkout process. The message lasts for 3 seconds and then disappears automatically, allowing the transaction to continue. Simultaneously, the triangular data source and scoring results for this transaction are marked as low-risk and cached in the local data structure for backend uploading. If the overall score is below the second threshold but greater than or equal to the third threshold, it indicates a moderate deviation in consistency, classifying the transaction as "medium-risk." Suspicious behaviors include substitution of different brand specifications or abnormal scanning rhythms. In this case, the edge AI chip sends a signal to the cash register. The control module simultaneously issues two types of control commands: It drives a buzzer to sound at a frequency of 2000Hz for 0.5 seconds to attract the cashier's attention and displays an orange warning dialog box in the center of the cashier interface, showing "Inconsistent product information detected; please have the supervisor review." This dialog box is a blocking interactive interface, pausing the current transaction process and locking the scanning operation until the on-duty supervisor completes identity verification using an authorization card and confirms the review process. Only then can subsequent product processing continue, and the supervisor's employee number and card swipe time are recorded as a review log and archived. If the overall score is below the third threshold, it indicates that the transaction has serious inconsistencies in multiple dimensions, such as discrepancies between the declared product and the actual product. Transactions exhibiting significant discrepancies in appearance, a severe disconnect between scanning behavior and operational mode, or discrepancies in quantity declaration are immediately classified as "high-risk." The edge AI chip then sends a transaction lock command to the POS main control system, freezing the current transaction status through the POS software interface and prohibiting the addition of goods or the execution of settlement operations. Simultaneously, the cash register interface is switched to a full-screen red warning screen displaying the alarm message "Serious fraud risk detected, transaction frozen." A real-time alarm notification is also pushed to the store management system via the local area network, requesting the store manager to conduct a manual verification on-site. The transaction can only be unlocked and the normal transaction process restored after the verification result is authenticated by the administrator card.
[0041] In one specific embodiment, the AI-based POS fraud prevention analysis method further includes the following steps: When the fraud risk level is low, medium or high, the transaction declaration data, product images, product feature vectors and overall score are packaged into a risk transaction record and stored in the eMMC memory of the edge AI chip and uploaded to the back-end audit database via the local area network.
[0042] Specifically, when the fraud risk level is low, medium, or high, the transaction declaration data corresponding to the current scanning event is extracted, including fields such as product barcode number, product name, declared unit price, declared quantity, and scanning timestamp, as a system declaration record of the transaction behavior; representative product images selected from the scanning image acquisition are extracted. The product images have undergone deblurring and grayscale mean filtering to ensure stable image clarity and representativeness; a 16-dimensional product feature vector generated by the image feature extraction algorithm is extracted. The product feature vector is jointly constructed by color histogram, geometric shape parameters, and texture principal components, and is used to reconstruct or compare the visual pattern of the product appearance; at the same time, the comprehensive score calculated by the edge AI chip in this transaction process is recorded as the numerical basis for risk assessment. The transaction declaration data, product images, product feature vectors, and comprehensive score are packaged into a unified data structure, defined as a risk transaction record. The risk transaction record has a unique identifier and includes a transaction timestamp and POS terminal number field. The edge AI chip writes risky transaction records into a designated risky transaction data partition in the chip's local eMMC persistent storage; through the built-in local area network communication module, the risky transaction records are reported to the database system of the store's back-end audit server via the LAN network protocol, written into a dedicated risky transaction audit table, and then stored in the database after the back-end database server verifies the integrity of the record structure.
[0043] The AI-based fraud prevention analysis method for cash registers in the embodiments of the present invention has been described above. The AI-based fraud prevention analysis system for cash registers in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 2 One embodiment of the AI-based POS fraud prevention analysis system in this invention includes: The synchronous acquisition module 201 is used to synchronously acquire transaction declaration data of the POS system, physical images of goods from the camera, and cashier operation characteristics when the barcode scanning device in the cash register triggers scanning. The feature extraction module 202 is used to extract features from the physical image of the commodity to obtain the feature vector of the commodity, and to query the local commodity database based on the commodity barcode number in the transaction declaration data to obtain the standard feature vector; The comprehensive calculation module 203 is used to calculate the comprehensive total score based on the physical feature vector of the goods, the standard feature vector, and the cashier operation features; The real-time response module 204 is used to determine the fraud risk level based on the numerical range of the overall score, and to trigger the corresponding real-time response operation based on the fraud risk level.
[0044] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0045] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0046] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A fraud prevention analysis method for cash registers based on AI, characterized in that, include: When the barcode scanning device in the cash register triggers scanning, it simultaneously collects the transaction declaration data of the POS system, the actual product image from the camera, and the characteristics of the cash register operation. Feature extraction is performed on the physical image of the goods to obtain a physical feature vector of the goods, and a standard feature vector is obtained by querying the local product database based on the product barcode number in the transaction declaration data; A comprehensive score is calculated based on the physical feature vector of the goods, the standard feature vector, and the cashier operation features. The fraud risk level is determined based on the numerical range of the overall score, and a corresponding real-time response operation is triggered based on the fraud risk level.
2. The AI-based fraud prevention analysis method for cash registers according to claim 1, characterized in that, When the barcode scanner in the cash register triggers a scan, it simultaneously collects transaction declaration data from the POS system, product images from the camera, and cashier operation characteristics, including: When the barcode scanning device in the cash register triggers scanning, it sends a barcode recognition success signal to the POS system. The edge AI chip monitors the data bus, detects the trigger signal, and records the trigger time as the scanning time. Read the transaction declaration data generated at the time of scanning from the transaction data buffer of the POS system. The transaction declaration data includes the product barcode number, the declared unit price and the declared quantity. Based on the scanning time, control the camera to capture an image of the actual product; Record the scanning trigger duration and scanning time interval corresponding to the scanning time, and determine whether the manual price change or discount rate modification function is called and generate a special permission call flag to obtain the cashier operation characteristics; The scanning time, the transaction declaration data, the physical image of the product, and the cashier operation features are packaged and stored in the memory buffer of the edge AI chip.
3. The AI-based fraud prevention analysis method for cash registers according to claim 2, characterized in that, The process involves extracting features from the physical image of the goods to obtain a physical feature vector, and then querying the local product database based on the product barcode number in the transaction declaration data to obtain a standard feature vector, including: In the edge AI chip, the physical image of the product is converted from the RGB color space to the HSV color space to construct a color feature vector; Extract the product outline from the product image and calculate the convex hull to obtain the circumscribed rectangle. Calculate the ratio of the width to the height of the circumscribed rectangle as the aspect ratio, calculate the ratio of the area enclosed by the outline to the square of the outline perimeter as the roundness, and calculate the ratio of the area enclosed by the outline to the area of the circumscribed rectangle as the rectangularity. A shape feature vector is constructed based on the aspect ratio, the circularity, and the rectangularity; the product image is converted into a grayscale image and a texture feature vector is calculated. The color feature vector, the shape feature vector, and the texture feature vector are concatenated to form the product feature vector. The standard feature vector is obtained by querying the local product database based on the product barcode number in the transaction declaration data.
4. The AI-based fraud prevention analysis method for cash registers according to claim 3, characterized in that, The step of querying the local product database based on the product barcode number in the transaction declaration data to obtain a standard feature vector includes: Based on the product barcode number in the transaction declaration data, a query is performed in the memory cache hash table of the edge AI chip to determine whether it matches the pre-loaded hot product feature vector; When the memory cache hash table is hit, the hot product feature vector is used as the corresponding standard feature vector; When the memory cache hash table is not found, the local product database in the eMMC memory of the edge AI chip is accessed according to the product barcode number, the standard reference image and pre-calculated feature vector in the corresponding product record are read, and the pre-calculated feature vector is used as the standard feature vector.
5. The AI-based fraud prevention analysis method for cash registers according to claim 4, characterized in that, The calculation of the comprehensive total score based on the product's physical feature vector, the standard feature vector, and the cashier operation features includes: The first score is calculated based on the physical feature vector of the commodity and the standard feature vector; Calculate the deviation of the scan trigger duration from the normal trigger duration, calculate the deviation of the scan time interval from the normal interval range, and calculate the discount deviation when the special permission call flag is 1 and the ratio of the declared unit price to the median of historical prices is less than the preset target value. The second score is calculated based on the duration deviation, the interval deviation, and the discount deviation. The absolute value of the difference between the number of outlines detected in the actual product image and the declared quantity is calculated and divided by the declared quantity to obtain the quantity deviation. A third score is calculated based on the quantity deviation and the duration deviation. The first score, the second score, and the third score are weighted and summed to obtain the overall total score.
6. The AI-based fraud prevention analysis method for cash registers according to claim 5, characterized in that, The calculation of the first score based on the physical feature vector of the commodity and the standard feature vector includes: The dot product value of the product is obtained by multiplying the physical feature vector of the commodity with the standard feature vector one by one and summing them. Calculate the sum of squares and take the square root of the product feature vectors to obtain the product feature vector norm. Calculate the sum of squares and take the square root of the standard feature vectors to obtain the standard feature vector norm. Multiply the product feature vector norm and the standard feature vector norm to obtain the norm product. The cosine similarity is obtained by dividing the dot product of the feature vectors by the norm product, and the cosine similarity is used as the first score.
7. The AI-based fraud prevention analysis method for cash registers according to claim 6, characterized in that, The calculation of the deviation between the scan trigger duration and the normal trigger duration, the calculation of the deviation between the scan time interval and the normal interval range, and the calculation of the discount deviation when the special permission call flag is 1 and the ratio of the declared unit price to the median historical price is less than a preset target value, include: Calculate the deviation of the scan trigger duration from the median of the normal trigger duration; Calculate the positive deviation of the scanning time interval from the upper limit of the normal interval range, calculate the negative deviation of the lower limit of the normal interval range from the scanning time interval, and sum the positive deviation and the negative deviation to obtain the interval deviation degree. Determine whether the special permission call flag is 1; When the special permission call flag is 1, the local product database is queried for the historical median price corresponding to the product barcode number, and the ratio of the declared unit price to the historical median price is calculated. When the ratio is less than a preset target value, the discount deviation is calculated based on the ratio.
8. The AI-based fraud prevention analysis method for cash registers according to claim 1, characterized in that, The process of determining the fraud risk level based on the numerical range of the overall score and triggering a corresponding real-time response based on the fraud risk level includes: Determine the numerical range in which the overall score falls; When the total score is greater than or equal to the first threshold, the fraud risk level is determined to be normal transaction; when the total score is between the second threshold and the first threshold, the fraud risk level is determined to be low risk; when the total score is between the third threshold and the second threshold, the fraud risk level is determined to be medium risk; and when the total score is less than the third threshold, the fraud risk level is determined to be high risk. When the fraud risk level is normal, the normal release operation is performed. When the fraud risk level is low, a yellow prompt box instruction is sent to the cash register display controller through the edge AI chip. When the fraud risk level is medium, a buzzer instruction and an orange warning dialog box are sent, and the supervisor is required to swipe the card for authorization before the transaction can continue. When the fraud risk level is high, a transaction lock instruction is sent to the POS main control system to freeze the current transaction.
9. The AI-based fraud prevention analysis method for cash registers according to claim 8, characterized in that, The AI-based POS fraud prevention analysis method also includes: When the fraud risk level is low, medium or high, the transaction declaration data, the physical image of the goods, the physical feature vector of the goods and the comprehensive score are packaged into a risk transaction record and stored in the eMMC memory of the edge AI chip and uploaded to the background audit database via the local area network.
10. An AI-based fraud prevention analysis system for cash registers, characterized in that, The method for performing AI-based fraud prevention analysis of cash registers as described in any one of claims 1-9 includes: The synchronous acquisition module is used to synchronously acquire transaction declaration data from the POS system, physical images of goods from the camera, and cashier operation characteristics when the barcode scanning device in the cash register triggers scanning. The feature extraction module is used to extract features from the physical image of the goods to obtain a physical feature vector of the goods, and to query the local product database based on the product barcode number in the transaction declaration data to obtain a standard feature vector; The comprehensive calculation module is used to calculate a comprehensive total score based on the physical feature vector of the goods, the standard feature vector, and the cashier operation features; The real-time response module is used to determine the fraud risk level based on the numerical range of the overall score, and to trigger the corresponding real-time response operation based on the fraud risk level.