Drawing projection marriage matching test system and method based on visual converter
By introducing visual converters and self-supervised clustering algorithms into the marriage and love matching system, users' drawing data are automatically analyzed to evaluate psychological characteristics, and personalized matching suggestions are generated based on marriage and love preferences. The problem that traditional systems cannot dynamically reflect the user's psychological state is solved, and higher matching accuracy and personalization are achieved.
Patent Information
- Application Number
- CN202411657767.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-11
AI Technical Summary
Traditional marriage and love matching systems rely on static information and cannot comprehensively and dynamically reflect the user's psychological state and its changes over time. The existing painting projection test analysis methods lack standardized quantitative tools, resulting in poor reliability of results and the ability to apply on a large scale.
An algorithm system based on the combination of visual converter and self-supervised clustering is adopted to automatically analyze the image features in the user's painting projection test, and a personalized marriage and love matching suggestions are generated based on their marriage and love preferences.
It significantly improves the accuracy and personalization level of marriage and love matching, can dynamically track and analyze user emotional changes, and provides more accurate and personalized matching suggestions.
Smart Images

Figure CN119597814A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the application field of combining artificial intelligence algorithms with psychology, and in particular to a system and method based on a visual converter and a self-supervised clustering combined algorithm, which is applied to a love and marriage matching scenario in a drawing projection test. Background Art
[0002] In traditional dating matching systems, matching usually relies on static information provided by users, such as personal information, hobbies and interests, and personality test questionnaires. This method cannot fully and dynamically reflect the user's psychological state and its changes over time. As an effective assessment tool in the field of psychology, drawing projective test can reveal the user's deep psychological characteristics through his or her drawing performance. However, existing drawing projective test analysis methods mostly rely on the subjective judgment of experts and lack standardized quantitative tools, resulting in poor reliability of the results and poor scalability.
[0003] With the rapid development of artificial intelligence technology, especially the breakthroughs in deep learning and self-supervised learning, image feature extraction technology based on visual converters and self-supervised clustering algorithms provide new possibilities for the objective analysis of drawing projective tests. However, current technology has not yet effectively combined these algorithms in the field of marriage and love matching to provide personalized and accurate matching suggestions. To address this shortcoming, the present invention proposes a system and method based on a visual converter combined with a self-supervised clustering algorithm, which automatically and deeply analyzes the image features in the user's drawing projective test, quantitatively evaluates the user's psychological characteristics, and generates personalized marriage and love matching suggestions in combination with their marriage and love preferences, thereby significantly improving the accuracy and personalization level of marriage and love matching. Summary of the invention
[0004] The purpose of the present invention is to provide a painting projection love and marriage matching test system and method based on a visual converter to solve the shortcomings of traditional love and marriage matching, such as reliance on static information and lack of dynamic analysis of user emotional changes. Existing love and marriage matching methods are mainly based on static data such as personal information, interests and hobbies provided by users, which makes it difficult to accurately reflect the dynamic changes of users' emotions and psychological states, and cannot achieve personalized love and marriage recommendations. By introducing the painting projection test, a psychological assessment tool, into the intelligent love and marriage matching system, the present invention can analyze the user's potential psychological state based on his or her painting behavior, and provide more accurate love and marriage matching suggestions in combination with his or her love and marriage preferences.
[0005] To achieve the above purpose, the present invention proposes the following technical solution: a painting projection love and marriage matching test system based on visual converter, which includes a data acquisition module, an image preprocessing module, a visual converter module, a self-supervised clustering module, and a love and marriage matching module connected in sequence. Each module can perform multi-dimensional analysis on the user's painting data, extract the user's emotional characteristics, and generate personalized love and marriage matching suggestions based on the user's psychological state and love and marriage needs through collaborative work.
[0006] 1. Data collection module: This module is responsible for collecting image data from the user's drawing projective test and dynamic behavior data during drawing, such as drawing speed, pen pressure, number of revisions, etc. These data not only reflect the content of the user's drawing, but also reveal the user's emotional changes and psychological state. Data collection sources include scanned images of paper drawings, digital drawings, etc. This module supports multiple input methods, such as touch screens, scanners, etc., to ensure the diversity and accuracy of data input and provide high-quality basic data for subsequent analysis.
[0007] 2. Image preprocessing module: The image preprocessing module is responsible for standardizing the collected painting images. First, the image noise is eliminated through an adaptive filtering algorithm to ensure the clarity and detail retention of the image. Then, the image quality is optimized through grayscale conversion and image enhancement technology to make the key features in the painting more prominent. At the same time, histogram equalization is used to adjust the brightness and contrast of the image to ensure that the subsequent algorithm can accurately extract key information. These steps improve data consistency and enable the system to better process image data from different sources.
[0008] 3. Visual converter module: This module uses a visual converter to extract multi-dimensional features from images. Specifically, this module uses a multi-head attention mechanism to extract complex features such as line thickness, color distribution, shape structure, and emotional expression from painting data. The advantage of the visual converter is that it can process global information and extract subtle emotional changes of users in paintings. After these features are extracted layer by layer by a deep neural network, a high-dimensional feature vector is generated as the basic data input of the user's psychological state.
[0009] 4. Self-supervised clustering module: The self-supervised clustering module uses the features extracted by the visual converter and adopts a self-supervised learning algorithm to classify and cluster the psychological characteristics of users. This module does not rely on labeled data and can automatically learn the user's painting behavior in an unsupervised manner and generate corresponding psychological state labels. By combining time series analysis, the system can also track the emotional fluctuations of users when painting, dynamically adjust the psychological state labels, and ensure real-time capture of user emotional changes. This enables the system to classify and analyze large-scale unlabeled painting data without labeled datasets.
[0010] 5. Marriage and Love Matching Module: The marriage and love matching module makes marriage and love matching suggestions based on the user's psychological state label and marriage and love preferences through an intelligent recommendation algorithm. This module is not only based on similarity analysis, but also combines emotional intelligence technology to ensure that the matching results are more accurate and personalized. By introducing reinforcement learning algorithms, the system can continuously optimize the marriage and love matching plan based on user feedback, making marriage and love matching more in line with the user's long-term emotional needs. The advantage of reinforcement learning is that it can dynamically adjust matching parameters to adapt to changes in the user's psychological state, thereby ensuring the continued accuracy of marriage and love matching.
[0011] Furthermore, the data acquisition module supports multiple data input methods, including static image acquisition, and also integrates dynamic data acquisition function, which records the user's drawing speed, pen strength, number of revisions, and dynamic data of the pen tip's moving trajectory on the screen in real time; these data provide additional information sources for subsequent sentiment analysis and psychological feature classification, helping the system to more accurately identify the user's emotional state;
[0012] Furthermore, the image preprocessing module adopts an adaptive filtering algorithm module and histogram equalization technology. The image preprocessing module removes noise in the image through the adaptive filtering algorithm module. The adaptive filtering can self-adjust parameters according to the local characteristics of the image, thereby improving the clarity and detail retention of the image; the histogram equalization technology is used to adjust the brightness and contrast of the image to make the details more prominent; at the same time, the system has an embedded noise detection algorithm module, which can automatically identify and remove noise areas in the image, ensuring that the image entering the feature extraction module is of high quality.
[0013] Furthermore, the visual converter module divides the image into multiple small blocks through a multi-head attention mechanism. Each block is analyzed by a different attention head to extract the line features, shape features and emotional expressions in the painting, and finally generate a global feature vector to represent the user's overall psychological state;
[0014] Furthermore, the self-supervised clustering module combines the unlabeled dataset and adopts the time series analysis method to regard the user's painting behavior as time series data, classify the user's painting behavior, and generate dynamic psychological state labels for long-term tracking of the user's emotional fluctuations and psychological changes during the painting process.
[0015] Furthermore, the marriage and love matching module introduces a reinforcement learning algorithm module. After the system generates preliminary matching results in the initial stage, it continuously adjusts and optimizes as the user's psychological state changes and matching feedback is provided. Reinforcement learning can adapt to user feedback and dynamically adjust matching parameters to ensure that the marriage and love matching results are more accurate and meet the user's long-term emotional needs. This method avoids the static limitations of traditional matching algorithms and can adapt to changes in user emotions.
[0016] Furthermore, it also includes an output module connected to the marriage and love matching module, which uses data visualization technology to present complex psychological state analysis and matching results in graphical form, making it easier for users to understand the report content; the report content includes a detailed analysis of the user's emotional state, specific suggestions for marriage and love preferences, and long-term emotional tracking results generated based on changes in the user's psychological state; data visualization not only improves the readability of the report, but also enhances the user's understanding of their own psychological and emotional state.
[0017] A drawing projection love and marriage matching test method based on a visual converter of the present invention comprises the following steps:
[0018] Step 1: Data Collection
[0019] The data collected by the data collection module includes hand-drawn images, digital drawing images, and drawing behavior records (such as drawing speed, pen pressure, modification frequency, etc.). It supports multiple input methods such as hand-drawn scanned images and digital drawings to ensure data diversity and accuracy.
[0020] Step 2: Image preprocessing
[0021] The collected painting data is preprocessed. The preprocessing process includes noise removal, grayscale conversion, image enhancement and standardization. Specifically, an adaptive filtering algorithm is used for denoising, grayscale conversion is used to simplify data and retain brightness information, and histogram equalization is used to adjust image brightness and contrast to ensure uniform image quality and prepare for subsequent feature extraction.
[0022] Step 3: Feature extraction
[0023] The visual converter module is used to extract multi-dimensional features from the preprocessed images. Through a multi-layer neural network and a multi-head attention mechanism, detailed features in the painting are extracted, including line thickness, color distribution, shape structure, emotional expression, etc. These feature data are extracted layer by layer through the visual converter and converted into feature vectors as the basis for user psychological feature analysis.
[0024] Step 4: Self-supervised clustering
[0025] Based on the features extracted by the visual converter, the user's psychological state is classified through a self-supervised learning algorithm. This process does not require pre-labeled data. The system dynamically analyzes the user's painting behavior through a self-supervised clustering algorithm to generate corresponding psychological state labels. This module also combines time series analysis to capture the dynamic characteristics of the user's emotional changes during the painting process and achieve accurate classification of the user's psychological state.
[0026] Step 5: Marriage Matching
[0027] The marriage and love matching module uses an intelligent recommendation algorithm to make marriage and love matching suggestions based on the generated psychological state labels, emotional fluctuations, and marriage and love preferences. The system uses a reinforcement learning algorithm to dynamically optimize the marriage and love matching scheme, and continuously adjusts the matching parameters based on user feedback and emotional changes to ensure the accuracy and personalization of marriage and love suggestions.
[0028] Step 6: Output Analysis
[0029] The system generates marriage and love matching results and psychological analysis reports, which are displayed to users through the output module. The report content includes the user's psychological state analysis, marriage and love matching suggestions, and personalized marriage and love guidance. Visualization technology is used to generate intuitive chart displays to help users understand the matching results and analysis process generated by the system. The report also provides long-term psychological state tracking and marriage and love emotional health suggestions.
[0030] Further, the step 1 comprises:
[0031] The first step of the system of the present invention is to obtain the multi-dimensional data of the user in the drawing projective test through the data acquisition module by integrating multiple input methods, hand-drawn image scanning, digital drawing, and user behavior records during drawing. These data are the core input of the subsequent psychological state analysis and marriage matching algorithm.
[0032] Hand-drawn image data collection: The drawings completed by the user on paper are collected through a high-resolution scanner to ensure that the details of the image are fully preserved. The line thickness, color transition, and stroke strength changes in the hand-drawn image are the key to the psychological state assessment.
[0033] Digital drawing image acquisition: Users draw through tablet computers and touch screen digital devices. This method avoids the scanning errors of paper drawings and directly obtains image data from the device. These image data are usually RGB three-channel images. The system extracts different visual features based on the color distribution and shadow color information of the image.
[0034] Behavioral data collection: During the user's painting process, the touch screen digital device (such as a digital tablet) will also record a variety of user behavior data, including painting speed, pen pressure, and modification frequency.
[0035] Calculation of drawing speed: During the drawing process, the pen tip position changes in each time period, effectively monitoring the user's emotional fluctuations. A sudden increase or decrease in drawing speed indicates that the user's psychological state has changed significantly. The system calculates the drawing speed by tracking the pen tip position at each time point. Assuming the pen tip position at time t is P(t), the calculation formula for drawing speed v(t) is:
[0036]
[0037] Among them, P(t+Δt) and P(t) are the positions of the pen tip at time t+Δt and time t respectively, and Δt is the time interval.
[0038] Calculation of pen pressure: During the digital drawing process, the system can detect the pressure of the user on the touch screen. These pressure data can reflect the intensity of the user's emotions. Let the pen pressure of the user at time t be p(t). The system records the pen pressure value at each moment to form a time series, {p(t1), p(t2),…, p(t n )}. The variation of pen pressure is quantified by its variance. The calculation formula is:
[0039]
[0040] Among them, p(t i ) represents the pen pressure at the i-th moment, μ p is the average value of pen pressure, and n is the number of time points. A large variance of pen pressure indicates that the user's emotions fluctuate greatly and the emotions are strong; a small variance indicates that the emotions are stable.
[0041] Statistics of modification frequency: The modification behavior of users during the drawing process is also monitored in real time by the system. Specifically, a higher modification frequency reflects the user's hesitation and nervousness in expressing themselves, while a lower modification frequency indicates that the user's emotional expression is relatively smooth. Assume that the time point of each modification is t1, t2, …, t m , modify the frequency f mod The calculation formula is:
[0042]
[0043] Where m is the number of modifications and T is the total drawing time. Diversity and accuracy of data acquisition modules
[0044] The data acquisition module not only supports multiple input methods, but also can dynamically capture the user's painting behavior. Whether it is through scanning of hand-drawn images or direct data acquisition of digital drawings, the system ensures the accuracy of the collected data. In the processing of hand-drawn scanned images, the system will automatically detect the color and line changes in the image; in digital drawing, the system provides a richer analysis basis by capturing behavioral data, pen pressure, and drawing speed in real time. When a user draws an image of a tree on the touch screen, the system not only collects information about each pixel of the image, but also records the process data of the painting. These multi-dimensional behavioral data are the basis for subsequent psychological state analysis and marriage matching, enabling the present invention to integrate various inputs to provide more accurate emotional analysis and personalized marriage suggestions.
[0045] Further, the step 2 includes:
[0046] In the present invention, image preprocessing processes the original painting data obtained from the data acquisition module to ensure that accurate and clear key information can be obtained in the subsequent feature extraction and psychological state analysis. The main purpose of image preprocessing is to improve image quality, eliminate noise and ensure data consistency, laying a solid foundation for the subsequent application of intelligent algorithms. Image preprocessing includes four key steps: noise removal, grayscale conversion, image enhancement and standardization.
[0047] Each step is interconnected, providing an orderly and accurate data flow for the entire system. Noise removal ensures the clarity of the image, so that subsequent steps will not be disturbed by noise; grayscale conversion simplifies the image data structure and reduces processing complexity; image enhancement further improves the contrast and brightness of the image, ensuring that the details can be captured by the subsequent feature extraction module; standardization allows image data from different sources to be analyzed and compared at a unified scale. Each step provides optimized input for the next step, ensuring that the subsequent visual converter and self-supervised clustering algorithm can extract meaningful psychological state features from high-quality images, thereby achieving more accurate marriage and love matching suggestions.
[0048] Noise removal: During the data acquisition process, image data may be affected by hardware device limitations, external environmental interference or user operation factors, resulting in noise. Therefore, noise removal is the primary step in image preprocessing. The purpose of noise removal is to eliminate unnecessary interference signals in the image while retaining key image details. The present invention adopts an adaptive filtering algorithm. By dynamically adjusting the filtering parameters, the system can effectively remove noise and retain edge details.
[0049] Derivation of the noise removal formula: Let the pixel value of the original image be I(x,y), and the pixel value of the image after adaptive filtering be I′(x,y). The filtering process determines the filtering result of each pixel by calculating the weighted average of the pixel neighborhood. The formula is as follows:
[0050]
[0051] Among them, x, y: are the horizontal and vertical coordinates of the image, I(x, y): This is the pixel value at the coordinate (x, y) in the original image. I′(x, y): This is the pixel value at the coordinate (x, y) in the filtered image. N(x, y): represents the neighborhood area of the coordinate (x, y). This neighborhood area is usually a window of a fixed size, which is used to capture the pixel values near the current pixel. w(i, j): represents the weight of the pixel at the coordinate (i, j). This weight is dynamic and is determined according to the size of the pixel change in the neighborhood where the pixel is located. When the pixel changes in the neighborhood are large, the weight will decrease to avoid over-smoothing the edge area; when the pixel changes in the neighborhood are small, the weight will increase to enhance the filtering effect and remove noise.
[0052] Grayscale conversion: This step converts the color image into a grayscale image to simplify the data structure and the amount of calculation. Each pixel of the color image contains three channels: red, green, and blue, while the grayscale image retains the brightness information by performing a weighted average calculation on these three channels. Grayscale conversion reduces the amount of data and improves calculation efficiency without losing key information.
[0053] Grayscale conversion formula: Assume that the pixel values of the red, green, and blue channels in the color image are R(x, y), G(x, y), and B(x, y), respectively. Then the pixel value I of the grayscale image is gray The calculation formula for (x,y) is as follows:
[0054] I gray (x,y)=0.299·R(x,y)+0.587·G(x,y)+0.114·B(x,y)
[0055] This formula is weighted according to the different sensitivities of the human eye to color, with the weights of the red, green, and blue channels being 0.299, 0.587, and 0.114, respectively.
[0056] Image enhancement: By adjusting the brightness and contrast of the image, the details in the image are made clearer, especially the stroke details which are crucial for psychological state analysis. In the present invention, the histogram equalization method is adopted to make the brightness and contrast more uniform by redistributing the gray value of the image, thereby enhancing the detail performance of the image.
[0057] Let the original grayscale image be I gray (x, y), its grayscale histogram is H(g), which indicates the number of pixels with grayscale value g. The grayscale value I after histogram equalization eq The calculation formula for (x,y) is as follows:
[0058]
[0059] Among them, Igray (x,y): This is the pixel value of the original grayscale image at coordinate (x,y). eq (x,y): This is the pixel value at coordinate (x,y) after histogram equalization. This value enhances the contrast of the image by redistributing the brightness so that the distribution of brightness values in the image is more uniform. H(g): This is the histogram of the original grayscale image, which represents the number of pixels with grayscale value g. L: This is the total number of grayscale levels. M×N: This is the total number of pixels in the image, where M and N represent the width and height of the image respectively, indicating the number of pixels contained in the entire image. This value is used to normalize the cumulative histogram so that the result is within the range of grayscale values. This cumulative sum represents the cumulative frequency of all pixel values before the gray value g. It is the core part of the cumulative histogram, which realizes the redistribution of brightness values by counting the total number of pixels less than the current gray value.
[0060] This processing method stretches the grayscale distribution of the image to make the brightness and contrast of the image more uniform, effectively improving the image details, especially in areas with lower grayscale values. Through this enhancement process, subtle changes in the image can be displayed more clearly, providing more effective information for the subsequent visual converter algorithm.
[0061] Standardization: To ensure the consistency of image data processed by the system across different devices and users, the system performs standardization on the images. The purpose of standardization is to adjust the image data to a uniform range and eliminate data differences caused by different devices or painting styles, thereby ensuring that the data can be fairly compared and processed in subsequent analysis.
[0062] Let the minimum pixel value of the image be I min , the maximum pixel value is I max , the normalized pixel value I norm The calculation formula for (x,y) is:
[0063]
[0064] Through this formula, the system normalizes each pixel value of the image to the range of [0,1]. The normalization process ensures that the image data has the same scale, making the subsequent feature extraction and analysis more consistent and accurate, and avoiding deviations caused by differences in image equipment or painting methods.
[0065] Further, the step three includes:
[0066] In the present invention, feature extraction determines whether the system can accurately capture the user's emotional and psychological characteristics in the drawing projective test. The present invention extracts multi-dimensional features from the preprocessed image by using a visual converter. Through a multi-layer neural network and a multi-head attention mechanism, the system extracts and transforms these features layer by layer into high-dimensional feature vectors, providing basic data for subsequent psychological state analysis and marriage matching.
[0067] The image preprocessing module provides high-quality input for feature extraction. The visual converter uses the attention mechanism and neural network structure to gradually extract and integrate the multi-dimensional features in the image. These features provide an important basis for subsequent psychological state analysis and marriage matching. Each small image block is processed layer by layer to extract the user's emotions and psychological state. By generating a global feature vector, the system can express the user's multi-dimensional psychological characteristics in a unified way, providing a solid foundation for the final analysis and decision-making. These steps are closely linked to each other and jointly ensure the accuracy and reliability of the system.
[0068] Multi-dimensional feature extraction of visual converter: Visual converter is a deep learning model based on self-attention mechanism, which can capture global image features well, and is particularly suitable for multi-dimensional feature extraction of complex images. In the present invention, the visual converter is used to extract psychological features from the user's painting projection image. The core idea of the visual converter is to divide the image into several small blocks, and process each small block to extract key information.
[0069] Image segmentation and input embedding: The system divides the preprocessed image I into small blocks of fixed size. The size of the image is W×H, and the size of each small block is p×p, so the image is segmented into Where W is the width of the image, H is the height of the image, p is the side length of each small block, indicating that the size of each image block is p×p pixels, and N is the number of small blocks into which the image is divided. For each small block P i Perform a linear transformation and embed it into the feature space. The formula is as follows:
[0070] z i =W e ·P i +b e
[0071] Among them, P i : represents the pixel value of the i-th small block in the image. Each small block is a two-dimensional pixel matrix of size p×p. e : The weight matrix of the linear transformation used to embed the small patch into the feature space. Its size is d×(p×p), where d is the dimension of the feature vector and b e : Bias term, a vector of size d, used to adjust the feature vector during the embedding process, zi : The embedded feature vector, which is composed of small blocks P i Obtained after mapping to the feature space. i The dimension is d, which represents the feature representation of the small block.
[0072] In this way, the small blocks of the two-dimensional image are converted into one-dimensional feature vectors z i , which becomes the input for subsequent processing. In this way, the system can gradually capture the details and global information in the image, ensuring that elements related to psychological characteristics can be extracted.
[0073] The multi-head attention mechanism is a key part of the visual transformer to extract image features. It enables the system to extract relevant information from each part (small image patch) in the image and weigh local and global features. The mechanism processes different areas of the image in parallel through multiple attention heads to obtain a more detailed feature description.
[0074] The core formula of the attention mechanism is as follows:
[0075]
[0076] Among them, A: attention matrix, which represents the relationship between image patches. Each element of it represents the weight assigned to a certain image patch in its interaction with other patches. Q: query vector, which is part of the input feature vector and represents the information that the model is interested in a certain patch. It is used to find image regions related to itself. K: key vector, which is another input feature vector that represents the features of the image patch and is used to perform dot product calculations with the query vector. K T : The transpose of the key vector, used to perform matrix multiplication with the query vector Q to calculate the similarity between each image patch. k : The dimension of the key vector, used for scaling operations so that the value is not too large or too small. This scaling factor Used to balance the size of the dot product to avoid the problem of excessive gradients during model training. Softmax: A normalization operation applied after the dot product calculation to convert the similarity into a probability distribution. It ensures that the sum of the weights of all image patches is 1, indicating the degree of attention the model pays to each patch.
[0077] The attention matrix A reflects the correlation between each small block in the image and other small blocks. The calculated attention matrix is used to weight the feature vector, and the formula is:
[0078] Z=A·V
[0079] Z: The final weighted feature vector of the output. It is obtained by multiplying the attention matrix A with the value vector V. This output contains the global and local features of the image. A: The attention matrix, calculated by Q and K, represents the relationship or attention weight between each small block in the image. V: The value vector is another part of the input feature vector, representing the specific information of the small block of the image.
[0080] Through the multi-head attention mechanism, the system is able to balance local details and global features in the image. These features are crucial for analyzing the user's psychological state.
[0081] Feature extraction layer by layer: The visual converter extracts complex features in the image layer by layer through a multi-layer neural network. In each layer, the features are continuously refined and enhanced through the combination of attention mechanism and feedforward neural network. Let the input feature vector of the lth layer be Z (l) , the output formula of this layer is as follows:
[0082] Z (l+1) =LayerNorm(Z (l) +MultiHead(Z (l) ))+FeedForward(Z (l) )
[0083] Among them, Z (l+1) is the feature vector of the l+1th layer, MultiHead(Z (l) ) represents the multi-head attention mechanism operation of this layer, FeedForward(Z (l) ) represents the operation of a feedforward neural network. (l) : The input feature vector of the lth layer, which represents the image feature representation after being processed by the first l layers. (l+1) : The output feature vector of the l+1th layer, which is the feature generated by the operation of this layer and contains more complex image information. LayerNorm: Layer normalization operation, used to standardize features to make them easier to be processed by subsequent network layers and reduce the problem of gradient disappearance or explosion. MultiHead(Z (l) ): The multi-head attention mechanism of this layer operates. Through multiple parallel attention heads, the system captures information and extracts features in different spaces. FeedForward(Z (l) ): Feedforward neural network operation. Through linear transformation and nonlinear activation function, the features are further enhanced and refined.
[0084] By updating layer by layer, the system is able to extract more complex psychological and emotional features from simple physical features.
[0085] Generation of feature vectors: After being processed by a multi-layer neural network, the system finally integrates the feature vectors of each small image block into a global feature vector z global This feature vector is a high-dimensional representation of the user's psychological state, containing all key information. It serves as basic data in subsequent psychological state analysis to help the system accurately analyze the user's emotional state and psychological characteristics. The formula for generating the global feature vector is:
[0086] z global =Concat(z1,z2,…,z N )
[0087] Among them, z global : The global feature vector is the final representation of the entire image after feature extraction. It contains the feature vectors of each small block in the image and can fully express the overall information of the image. i : represents the feature vector extracted from the i-th small block in the image. Concat: represents the concatenation operation. The feature vectors z1, z2, …, z N They are concatenated together to form a global feature vector.
[0088] Application to psychological feature analysis: global feature vector z global It represents the user's psychological state. In the subsequent analysis process, the system will classify and analyze these features in combination with the self-supervised clustering algorithm. Through these features, the system can capture the user's emotional expression, anxiety level and mood swings when drawing.
[0089] The thickness of the line reflects the intensity of the user's emotions, with thicker lines indicating tension or anxiety; the use of colors shows the user's emotional state, with warm tones suggesting positive emotions and cool tones indicating negative and depressive emotions; the complexity of the graphic structure reveals the user's way of thinking and cognitive ability. These features can not only help the system identify the user's psychological state, but can also be applied to the process of marriage and love matching, combining the user's emotional and psychological characteristics to provide personalized matching suggestions.
[0090] Further, the step 4 includes:
[0091] The self-supervised clustering module performs self-supervised learning analysis based on multi-dimensional features extracted by the visual converter. In the present invention, self-supervised clustering is used to analyze the user's painting behavior and emotional characteristics and generate corresponding psychological state labels. At the same time, the system combines time series analysis to dynamically capture the user's emotional fluctuations during the painting process and achieve more accurate psychological state classification.
[0092] Self-supervised clustering allows the model to automatically learn and discover features and patterns in the data by clustering unlabeled data. It uses contrastive learning tasks for optimization, generates labels during the learning process, and classifies samples into different groups. In user drawing projective tests, users' emotions and psychological states are often complex and varied. Self-supervised clustering can automatically extract users' emotions and psychological characteristics without manual labeling, generate classification results, and provide support for psychological analysis.
[0093] The visual converter extracts the multi-level features of the user's drawing through the self-attention mechanism, and obtains high-quality feature vectors z for lines, colors, and emotional expressions. i ,z j , providing a basis for subsequent clustering. Self-supervised learning automatically optimizes the similarity between similar samples and samples of different classes by comparing loss functions, and ultimately achieves dynamic classification of the user's psychological state.
[0094] In order to achieve self-supervised clustering, the contrastive loss function is used to guide the model to learn the similarity between samples and classify them. It optimizes by maximizing the similarity of similar samples and minimizing the similarity of different samples.
[0095]
[0096] Where: L: represents the value of the loss function, which measures the clustering effect of the model. By minimizing the loss function, the model clusters similar samples together and increases the distance between different samples. Indicates traversal calculation of sample pairs, where i and j represent the index of the sample, i.e., the i-th and j-th samples. i,j : is a binary label, indicating the category relationship between sample i and sample j. i,j =1, indicating that the two samples are of the same class; i,j = 0, indicating that the two samples belong to different classes. i,j = 1, it means that sample i and sample j should be close, so their similarity is added to the formula. i,j = 0, it means that sample i and sample j belong to different classes, and the formula will try to increase their distance so that the similarity is lower than the preset threshold m. i ,z j ): represents the similarity between sample i and sample j. Cosine similarity is usually used to measure similarity, and its calculation formula is:
[0097]
[0098] Where: z i ·z j: is the dot product of the feature vectors of sample i and sample j, indicating the similarity between the two in the feature space. ∥z i ∥ and ∥z j ∥: are the eigenvectors z i and z j The modulus (length of the vector). Cosine similarity represents the cosine value of the angle between two feature vectors, and its value range is [-1,1], where 1 represents complete similarity and -1 represents complete difference. max(0,m-sim(z i ,z j )):When y i,j = 0, this item calculates the similarity between samples of different classes and tries to compare it with the preset threshold m. m is a predefined threshold that ensures that the similarity between samples of different categories is lower than this threshold, forcing the model to maintain their distance in the feature space. i ,z j ) is positive, it means that samples i and j are too close and the model needs to increase their distance, so this item is not zero. i ,z j ) is small enough, that is, lower than m, then this term is zero and no longer affects the loss function.
[0099] By optimizing the contrast loss function, the model can effectively learn the similarities between samples and cluster similar samples together. This formula minimizes the loss function, maximizes the similarity of samples of the same class, and ensures that the distance between samples of different classes is large enough in the feature space. Then, the feature vector z extracted by the visual converter is i and z j As input, the system uses a self-supervised clustering algorithm to perform feature analysis and automatically generate mental state labels for users.
[0100] Dynamic emotional feature capture and time series analysis: The emotions in the painting process are dynamic, so in this invention, time series analysis is used to capture the dynamic change characteristics of emotions. Time series analysis can gradually track the emotional fluctuations of users in the painting process and present them in the form of time series. Suppose the time points in the painting process are t1, t2, …, t n , each time point corresponds to an emotional feature vector z(t i ). In order to analyze the change of emotion, the system calculates the rate of change of emotion between adjacent time points. By calculating the rate of change of emotion at each time point, the system can identify the dynamic fluctuation of user emotion. The formula is:
[0101] Δz(t i )=z(t i+1 )-z(t i )
[0102] Where: Δz(t i ): indicates at time point t i and t i+1 The emotional changes between i ): indicates time point t i The emotional feature vector of z(t i+1 ) represents the time point t i+1 The sentiment feature vector.
[0103] Implementation of psychological state classification: Through self-supervised clustering and time series analysis, the system generates multiple emotional and psychological state labels for users. These labels include anxiety, depression, stability, and pleasure, which help the system classify the user's emotional changes. The final generated global emotional feature vector z global It is obtained by combining clustering algorithm with time series analysis, and it can accurately reflect the emotional dynamics of users during the painting process.
[0104] The formula for generating the global eigenvector is:
[0105] z global =Concat(z1,z2,…,z N )
[0106] Among them, z global : The global feature vector is the final representation of the entire image after feature extraction. It contains the feature vectors of each small block in the image and can fully express the overall information of the image. i : represents the feature vector extracted from the i-th small block in the image. Concat: represents the concatenation operation. The feature vectors z1, z2, …, z N They are concatenated together to form a global feature vector.
[0107] The global feature vector integrates the emotional changes during the painting process and provides a basis for the system's psychological state classification. Through this classification method, the system accurately analyzes the user's psychological characteristics under different emotional states and generates corresponding psychological state labels.
[0108] Further, the step five includes:
[0109] In the present invention, the love and marriage matching module combines the psychological state labels, emotional fluctuations and multi-dimensional information of love and marriage preferences generated by users, and adopts intelligent recommendation algorithms and reinforcement learning models to provide users with personalized love and marriage matching suggestions. The core of this module is to improve the accuracy and personalization of matching through dynamic optimization of matching strategies, and ensure the long-term happiness of users in emotions and love and marriage.
[0110] The relationship between psychological state labels and matching: The system generates psychological state labels for users through visual converters and self-supervised clustering modules. Psychological state labels integrate users' emotional characteristics, emotional fluctuations, and psychological needs in love and marriage. This information provides the core basis for personalized love and marriage matching.
[0111] In order to optimize the marriage matching suggestions, the present invention adopts a reinforcement learning algorithm, which is adjusted through continuous iteration and user feedback loops, so that the matching scheme can better meet the user's emotional needs. Reinforcement learning is used to calculate the expected returns of different marriage matching strategies, helping the system to dynamically optimize the matching scheme. The form of the equation is:
[0112] Q(s,a)=r+γ·max a′ Q(s′,a′)
[0113] Where: Q(s,a): the value function of taking action a in state s, which measures the expected return of the current love and marriage matching strategy. Here, state s represents the user's current psychological state, emotional fluctuations, and love and marriage preferences, and action a represents the selection of a certain love and marriage partner for matching. r: immediate reward, which represents the user's feedback on the current love and marriage matching and the satisfaction score. A higher feedback score indicates that the user is more satisfied with the current love and marriage partner. γ: discount factor, which is used to balance the weight of immediate return and long-term return. A larger γ value indicates that the system attaches more importance to the user's long-term love and marriage needs and the stability of the love and marriage relationship. max a′ Q(s′,a′): The maximum value function of the best action to be taken in the future, that is, the optimal strategy adopted by the system in future marriage and love matching.
[0114] Through reinforcement learning algorithms, the system will continuously optimize these parameters. In addition, the matching results should also take into account their psychological expectations for marriage and love and their long-term marriage and love needs to ensure that marriage and love matching can meet the personalized needs of users;
[0115] The reinforcement learning algorithm adjusts the marriage matching strategy through the user's immediate feedback. The system obtains immediate rewards r from the user's feedback and dynamically adjusts the matching strategy based on the positive and negative feedback: if the user shows high satisfaction with a marriage match, the system will tend to increase the recommendation weight of similar objects. If the user is less satisfied with the marriage partner, the system will reduce the recommendation of similar objects and improve the matching strategy.
[0116] In addition, the system will adjust the matching strategy based on the user's long-term marriage and love needs. For those users who show long-term emotional needs, the system will give priority to recommending those who are more emotionally stable and can maintain long-term relationships, while for users with short-term needs, the system will provide more flexible matching solutions.
[0117] Further, the step six includes:
[0118] In the present invention, the output analysis module is responsible for generating love and marriage matching results and psychological state analysis reports, and visually presenting the results to users through visualization technology. The goal of this module is to provide personalized love and marriage matching suggestions, while helping users to gain a deeper understanding of their own emotional state and its impact on love and marriage matching. Through psychological analysis reports, love and marriage matching suggestions, visualization displays, and long-term psychological state tracking, users can obtain more comprehensive emotional and love and marriage health support.
[0119] The psychological analysis report is an important output of this module, which shows the classification results of the user's emotional state and the trend of emotional changes. The system captures the user's emotional fluctuations during the painting process through time series analysis, thereby revealing the dynamic changes of their emotions. Through this report, users can have a deeper understanding of their own emotional fluctuations and psychological characteristics.
[0120] The core of time series analysis is to capture the user's emotional fluctuations at different times to help understand the changes in emotions. Let the emotional fluctuation coefficient be Δe i , and its calculation formula is:
[0121] Δe i =e(t i+1 )-e(t i )
[0122] Where: Δe i :Indicates at time point t i With t i+1 The emotional fluctuations between i ): indicates at time point t i The user's emotional characteristics. e(t i+1 ): indicates at time point t i+1 User's emotional characteristics.
[0123] By continuously calculating these change rates, the system generates a curve that reflects the user's emotional fluctuations. This curve helps users understand how their emotions change over time, especially in the drawing projection test, where the emotional fluctuation coefficient reveals the user's emotional ups and downs at different times.
[0124] Visualization of emotional fluctuation graph: To facilitate user understanding, the system generates an emotional fluctuation graph, which uses a curve graph to show the user's emotional changes at different time points during the painting process. The emotional fluctuation graph is based on the emotional fluctuation coefficient Δe i , reflecting the stability or fluctuation of users’ emotions. This visual display enables users to intuitively understand the dynamic changes of emotions and how such changes affect marriage and love matching.
[0125] Marriage and love matching suggestions: Marriage and love matching suggestions are based on multiple dimensions, including the user's psychological state label, emotional fluctuation coefficient, and marriage and love preferences. The system generates personalized marriage and love matching solutions for users through intelligent recommendation algorithms combined with reinforcement learning models. Matching not only takes into account the user's current emotional needs, but also aims to ensure the long-term stability of the marriage and love relationship.
[0126] Visualization: In order to enable users to intuitively understand the marriage and love matching results, the system uses visualization technology to display matching suggestions and psychological state analysis. Common display forms include emotional fluctuation curves and marriage and love matching charts to help users understand the basis and logic behind the matching.
[0127] Marriage and romance matching chart: used to show the matching degree between the user and the recommended object. The matching degree is based on the psychological state label and the emotional fluctuation coefficient Δe i , Marriage preference parameters Pref i It is calculated based on comprehensive multi-dimensional information.
[0128] The calculation formula for matching is as follows:
[0129] Match Score = α1·Sim(Tag i ,Tag j )+α2·Sim(Pref i ,Pref j )+α3·(1-|Δe i -Δe j |)
[0130] Among them: α1, α2, α3: These three parameters are the weights of psychological state, marriage and love preferences and emotional fluctuations in the matching calculation. The size of the weight value is adjusted according to the influence of different factors in each user's matching. The sum of the weights α1, α2, and α3 should be 1 to ensure that the overall matching score is within a reasonable range. Sim(x, y): The Sim function represents the similarity between two parameters (psychological state or marriage and love preferences). Cosine similarity is usually used to measure the similarity between two vectors in a high-dimensional space. x and y are the psychological state vectors or marriage and love preference vectors of user i and recommended object j, respectively. Δe i : The emotional fluctuation coefficient represents the degree of emotional fluctuation of user i and recommended object j over a period of time. Through time series analysis, the system captures the changes in user emotions at different time points. The emotional fluctuation coefficient Δe is used to indicate the degree of fluctuation of user emotions. The larger the value, the more intense the emotional fluctuation. |Δe i -Δe j ∣ represents the difference in emotional fluctuations between the user and the recommended object.
[0131] Through this formula, the system comprehensively considers psychological state, marriage and love preferences, and emotional fluctuations, calculates a personalized marriage and love matching score, and displays it to the user through a chart.
[0132] Long-term psychological state tracking and marriage and love health advice: In order to help users maintain the long-term healthy development of emotions and marriage and love relationships, the system provides long-term psychological state tracking and marriage and love health advice functions. By tracking the changes in the user's emotional state, the system can provide users with personalized emotional health management advice.
[0133] Long-term psychological state tracking: The system uses time series analysis to track the long-term trend of the user's emotional state. By recording the emotional fluctuations during multiple painting processes, the system can generate long-term trend charts of the user's emotions. Users can understand the changes in their emotional state through these charts and adjust their psychological or marriage needs according to the system's suggestions.
[0134] Marriage and love health advice: Based on long-term emotional state analysis and marriage and love matching results, the system provides users with marriage and love health advice. When the user's emotions fluctuate greatly, the system will suggest that the user make psychological adjustments or seek emotional support. At the same time, the system will also suggest how to better maintain the relationship with the marriage and love partner based on the marriage and love matching results, and how to enhance the emotional stability of each other through communication and understanding.
[0135] Compared with the prior art, the present invention has the following beneficial effects:
[0136] 1. Dynamic psychological state analysis: This invention realizes dynamic tracking and real-time analysis of the user's emotions and psychological state in the painting by introducing an intelligent algorithm that combines visual converters with self-supervised clustering. Traditional love and marriage matching systems mainly rely on static information provided by users, such as questionnaires or hobbies, while this invention can capture the emotional changes of users during the painting process and provide a more comprehensive and accurate psychological state assessment. This dynamic analysis method significantly improves the accuracy and pertinence of love and marriage matching, surpassing the static analysis limitations of the existing technology.
[0137] 2. Automated psychological feature extraction: This invention uses visual converters to extract multi-dimensional image features, which can accurately identify subtle emotional features in user drawings, including line thickness, color distribution, shape structure, etc. This neural network-based feature extraction method greatly improves the automation and standardization level of analysis, reduces the limitations of traditional methods that rely on subjective judgment of human experts, and avoids the instability and subjectivity of evaluation results.
[0138] 3. Innovative application of self-supervised learning: The present invention classifies and clusters the user's psychological state through a self-supervised clustering algorithm. There is no need to pre-label the data set. The system can automatically learn the user's drawing behavior and generate psychological state labels. This technology solves the problem of large-scale psychological assessment being difficult to label in the prior art, and makes the system more efficient when processing unlabeled data. The introduction of self-supervised learning not only reduces labor costs, but also can dynamically update psychological state assessments to adapt to long-term emotional changes in users.
[0139] 4. Personalized love and marriage matching suggestions: The present invention uses an intelligent recommendation algorithm to match love and marriage based on the user's psychological state label and love and marriage preferences. The system dynamically adjusts the matching scheme through reinforcement learning and can optimize the matching results based on user feedback. This method not only ensures the accuracy of love and marriage matching, but also provides continuously optimized love and marriage suggestions based on the user's emotional fluctuations and psychological changes, ensuring that the matching results are highly consistent with the user's long-term emotional needs. Compared with the traditional static matching model, the present invention has significantly improved personalization and dynamism.
[0140] 5. Comprehensive psychological analysis and marriage suggestions: Traditional marriage matching systems usually cannot provide in-depth analysis of the user's psychological state. This invention combines the drawing projection test, analyzes the user's psychological characteristics through intelligent algorithms, and generates personalized psychological health and marriage suggestions. This not only improves the success rate of marriage matching, but also helps users deeply understand their own emotional needs and psychological state, and promotes the healthy development of marriage relationships.
[0141] 6. Combined analysis of emotions and behaviors: The present invention not only obtains the user's static painting images through the data acquisition module, but also records the user's dynamic behavior data (such as painting speed, pen pressure, number of revisions, etc.) during the painting process. These behavioral data provide richer dimensions for psychological state analysis, making the identification of emotional fluctuations more accurate, and effectively improving the scientific nature of psychological assessment and the personalization of marriage and love matching.
[0142] 7. Highly adaptable algorithm architecture: The visual converter combined with the self-supervised clustering algorithm in the present invention has strong adaptability, can process unlabeled data of different types and sources, and is applicable to user data sets of various sizes. Traditional dating matching methods are difficult to effectively analyze large-scale unlabeled data sets, and the present invention introduces advanced algorithms to make the system have a wide range of application scenarios and stronger adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0143] Figure 1 : The present invention introduces the flow chart of the visual converter algorithm;
[0144] Figure 2 : The present invention introduces a self-supervised clustering algorithm flow chart;
[0145] Figure 3 : The present invention introduces a reinforcement learning algorithm flow chart. DETAILED DESCRIPTION
[0146] like Figure 1-3 The present invention provides a painting projection marriage and love matching test system and method based on a visual converter, which uses an intelligent algorithm to conduct in-depth analysis of the user's painting projection test, and generates personalized marriage and love matching suggestions in combination with the user's psychological characteristics and marriage and love preferences. The specific implementation methods of the present invention are described in detail below in combination with each module:
[0147] Data acquisition module
[0148] The system of the present invention first obtains the drawing data of the user in the drawing projective test through the data acquisition module. The data acquisition includes hand-drawn scanned images, digital drawings, and behavioral data during the drawing process, such as drawing speed, pen pressure, pauses and revision times during drawing, etc. The module collects the user's drawing data through a touch screen, scanner or other digital input device to ensure the diversity and accuracy of the data. In order to improve the integrity of the data, the module supports real-time acquisition of dynamic information during the user's drawing process, providing an additional data source for subsequent psychological state analysis.
[0149] Image preprocessing module
[0150] After data collection is completed, the system will standardize the collected painting images through the image preprocessing module to ensure data consistency. This module uses an adaptive filtering algorithm to remove image noise and reduce the complexity of image data through grayscale conversion while maintaining the main visual features of the image. Histogram equalization technology is used to optimize the brightness and contrast of the image, further enhancing the image details to ensure that subsequent algorithms can accurately extract key information. In addition, image preprocessing also includes edge enhancement and detail optimization processing of the image to ensure that the visual features of the image are accurately captured in subsequent analysis.
[0151] Visual Converter Module
[0152] The visual converter module in the present invention extracts multi-dimensional feature information from the preprocessed image through a multi-head attention mechanism, including but not limited to line thickness, color distribution, morphological structure, emotional expression, etc. By extracting features from the image layer by layer through a hierarchical neural network, the module can generate a high-dimensional feature vector that reflects the user's psychological state. The multi-layer architecture of the visual converter enables it to capture global and local features in the image and extract complex visual information such as the strength of the line and the speed of painting, helping the system to deeply understand the user's emotional and psychological changes during the painting process.
[0153] Self-supervised clustering module
[0154] This module uses a self-supervised learning algorithm to perform unsupervised classification of the user's psychological state based on the feature vector generated by the visual converter. Self-supervised clustering does not require manual data annotation. By learning the user's painting behavior pattern, the system automatically generates a psychological state label. This module also combines time series analysis technology to dynamically analyze the user's emotional fluctuations during the painting process and generate a long-term emotional change trend chart. Through automatic learning of a large amount of user painting data, this module can accurately identify the user's psychological state changes and provide a key psychological state basis for marriage and love matching.
[0155] Marriage matching module
[0156] The love and marriage matching module uses an intelligent recommendation algorithm to generate love and marriage matching suggestions based on the user's psychological state label and love and marriage preferences. This module introduces a reinforcement learning algorithm, which enables the system to dynamically optimize the matching scheme based on user feedback. After the initial match is generated, the system continuously adjusts the matching parameters through a feedback loop to improve the accuracy and personalization of love and marriage matching. The system not only matches based on the user's psychological state, but also combines the user's long-term emotional changes and psychological state fluctuations to ensure that the love and marriage matching results can adapt to the user's emotional needs and provide personalized love and marriage suggestions.
[0157] Output Module
[0158] The output module of the present invention generates an analysis report of the love and marriage matching results and the user's psychological state. The report is displayed in a visual way, including the user's psychological analysis, emotional fluctuation trends, love and marriage matching suggestions, etc. The report intuitively displays the analysis results in a variety of ways such as charts and texts to help users understand the matching process and analysis basis of the system. The output module also provides personalized emotional health suggestions to help users better manage emotional changes and make wise decisions in love and marriage relationships.
[0159] System optimization and feedback
[0160] The reinforcement learning module in the system will continuously adjust the matching strategy based on the long-term feedback from users. By introducing the user's marriage and love matching feedback and changes in psychological state, the system can dynamically optimize the recommendation results to ensure that the marriage and love suggestions are more personalized and accurate.
[0161] Specific numerical analysis
[0162] Step 1: Behavioral Data
[0163] 1) Calculation of drawing speed
[0164] During the drawing process, the system records the position of the pen tip at each time period and calculates the drawing speed based on the change in the pen tip position. Set the time interval to Δt and the time to t i , the position is P(ti ), the calculation formula of drawing speed is:
[0165]
[0166] The positions at the 1st second and the 2nd second are P(1)=(3,4) and P(2)=(6,7) respectively, and the time interval Δt=1 second. Then the drawing speed is: v(1)=(6-3,7-4) / 1=(3,3), that is, the drawing speed is 3 units / second.
[0167] 2) Calculation of pen pressure
[0168] During the digital drawing process, the system records the user’s pen pressure p(t i ), and the variance is used to quantify the variation of pen pressure. The variance is calculated as:
[0169]
[0170] Assuming that the pen pressure values recorded during the painting process are {10, 12, 14, 16, 18}, the average pen pressure is: μ p =(10+12+14+16+18) / 5=14
[0171] The variance is: A larger variance indicates that the user's emotions fluctuate greatly and their emotions are stronger.
[0172] 3) Modification frequency calculation
[0173] The frequency of user modification during the drawing process will also be monitored by the system in real time. Assume that the time point of each modification is t1, t2, ..., t m , the calculation formula for modification frequency is:
[0174]
[0175] For example, if the user makes 5 revisions during a 10-minute drawing process, the revision frequency is: 5 / 10=0.5 times / minute. A higher revision frequency indicates that the user may be hesitant or nervous when expressing himself.
[0176] Step 2:
[0177] 1. Noise Removal
[0178] Noise is inevitable in the image acquisition process, especially in the scanning of hand-drawn images. Noise removal is the first step in image preprocessing. Suppose there is an image with pixel values I(x,y). To remove the noise, we use an adaptive filtering algorithm. The size of the image neighborhood is set to a 3×3 window. The pixel value after filtering is calculated as follows:
[0179]
[0180] Assume that in the neighborhood, the original value of a pixel is [120, 125, 130, 135, 140, 145, 150, 155, 160]. After filtering, the new value is 138. This step removes noise by reducing the variation of local pixels.
[0181] 2. Grayscale conversion
[0182] After noise removal, the next step is to convert the color image to grayscale to reduce the amount of data and improve processing efficiency. Assuming that the RGB value of a pixel in the image is R=100, G=150, B=200, the formula for grayscale conversion is:
[0183] I gray (x,y)=0.299·R(x,y)+0.587·G(x,y)+0.114·B(x,y)
[0184] For this pixel, the grayscale value is:
[0185] I gray (x,y)=0.299×100+0.587×150+0.114×200=29.9+88.05+22.8=140.75
[0186] Therefore, the grayscale value of the pixel is 140.75 (rounded to 141), which reduces the computational complexity caused by the RGB channels.
[0187] 3. Image Enhancement
[0188] In order to make the details clearer, especially the line details in the painting, the histogram equalization method is used to enhance the image. Assuming that the grayscale histogram of an image is as follows: there are more pixels with low grayscale values and fewer pixels with high grayscale values, the grayscale values are redistributed through histogram equalization to make the contrast of the image more uniform.
[0189]
[0190] Assume that the image width M = 1000, the height N = 1000, and the total number of gray levels L = 256. After equalization, the original pixel gray value is increased from 120 to 180, so that the details are more obvious and the brightness and contrast of the image are improved.
[0191] 4. Standardization
[0192] In order to ensure that the image data drawn by different devices or different users are consistent, the system standardizes the image. Assume that the minimum pixel value of the image is I min=0, maximum pixel value I max =255, the pixel value after normalization is I norm (x,y) is calculated as follows:
[0193]
[0194] For a pixel with a grayscale value of 141, the normalized result is:
[0195] After normalization, all pixel values are adjusted to the range of [0, 1], which provides uniform input data for subsequent feature extraction and analysis.
[0196] Step 3:
[0197] 1. Image segmentation and input embedding
[0198] The system first divides the preprocessed image I into small blocks of fixed size. In this case, assume that the image size is 128×128 pixels and the size of each small block is 16×16 pixels. In this way, the image is divided into N=64 small blocks.
[0199] Each small piece P i After linear transformation, the feature space is embedded to generate the emotional feature vector z i The embedding formula is as follows:
[0200] z i =W e ·P i +b e
[0201] W e : The weight matrix of the linear transformation, the size is d×(p×p) assuming d=512.
[0202] P i : The pixel value of the i-th small block in the image.
[0203] b e : Bias term, size is 512.
[0204] Thus, after embedding, the two-dimensional patch is converted into a 512-dimensional feature vector z i .
[0205] 2. Calculation of multi-head attention mechanism
[0206] The multi-head attention mechanism is used to extract correlation information between small image patches. The formula is as follows:
[0207]
[0208] d k=512: Dimension of the key vector, used as a scaling factor.
[0209] Assume that at a certain time point, the feature vectors of Q and K are Q = [0.2, 0.4, ..., 0.6] and K = [0.3, 0.5, ..., 0.7], respectively, and their dot product result is Q·K^T = 5.4. The final calculated attention matrix A is normalized by softmax to obtain the weight.
[0210] 3. Feedforward Neural Networks and Layer Normalization
[0211] In each layer of the neural network, the feature vector z i After updating through the multi-head attention mechanism and feedforward neural network, the formula is as follows:
[0212] Z (l+1) =LayerNorm(Z (l) +MultiHead(Z (l) ))+FeedForward(Z (l) )
[0213] In this case, assume that the feature vector z of each small block is i is [0.1, 0.2, 0.3, …, 0.5]. After multiple layers of extraction, the final output global feature vector can integrate the information of each small block into a unified representation.
[0214] 4. Generation of global feature vectors
[0215] After processing the feature extraction of all layers, the system concatenates the feature vectors of all small blocks into a global feature vector, and the formula is as follows:
[0216] z global =Concat(z1,z2,…,z N )
[0217] Assuming the final feature vector for each patch is 512-dimensional, the global feature vector size will be 512×64, which is a complete representation of the entire image.
[0218] Step 4: Dynamic emotional feature capture and time series analysis example:
[0219] Assume that the user's painting process has the following emotional changes:
[0220] At time t1, the user's emotional feature vector z(t1) = [0.5, 0.2, 0.3]
[0221] At time t2, the sentiment feature vector z(t2) = [0.7, 0.3, 0.4]
[0222] According to the formula, the emotional change can be calculated:
[0223] Δz(t1)=z(t2)-z(t1)=[0.7-0.5,0.3-0.2,0.4-0.3]=[0.2,0.1,0.1]
[0224] This change shows that users' emotions are gradually becoming stable.
[0225] Step 5:
[0226] 1. Generation and matching of mental state labels
[0227] Classification is carried out according to the Big Five personality dimensions and the drawing projective test index theory or other drawing projective theories. Since the drawing projective theory is a well-known psychological measurement method, it is not the focus of the present invention. The present invention focuses on the classification method of constructing an algorithm. Taking drawing trees as an example, the psychological state of talents is analyzed and classified into the following types:
[0228] Important clues about mood and stress can be obtained by analyzing the content of the paintings (the tree's trunk, crown, leaves, fruit, roots and ground line, as well as non-subject information), line intensity, and symbols in the drawings.
[0229] Emotional level: The emotions expressed when drawing the tree's trunk, crown, leaves, fruit, roots, and ground line, as well as non-thematic information (closed crown, top of the crown cut, etc.).
[0230] 1) Anxiety and stress: The picture is blacked out in many places, with messy and fragmented lines, and the main body of the picture is too small. The degree of the above painting characteristics is set on a scale of 0-1, and the more degrees, the deeper the value;
[0231] 2) Depressed state: light brushstroke pressure, stiff brushstrokes, poor fluency, and a snowy scene; the degree of the above painting characteristics is set on a scale of 0-1, with the higher the degree, the higher the value;
[0232] 3) Unstable state: the trunk is abnormal, and the contact surface between the roots and the ground is unstable; the degree of the above painting characteristics is set on a scale of 0-1, and the greater the degree, the greater the value;
[0233] 4) Pleasant state: smooth lines, moderate size of the picture, bright colors, rich layers of leaves and trunks. The degree of the above painting characteristics is set on a scale of 0-1, with the greater the degree, the greater the value;
[0234] In the present invention, the psychological state label is generated by a visual converter and a self-supervised clustering algorithm to represent the user's current emotions and psychological needs. In the numerical case, it is assumed that the psychological state label of user A is as follows:
[0235] Current emotional state: Anxiety A )
[0236] Long-term emotional needs: need for stable emotional support;
[0237] Psychological expectations of marriage and love: looking for a partner who can give a sense of security and understanding;
[0238] For user B, his mental state label is as follows:
[0239] Current emotional state: Stable B )
[0240] Long-term emotional needs: hope to establish a long-term intimate relationship;
[0241] Psychological expectations of marriage and love: looking for a partner with complementary personality;
[0242] By calculating the label similarity, the system evaluates the matching degree of two users. The similarity of psychological state labels is calculated using the cosine similarity formula:
[0243]
[0244] Assume that after calculation, the similarity of the psychological state labels is 0.85, which means that the psychological needs of user A and user B are highly similar.
[0245] 2. Matching of marriage and love preferences
[0246] In terms of marriage and love preferences, it is assumed that the preference parameters of user A and user B include:
[0247] User A: 25-30 years old, teacher, and hobby: reading;
[0248] User B: 28 years old, engineer, sports hobbies;
[0249] Assumed quantization parameters and weights:
[0250] 1) Basic preferences (30%): age gap (10%), geographic location (10%), education level (10%);
[0251] 2) Lifestyle and interests (20%):
[0252] Similarity of living habits (10%), similarity of interests and hobbies (10%);
[0253] 3) Emotional and psychological characteristics (30%): emotional stability similarity (15%), personality characteristics compatibility (15%);
[0254] 4) Long-term relationship potential (20%): similarity of relationship expectations (10%), adaptability and conflict resolution skills (10%);
[0255] Age similarity: User A's ideal matching age range is 25-30 years old, while User B's age is 28 years old, which fully meets User A's expected range. Therefore, in terms of age, the similarity can be considered high (close to 1.0).
[0256] Occupational similarity: User A is a teacher and User B is an engineer. These two occupations have obvious differences in nature and working environment. The teaching profession is usually related to education and humanistic care, while the engineer is more focused on technology and applied science. The occupational similarity is low, probably between 0.2 and 0.3, because although both occupations require professional knowledge, they are less related.
[0257] Similarity of interests and hobbies: User A likes reading, which is usually a static and personal activity. User B likes sports, which usually points to a more dynamic and social activity. The difference in the nature of interests and hobbies leads to a lower similarity, which may be between 0.1 and 0.2.
[0258] Comprehensive similarity calculation: Assuming that the weights of each dimension are equal, the comprehensive similarity can be approximately calculated as the average of the similarities of age, occupation, and hobbies. Based on the above estimates, we can roughly calculate:
[0259] Age similarity: 1.0
[0260] Occupational similarity: 0.25
[0261] Similarity of interests and hobbies: 0.15
[0262] Comprehensive similarity = (1.0 + 0.25 + 0.153) / 3 ≈ 0.47; the similarity is low, indicating that there are differences.
[0263] The present invention also provides a case of judging the similarity of marriage and love preferences by drawing tree projection:
[0264] Whether the upper and lower positions of the trees are consistent (representing spiritual and material pursuits); the similarity degree is divided into an interval of 0-1 according to whether they are close or not;
[0265] The presence or absence of tree roots and whether their sizes are consistent (indicating sexual needs); the similarity is divided into intervals of 0-1 according to whether they are close or not;
[0266] Original family (referring to family values, etc.); the similarity is divided into an interval of 0-1 according to whether it is close or not;
[0267] Whether the degree of openness of the tree crowns is consistent (representing communication); the similarity degree is divided into an interval of 0-1 based on whether they are close or not.
[0268] 3. Calculation of emotional fluctuation coefficient
[0269] Emotional fluctuation coefficient Δe i It is used to measure the degree of change in user emotions. Assume that user A has a large emotional fluctuation over a period of time, with an emotional fluctuation coefficient of 0.7; while user B has a small emotional fluctuation, with an emotional fluctuation coefficient of 0.3.
[0270] The difference in emotional fluctuations between the two is calculated as:
[0271] ∣Δe A -Δe B ∣=∣0.7-0.3∣=0.4
[0272] A larger fluctuation difference means that user A's emotions change more dramatically, while user B's emotions are relatively stable.
[0273] 4. Calculation of marriage and love matching scores
[0274] Based on the above similarity and fluctuation coefficient differences, the following formula is used to comprehensively calculate the marriage and love matching scores of the two users:
[0275] Match Score = α1·Sim(Tag i ,Tag j )+α2·Sim(Pref i ,Pref j )+α3·(1-|Δe i -Δe j |)
[0276] Assume weight parameters α1 = 0.4, α2 = 0.3, α3 = 0.3. After substituting each parameter, the final matching score is obtained:
[0277] Match_Score=0.4·0.85+0.3·0.6+0.3·(1-0.4)=0.34+0.18+0.18=0.7The final matching score is 0.7, indicating that user A and user B have a high degree of match in terms of emotions, marriage and love preferences, and emotional fluctuations. The system will recommend them to have further marriage and love exchanges.
[0278] Step 6:
[0279] 1. Calculation and display of emotional fluctuations
[0280] In this system, the user's emotional state is quantified and calculated through the emotional fluctuation coefficient during the painting process. The calculation formula of the emotional fluctuation coefficient is as follows:
[0281] Δe i =e(t i+1)-e(t i )
[0282] By calculating the emotional fluctuations at each time point, the system can generate a curve that reflects the user's emotional changes. For example, a user shows a large change in emotional fluctuations during the painting process, and the time points are:
[0283] t1: emotional value is 0.5, t2: emotional value is 0.7, t3: emotional value is 0.4 At this time, the emotional fluctuation of the system is calculated as: Δe1 = 0.7-0.5 = 0.2, Δe2 = 0.4-0.7 = -0.3;
[0284] Through these data, the system generates an emotional fluctuation curve to intuitively display the user's emotional ups and downs. These values help users understand the potential impact of their emotional fluctuations on marriage and love matching.
[0285] 2. Calculation of marriage and love matching
[0286] The marriage and love matching degree is calculated based on the user's psychological state label, emotional fluctuation coefficient, and marriage and love preferences. The formula is as follows:
[0287] Match Score = α1·Sim(Tag i ,Tag j )+α2·Sim(Pref i ,Pref j )+α3·(1-|Δe i -Δe j |)
[0288] Set to α1=0.4, α2=0.4, α3=0.2.
[0289] Assumption: The similarity between the psychological state label of user i and the dating partner j is 0.8.
[0290] The similarity of marriage and love preferences is 0.75.
[0291] User's emotional fluctuation Δe i =0.2, and the emotional fluctuation of the marriage partner Δe j =0.1.
[0292] Substituting into the formula:
[0293] Match Score=0.4·0.8+0.4·0.75+0.2·(1-∣0.2-0.1∣)=0.32+0.3+0.18=0.8=0.32+0.3+0.18=0.8=0.32+0.3+0.18=0.8
[0294] The marriage match degree is 0.8, indicating that the marriage match degree of the two is relatively high, and the system may recommend this marriage partner as a potential long-term partner.
[0295] 3. Long-term psychological status tracking and marriage and love health advice
[0296] The system tracks the long-term trend of user emotional fluctuations through time series analysis. Assume that within a period of time, the user's emotional fluctuation data is as follows:
[0297] Average volatility coefficient in the first week: 0.3
[0298] Average volatility coefficient in the second week: 0.2
[0299] Average volatility coefficient for the third week: 0.1
[0300] From the data, we can see that the user's emotional fluctuations are gradually becoming stable. Based on this, the system recommends that users can find a more stable marriage partner, and reminds users that their emotional state is becoming stable, which is conducive to entering into a long-term marriage relationship. At the same time, the system will also generate personalized marriage and love health advice to help users better maintain their relationship with their partners.
[0301] The present invention introduces an intelligent algorithm that combines visual converters with self-supervised clustering to quantitatively analyze the image features and emotional features in the drawing projection test, thereby achieving more accurate marriage and love matching suggestions. The system realizes dynamic tracking and classification of user psychological states through systematic image processing and unlabeled data classification, greatly improving the personalization and accuracy of marriage and love matching. Although the embodiments of the present invention provide a detailed description, those skilled in the art can still make appropriate modifications or equivalent substitutions to the specific implementation methods without departing from the core idea of the present invention, and all such modifications should be included in the scope of protection of the present invention.
[0302] The general algorithm and each module involved in the present invention are implemented by writing software code, or by calling the corresponding algorithm module and calling the M function code by MATLAB. The algorithm can be implemented in a variety of programming environments and run in a general computer operating system, including but not limited to C language, Python, SPSSAU and other tools.
Claims
1. A painting projection love and marriage matching test system based on visual converter, characterized in that: It includes a data acquisition module, an image preprocessing module, a visual converter module, a self-supervised clustering module, and a love and marriage matching module which are connected in sequence; Data collection module: This module is responsible for collecting the image data of users in the drawing projective test; the collection sources include hand-drawn scanned images, digital drawings, and drawing behavior record data; the collected data can accurately capture the details of the user's drawing process and provide high-quality input for subsequent analysis; Image preprocessing module: Before the image data is sent to the system for analysis, it needs to go through multiple preprocessing steps, including denoising, grayscale conversion, image enhancement and standardization; Improve data consistency, reduce noise in images, and enhance image quality, allowing the algorithm to more accurately extract key features; Visual Transformer Module: Extracts multi-dimensional features of images through a layered neural network, including line thickness, color distribution, shape structure, and emotional expression; Self-supervised clustering module: Based on the multi-dimensional features extracted by the visual converter, the self-supervised learning algorithm is used to perform unsupervised classification of the user's mental state and generate mental state labels. This module does not require a pre-labeled data set and can learn the user's behavior patterns through the algorithm to automatically generate mental state classification results. Marriage and love matching module: Combines the user's psychological state label and marriage and love preferences to generate marriage and love matching suggestions through intelligent matching algorithms; The matching process is based on user similarity analysis and combined with users' emotional expressions and changes in psychological states to ensure that the recommended love and marriage matching results are accurate and personalized.
2. The system according to claim 1, characterized in that The data acquisition module supports multiple data input methods, including static image acquisition, and also integrates dynamic data acquisition function, which records the user's drawing speed, pen strength, number of revisions, and dynamic data of the pen tip's moving trajectory on the screen in real time; these data provide additional information sources for subsequent sentiment analysis and psychological feature classification, helping the system to more accurately identify the user's emotional state; The image preprocessing module adopts an adaptive filtering algorithm module and histogram equalization technology. The image preprocessing module removes noise in the image through the adaptive filtering algorithm module. The adaptive filtering can self-adjust parameters according to the local characteristics of the image, thereby improving the clarity and detail retention of the image; the histogram equalization technology is used to adjust the brightness and contrast of the image to make the details more prominent; at the same time, the system has an embedded noise detection algorithm module that can automatically identify and remove noise areas in the image to ensure that the image entering the feature extraction module is of high quality.
3. The system according to claim 1, characterized in that The visual converter module divides the image into multiple small blocks through a multi-head attention mechanism. Each block is analyzed by a different attention head to extract the line features, shape features and emotional expressions in the painting, and finally generates a global feature vector to represent the user's overall psychological state. The self-supervised clustering module combines the unlabeled dataset and adopts the time series analysis method to regard the user's painting behavior as time series data, classify the user's painting behavior, and generate dynamic psychological state labels for long-term tracking of the user's emotional fluctuations and psychological changes during the painting process.
4. The system according to claim 1, characterized in that The marriage and love matching module introduces a reinforcement learning algorithm module. After the system generates preliminary matching results in the initial stage, it continuously adjusts and optimizes as the user's psychological state changes and matching feedback is received; Reinforcement learning can adapt to user feedback and dynamically adjust matching parameters to ensure that marriage and love matching results are more accurate and meet users' long-term emotional needs; this method avoids the static limitations of traditional matching algorithms and can adapt to users' emotional changes.
5. The system according to claim 4, characterized in that It also includes an output module connected to the love and marriage matching module. This module uses data visualization technology to present complex psychological state analysis and matching results in the form of charts, making it easier for users to understand the report content; the report content includes a detailed analysis of the user's emotional state, specific suggestions for love and marriage preferences, and long-term emotional tracking results generated based on changes in the user's psychological state; Data visualization not only improves the readability of reports, but also enhances users’ understanding of their own psychological and emotional states.
6. A painting projection love and marriage matching test method based on visual converter, characterized in that: The following steps are involved: Step 1: Data Collection The data collected by the data collection module include hand-drawn images, digital drawing images and drawing behavior records; it supports multiple input methods such as hand-drawn scanned images and digital drawings to ensure data diversity and accuracy; Step 2: Image preprocessing The collected painting data is preprocessed; the preprocessing process includes noise removal, grayscale conversion, image enhancement and standardization. Specifically, an adaptive filtering algorithm is used for denoising, grayscale conversion is used to simplify data and retain brightness information, and histogram equalization is used to adjust image brightness and contrast to ensure uniform image quality and prepare for subsequent feature extraction. Step 3: Feature extraction The visual converter module is used to extract multi-dimensional features from the preprocessed images. Through a multi-layer neural network and a multi-head attention mechanism, detailed features in the painting are extracted, including line thickness, color distribution, shape structure, and emotional expression. These feature data are extracted layer by layer through the visual converter and converted into feature vectors as the basis for user psychological feature analysis. Step 4: Self-supervised clustering Based on the features extracted by the visual converter, the user's psychological state is classified through a self-supervised learning algorithm. This process does not require pre-labeled data. The system dynamically analyzes the user's painting behavior through a self-supervised clustering algorithm to generate corresponding psychological state labels. This module also combines time series analysis to capture the dynamic characteristics of the user's emotional changes during the painting process, and achieves accurate classification of the user's psychological state. Step 5: Marriage Matching The love and marriage matching module uses an intelligent recommendation algorithm to make love and marriage matching suggestions based on the generated psychological state labels, emotional fluctuations, and love and marriage preferences. The system uses a reinforcement learning algorithm to dynamically optimize the love and marriage matching scheme, and continuously adjusts the matching parameters based on user feedback and emotional changes to ensure the accuracy and personalization of love and marriage suggestions. Step 6: Output Analysis The system generates love and marriage matching results and psychological analysis reports, which are displayed to users through the output module. The report content includes the user's psychological state analysis, love and marriage matching suggestions, and personalized love and marriage guidance. Visual technology is used to generate intuitive chart displays to help users understand the matching results and analysis process generated by the system. The report also provides long-term psychological state tracking and love and marriage emotional health suggestions.
7. The method according to claim 6, characterized in that: Step one includes: Hand-drawn image data collection: The drawings completed by the user on paper are collected through a high-resolution scanner to ensure that the details of the image are fully preserved; the line thickness and color in the hand-drawn image are the key to the psychological state assessment; Digital drawing image acquisition: Users draw through tablet computers and touch-screen digital devices; this method avoids the scanning errors of paper drawings and directly obtains image data from the device. These image data are usually RGB three-channel images. The system extracts different visual features based on the color distribution and shadow color information of the image; Behavioral data collection: During the user's painting process, the touch screen digital device will also record a variety of user behavior data, including painting speed, pen pressure, and modification frequency; Calculation of drawing speed: During the drawing process, the change of the pen tip position in each time period effectively monitors the user's emotional fluctuations; a sudden increase or decrease in the drawing speed indicates that the user's psychological state has changed significantly; the system calculates the drawing speed by tracking the pen tip position at each time point. Assuming that the pen tip position at time t is P(t), the calculation formula for the drawing speed v(t) is: Among them, P(t+Δt) and P(t) are the pen tip positions at time t+Δt and time t respectively, and Δt is the time interval; Calculation of pen pressure: During the digital drawing process, the system can detect the pressure of the user on the touch screen. These pressure data can reflect the intensity of the user's emotions. Let the pen pressure of the user at time t be p(t). The system records the pen pressure value at each moment to form a time series, {p(t1), p(t2), …, p(t n )}; The variation of pen pressure is quantified by its variance. The calculation formula is: Among them, p(t i ) represents the pen pressure at the i-th moment, μ p is the average value of pen pressure, and n is the number of time points. A larger variance of pen pressure indicates that the user's emotions fluctuate greatly and the emotions are strong. A smaller variance indicates that the emotions are stable. Statistics of modification frequency: The modification behavior of users during the painting process is also monitored in real time by the system; specifically, a higher modification frequency reflects the user's hesitation, anxiety and tension in expressing themselves, while a lower modification frequency indicates that the user's emotional expression is relatively smooth; assuming that the time point of each modification is t1, t2, …, t m , modify the frequency f mod The calculation formula is: Among them, m is the number of modifications, T is the total time of painting; Diversity and accuracy of data acquisition modules; The data acquisition module not only supports multiple input methods, but also can dynamically capture the user's painting behavior; whether it is through scanning hand-drawn images or directly acquiring data from digital drawings, the system ensures the accuracy of the collected data; in the processing of hand-drawn scanned images, the system automatically detects the color and line changes in the image; in digital drawings, the system provides richer analysis basis by capturing behavior data, pen pressure, and drawing speed in real time; when a user draws a tree image on the touch screen, the system not only collects information about each pixel of the image, but also records the process data of the drawing; Step 2 includes: Image preprocessing includes four key steps: noise removal, grayscale conversion, image enhancement and standardization; Noise removal: The present invention adopts an adaptive filtering algorithm. By dynamically adjusting the filtering parameters, the system can effectively remove noise and retain edge details; Derivation of the noise removal formula: Let the pixel value of the original image be I(x, y), and the pixel value of the image after adaptive filtering be I′(x, y); the filtering process determines the filtering result of each pixel by calculating the weighted average of the pixel neighborhood, and the formula is as follows: Among them, x, y: are the horizontal and vertical coordinates of the image, I(x, y): this is the pixel value at the coordinate (x, y) in the original image; I′(x, y): this is the pixel value at the coordinate (x, y) in the filtered image; N(x, y): represents the neighborhood area of the coordinate (x, y); this neighborhood area is usually a fixed-size window used to capture the pixel values near the current pixel; w(i, j): represents the weight of the pixel at the coordinate (i, j); this weight is dynamic and is determined according to the size of the pixel change in the neighborhood where the pixel is located; when the pixel changes in the neighborhood are large, the weight will decrease, thereby avoiding over-smoothing the edge area; when the pixel changes in the neighborhood are small, the weight will increase, enhancing the filtering effect and removing noise; Grayscale conversion: This step converts the color image into a grayscale image in order to simplify the data structure and the amount of calculation. Each pixel of a color image contains three channels: red, green, and blue, while a grayscale image retains the brightness information by performing a weighted average calculation on these three channels. Grayscale conversion formula: Assume that the pixel values of the red, green, and blue channels in the color image are R(x, y), G(x, y), and B(x, y), respectively. Then the pixel value I of the grayscale image is gray The calculation formula for (x,y) is as follows: I gray (x,y)=0.299·R(x,y)+0.587·G(x,y)+0.114·B(x,y) This formula is weighted according to the different sensitivities of the human eye to color, with the weights of the red, green, and blue channels being 0.299, 0.587, and 0.114, respectively; Image enhancement: by adjusting the brightness and contrast of the image, the details in the image are made clearer, especially the stroke details which are crucial for psychological state analysis; in the present invention, the histogram equalization method is adopted to make the brightness and contrast more uniform by redistributing the gray value of the image, thereby enhancing the detail expression of the image; Let the original grayscale image be I gray (x, y), its grayscale histogram is H(g), which indicates the number of pixels with grayscale value g; the grayscale value after histogram equalization is I eq The calculation formula for (x,y) is as follows: Among them, I gray (x,y): This is the pixel value of the original grayscale image at coordinate (x,y); eq (x,y): This is the pixel value at the coordinate (x,y) after histogram equalization. This value enhances the contrast of the image by redistributing the brightness, making the distribution of brightness values in the image more uniform. H(g): This is the histogram of the original grayscale image, which indicates the number of pixels with a grayscale value of g. L: This is the total number of grayscale levels. M×N: This is the total number of pixels in the image. M and N represent the width and height of the image, respectively, indicating the number of pixels contained in the entire image. This value is used to normalize the cumulative histogram so that the result is within the range of grayscale values. This cumulative sum represents the cumulative frequency of all pixel values before the gray value g; it is the core part of the cumulative histogram, which realizes the redistribution of brightness values by counting the total number of pixels less than the current gray value; Standardization: Let the minimum pixel value of the image be I min , the maximum pixel value is I max , the normalized pixel value I norm The calculation formula for (x,y) is: Through this formula, the system normalizes each pixel value of the image to the range of [0,1]; the normalization process ensures that the image data has the same scale, making subsequent feature extraction and analysis more consistent and accurate, and avoiding deviations caused by differences in image equipment or painting methods.
8. The method according to claim 6, characterized in that: Step three includes: Multi-dimensional feature extraction of visual converter: Visual converter is a deep learning model based on self-attention mechanism, which can well capture global image features and is particularly suitable for multi-dimensional feature extraction of complex images. In the present invention, visual converter is used to extract psychological features from the user's painting projection image. The core idea of visual converter is to divide the image into several small blocks, and process each small block to extract key information. Image segmentation and input embedding: The system divides the preprocessed image I into small blocks of fixed size; the size of the image is W×H, and the size of each small block is p×p, so the image is segmented into small blocks; where W is the width of the image, H is the height of the image, p is the side length of each small block, indicating that the size of each image block is p×p pixels, and N is the number of small blocks into which the image is divided; for each small block P i Perform a linear transformation and embed it into the feature space. The formula is as follows: z i =W e ·P i +b e Among them, P i : represents the pixel value of the i-th small block in the image; each small block is a two-dimensional pixel matrix of size p×p; W e : The weight matrix of the linear transformation used to embed the patch into the feature space; its size is d×(p×p), where d is the dimension of the feature vector and b e : Bias term, a vector of size d, used to adjust the feature vector during the embedding process, z i : The embedded feature vector, which is composed of small blocks P i After mapping to the feature space; z i The dimension is d, which represents the feature representation of the small block; In this way, the small blocks of the two-dimensional image are converted into one-dimensional feature vectors z i , which becomes the input for subsequent processing; in this way, the system can gradually capture the details and global information in the image, ensuring that elements related to psychological characteristics can be extracted; The multi-head attention mechanism is a key part of the visual transformer to extract image features; it enables the system to extract relevant information from each part (image patch) in the image and weigh local and global features; the mechanism processes different areas of the image in parallel through multiple attention heads to obtain a more detailed feature description; The core formula of the attention mechanism is as follows: Among them, A: attention matrix, which represents the relationship between image patches; each element of it represents the weight assigned to a certain image patch in the interaction with other patches; Q: query vector, which is part of the input feature vector, represents the information that the model is interested in a certain patch; it is used to find image regions related to itself; K: key vector, which is another input feature vector, represents the features of the image patch, and is used to perform dot product calculations with the query vector; K T : The transpose of the key vector, used to perform matrix multiplication with the query vector Q to calculate the similarity between each image patch; d k : The dimension of the key vector, used for scaling operations so that the value is not too large or too small; this scaling factor Used to balance the size of the dot product to avoid the problem of excessive gradient during model training; softmax: a normalization operation applied after the dot product calculation to convert the similarity into a probability distribution; it ensures that the sum of the weights of all image patches is 1, indicating the degree of attention the model pays to each patch; The attention matrix A reflects the correlation between each small block in the image and other small blocks; the calculated attention matrix is used to weight the feature vector, and the formula is: Z=A·V Z: The final weighted feature vector of the output; it is obtained by multiplying the attention matrix A with the value vector V; this output contains the global and local features of the image; A: The attention matrix, calculated by Q and K, represents the relationship or attention weight between each small block in the image; V: The value vector is another part of the input feature vector, representing the specific information of the small block of the image; Through the multi-head attention mechanism, the system is able to balance local details and global features in the image; these features are crucial for analyzing the user's psychological state; Feature extraction layer by layer: The visual converter extracts complex features in the image layer by layer through a multi-layer neural network; in each layer, the features are continuously refined and enhanced through the combination of attention mechanism and feedforward neural network; let the input feature vector of the lth layer be Z (l) , the output formula of this layer is as follows: WITH (l+1) =LayerNorm(Z (l) +MultiHead(Z (l) ))+FeedForward(From (l) ) Among them, Z (l+1) is the feature vector of the l+1th layer, MultiHead(Z (l) ) represents the multi-head attention mechanism operation of this layer, FeedForward(Z (l) ) represents the operation of the feedforward neural network; Z (l) : The input feature vector of the lth layer, which represents the image feature representation after being processed by the first l layers; Z (l+1) : The output feature vector of the l+1th layer, which is the feature generated by the operation of this layer and contains more complex image information; LayerNorm: Layer normalization operation, used to standardize features to make them easier to be processed by subsequent network layers and reduce the problem of gradient disappearance or explosion; MultiHead (Z (l) ): The multi-head attention mechanism operation of this layer; through multiple parallel attention heads, the system captures information and extracts features in different spaces; FeedForward (Z (l) ): Operation of feedforward neural network; further enhance and refine features through linear transformation and nonlinear activation function; By updating layer by layer, the system is able to extract more complex psychological and emotional features from simple physical features; Generation of feature vectors: After being processed by a multi-layer neural network, the system finally integrates the feature vectors of each small image block into a global feature vector z global ; This feature vector is a high-dimensional representation of the user's psychological state, containing all key information. It serves as basic data in subsequent psychological state analysis to help the system accurately analyze the user's emotional state and psychological characteristics; the formula for generating the global feature vector is: from global =Concat(z1,z2,…,z N ) Among them, z global : The global feature vector is the final representation of the entire image after feature extraction; it contains the feature vectors of each small block in the image and can fully express the overall information of the image; i : represents the feature vector extracted from the i-th small block in the image; Concat: represents the concatenation operation; the feature vectors z1, z2, ..., z N Spliced together to form a global feature vector; Application to psychological feature analysis: global feature vector z global It represents the user's psychological state. In the subsequent analysis process, the system will classify and analyze these features in combination with the self-supervised clustering algorithm. Through these features, the system can capture the user's emotional expression, anxiety level and mood fluctuations when drawing. In hand-drawn scanned images, the thickness of the lines reflects the intensity of the user's emotions, with thicker lines indicating tension or anxiety; the use of colors shows the user's emotional state, with warm colors suggesting positive emotions, while cool colors indicate negative and depressed emotions; The complexity of the graphic structure in hand-drawn scanned images and digital drawings reveals the user's thinking style and cognitive ability; these features can not only help the system identify the user's mental state, but also be applied to the marriage and love matching process, combining the user's emotional and psychological characteristics to provide personalized matching suggestions for them; In addition, in digital drawing, pen pressure, drawing speed, and revision frequency suggest the degree of emotional fluctuation; Step 4 includes: The self-supervised clustering module performs self-supervised learning analysis based on multi-dimensional features extracted by the visual transformer; The visual converter extracts the multi-level features of the user's drawing through the self-attention mechanism, and obtains high-quality feature vectors z for lines, colors, and emotional expressions. i ,z j , providing a basis for subsequent clustering; self-supervised learning automatically optimizes the similarity between similar samples and samples of different classes by comparing loss functions, and ultimately achieves dynamic classification of the user's psychological state; In order to achieve self-supervised clustering, the contrast loss function is used to guide the model to learn the similarity between samples and classify them. It optimizes by maximizing the similarity of similar samples and minimizing the similarity of different samples. Where: L: represents the value of the loss function, which measures the clustering effect of the model; by minimizing the loss function, the model clusters similar samples together and increases the distance between different samples; Indicates the traversal calculation of sample pairs, where i and j represent the index of the sample, i.e., the i-th and j-th samples respectively; y i,j : is a binary label, indicating the category relationship between sample i and sample j; y i,j =1, indicating that the two samples are of the same class; i,j = 0, indicating that the two samples belong to different classes; when y i,j =1, it means that sample i and sample j should be close, so their similarity will be added to the formula; when y i,j = 0, it means that sample i and sample j belong to different classes, and the formula will try to increase their distance so that the similarity is lower than the preset threshold m; sim(z i ,z j ): represents the similarity between sample i and sample j; cosine similarity is usually used to measure similarity, and its calculation formula is: Where: z i ·z j : is the dot product of the feature vectors of sample i and sample j, indicating the similarity between the two in the feature space; ||z i || and ||z j ||: are the eigenvectors z i and z j The modulus of the cosine similarity is the cosine value of the angle between two feature vectors, and the value range is [-1,1], where 1 means completely similar and -1 means completely different; max(0,m-sim(z i ,z j )):When y i,j = 0, this item will calculate the similarity between samples of different classes and try to compare it with the preset threshold m; m is a predefined threshold to ensure that the similarity between samples of different categories is lower than this threshold, forcing the model to maintain their distance in the feature space; when m-sim(z i ,z j ) is positive, it means that samples i and j are too close and the model needs to increase their distance, so this item is not zero; when the similarity sim(z i ,z j ) is small enough, that is, lower than m, then this term is zero and no longer affects the loss function; By optimizing the contrast loss function, the model can effectively learn the similarities between samples and cluster similar samples together. This formula minimizes the loss function, maximizes the similarity of samples of the same class, and ensures that the distance between samples of different classes is large enough in the feature space. Then, the feature vector z extracted by the visual converter is i and z j As input, the system uses a self-supervised clustering algorithm to perform feature analysis and automatically generate psychological state labels for users; Dynamic emotional feature capture and time series analysis: The emotions in the painting process are dynamically changing. Therefore, in the present invention, time series analysis is used to capture the dynamic changing characteristics of emotions. Time series analysis can gradually track the emotional fluctuations of users in the painting process and present them in the form of time series. Assume that the time points in the painting process are t1, t2, ..., t n , each time point corresponds to an emotional feature vector z(t i ); In order to analyze the change of emotion, the system will calculate the rate of change of emotion between adjacent time points. By calculating the rate of change of emotion at each time point, the system can identify the dynamic fluctuation of user emotion; the formula is: Δz(t i )=z(t i+1 )-z(t i ) Where: Δz(t i ): indicates at time point t i and t i+1 Emotional changes between i ): indicates time point t i The emotional feature vector of z(t i+1 ) represents the time point t i+1 The sentiment feature vector of Implementation of psychological state classification: Through self-supervised clustering and time series analysis, the system generates multiple emotional and psychological state labels for users; these labels include anxiety, depression, stability, and pleasure, which help the system classify the user's emotional changes; the final generated global emotional feature vector z global It is obtained by combining clustering algorithm with time series analysis, which can accurately reflect the emotional dynamics of users during the painting process; The formula for generating the global eigenvector is: from global =Concat(z1,z2,…,z N ) Among them, z global : The global feature vector is the final representation of the entire image after feature extraction; it contains the feature vectors of each small block in the image and can fully express the overall information of the image; i : represents the feature vector extracted from the i-th small block in the image; Concat: represents the concatenation operation; the feature vectors z1, z2, ..., z N Spliced together to form a global feature vector; The global feature vector integrates the emotional changes during the painting process and provides a basis for the system's psychological state classification; through this classification method, the system accurately analyzes the user's psychological characteristics under different emotional states and generates corresponding psychological state labels.
9. The method according to claim 6, characterized in that: Step five includes: In the present invention, the love and marriage matching module combines the psychological state labels, emotional fluctuations and multi-dimensional information of love and marriage preferences generated by users, and adopts intelligent recommendation algorithms and reinforcement learning models to provide users with personalized love and marriage matching suggestions; In order to optimize the marriage matching suggestions, the present invention adopts a reinforcement learning algorithm, which is adjusted through continuous iteration and user feedback loops so that the matching scheme can better meet the user's emotional needs; reinforcement learning is used to calculate the expected returns of different marriage matching strategies to help the system dynamically optimize the matching scheme. The form of the equation is: Q(s,a)=r+γ·max a′ Q(s′,a′) Where: Q(s,a): the value function of taking action a in state s, which measures the expected return of the current love and marriage matching strategy; here, state s represents the user's current psychological state, emotional fluctuations and love and marriage preferences, and action a represents the selection of a certain love and marriage partner for matching; r: immediate reward, which represents the user's feedback on the current love and marriage matching, and the satisfaction score; a higher feedback score indicates that the user is more satisfied with the current love and marriage partner; γ: discount factor, which is used to balance the weight of immediate return and long-term return; a larger γ value indicates that the system attaches more importance to the user's long-term love and marriage needs and the stability of the love and marriage relationship; max a′ Q(s′,a′): the maximum value function of the best action to be taken in the future, that is, the optimal strategy to be adopted by the system in future love and marriage matching; Through reinforcement learning algorithms, the system will continuously optimize these parameters. In addition, the matching results should also take into account their psychological expectations for marriage and love and their long-term marriage and love needs to ensure that marriage and love matching can meet the personalized needs of users; The reinforcement learning algorithm adjusts the marriage matching strategy through the user's immediate feedback; the system obtains immediate rewards r from the user's feedback and dynamically adjusts the matching strategy based on the positive and negative feedback: if the user shows high satisfaction with a certain marriage matching, the system will tend to increase the recommendation weight of similar objects; if the user is less satisfied with the marriage partner, the system will reduce the recommendation of similar objects and improve the matching strategy.
10. The method according to claim 6, characterized in that: Step six includes: In the present invention, the output analysis module is responsible for generating love and marriage matching results and psychological status analysis reports, and intuitively presenting the results to users through visualization technology; The core of time series analysis is to capture the user's emotional fluctuations at different times to help understand the changes in emotions; let the emotional fluctuation coefficient be Δe i , and its calculation formula is: Δe i =e(t i+1 )-e(t i ) Where: Δe i :Indicates at time point t i With t i+1 The emotional fluctuations between i ): indicates at time point t i User's emotional characteristics; e(t i+1 ): indicates at time point t i+1 User’s emotional characteristics; By continuously calculating these change rates, the system generates a curve that reflects the user's emotional fluctuations; this curve helps users understand how their emotions change over time. In particular, in the drawing projection test, the emotional fluctuation coefficient reveals the user's emotional ups and downs at different times. Visualization of emotional fluctuation graph: To facilitate user understanding, the system generates an emotional fluctuation graph, which uses a curve graph to show the user's emotional changes at different time points during the painting process; the emotional fluctuation graph is based on the emotional fluctuation coefficient Δe i , reflecting the stability or fluctuation of users’ emotions; this visual display enables users to intuitively understand the dynamic changes of emotions and how such changes affect marriage and love matching; Marriage and love matching suggestions: Marriage and love matching suggestions are based on multiple dimensions, including the user's psychological state label, emotional fluctuation coefficient, and marriage and love preferences. The system generates personalized marriage and love matching plans for users through intelligent recommendation algorithms combined with reinforcement learning models. Matching not only takes into account the user's current emotional needs, but also aims to ensure the long-term stability of the marriage and love relationship. Visual display: In order to enable users to intuitively understand the marriage and love matching results, the system uses visualization technology to display matching suggestions and psychological state analysis; common display forms include emotional fluctuation curves and marriage and love matching charts to help users understand the basis and logic behind the matching; Marriage and romance matching chart: used to show the matching degree between the user and the recommended object; the matching degree is based on the psychological state tag i , emotional fluctuation coefficient Δe i , Marriage preference parameters Pref i It is calculated based on multi-dimensional information; The calculation formula for matching degree is as follows: Match Score=α1·Sim(Tag i ,Tag j )+α2·Sim(Pref i ,Pref j )+α3·(1-|Δe i -Δe j |) Among them: α1, α2, α3: these three parameters are the weights of psychological state, marriage preference and emotional fluctuation in the matching calculation; the size of the weight value is adjusted according to the influence of different factors in each user's matching; the sum of weights α1, α2, α3 should be 1 to ensure that the overall matching score is within a reasonable range; Sim(x, y): Sim function represents the similarity between two parameters; cosine similarity is usually used to measure the similarity between two vectors in high-dimensional space; x and y are the psychological state vector or marriage preference vector of user i and recommended object j respectively; Δe i : The emotional fluctuation coefficient represents the degree of emotional fluctuation of user i and recommended object j over a period of time. Through time series analysis, the system captures the changes in user emotions at different time points. The emotional fluctuation coefficient Δe is used to indicate the degree of fluctuation of user emotions. The larger the value, the more intense the emotional fluctuation. |Δe i -Δe j ∣ represents the difference in emotional fluctuations between the user and the recommended object; Through this formula, the system comprehensively considers psychological state, marriage and love preferences, and emotional fluctuations, calculates a personalized marriage and love matching score, and displays it to the user through a chart.
Citation Information
Cited By
User matching system based on recommendation algorithm
CN121327230A