A passenger counting method and system based on image recognition
Through the passenger counting method based on image recognition, the problem of low accuracy and repeated counting of traditional methods in complex environments is solved, and efficient and accurate passenger counting and safety management are achieved.
Patent Information
- Application Number
- CN202410448484.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-04-15
AI Technical Summary
Traditional ship passenger statistics methods have low accuracy in complex or emergency operation scenarios, especially in bad weather or insufficient lighting conditions, and cannot effectively identify and exclude passengers who enter and exit repeatedly, resulting in large statistical data errors.
Using a passenger counting method based on image recognition, through environmental adaptability image adjustment, passenger characteristics and behavioral diversity management, comprehensive data processing and threshold alarm mechanisms, passenger images are captured and analyzed in real time, and unique identifiers are assigned to avoid repeated counting. And trigger an alarm when the number of passengers approaches or exceeds the safe amount.
It improves the accuracy and efficiency of passenger statistics, can obtain clear images under different lighting and weather conditions, achieves high-precision individual identification and classification, avoids repeated counting, and enhances the ship's safety management capabilities.
Smart Images

Figure CN118351482B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of transportation passenger technology, and in particular to a passenger counting method and system based on image recognition. Background Art
[0002] In the current ship operation management, accurately counting the number of passengers on board is a key link in ensuring safety and providing high-quality services. Traditional passenger counting methods mostly rely on manual ticket checking or simple mechanical counters. These methods are not only time-consuming and labor-intensive, but also prone to errors during peak hours and difficult to cope with complex or emergency ship operation scenarios, especially in severe weather conditions or at night when there is insufficient light. The accuracy of manual counting will drop significantly. In addition, due to the lack of effective behavioral analysis and individual recognition technology, traditional methods cannot accurately identify and exclude repeated passengers, resulting in large errors in passenger number statistics.
[0003] With the development of technology, image recognition technology has been widely used in various crowd counting and monitoring systems due to its high efficiency and automation. However, directly applying existing image recognition technology to ship passenger counting still faces multiple challenges. For example, the diversity of ship operating environments makes the counting system unable to adapt to different lighting and weather conditions. The diversity of passengers' appearance characteristics and behavior patterns affects the recognition accuracy and flexibility of the system. In addition, the system cannot effectively distinguish and record the entry and exit status of each passenger, resulting in problems such as duplicate counting. Summary of the invention
[0004] Based on the above objectives, the present invention provides a method and system for counting passengers based on image recognition.
[0005] A passenger counting method based on image recognition comprises the following steps:
[0006] S1, environmental adaptive image adjustment: before capturing an image, the camera's shooting parameters are automatically adjusted according to lighting conditions, weather conditions, and environmental changes in the camera's current field of view, and the captured image is enhanced;
[0007] S2, capture images: use the adjusted camera to capture passenger images at the entrance and exit in real time;
[0008] S3, Passenger Characteristics and Behavior Diversity Management: Through comprehensive feature recognition and dynamic tracking technology, passengers’ movement paths are tracked in real time and their behavior patterns are analyzed, including comprehensive consideration of appearance and behavior diversity;
[0009] S4, comprehensive data processing: after completing the comprehensive analysis of passenger characteristics and behaviors, the collected images and data are comprehensively processed;
[0010] S5, passenger identification and record update: based on the results of comprehensive data processing, a unique identifier is assigned to each identified passenger, and the passenger quantity record in the database is updated when the passenger enters or exits to avoid duplicate counting;
[0011] S6, Threshold Alarm Mechanism: Set a threshold alarm mechanism. When the number of passengers approaches or exceeds the safe passenger capacity, the alarm will be automatically triggered and the management personnel will be notified.
[0012] Furthermore, the environmental adaptability image adjustment in S1 includes:
[0013] S11, environmental monitoring: real-time monitoring of current lighting conditions, weather conditions, and changes in the environment where the camera is located;
[0014] S12, automatically adjusting shooting parameters: based on the collected environmental monitoring data, automatically adjusting the shooting parameters of the camera, the shooting parameters including exposure, contrast and saturation, to adapt to the current environmental conditions;
[0015] S13, real-time image enhancement: performing image enhancement on the captured image, where the image enhancement includes sharpening, noise reduction, and color correction on the captured image.
[0016] Furthermore, the passenger characteristics and behavior diversity management in S3 includes:
[0017] S31, Feature Recognition and Data Collection: Real-time passenger images are collected and comprehensive feature recognition technology is used to analyze the appearance characteristics of each passenger, including facial features, body shape, clothing style and color. At the same time, passenger behavior data is collected, including movement speed, walking path, stop time and interaction with other passengers;
[0018] S32, Dynamic Tracking and Behavior Analysis: Use dynamic tracking technology to track the movement path of each passenger in real time, and analyze the passenger's behavior pattern by combining the collected appearance characteristics and behavior data. Behavior pattern analysis includes identifying unique behavior patterns and evaluating passengers' behavior intentions and behavior trends. Unique behavior patterns include individual action, group movement, and frequent entry and exit;
[0019] S33, Optimization of individual passenger identification: Identify and differentiate individual passengers based on the analyzed appearance characteristics and behavior patterns. When dealing with passengers with similar appearance or repeated behavior patterns, compare the comprehensive characteristics and behavior differences.
[0020] Furthermore, the feature recognition and data collection in S31 include:
[0021] S311, image acquisition: capturing passenger image I in real time;
[0022] S312, appearance feature analysis:
[0023] Facial features F:
[0024] Among them, ReLU is the activation function, W i and b i are weights and biases, w i is the corresponding feature weight, N is the number of network layers;
[0025] Body type B:
[0026] in, Represents image I body The gradient in the body contour area, ∫ represents the integral of the area;
[0027] Clothing style and color C:
[0028] Among them, I cloth (x, y) is the pixel value of the clothing area, M is the total number of pixels in the clothing area;
[0029] S313, behavioral data analysis:
[0030] Moving speed V and walking path P:
[0031]
[0032] P={(x1, y1), (x2, y2),..., (x T ,y T )};
[0033] Among them, (x t ,y t ) is the passenger position coordinate at time point t, T is the observation time window;
[0034] Dwell time T:
[0035] Among them, 1 area is an indicator function, indicating whether the passenger stays in the area of interest;
[0036] S314, data fusion and analysis: The comprehensive feature vector EFV is used for passenger identification, and the calculation formula is:
[0037]
[0038] Among them, α, β, γ, δ, ∈, ζ are weight coefficients, P i is the i-th point in the walking path.
[0039] Furthermore, the dynamic tracking and behavior analysis in S32 includes:
[0040] S321, moving path tracking: Use dynamic tracking technology to track the moving path of each passenger in real time, record the position coordinates of the passenger in time series, and record the moving trajectory P. For each passenger n, the moving trajectory of the passenger is expressed as: P n ={(x τ ,y τ )|τ=1,2,...,T total};
[0041] Among them, T total is the observation period, (x τ ,y τ ) is the position coordinate at time τ;
[0042] S322, behavior pattern recognition: Identify or classify the behavior pattern of an individual based on the input feature vector. The behavior pattern recognition function is expressed as: BM(v) = σ(W bm ·v+b bm );
[0043] Among them, σ is the activation function, W bm is the weight matrix, b bm is the deviation vector, v is the feature vector obtained from the passenger's movement trajectory P;
[0044] S323, behavior intention evaluation: The behavior intention is evaluated by analyzing the change trend of the passenger's position and the change of the passenger's speed. The intention evaluation function is expressed as:
[0045] I(ΔP, V) = softmax(W i ·[ΔP||V]+b i );
[0046] Where ΔP is the change in the passenger's position, V is the passenger's moving speed, and W i is the weight matrix for intent assessment, b i is the bias vector;
[0047] S324, comprehensive analysis of behavior data: combining behavior patterns with appearance features to conduct a comprehensive analysis of passenger behavior. The calculation formula for the comprehensive behavior feature vector is:
[0048] BFV n =ω1·BM(v n )+ω2·I(ΔP n , V n )+ω3·F n +ω4·B n +ω5·C n ;
[0049] Among them, BM(v n ) is the behavior pattern recognition result for passenger n, I(ΔP n , V n ) The evaluation result of passenger n’s behavioral intention, F n is the facial feature of passenger n, B n is the physical characteristic of passenger n, C n are the clothing style and color characteristics of passenger n, and ω1, ω2, ω3, ω4, and ω5 are weight coefficients.
[0050] Furthermore, the passenger individual identification optimization in S33 includes:
[0051] S331, similarity calculation: For each pair of passengers m1 and m2, calculate the comprehensive behavior feature vector and The similarity between them is calculated as:
[0052]
[0053] Among them, S(m1, m2) represents the similarity score between two passengers, and the Similarity function uses cosine similarity to calculate the similarity between two feature vectors;
[0054] S332, identification and differentiation: Different individuals are differentiated based on the similarity score and the pre-set threshold θ. If S(m1, m2) is greater than θ, m1 and m2 are considered to be the same individual, otherwise they are different individuals, expressed as:
[0055]
[0056] S333, individual identification optimization: Combine similarity scores and classification threshold decisions to optimize the individual passenger identification process.
[0057] Furthermore, the comprehensive data processing in S4 includes:
[0058] S41, data preprocessing: preprocessing the collected images and behavioral data, including cropping, scaling, and normalization of images, and cleaning and standardization of behavioral data;
[0059] S42, feature extraction: extracting the passenger's body features from the processed image and extracting the behavior features from the behavior data;
[0060] S43, feature fusion: features extracted from image and behavior data are fused into a final feature vector;
[0061] S44, feature analysis: processing the final fused feature vector to achieve identification and classification of individual passengers;
[0062] S45, Passenger Count: Based on the feature analysis results, count the number of independent passengers in the scene.
[0063] Furthermore, the feature analysis in S44 includes:
[0064] S441, final feature vector preparation: obtaining the final feature vector FFV of each passenger;
[0065] S442, classification model training: Use the AdaBoost algorithm to train the classification model for the final feature vector FFV of the passenger. The training process is as follows:
[0066] S4421, initialize sample weights: Initialize the weight of each sample to Where M is the total number of samples;
[0067] S4422, training weak classifiers: For each round k in K rounds of iterations:
[0068] Train a weak classifier h k (x);
[0069] Calculate the weighted error rate and classifier weight of the weak classifier:
[0070]
[0071]
[0072] Among them, y i is the true label of the i-th sample, I(y i ≠h k (x i )) is the indicator function;
[0073] Update sample weights: And Perform normalization;
[0074] S4423, combine weak classifiers to obtain the final strong classifier:
[0075] S443, individual passenger identification and classification: Apply the trained classification model to new passenger data, and use the strong classifier H(x) to identify and classify each passenger's FFV to determine the specific category or identity of the passenger.
[0076] Furthermore, the passenger identification and record update in S5 includes:
[0077] S51, unique identifier allocation: after the passenger feature analysis and identification process is completed, a unique identifier UID will be allocated to each identified passenger;
[0078] S52, passenger database update: check whether the unique identifier of the newly identified passenger already exists in the passenger database. If it is a new passenger (i.e., the UID does not exist in the database), a new database record will be created for the new passenger, including the UID and related feature information, and the passenger count will be increased. If the UID already exists, it means that the passenger has been recorded, and the record will be updated without changing the total passenger count;
[0079] S53, entry and exit records and count adjustment: for each passenger entering or leaving, the passenger quantity record is updated according to the unique identifier UID and the detected moving direction. If the passenger is detected as entering, the count is increased in the database, and if the passenger is detected as leaving, the count is decreased;
[0080] S54, Double counting avoidance: By monitoring the location and movement trajectory of each passenger, double counting caused by repeated entry and exit in a short period of time is identified and eliminated.
[0081] A passenger counting system based on image recognition, used to implement the above-mentioned passenger counting method based on image recognition, includes the following modules:
[0082] Environmental Adaptive Image Adjustment Module: responsible for automatically adjusting the camera's shooting parameters according to lighting conditions, weather conditions, and environmental changes in the camera's current field of view, and performing real-time image enhancement processing on the captured images;
[0083] Real-time passenger image capture module: Through the adjusted camera, the passenger images at the entrance and exit are captured in real time;
[0084] Passenger characteristics and behavior diversity management module: Through comprehensive feature recognition and dynamic tracking technology, it tracks passengers' movement paths in real time and analyzes their behavior patterns, including the diversity of appearance and behavior;
[0085] Comprehensive data processing module: After completing the comprehensive analysis of passenger characteristics and behaviors, the collected images and data are comprehensively processed;
[0086] Passenger identification and record update module: Based on the results of comprehensive data processing, a unique identifier is assigned to each identified passenger, and the passenger quantity record in the database is updated when passengers enter or leave;
[0087] Threshold alarm mechanism module: When the number of passengers approaches or exceeds the safe passenger capacity, an alarm is automatically triggered and the management personnel are notified.
[0088] Beneficial effects of the present invention:
[0089] The present invention improves the accuracy and efficiency of passenger statistics through a highly automated and intelligent processing process. It automatically adjusts the shooting parameters of the camera and performs real-time image enhancement through an environmental adaptability image adjustment module, thereby ensuring that clear passenger images can be obtained under different lighting conditions and weather conditions. It solves the problem that traditional means are difficult to ensure image quality in complex environments, and provides high-quality image data for subsequent passenger identification and classification.
[0090] The present invention, through the passenger feature and behavior diversity management module, can comprehensively utilize the passenger's appearance features and behavior data to achieve high-precision recognition and classification of individual passengers. The combination of dynamic tracking and behavior analysis not only improves the accuracy of individual recognition, but also can effectively cope with the challenges brought by the similarity of passenger features and behavior diversity, so that it shows superior performance in processing complex practical application scenarios, especially in environments with dense crowds or poor lighting conditions.
[0091] The present invention, through integrated data processing and passenger identification and record updating modules, assigns a unique identifier to each identified passenger, and updates the database in real time when passengers enter and exit, effectively avoiding the problem of duplicate counting. In addition, the set threshold alarm mechanism can promptly alert ship management personnel when the number of passengers approaches or exceeds the safe passenger capacity, further enhancing the ship's safety management capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0092] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0093] Figure 1 A schematic diagram of a statistical method flow chart of an embodiment of the present invention;
[0094] Figure 2 Schematic diagram of system function modules according to an embodiment of the present invention. DETAILED DESCRIPTION
[0095] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.
[0096] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0097] like Figure 1 As shown, a passenger counting method based on image recognition comprises the following steps:
[0098] S1, environmental adaptive image adjustment: before capturing images, the camera's shooting parameters are automatically adjusted according to lighting conditions, weather conditions and environmental changes in the camera's current field of view, and the captured images are enhanced to ensure clear passenger images in various environments;
[0099] S2, capturing images: using adjusted cameras, installed at the ship entrance and exit, to capture images of passengers entering and leaving the ship in real time;
[0100] S3, Passenger characteristics and behavior diversity management: Through comprehensive feature recognition and dynamic tracking technology, the passenger's movement path is tracked in real time and their behavior patterns are analyzed, including comprehensive consideration of appearance and behavior diversity, to improve the accuracy of individual identification;
[0101] S4, comprehensive data processing: after completing the comprehensive analysis of passenger characteristics and behaviors, the collected images and data are comprehensively processed to accurately identify and analyze the human features in the images, so as to achieve accurate statistics of the number of passengers;
[0102] S5, passenger identification and record update: based on the results of comprehensive data processing, a unique identifier is assigned to each identified passenger, and the passenger quantity record in the database is updated when the passenger enters or exits to avoid duplicate counting;
[0103] S6, Threshold Alarm Mechanism: Set a threshold alarm mechanism, which will automatically trigger an alarm and notify the ship's management personnel when the number of passengers on board approaches or exceeds the safe passenger capacity;
[0104] The present invention can effectively cope with the challenges brought by the similarity of passenger characteristics and the diversity of behavior, thereby achieving more accurate passenger counting in complex practical application scenarios. This not only improves the practicality of image recognition technology in the field of ship passenger statistics, but also demonstrates the advancement and flexibility of the technology in dealing with complex environments and behavior patterns.
[0105] Environmentally adaptive image adjustments in S1 include:
[0106] S11, environmental monitoring: real-time monitoring of current lighting conditions, weather conditions, and changes in the environment where the camera is located;
[0107] S12, automatically adjusting shooting parameters: based on the collected environmental monitoring data, automatically adjusting the shooting parameters of the camera, the shooting parameters including exposure, contrast and saturation, to adapt to the current environmental conditions;
[0108] S13, real-time image enhancement: performing image enhancement on the captured image, the image enhancement including sharpening, noise reduction and color correction on the captured image;
[0109] Through the above steps, it is ensured that image recognition can automatically adapt to various environmental changes in the application of ship passenger counting, so as to obtain the best image capture effect in all situations.
[0110] Passenger characteristics and behavior diversity management in S3 includes:
[0111] S31, Feature Recognition and Data Collection: Real-time passenger images are collected and comprehensive feature recognition technology is used to analyze the appearance characteristics of each passenger, including facial features, body shape, clothing style and color. At the same time, passenger behavior data is collected, including movement speed, walking path, stop time and interaction with other passengers;
[0112] S32, Dynamic Tracking and Behavior Analysis: Use dynamic tracking technology to track the movement path of each passenger in real time, and analyze the passenger's behavior pattern by combining the collected appearance characteristics and behavior data. Behavior pattern analysis includes identifying unique behavior patterns and evaluating passengers' behavior intentions and behavior trends. Unique behavior patterns include individual action, group movement, and frequent entry and exit;
[0113] S33, passenger individual identification optimization: Identify and differentiate individual passengers based on the analyzed appearance characteristics and behavior patterns. When dealing with passengers with similar appearances or repeated behavior patterns, compare the comprehensive characteristics and behavior differences to improve the accuracy of individual identification;
[0114] Through the above steps, it is possible to effectively cope with the challenges brought about by the similarity of passenger characteristics and the diversity of behavior, and achieve more accurate passenger counting in complex practical application scenarios. This not only improves the practicality of image recognition technology in the field of ship passenger counting, but also enhances the sophistication and flexibility of the technology in dealing with complex environments and behavior patterns.
[0115] Feature recognition and data collection in S31 include:
[0116] S311, image acquisition: capturing passenger image I in real time;
[0117] S312, appearance feature analysis:
[0118] Facial features F:
[0119] Among them, ReLU is the activation function, expressed as ReLU(x)=max(0,x), W i and b i are weights and biases, w i is the corresponding feature weight, N is the number of network layers;
[0120] Body type B:
[0121] in, Represents image I body The gradient in the body contour area, ∫ represents the integration of the area to obtain the contour characteristics of the body shape;
[0122] Clothing style and color C:
[0123] Among them, I clothes (x, y) is the pixel value of the clothing area, M is the total number of pixels in the clothing area, and the sum is used to obtain the average value of the clothing color;
[0124] S313, behavioral data analysis:
[0125] Moving speed V and walking path P:
[0126]
[0127] P={(x1, y1), (x2, y2), .., (x T ,y T )};
[0128] Among them, (x t ,y t ) is the passenger position coordinate at time point t, T is the observation time window;
[0129] Dwell time T:
[0130] Among them, 1 area is an indicator function, indicating whether the passenger stays in the area of interest;
[0131] The indicator function is used to indicate whether a condition is met. If the condition is met, the function value is 1, if not, it is 0. area (x, y), expressed as:
[0132]
[0133] In applications, this area usually refers to a predefined stop area, such as a passenger waiting area or a boarding area. This function checks whether the passenger is in this area;
[0134] S314, data fusion and analysis: The comprehensive feature vector EFV is used for passenger identification, and the calculation formula is:
[0135]
[0136] Among them, α, β, γ, δ, ∈, ζ are weight coefficients, P i is the i-th point in the walking path;
[0137] Through the above steps, comprehensive analysis of passengers' appearance characteristics and behavior patterns can accurately identify individual passengers, thereby effectively improving the accuracy and reliability of ship passenger statistics.
[0138] Dynamic tracking and behavior analysis in S32 include:
[0139] S321, moving path tracking: Use dynamic tracking technology to track the moving path of each passenger in real time, record the position coordinates of the passenger in time series, and record the moving trajectory P. For each passenger n, the moving trajectory of the passenger is expressed as: P n ={(x τ ,y τ )|τ=1,2,...,T total};
[0140] Among them, T total is the observation period, (x τ ,y τ ) is the position coordinate at time τ;
[0141] S322, behavior pattern recognition: Identify or classify the behavior pattern of an individual based on the input feature vector. The behavior pattern recognition function is expressed as: BM(v) = σ(W bm ·v+b bm );
[0142] Among them, σ is the activation function, W bm is the weight matrix used in the behavior pattern recognition model, b bm is the deviation vector, v is the feature vector obtained from the passenger's movement trajectory P, which may contain the statistical information, speed, acceleration, etc. of the trajectory;
[0143] The activation function σ uses the softmax function for multi-classification problems. Given the original output vector z, the element z i Corresponding to the original output value of the i-th class, the softmax function calculates the probability P(y=i|z) of the i-th class, and the calculation formula is:
[0144] in, Yes i The natural exponential of the denominator is z for all possible classes j j The natural exponential summation ensures that the probabilities of all categories add up to 1;
[0145] S323, behavior intention evaluation: The behavior intention is evaluated by analyzing the change trend of the passenger's position and the change of the passenger's speed. The intention evaluation function is expressed as:
[0146] I(ΔP, V) = softmax(W i ·[ΔP||V]+b i );
[0147] Where ΔP is the change in the passenger's position, V is the passenger's moving speed, and W i is the weight matrix for intent assessment, b i is the bias vector;
[0148] S324, comprehensive analysis of behavior data: combining behavior patterns with appearance features to conduct a comprehensive analysis of passenger behavior. The calculation formula for the comprehensive behavior feature vector is:
[0149] BFV n =ω1·BM(v n )+ω2·I(ΔP n , V n )+ω3·F n +ω4·B n +ω5·C n ;
[0150] Among them, BM(v n ) is the behavior pattern recognition result for passenger n, I(ΔP n , V n ) The evaluation result of passenger n’s behavioral intention, F n is the facial feature of passenger n, B nis the physical characteristic of passenger n, C n are the clothing style and color characteristics of passenger n, ω1, ω2, ω3, ω4, ω5 are weight coefficients;
[0151] Through the above steps, the passengers' movement paths are tracked in real time, and combined with their appearance characteristics, the passengers' behavior patterns are effectively identified and analyzed. The comprehensive behavior analysis enhances the understanding of passenger behavior and provides accurate data support for ship passenger statistics.
[0152] The optimization of individual passenger identification in S33 includes:
[0153] S331, similarity calculation: For each pair of passengers m1 and m2, calculate the comprehensive behavior feature vector and The similarity between them is calculated as:
[0154]
[0155] Among them, S(m1, m2) represents the similarity score between two passengers, and the Similarity function uses cosine similarity to calculate the similarity between two feature vectors;
[0156] Cosine similarity determines the similarity between two vectors by calculating the cosine value of the angle between the two vectors. The calculation formula is:
[0157] Where a·b is the dot product of two vectors, and ||a|| is the Euclidean norm of vector a (i.e., the length of the vector), calculated as ||b|| is the Euclidean norm of vector b, calculated as
[0158] S332, identification and differentiation: Different individuals are differentiated based on the similarity score and the pre-set threshold θ. If S(m1, m2) is greater than θ, m1 and m2 are considered to be the same individual, otherwise they are different individuals, expressed as:
[0159]
[0160] S333, individual identification optimization: Combine the similarity score and classification threshold decision to optimize the passenger individual identification process to improve the accuracy of individual identification;
[0161] Through the above steps, the appearance features and behavioral data of passengers are integrated and the similarity between feature vectors is calculated. This can effectively identify and distinguish different individuals when their appearances are similar or their behavioral patterns are repeated, enhance the performance of the system in complex scenarios, and improve the overall accuracy and efficiency of passenger counting and monitoring.
[0162] Comprehensive data processing in S4 includes:
[0163] S41, data preprocessing: preprocessing the collected images and behavioral data, including cropping, scaling, and normalization of images, and cleaning and standardization of behavioral data;
[0164] S42, feature extraction: extracting the passenger's body features from the processed image and extracting the behavior features from the behavior data;
[0165] S43, feature fusion: features extracted from image and behavior data are fused into a final feature vector;
[0166] S44, feature analysis: processing the final fused feature vector to achieve identification and classification of individual passengers;
[0167] S45, passenger number statistics: based on the feature analysis results, count the number of independent passengers in the scene;
[0168] Through the above-mentioned comprehensive data processing method, passenger characteristics can be effectively extracted, fused and analyzed from image and behavior data without relying on complex models to optimize the recognition and statistical process of individual passengers.
[0169] The feature analysis in S44 includes:
[0170] S441, final feature vector preparation: obtaining the final feature vector FFV of each passenger;
[0171] S442, classification model training: Use the AdaBoost algorithm to train the classification model for the final feature vector FFV of the passenger. The training process is as follows:
[0172] S4421, initialize sample weights: Initialize the weight of each sample to Where M is the total number of samples;
[0173] S4422, training weak classifiers: For each round k in K rounds of iterations:
[0174] Train a weak classifier h k (x);
[0175] Calculate the weighted error rate and classifier weight of the weak classifier:
[0176]
[0177]
[0178] Among them, y i is the true label of the i-th sample, I(y i≠h k (x i )) is the indicator function, when the weak classifier h k The predicted result and the true label y of the sample i If they are inconsistent, the value is 1, otherwise it is 0;
[0179] Update sample weights: And Perform normalization;
[0180] S4423, combine weak classifiers to obtain the final strong classifier:
[0181] S443, passenger individual identification and classification: Apply the trained classification model to new passenger data, and use the strong classifier H(x) to identify and classify each passenger's FFV to determine the specific category or identity of the passenger;
[0182] Through the above feature analysis method, combined with the AdaBoost algorithm, the final feature vector of passengers can be effectively processed and analyzed, and accurate identification and classification of individual passengers can be achieved, which not only improves the efficiency and accuracy of passenger management, but also provides technical support for passenger count based on image recognition.
[0183] Passenger identification and record updates in S5 include:
[0184] S51, unique identifier allocation: after the passenger feature analysis and identification process is completed, a unique identifier UID will be allocated to each identified passenger. The unique identifier UID is generated based on the passenger's final feature vector and classification result, ensuring the uniqueness of each passenger;
[0185] S52, passenger database update: check whether the unique identifier of the newly identified passenger already exists in the passenger database. If it is a new passenger (i.e., the UID does not exist in the database), a new database record will be created for the new passenger, including the UID and related feature information, and the passenger count will be increased. If the UID already exists, it means that the passenger has been recorded, and the record will be updated without changing the total passenger count;
[0186] S53, entry and exit records and count adjustment: for each passenger entering or leaving, the passenger quantity record is updated according to the unique identifier UID and the detected moving direction. If the passenger is detected as entering, the count is increased in the database, and if the passenger is detected as leaving, the count is decreased;
[0187] S54, double counting avoidance: By monitoring the location and movement trajectory of each passenger, double counting caused by repeated entry and exit in a short period of time is identified and eliminated, ensuring the accuracy of passenger counting and avoiding statistical errors caused by repeated entry and exit behavior;
[0188] The above steps can effectively manage passenger data, improve the accuracy of passenger counting and the overall efficiency of the system. By assigning a unique identifier to each passenger and updating the database records when appropriate, the system can accurately track changes in the number of passengers and provide important information for ship safety management and operational decisions. In addition, it helps to avoid duplicate counting and ensure the accuracy and reliability of passenger statistics.
[0189] like Figure 2 As shown, a passenger counting system based on image recognition is used to implement the above-mentioned passenger counting method based on image recognition, and includes the following modules:
[0190] Environmental Adaptive Image Adjustment Module: responsible for automatically adjusting the camera's shooting parameters according to lighting conditions, weather conditions, and environmental changes in the camera's current field of view, and performing real-time image enhancement processing on the captured images;
[0191] Real-time passenger image capture module: Adjusted cameras installed at the ship's entrance and exit to capture real-time images of passengers entering and leaving the ship;
[0192] Passenger characteristics and behavior diversity management module: Through comprehensive feature recognition and dynamic tracking technology, it tracks passengers' movement paths in real time and analyzes their behavior patterns, including the diversity of appearance and behavior;
[0193] Comprehensive data processing module: After completing the comprehensive analysis of passenger characteristics and behaviors, the collected images and data are comprehensively processed;
[0194] Passenger identification and record update module: Based on the results of comprehensive data processing, a unique identifier is assigned to each identified passenger, and the passenger quantity record in the database is updated when passengers enter or leave;
[0195] Threshold alarm mechanism module: When the number of passengers on board approaches or exceeds the safe passenger capacity, an alarm is automatically triggered and the ship management personnel are notified.
[0196] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present invention is limited to these examples. Under the concept of the present invention, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity.
[0197] The present invention is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A passenger counting method based on image recognition, characterized in that: The following steps are involved: S1, environmental adaptive image adjustment: before capturing an image, the camera's shooting parameters are automatically adjusted according to lighting conditions, weather conditions, and environmental changes in the camera's current field of view, and the captured image is enhanced; S2, capture images: use the adjusted camera to capture passenger images at the entrance and exit in real time; S3, Passenger characteristics and behavior diversity management: Through comprehensive feature recognition and dynamic tracking technology, the passenger's movement path is tracked in real time and their behavior patterns are analyzed, including comprehensive consideration of appearance and behavior diversity. The passenger characteristics and behavior diversity management includes: S31, Feature Recognition and Data Collection: Real-time passenger images are collected and comprehensive feature recognition technology is used to analyze the appearance characteristics of each passenger, including facial features, body shape, clothing style and color. At the same time, passenger behavior data is collected, including movement speed, walking path, stop time and interaction with other passengers; S32, Dynamic Tracking and Behavior Analysis: Use dynamic tracking technology to track the movement path of each passenger in real time, and analyze the passenger's behavior pattern by combining the collected appearance characteristics and behavior data. Behavior pattern analysis includes identifying unique behavior patterns and evaluating passengers' behavior intentions and behavior trends. Unique behavior patterns include individual action, group movement, and frequent entry and exit; S33, optimization of individual passenger identification: Identify and differentiate individual passengers based on the analyzed appearance characteristics and behavior patterns. When dealing with passengers with similar appearance or repeated behavior patterns, compare the comprehensive characteristics and behavior differences; The feature recognition and data collection in S31 include: S311, image acquisition: capturing passenger image I in real time; S312, appearance feature analysis: Facial features F: Among them, ReLU is the activation function, W i and b i are weights and biases, w i is the corresponding feature weight, N is the number of network layers; Body Type B: in, Represents image I body The gradient in the body contour area, ∫ represents the integral of the area; Clothing style and color C: Among them, I clothes (x, y) is the pixel value of the clothing area, M is the total number of pixels in the clothing area; S313, behavioral data analysis: Moving speed V and walking path P: P={(x1,y1),(x2,y2),…,(x T ,y T )}; Among them, (x t ,y t ) is the passenger position coordinate at time point t, T is the observation time window; Dwell time T: Among them, 1 area is an indicator function, indicating whether the passenger stays in the area of interest; S314, data fusion and analysis: The comprehensive feature vector EFV is used for passenger identification, and the calculation formula is: Among them, α, β, γ, δ,∈, ζ are weight coefficients, P i is the i-th point in the walking path; S4, comprehensive data processing: after completing the comprehensive analysis of passenger characteristics and behaviors, the collected images and data are comprehensively processed; S5, passenger identification and record update: based on the results of comprehensive data processing, a unique identifier is assigned to each identified passenger, and the passenger quantity record in the database is updated when the passenger enters or exits to avoid duplicate counting; S6, Threshold Alarm Mechanism: Set a threshold alarm mechanism. When the number of passengers approaches or exceeds the safe passenger capacity, the alarm will be automatically triggered and the management personnel will be notified.
2. The passenger counting method based on image recognition according to claim 1, characterized in that: The environmental adaptability image adjustment in S1 includes: S11, environmental monitoring: real-time monitoring of current lighting conditions, weather conditions, and changes in the environment where the camera is located; S12, automatically adjusting shooting parameters: based on the collected environmental monitoring data, automatically adjusting the shooting parameters of the camera, the shooting parameters including exposure, contrast and saturation, to adapt to the current environmental conditions; S13, real-time image enhancement: performing image enhancement on the captured image, where the image enhancement includes sharpening, noise reduction, and color correction on the captured image.
3. The passenger counting method based on image recognition according to claim 1, characterized in that: The dynamic tracking and behavior analysis in S32 includes: S321, moving path tracking: Use dynamic tracking technology to track the moving path of each passenger in real time, record the position coordinates of the passenger in time series, and record the moving trajectory P. For each passenger n, the moving trajectory of the passenger is expressed as: P n ={(x τ ,y τ )|τ=1,2,...,T total }; Among them, T total is the observation period, (x τ ,y τ ) is the position coordinate at time τ; S322, behavior pattern recognition: Identify or classify the behavior pattern of an individual based on the input feature vector. The behavior pattern recognition function is expressed as: BM(v) = σ(W bm ·v+b bm ); Among them, σ is the activation function, W bm is the weight matrix, b bm is the deviation vector, v is the feature vector obtained from the passenger's movement trajectory P; S323, behavior intention evaluation: The behavior intention is evaluated by analyzing the change trend of the passenger's position and the change of the passenger's speed. The intention evaluation function is expressed as: I(ΔP,V)=softmax(W i ·[ΔP‖V]+b i ); Where ΔP is the change in the passenger's position, V is the passenger's moving speed, and W i is the weight matrix for intent assessment, b i is the bias vector; S324, comprehensive analysis of behavior data: combining behavior patterns with appearance features to conduct a comprehensive analysis of passenger behavior. The calculation formula for the comprehensive behavior feature vector is: BFV n =ω1·BM(v n )+ω2·I(ΔP n ,V n )+ω3·F n +ω4·B n +ω5·C n ; Among them, BM(v n ) is the behavior pattern recognition result for passenger n, I(ΔP n ,V n ) The evaluation result of passenger n’s behavioral intention, F n is the facial feature of passenger n, B n is the physical characteristic of passenger n, C n are the clothing style and color characteristics of passenger n, and ω1, ω2, ω3, ω4, and ω5 are weight coefficients.
4. The passenger counting method based on image recognition according to claim 3 is characterized in that: The passenger individual identification optimization in S33 includes: S331, similarity calculation: For each pair of passengers m1 and m2, calculate the comprehensive behavior feature vector and The similarity between them is calculated as: Among them, S(m1,m2) represents the similarity score between two passengers, and the Similarity function uses cosine similarity to calculate the similarity between two feature vectors; S332, identification and differentiation: Different individuals are differentiated based on the similarity score and the pre-set threshold θ. If S(m1,m2) is greater than θ, m1 and m2 are considered to be the same individual, otherwise they are different individuals, expressed as: S333, individual identification optimization: Combine similarity scores and classification threshold decisions to optimize the individual passenger identification process.
5. The passenger counting method based on image recognition according to claim 4 is characterized in that: The comprehensive data processing in S4 includes: S41, data preprocessing: preprocessing the collected images and behavioral data, including cropping, scaling, and normalization of images, and cleaning and standardization of behavioral data; S42, feature extraction: extracting the passenger's body features from the processed image and extracting the behavior features from the behavior data; S43, feature fusion: features extracted from image and behavior data are fused into a final feature vector; S44, feature analysis: processing the final fused feature vector to achieve identification and classification of individual passengers; S45, Passenger Count: Based on the feature analysis results, count the number of independent passengers in the scene.
6. The passenger counting method based on image recognition according to claim 5 is characterized in that: The feature analysis in S44 includes: S441, final feature vector preparation: obtaining the final feature vector FFV of each passenger; S442, classification model training: Use the AdaBoost algorithm to train the classification model for the final feature vector FFV of the passenger. The training process is as follows: S4421, initialize sample weights: Initialize the weight of each sample to Where M is the total number of samples; S4422, training weak classifiers: For each round k in K rounds of iterations: Train a weak classifier h k (x); Calculate the weighted error rate and classifier weight of the weak classifier: Among them, y i is the true label of the i-th sample, I(y i ≠h k (x i )) is the indicator function; Update sample weights: And Perform normalization; S4423, combine weak classifiers to obtain the final strong classifier: S443, individual passenger identification and classification: Apply the trained classification model to new passenger data, and use the strong classifier H(x) to identify and classify each passenger's FFV to determine the specific category or identity of the passenger.
7. The passenger counting method based on image recognition according to claim 6 is characterized in that: The passenger identification and record update in S5 includes: S51, unique identifier allocation: after the passenger feature analysis and identification process is completed, a unique identifier UID will be allocated to each identified passenger; S52, passenger database update: check whether the unique identifier of the newly identified passenger already exists in the passenger database. If it is a new passenger, a new database record will be created for the new passenger, including the UID and related feature information, and the passenger count will be increased. If the UID already exists, it means that the passenger has been recorded, and the record will be updated without changing the total passenger count; S53, entry and exit records and count adjustment: for each passenger entering or leaving, the passenger quantity record is updated according to the unique identifier UID and the detected moving direction. If the passenger is detected as entering, the count is increased in the database, and if the passenger is detected as leaving, the count is decreased; S54, Double counting avoidance: By monitoring the location and movement trajectory of each passenger, double counting caused by repeated entry and exit in a short period of time is identified and eliminated.
8. A passenger counting system based on image recognition, used to implement a passenger counting method based on image recognition as claimed in any one of claims 1 to 7, characterized in that: Includes the following modules: Environmental Adaptive Image Adjustment Module: responsible for automatically adjusting the camera's shooting parameters according to lighting conditions, weather conditions, and environmental changes in the camera's current field of view, and performing real-time image enhancement processing on the captured images; Real-time passenger image capture module: Through the adjusted camera, the passenger images at the entrance and exit are captured in real time; Passenger characteristics and behavior diversity management module: Through comprehensive feature recognition and dynamic tracking technology, it tracks passengers' movement paths in real time and analyzes their behavior patterns, including the diversity of appearance and behavior; Comprehensive data processing module: After completing the comprehensive analysis of passenger characteristics and behaviors, the collected images and data are comprehensively processed; Passenger identification and record update module: Based on the results of comprehensive data processing, a unique identifier is assigned to each identified passenger, and the passenger quantity record in the database is updated when passengers enter or leave; Threshold alarm mechanism module: When the number of passengers approaches or exceeds the safe passenger capacity, an alarm is automatically triggered and the management personnel are notified.
