Ant colony algorithm and neural network combined house price data prediction technology
The housing price prediction technology that combines ant colony optimization with neural networks solves the problem that traditional neural network models are prone to getting trapped in local optima due to random parameter initialization, thus improving prediction accuracy and model generalization ability, and adapting to the complex and ever-changing real estate market.
Patent Information
- Application Number
- CN202511296207.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2025-12-16
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional neural network models are prone to getting stuck in local optima when their parameters are randomly initialized, which limits their prediction accuracy. Single data processing and model training methods are insufficient to fully extract effective information from multi-source heterogeneous data and cannot adapt to the complex and ever-changing real estate market.
This paper proposes a housing price data prediction technology that combines ant colony optimization and neural network. Through multi-source data collection, data preprocessing, ant colony optimization parameter optimization, and two-stage training of neural network, a four-layer optimization architecture is designed to achieve global optimization. By combining various data processing methods and model training methods, the neural network parameters are optimized to improve the model's generalization ability.
It achieves efficient and accurate prediction of housing price data, improves the prediction accuracy of the model, and adapts to the complex and ever-changing real estate market.
Smart Images

Figure CN121146801A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of real estate technology, in particular to a house price data prediction technology combining an ant colony algorithm and a neural network. BACKGROUND
[0002] The house price data prediction refers to a process of collecting and processing historical and real-time data of a real estate market, analyzing and estimating indexes such as a house price trend and a transaction volume by using an algorithm model, and providing a decision basis for market participants such as house buyers and developers.
[0003] However, the existing house price prediction method has many defects, the traditional neural network model is prone to falling into a local optimum due to random initialization of parameters, so that the prediction accuracy is limited, and a single data processing and model training method cannot fully mine effective information in multi-source heterogeneous data, and cannot adapt to a complex and changeable real estate market, and therefore the house price data prediction technology combining an ant colony algorithm and a neural network is provided. SUMMARY
[0004] (I) Technical problems solved In view of the defects of the prior art, the application provides a house price data prediction technology combining an ant colony algorithm and a neural network, which has the advantages of effectively improving prediction accuracy and model generalization ability, and realizing efficient and accurate prediction of house price data, and solves the problems that the traditional neural network model is prone to falling into a local optimum due to random initialization of parameters, so that the prediction accuracy is limited, and a single data processing and model training method cannot fully mine effective information in multi-source heterogeneous data, and cannot adapt to a complex and changeable real estate market.
[0005] (II) Technical solutions In order to achieve the above-mentioned purposes of effectively improving prediction accuracy and model generalization ability, and realizing efficient and accurate prediction of house price data, the application provides the following technical solutions: a house price data prediction method combining an ant colony algorithm and a neural network, comprising the following steps: S1, multi-source data acquisition, housing basic data is grabbed from no less than three real estate platforms through a distributed crawler cluster, covering five basic attributes of building area, house type structure, house age, floor level and transaction ownership; laser ranging sensors are deployed within a range of 500 meters from schools, hospitals and subway stations to collect straight-line distance data from houses to each facility; five economic indexes of regional GDP, per capita disposable income, population density, employment rate and real estate investment growth rate are obtained through a government open data interface to construct an original data set containing 15-dimensional features; S2, data preprocessing, a three-level processing procedure is designed to improve data quality: Outlier elimination: the house unit price is subjected to normality test by using 3σ criterion, and samples deviating from the mean value by 3 times the standard deviation are deleted; Normalization: Linear transformation is performed on numerical features such as building area and house age to compress the data into the interval [0, 1]; Feature reconstruction: Calculate feature importance using random forest algorithm, delete features with importance index less than 0.05, and convert category features such as house structure into one-hot encoding vector; S3, parameter optimization of ant colony algorithm, in order to solve the problem of local optimization of random initialization of neural network parameters, a four-layer optimization architecture is designed to realize global optimization: Initialization configuration: Set 60 ants to form the search population, initial concentration of pheromone 0.1, evaporation coefficient 0.6, heuristic factor 3, and maximum iteration number 120; Parameter coding: The 50-dimensional weight matrix from 5 nodes in the input layer to 10 nodes in the hidden layer is expanded into a one-dimensional vector according to the row priority principle, followed by the 10-dimensional weight vector and 11-dimensional threshold vector from the hidden layer to the output layer, forming a 61-dimensional parameter search space; State transition: The next parameter node is selected using the roulette strategy, and the transition probability is based on the current path pheromone concentration and the parameter gradient calculated by the finite difference method; Pheromone update: Update the pheromone of the optimal path for each iteration according to the reciprocal of the prediction error, and decay the non-elite path according to the 0.6 evaporation coefficient; S4, two-stage training of neural network: In order to balance the optimization efficiency and model fitting accuracy, a two-stage training strategy is designed: First stage: Initialize the network with the 61-dimensional parameters optimized by ant colony, and use batch gradient descent training for the first 500 rounds with a learning rate of 0.01, a batch size of 32, and a ReLU activation function for the hidden layer; Second stage: Switch to Adam optimizer, learning rate is exponentially decayed by 0.01x0.95^t, L2 regularization (λ=0.001) is introduced, monitor the validation set loss, and early stop if there is no decrease for 10 consecutive rounds; S5, adaptive optimization feedback: When the root mean square error of continuous 5 times evaluation decreases by less than 1%, execute: Network structure adjustment: Increase the number of hidden layer nodes from 10 to 12, and re-initialize the added node weights; Ant colony parameter fine-tuning: The heuristic factor is adjusted to 3.5, and the evaporation coefficient is dynamically adjusted to 0.6-0.2xt / T; Feature dimensionality reduction: Perform principal component analysis on the input data, retain the first 8 principal components, and ensure that more than 95% of the original information is retained.
[0006] Preferably, in the ant colony algorithm optimization step, the optimal solution generated for each iteration is subjected to chaotic disturbance processing: The perturbation value is generated using a Tent chaotic sequence. The iteration rule of the Tent chaotic sequence is that when the current value is less than 0.5, the current value is multiplied by 2; otherwise, the difference between 2 and 1 is multiplied by 1. The initial value is set to the result of the current iteration number plus 1 calculated by the natural logarithm function. The perturbation amplitude is adjusted in a linear decay manner according to 0.1 multiplied by 1 minus the ratio of the current iteration number to the total number of iterations. Then, the corresponding perturbation value is added to each element of the 61-dimensional parameter vector.
[0007] Preferably, in the data collection step, the incremental crawler identifies new listings by comparing MD5 hash values, and retains the latest version according to the timestamp for duplicate records; at the same time, a distributed crawler node is used to achieve parallel crawling of data from multiple platforms, and the number of concurrent requests per node is controlled to within 50, thereby avoiding IP blocking.
[0008] Preferably, in the neural network training step, the ReLU activation function is specifically implemented by performing element-by-element judgment on the input value of each node in the hidden layer. If the input value is greater than 0, the input value is directly used as the output value of the node; otherwise, the value 0 is output.
[0009] Preferably, in the three-layer adaptive optimization feedback step, when performing principal component analysis for dimensionality reduction, the feature covariance matrix is first calculated, then the eigenvalues and eigenvectors of the matrix are solved, the eigenvalues are sorted in descending order, and the first 8 principal components are selected.
[0010] A housing price data prediction system combining ant colony optimization and neural networks includes: Distributed data acquisition module: To achieve real-time acquisition of multi-source data, a crawler cluster consisting of 10 servers is constructed, with 5 crawler instances deployed on each server; 20 laser ranging sensor nodes; and a government data interface calling module; A three-layer data preprocessing module is designed to eliminate data noise and improve feature quality. This includes an outlier detection unit, a normalization unit, and a feature reconstruction unit. The outlier detection unit incorporates a 3σ criterion algorithm module; the normalization unit implements a linear transformation algorithm; and the feature reconstruction unit integrates random forest and one-hot encoding conversion modules. Ant colony algorithm optimization module: To achieve the global optimal search of neural network parameters, a four-layer functional architecture is constructed, including an initialization configuration unit, an encoding mapping unit, a state transition unit, and a pheromone update unit. The initialization configuration unit supports setting six parameters, such as the number of ants; the encoding mapping unit converts the parameters into a 61-dimensional vector; the state transition unit implements the roulette wheel strategy and gradient calculation; and the pheromone update unit performs elite reinforcement updates. The neural network prediction module constructs a two-stage training architecture to achieve non-linear mapping of housing price data. This architecture includes a network architecture unit, a training control unit, and a parameter interface unit. The network architecture unit consists of a 5-10-1 three-layer feedforward network with ReLU modules integrated in the hidden layers. The training control unit supports two-stage training strategy scheduling. The parameter interface unit parses 61-dimensional parameters and reshapes them into weight matrices and thresholds. Adaptive Feedback and Output Module: To achieve dynamic optimization of model performance and visualization of results, a three-layer feedback architecture is constructed, including an evaluation unit, an adjustment unit, and a visualization unit. The evaluation unit calculates three indicators, including the root mean square error; the adjustment unit performs adjustments to the network structure, ant colony parameters, and feature dimensionality reduction; and the visualization unit generates dynamic heatmaps and error reports.
[0011] Preferably, the parameter interface unit between the ant colony algorithm optimization module and the neural network prediction module includes a dedicated dimension splitting algorithm, specifically: the first 50 dimensions of the 61-dimensional parameter vector are reshaped into a 5×10-dimensional weight matrix from the input layer to the hidden layer according to the row priority principle, the next 10 dimensions are used as the weight vector from the hidden layer to the output layer, and the last 11 dimensions are used as the 10-dimensional threshold of the hidden layer and the 1-dimensional threshold vector of the output layer, respectively.
[0012] Preferably, in the state transition unit, the approximate calculation method for the parameter gradient is to perform a small incremental perturbation of 0.01 on each parameter, calculate the ratio of the difference in prediction error before and after the perturbation to the increment, and use this ratio as the gradient estimate of the parameter for calculating the state transition probability.
[0013] Preferably, the ReLU activation function module adopts a parallel computing architecture, using GPU acceleration to perform vectorized operations on the input values of each node in the hidden layer.
[0014] Preferably, in the adaptive adjustment unit, the network structure adjustment is specifically implemented as follows: when the adjustment mechanism is triggered, two new nodes are added to the original 10 hidden layer nodes. The weights of the new nodes are re-optimized using the ant colony algorithm, and together with the original nodes, they form a 12-node hidden layer structure.
[0015] (III) Beneficial Effects Compared with existing technologies, this invention provides a housing price data prediction technology that combines ant colony optimization and neural networks, which has the following beneficial effects: 1. This housing price prediction technology, which combines ant colony optimization with neural networks, optimizes the parameters of the neural network model using ant colony optimization. In the housing price prediction model, the combinations of parameters form paths, and ants traverse different parameter combination paths. As iteration progresses, pheromones accumulate and strengthen on the paths with better parameter combinations, guiding ants to explore more. This allows for a full traversal of the parameter space, avoiding the local optima caused by random parameter initialization in traditional neural networks. As a result, the model can obtain better parameter combinations, significantly improving prediction accuracy.
[0016] 2. This ant colony algorithm combined with neural network for housing price prediction technology employs multiple data processing methods and different model training approaches for multi-source heterogeneous data. First, appropriate preprocessing techniques are applied to different types of data. For example, numerical data is standardized to eliminate the influence of units; for textual data, feature extraction is performed, converting textual information into numerical features that the model can recognize. Next, the processed data is input into different models for training. Each model mines data features from different perspectives: linear regression excels at capturing linear relationships, decision trees can handle nonlinear relationships and perform feature selection, and neural networks have powerful nonlinear fitting capabilities. Finally, the combined model results fully mine the effective information from multi-source heterogeneous data, better adapting to the complex and ever-changing real estate market. Attached Figure Description
[0017] Fig. 1 This is a flowchart of the housing price data prediction method of the present invention; Fig. 2 This is a diagram of the housing price data prediction system architecture of the present invention. Detailed Implementation
[0018] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments and accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Please see Figs. 1-2 A method for predicting housing prices by combining ant colony optimization and neural networks includes the following steps: S1. Multi-source data collection: Basic housing data is collected from no fewer than three real estate platforms using a distributed crawler cluster, covering five basic attributes: building area, unit type, building age, floor level, and ownership. Laser rangefinders are deployed at schools, hospitals, and subway stations within 500 meters of the housing to collect straight-line distance data from the housing to each facility. Five economic indicators—regional GDP, per capita disposable income, population density, employment rate, and real estate investment growth rate—are obtained through government open data interfaces to construct a raw dataset containing 15 dimensions of features. S2. Data preprocessing: Design a three-level processing flow to improve data quality. Outlier removal: The normality of the house unit price was tested using the 3σ criterion, and samples that deviated from the mean by more than 3 standard deviations were deleted; Normalization: Perform a linear transformation on numerical features such as building area and building age to compress the data to the [0,1] interval; Feature reconstruction: The random forest algorithm is used to calculate the importance of features, and features with an importance index of less than 0.05 are deleted. Category features such as apartment layout are converted into one-hot encoded vectors. S3. Ant colony algorithm parameter optimization: To address the problem of neural network parameters easily getting trapped in local optima due to random initialization, a four-layer optimization architecture is designed to achieve global optimization. Initial configuration: Set up a search population of 60 ants, initial pheromone concentration of 0.1, volatility coefficient of 0.6, heuristic factor of 3, and maximum number of iterations of 120. Parameter encoding: Expand the 50-dimensional weight matrix from the 5 nodes of the input layer to the 10 nodes of the hidden layer into a one-dimensional vector according to the row order principle, and then connect it with the 10-dimensional weight vector and the 11-dimensional threshold vector from the hidden layer to the output layer to form a 61-dimensional parameter search space. State transition: The next parameter node is selected using a roulette wheel strategy, and the transition probability is based on the pheromone concentration of the current path and the parameter gradient calculated by the finite difference method; Pheromone update: For the optimal path in each iteration, the pheromone is updated according to the inverse of the prediction error, and the pheromone for non-elite paths is decayed according to a volatility coefficient of 0.6. S4. Two-stage training of neural networks: To balance parameter optimization efficiency and model fitting accuracy, a two-stage training strategy is designed. Phase 1: Initialize the network with 61-dimensional parameters optimized by ant colony. Train the first 500 rounds using batch gradient descent with a learning rate of 0.01, a batch size of 32, and ReLU activation function for the hidden layers. Phase 2: Switch to the Adam optimizer, with the learning rate decaying exponentially by 0.01 × 0.95^t, introducing L2 regularization (λ = 0.001), monitoring the validation set loss, and stopping early if there is no decrease after 10 consecutive rounds; S5. Adaptive optimization feedback: When the root mean square error decreases by less than 1% after 5 consecutive evaluations, execute: Network structure adjustment: The number of hidden layer nodes was increased from 10 to 12, and the weights of the newly added nodes were reinitialized; Ant colony parameter fine-tuning: heuristic factor adjusted to 3.5, volatility coefficient dynamically adjusted to 0.6-0.2×t / T; Feature dimensionality reduction: Perform principal component analysis on the input data, retain the first 8 principal components, and ensure that more than 95% of the original information is retained.
[0020] A housing price data prediction system combining ant colony optimization and neural networks includes: Distributed data acquisition module: To achieve real-time acquisition of multi-source data, a crawler cluster consisting of 10 servers is constructed, with 5 crawler instances deployed on each server; 20 laser ranging sensor nodes; and a government data interface calling module; A three-layer data preprocessing module is designed to eliminate data noise and improve feature quality. This includes an outlier detection unit, a normalization unit, and a feature reconstruction unit. The outlier detection unit incorporates a 3σ criterion algorithm module; the normalization unit implements a linear transformation algorithm; and the feature reconstruction unit integrates random forest and one-hot encoding conversion modules. Ant colony algorithm optimization module: To achieve the global optimal search of neural network parameters, a four-layer functional architecture is constructed, including an initialization configuration unit, an encoding mapping unit, a state transition unit, and a pheromone update unit. The initialization configuration unit supports setting six parameters, such as the number of ants; the encoding mapping unit converts the parameters into a 61-dimensional vector; the state transition unit implements the roulette wheel strategy and gradient calculation; and the pheromone update unit performs elite reinforcement updates. The neural network prediction module constructs a two-stage training architecture to achieve non-linear mapping of housing price data. This architecture includes a network architecture unit, a training control unit, and a parameter interface unit. The network architecture unit consists of a 5-10-1 three-layer feedforward network with ReLU modules integrated in the hidden layers. The training control unit supports two-stage training strategy scheduling. The parameter interface unit parses 61-dimensional parameters and reshapes them into weight matrices and thresholds. Adaptive Feedback and Output Module: To achieve dynamic optimization of model performance and visualization of results, a three-layer feedback architecture is constructed, including an evaluation unit, an adjustment unit, and a visualization unit. The evaluation unit calculates three indicators, including the root mean square error; the adjustment unit performs adjustments to the network structure, ant colony parameters, and feature dimensionality reduction; and the visualization unit generates dynamic heatmaps and error reports.
[0021] Example 1: This embodiment achieves data collection through a distributed architecture and multi-source data fusion, ensuring the integrity and timeliness of the dataset.
[0022] During the distributed crawler cluster deployment phase, a cluster consisting of 10 servers was built, with 5 crawler instances deployed on each server, for a total of 50 nodes. An incremental collection strategy was adopted, adding housing listings by comparing MD5 hash values, retaining the latest version of duplicate records by timestamp, and setting the number of concurrent requests per node to 45 to avoid platform blocking. Five basic attributes, namely building area, unit type, building age, floor, and transaction ownership, were crawled from more than 3 real estate platforms. The collection process referred to the second-hand housing data collection method in similar studies.
[0023] During laser ranging sensor data acquisition, 20 nodes are deployed at facilities such as schools, hospitals, and subway stations within 500 meters of the target building. Samples are taken at 30-minute intervals to collect straight-line distance data from the building to each facility. The storage format includes building ID, facility type, distance value, and collection time.
[0024] The government opens the data interface once a day to obtain five economic indicators: regional GDP, per capita disposable income, population density, employment rate, and real estate investment growth rate. After parsing the JSON data, it associates and matches the data with housing data by region ID.
[0025] Finally, the three types of data are merged according to house ID to form a 15-dimensional original dataset, including 5 basic attributes, 3 facility distances (school, hospital, subway), 5 economic indicators, and 2 derived features such as the ratio of building age to building area and the product of subway distance and regional GDP. The dataset structure is based on the dimensional settings of the standard house price dataset.
[0026] Example 2: This embodiment improves data quality and ensures the validity of model input through a three-level processing architecture.
[0027] The outlier removal process uses the 3σ criterion to test the normality of housing unit prices. Taking second-hand housing data in a certain city as an example, if the calculated mean is 12,000 yuan / ㎡ and the standard deviation is 2,500 yuan / ㎡, then samples with unit prices exceeding 19,500 yuan / ㎡ or below 4,500 yuan / ㎡ are deleted.
[0028] During normalization, a linear transformation is performed on numerical features such as building area and building age. The data is compressed to the [0,1] range by calculating (current value - minimum value) divided by (maximum value - minimum value). For example, a building area of 40-150㎡ is normalized to a value between 0 and 1. Label encoding is used for categorical features such as "floor location", and high, medium and low are assigned values of 3, 2 and 1 respectively.
[0029] In the feature reconstruction stage, the random forest algorithm is used to calculate feature importance. 100 trees are set up and the Gini index is used as the node splitting standard. Features with an importance index of less than 0.05 are deleted, such as "transaction ownership" with an importance index of 0.03. Category features such as apartment type structure are converted into one-hot encoded vectors, such as "three bedrooms and one living room" being converted into a binary vector of the corresponding dimension.
[0030] Finally, the preprocessed data was divided into training and testing sets in an 8:2 ratio, and stratified sampling was used to ensure that the feature distribution was consistent with the original data.
[0031] Example 3: This embodiment achieves global optimization of neural network parameters through a four-layer optimization architecture.
[0032] In the initialization phase, a search population of 60 ants is set up with an initial pheromone concentration of 0.1, a volatility coefficient of 0.6, a heuristic factor of 3, a maximum number of iterations of 120, and ant positions are randomly distributed in a 61-dimensional parameter search space with a boundary of -1 to 1.
[0033] During parameter encoding, the weight matrix from the 5 nodes of the input layer to the 10 nodes of the hidden layer is expanded into a one-dimensional vector according to the row order principle. The weight vector and threshold vector from the hidden layer to the output layer are connected to form a 61-dimensional parameter vector. For example, a 5×10 weight matrix is expanded into a one-dimensional vector arranged in rows.
[0034] The state transition adopts a roulette wheel strategy. The transition probability combines the current path pheromone concentration and parameter gradient. The gradient is obtained by performing a small perturbation of +0.01 on each parameter and calculating the ratio of the difference in prediction error before and after the perturbation to the increment.
[0035] When pheromones are updated, the optimal path in each round is enhanced proportionally to the inverse of the prediction error. The formula is the original concentration multiplied by (1 - volatility coefficient) plus the product of the pheromone intensity and the inverse of the root mean square error. Non-elite paths are only weakened by a volatility coefficient of 0.6.
[0036] Chaotic perturbation processing uses Tent chaotic sequences to generate perturbation values. The sequence iteration rule is to multiply the current value by 2 when it is less than 0.5, otherwise multiply it by (1-current value). The initial value is obtained by calculating the current iteration number plus 1 using the natural logarithm function. The perturbation amplitude decays linearly by multiplying 0.1 by (1-current iteration number / total iteration number). Boundary verification is performed after adding perturbation values to each element of the 61-dimensional parameter vector.
[0037] Example 4: This embodiment improves model fitting accuracy through a two-stage strategy.
[0038] The first stage constructs a 5-10-1 three-layer feedforward neural network. The five nodes in the input layer correspond to five core features: building area, building age, subway distance, regional GDP, and per capita disposable income. The ten nodes in the hidden layer use the ReLU activation function (outputting the value directly when the input value is greater than 0, otherwise outputting 0). GPU parallel computing is used to accelerate vectorization operations.
[0039] During parameter initialization, the first 50 dimensions of the 61-dimensional parameter vector optimized by the ant colony are reshaped into a 5×10 weight matrix from the input layer to the hidden layer. The next 10 dimensions are used as the weight vector from the hidden layer to the output layer. The last 11 dimensions are used as the 10-dimensional threshold of the hidden layer and the 1-dimensional threshold of the output layer, respectively. The batch gradient descent algorithm is used for training for 500 rounds with a learning rate of 0.01 and a batch size of 32. The loss function is the squared mean of the difference between the predicted value and the true value.
[0040] The second stage switches to the Adam optimizer, with the learning rate decaying exponentially by 0.01 multiplied by 0.95 raised to the power of the current epoch number. A regularization coefficient of 0.001 is introduced to prevent overfitting. The validation set loss is monitored, and if there is no decrease for 10 consecutive epochs, training is stopped early. The loss curve and accuracy are recorded for model evaluation.
[0041] Example 5: This embodiment triggers dynamic adjustments when model performance stagnates.
[0042] When the root mean square error decreases by less than 1% in five consecutive assessments, for example, if the current error is 1200, and the results after five consecutive assessments are 1195, 1194, 1193, 1193, and 1192, the following adjustments will be initiated: The number of hidden layer nodes was increased from 10 to 12, the parameter vector was expanded to 73 dimensions, the weights and thresholds of the original 10 nodes were retained, and the weights of the newly added nodes were optimized through 20 ant colony iterations. The heuristic factor is increased from 3 to 3.5, and the volatility coefficient is dynamically adjusted to 0.6 minus 0.2 multiplied by (current iteration number / maximum iteration number), such that the volatility coefficient is 0.5 in the 60th iteration; Perform principal component analysis on the input data, calculate the feature covariance matrix, solve for the eigenvalues and eigenvectors and sort them from largest to smallest, select the first 8 principal components, ensure that more than 95% of the original information is retained, and if the cumulative variance contribution rate reaches 96.3%, the requirements are met.
[0043] Example 6: This embodiment details the engineering implementation of each module.
[0044] In the distributed data acquisition module, the crawler cluster is developed based on an open-source framework. Ten servers are deployed with Ubuntu systems, each with five crawler instances installed. Incremental updates are achieved by storing historical hash values in a Redis database. User-Agent pools and IP proxy pools are configured to reduce the risk of being blocked. The laser ranging sensor uses the UDP protocol for communication, deploys 20 nodes to sample at 30-minute intervals, and stores the data in JSON format, including information such as house ID, facility type, distance, and timestamp.
[0045] The outlier detection unit of the three-layer data preprocessing module uses the data processing library to calculate the mean and standard deviation, deletes outlier samples through Boolean indexing, and generates box plots; the normalization unit supports Min-Max normalization and Z-Score normalization, and users can select the processing method through configuration files to output array format data.
[0046] The ant colony algorithm optimization module provides a graphical interface for setting parameters such as the number of ants and pheromone concentration. It has a parameter validity verification mechanism. The encoding and mapping unit realizes the reshaping of the 61-dimensional parameter vector into a weight matrix and threshold vector, and provides visualization tools.
[0047] The neural network prediction module is based on a deep learning framework to build a 5-10-1 network. The hidden layer integrates the ReLU activation function module and supports GPU acceleration. The training control unit implements the state machine control of the two-stage policy. The early stopping policy stops if there is no improvement after 10 consecutive rounds by default.
[0048] In summary, this housing price prediction technology combining ant colony optimization and neural network optimization optimizes the parameters of the neural network model. In the housing price prediction model, the combinations of parameters form paths, and ants traverse different parameter combination paths. As iteration progresses, pheromones accumulate and strengthen on the paths with better parameter combinations, guiding ants to explore further. This allows for a full traversal of the parameter space, avoiding the local optima caused by random parameter initialization in traditional neural networks. As a result, the model can obtain better parameter combinations, significantly improving prediction accuracy.
[0049] Furthermore, this ant colony algorithm combined with neural network for housing price prediction employs multiple data processing methods and different model training approaches for multi-source heterogeneous data. First, it uses appropriate preprocessing techniques for different data types, such as standardizing numerical data to eliminate the influence of units; for textual data, it extracts features, transforming textual information into numerical features recognizable by the model. Next, the processed data is input into different models for training. Each model mines data features from different perspectives: linear regression excels at capturing linear relationships, decision trees can handle nonlinear relationships and perform feature selection, and neural networks have powerful nonlinear fitting capabilities. Finally, by synthesizing the model results, it fully mines the effective information from multi-source heterogeneous data, better adapting to the complex and ever-changing real estate market. This solves the problem that traditional neural network models, with their randomly initialized parameters, are prone to getting trapped in local optima, leading to limited prediction accuracy; and that single data processing and model training methods are insufficient to fully mine the effective information in multi-source heterogeneous data and cannot adapt to the complex and ever-changing real estate market.
[0050] The relevant modules involved in this system are all hardware system modules or functional modules that combine computer software programs or protocols with hardware in the prior art. The computer software programs or protocols involved in these functional modules are technologies known to those skilled in the art and are not improvements to this system. The improvement of this system lies in the interaction or connection between the modules, that is, in improving the overall structure of the system to solve the corresponding technical problems that this system aims to address.
[0051] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for predicting housing price data by combining ant colony optimization and neural networks, characterized in that, Includes the following steps: S1. Multi-source data collection: Basic housing data is collected from no fewer than three real estate platforms using a distributed crawler cluster, covering five basic attributes: building area, unit type, building age, floor level, and ownership. Laser rangefinders are deployed at schools, hospitals, and subway stations within 500 meters of the housing to collect straight-line distance data from the housing to each facility. Five economic indicators—regional GDP, per capita disposable income, population density, employment rate, and real estate investment growth rate—are obtained through government open data interfaces to construct a raw dataset containing 15 dimensions of features. S2. Data preprocessing: Design a three-level processing flow to improve data quality. Outlier removal: The normality of the house unit price was tested using the 3σ criterion, and samples that deviated from the mean by more than 3 standard deviations were deleted; Normalization: Perform a linear transformation on numerical features such as building area and building age to compress the data to the [0,1] interval; Feature reconstruction: The random forest algorithm is used to calculate the importance of features, and features with an importance index of less than 0.05 are deleted. Category features such as apartment layout are converted into one-hot encoded vectors. S3. Ant colony algorithm parameter optimization: To address the problem of neural network parameters easily getting trapped in local optima due to random initialization, a four-layer optimization architecture is designed to achieve global optimization. Initial configuration: Set up a search population of 60 ants, initial pheromone concentration of 0.1, volatility coefficient of 0.6, heuristic factor of 3, and maximum number of iterations of 120. Parameter encoding: Expand the 50-dimensional weight matrix from the 5 nodes of the input layer to the 10 nodes of the hidden layer into a one-dimensional vector according to the row order principle, and then connect it with the 10-dimensional weight vector and the 11-dimensional threshold vector from the hidden layer to the output layer to form a 61-dimensional parameter search space. State transition: The next parameter node is selected using a roulette wheel strategy, and the transition probability is based on the pheromone concentration of the current path and the parameter gradient calculated by the finite difference method; Pheromone update: For the optimal path in each iteration, the pheromone is updated according to the inverse of the prediction error, and the pheromone for non-elite paths is decayed according to a volatility coefficient of 0.
6. S4. Two-stage training of neural networks: To balance parameter optimization efficiency and model fitting accuracy, a two-stage training strategy is designed. Phase 1: Initialize the network with 61-dimensional parameters optimized by ant colony. Train the first 500 rounds using batch gradient descent with a learning rate of 0.01, a batch size of 32, and ReLU activation function for the hidden layers. Phase 2: Switch to the Adam optimizer, with the learning rate decaying exponentially by 0.01 × 0.95^t, introducing L2 regularization (λ = 0.001), monitoring the validation set loss, and stopping early if there is no decrease after 10 consecutive rounds; S5. Adaptive optimization feedback: When the root mean square error decreases by less than 1% after 5 consecutive evaluations, execute: Network structure adjustment: The number of hidden layer nodes was increased from 10 to 12, and the weights of the newly added nodes were reinitialized; Ant colony parameter fine-tuning: heuristic factor adjusted to 3.5, volatility coefficient dynamically adjusted to 0.6-0.2×t / T; Feature dimensionality reduction: Perform principal component analysis on the input data, retain the first 8 principal components, and ensure that more than 95% of the original information is retained.
2. The method for predicting housing price data by combining ant colony algorithm and neural network according to claim 1, characterized in that, In the ant colony algorithm optimization step, chaotic perturbation processing is performed on the optimal solution generated in each iteration: The perturbation value is generated using a Tent chaotic sequence. The iteration rule of the Tent chaotic sequence is that when the current value is less than 0.5, the current value is multiplied by 2. Otherwise, multiply 2 by the difference between 1 and the current value; The initial value is set to the result of the current iteration number plus 1 calculated by the natural logarithm function. The perturbation amplitude is adjusted in a linear decay manner according to 0.1 multiplied by 1 minus the ratio of the current iteration number to the total number of iterations. Then, the corresponding perturbation value is added to each element of the 61-dimensional parameter vector.
3. The method for predicting housing price data by combining ant colony algorithm and neural network according to claim 1, characterized in that, In the data collection step, the incremental crawler identifies new listings by comparing MD5 hash values. For duplicate records, the latest version is retained according to the timestamp. At the same time, a distributed crawler node is used to achieve parallel crawling of data from multiple platforms, keeping the number of concurrent requests per node below 50, thereby avoiding IP blocking.
4. The method for predicting housing price data by combining ant colony algorithm and neural network according to claim 1, characterized in that, In the neural network training steps, the ReLU activation function is implemented by performing element-wise judgment on the input value of each node in the hidden layer. If the input value is greater than 0, the input value is directly used as the output value of the node; otherwise, the value 0 is output.
5. The method for predicting housing price data by combining ant colony algorithm and neural network according to claim 1, characterized in that, In the three-layer adaptive optimization feedback step, when performing principal component analysis for dimensionality reduction, the feature covariance matrix is first calculated, then the eigenvalues and eigenvectors of the matrix are solved, the eigenvalues are sorted in descending order, and the first 8 principal components are selected.
6. A housing price data prediction system combining ant colony optimization and neural networks, characterized in that, include: Distributed data acquisition module: To achieve real-time acquisition of multi-source data, a crawler cluster consisting of 10 servers is constructed, with 5 crawler instances deployed on each server; 20 laser ranging sensor nodes; government data interface calling module; A three-layer data preprocessing module is designed to eliminate data noise and improve feature quality. This includes an outlier detection unit, a normalization unit, and a feature reconstruction unit. The outlier detection unit incorporates a 3σ criterion algorithm module; the normalization unit implements a linear transformation algorithm; and the feature reconstruction unit integrates random forest and one-hot encoding conversion modules. Ant colony algorithm optimization module: To achieve the global optimal search of neural network parameters, a four-layer functional architecture is constructed, including an initialization configuration unit, an encoding mapping unit, a state transition unit, and a pheromone update unit. The initialization configuration unit supports setting six parameters, such as the number of ants; the encoding mapping unit converts the parameters into a 61-dimensional vector; the state transition unit implements the roulette wheel strategy and gradient calculation; and the pheromone update unit performs elite reinforcement updates. The neural network prediction module constructs a two-stage training architecture to achieve non-linear mapping of housing price data. This architecture includes a network architecture unit, a training control unit, and a parameter interface unit. The network architecture unit consists of a 5-10-1 three-layer feedforward network with ReLU modules integrated in the hidden layers. The training control unit supports two-stage training strategy scheduling. The parameter interface unit parses 61-dimensional parameters and reshapes them into weight matrices and thresholds. Adaptive Feedback and Output Module: To achieve dynamic optimization of model performance and visualization of results, a three-layer feedback architecture is constructed, including an evaluation unit, an adjustment unit, and a visualization unit. The evaluation unit calculates three indicators, including the root mean square error; the adjustment unit performs adjustments to the network structure, ant colony parameters, and feature dimensionality reduction; and the visualization unit generates dynamic heatmaps and error reports.
7. A housing price data prediction system combining ant colony algorithm and neural network according to claim 6, characterized in that, The parameter interface unit between the ant colony algorithm optimization module and the neural network prediction module includes a dedicated dimension splitting algorithm, specifically: the first 50 dimensions of the 61-dimensional parameter vector are reshaped into a 5×10-dimensional weight matrix from the input layer to the hidden layer according to the row priority principle, the next 10 dimensions are used as the weight vector from the hidden layer to the output layer, and the last 11 dimensions are used as the 10-dimensional threshold of the hidden layer and the 1-dimensional threshold vector of the output layer, respectively.
8. A housing price data prediction system combining ant colony algorithm and neural network according to claim 6, characterized in that, In the state transition unit, the approximate calculation method for the parameter gradient is to perform a small incremental perturbation of 0.01 on each parameter, calculate the ratio of the difference in prediction error before and after the perturbation to the increment, and use this ratio as the gradient estimate of the parameter for calculating the state transition probability.
9. A housing price data prediction system combining ant colony algorithm and neural network according to claim 6, characterized in that, The ReLU activation function module adopts a parallel computing architecture, using GPU acceleration to perform vectorized operations on the input values of each node in the hidden layer.
10. A housing price data prediction system combining ant colony algorithm and neural network according to claim 6, characterized in that, In the adaptive adjustment unit, the network structure adjustment is specifically implemented as follows: when the adjustment mechanism is triggered, two new nodes are added to the original 10 hidden layer nodes. The weights of the new nodes are re-optimized using the ant colony algorithm, and together with the original nodes, they form a 12-node hidden layer structure.
Citation Information
Cited By
Coal spontaneous combustion temperature prediction method based on ant colony algorithm optimization neural network
CN121525995A