Manuscript Offprint
arXiv:2610.41108Memory and Recall of Color Images Using Neural Networks-1 - The Cue-Ball Model based on the Associative Memory Mechanism -
Abstract
This paper presents a neural network model for storing and recalling color images of different sizes using the Cue Ball-Recall Net systems [1–5]. The Cue Ball system consists of a Recall Net composed of multiple memory neurons each responsible for memorizing a single, distinct memory and a large number of neurons that represent image patterns. The images used in this study [6] consist of ten images (see Appendix). The pixel values of these images were converted into digital values and used for subsequent processing. Accordingly, the Cue Ball contains ten Cue neurons, corresponding to the ten images stored in memory. The number of pixels varies among the images, and therefore, the number of Recall neurons comprising the Recall Net also varies accordingly. In this study, the number of Recall neurons was prepared between 106,134 and 360,000, depending on the number of pixels in each image. In this simulation, after the connection weights had been learned, we have used the learning and recall algorithms to investigate whether the Cue neuron which had memorized a specific image could be identified by the Recall Net when that a memorized image has been presented. Therefore, the most important simulation result is which Cue neuron responds when a memorized image is presented to the Recall Net. If the Cue neuron that memorizes the presented image responds, its output can be used to obtain the corresponding image data. By adding a BMP header to the resulting image data, the original memorized image can be accurately recalled.
1. Introduction
This paper presents a model for memorizing and recalling color images of different sizes. The model used in this study is the Cue Ball–Recall Net [1–5]. The system consists of the Cue Ball, a group of neurons in which each neuron is responsible for memorizing one memory, and the Recall Net, which comprises a large number of neurons used to represent image patterns. This study builds on a series of papers published from 2018 to 2026 [1–5]. Now, we focus on the storage and recall of color images with different image sizes. Now, I will briefly revisit the basic structure of the model. It consists of a neural network,
I was affiliated with Kobe Shoin Women's University but retired upon reaching the mandatory retirement age at the end of March 2025. Please note that as of April 2025, the university has been renamed "Kobe Shoin University."
Regarding the program used in the simulation, I consulted the explanation for ChatGPT and Gemini 3, a form of generative AI.
comprising numerous neurons arranged in a two-dimensional layout to represent images, along with a set of neurons designed to memorize individual images, with each image represented by a single neuron. The neural network used to represent images is referred to as the Recall Net, while the group of neurons responsible for storing memories is called the Cue Ball. The neurons constituting the Recall Net are called Recall neurons, and those constituting the Cue Ball are called Cue neurons. Ten images of different sizes [6] are used in this study (see Appendix). Accordingly, ten Cue neurons are used to store the images.
Until now, the term "memory" in the context of neural networks has referred to associative memory models [3-8,17]. Since this model also pertains to memory, it can be classified as an associative memory model. Among associative memory models, the Hopfield-type model is particularly well-known. Other types, such as auto-associative memory models and hetero-associative memory models, also exist. In autocorrelation and cross-correlation models, the "memory rate" plays a crucial role in enabling the storage of various types of information [8-14]. This depends on the number of neurons being used, and the key lies in maximizing the ratio of the number of stored items to the total number of neurons. The model presented here falls, in principle, into the category of cross-correlation-type associative memory models. In the Cue Ball-Recall Net model described in this paper (as well as in previous papers), a single Cue neuron, which serves as the basis for memory, memorizes one individual image. Consequently, 10 images are memorized across 10 Cue neurons. In this sense, the memory rate is 100%. However, when the Recall neurons that make up the Recall net are taken into account, the memory rate decreases. Therefore, if the number of Cue neurons (the number of images to be memorized) becomes overwhelmingly large, the memory rate—defined as (number of memorized images / total number of neurons used) × 100—will, in principle, approach 100%. On the other hand, as the number of images to be memorized increases and as the size of the individual images grows, the amount of memory required also increases. Despite this drawback, given the trend toward ever-greater memory capacities in modern devices, the approach likely remains sufficiently practical. In the following, Section 2 detail the model, Section 3 present the simulation methodology and results, and Section 4, the final section, offer conclusions and discussion.

Figure.1: Diagram of the proposed model's structure. A single Cue neuron in the Cue Ball is connected to the Recall neurons in all of the Recall Nets. Using this structure, the pixel values of a color image presented to the Recall Net are memorized in digital form within a single Cue neuron.
In Figure 1, each Cue neuron is connected to all the Recall neurons in the recall network. Since 10 color images are used, 10 Cue neurons are required: meanwhile, because the 10 images vary in size, ranging from 106,134 to 360,000 pixels, up to 360,000 Recall neurons are needed. On the other hand, since Cue neurons can be added at any time, one could theoretically include an infinite number of them; however, as this study focuses on fundamental principles, the number has been set to 10, matching the number of color images used. Now, we briefly describe the connectivity of the neurons in the Cue Ball and the Recall Net. The Cue neurons in the Cue Ball are not interconnected. Similarly, the Recall neurons in the Recall Net are not interconnected. On the other hand, the Cue neuron and the corresponding Recall neuron have bidirectional connections. Note that the general Gradient Descent Method (GDM) is used as a learning method for memorization [14-16].
At this point, let us address the process of learning (encoding). The learning sequence begins with the learning of the connection weights for the Recall neurons, followed by the learning of the connection weights for the Cue neurons.
Let us begin by explaining the learning of the connection weights in the Recall Net. The input-output relationships for the Cue neurons and Recall neurons are defined below.
where, denotes the image index, is the output of the -th Recall neuron, is the input to the -th Cue neuron, and is the connection weight from the -th Cue neuron to the -th Recall neuron. In Equation (1), no summation is performed over the index "i". Therefore, for each image, there is only one term. In the expression "j = 0 \sim (R - 1)", represents the number of neurons within the Recall Net. During the learning process of the Recall neurons, the digital values of one digitally encoded image are first input to the individual Recall neurons in the Recall Net (i.e., the image is presented to the Recall Net). Using these digital values and from Equation (1), the weights are learned via GDM. Here, the error function used during the learning process is defined as follows:
where, represents the j-th digital element value of the presented image p input into the Recall Net. Using Equation (2), the connection weight is updated via GDM as follows:
(3)
where, is the number of updates, and is the learning rate. The learning of is completed using Eq. (3). Setting , Equations. (1) and (3) can be used to rewrite and as follows.
(4)
where Equation (1), the following equation is obtained.
It follows that, after learning the connection weights , the output value of the Recall neuron matches the corresponding element value of the presented pattern.
Next, we describe the learning process for the connection weights on the Cue neuron side. The input-output relation between the Recall neurons in the Recall Net, where one previously learned image is presented, and the i-th Cue neuron is defined as follows. Now, denotes the intermediate output of the Cue neuron.
where, represents the connection weight from the j-th Recall neuron to the i-th Cue neuron. is the number of patterns to be memorized. The final output of the Cue neuron is defined as follows, using the "max" function:
The max function identifies the maximum value among the intermediate outputs of all cue neurons within a cue ball. The final output of the cue neuron with the highest intermediate output is set to 1.0, while the final outputs of all other cue neurons are set to 0.0.
The error function used in the learning process of is defined as follows.
where, denotes the teacher signal for the Cue neurons and is common to all Cue neurons. Learning is considered complete when becomes equal to .
Next, we consider the process of updating the connection weights using GDM. The weights are updated according to the following equation.
(9)
where, denotes the update iteration, and is the learning rate. The input-output Equation (6) and the learning Equation (9) demonstrate that the Cue neuron under consideration can learn the image.
First, by setting , the term during the learning process (where in Equation (6) is equal to ) can be expressed as follows:
(10)
where, we set the following normalization condition for the digital value of the input image.
Using Equation (11) yields the following result.
In the following, this "normalize_d^{p}" is treated as "d_{j}^{p}".
Using Equation (13), in Equation (10) can be expressed as follows.
In this way, becomes equal to the teacher signal , and the learning process is completed.
3. Simulation and Results
This section describes the simulations based on the model presented in Section 2. In this model, only ten neurons are required for memory storage, corresponding to the number of images, whereas 106,134 to 360,000 neurons are required to represent the images, depending on their sizes. Figure.2 shows a sample of an image and the corresponding digital values for a portion of that image. The 10 color images are provided in the Appendix [6].
| Picture | Digital Data(Partial) |
|---|---|
|  |
Figure.2: Images used in the simulation process and a portion of their digital data. The left side shows the color image used (0.bmp), while the right side displays the digital data corresponding to the initial part of that image.
The image shown in Figuer.2 is 399 pixels wide and 266 pixels high, giving a total of 106,134 pixels. Since each pixel is represented by one digital value, 106,134 Recall neurons are required to represent the image data. Note that this size is the smallest image among those used in this study. In the simulations, the connection weights and are trained sequentially for each image. That is, for the p-th image, the weights and are trained consecutively. However, for clarity, the two learning processes are described separately below. The learning algorithms for memorizing (encoding) and are summarized below.
[The learning algorithm for ]
-
Select the images sequentially, starting from the 0-th image.
-
Read the data containing the digital values converted from the image pixel values.
-
Normalize the digital values read in Step 2 using Equation (11).
-
Initialize the connection weights of the Recall neurons: .
-
Initialize and , and calculate the output using Equation (1): .
-
Learn the connection weights according to Equation (3), using a learning rate of .
-
Write the post-learning to a file.
-
Return to Step 1 and repeat Steps 2–8 for each image (1–9).
-
Terminate the process after all image patterns have been learned.
[The learning algorithm for ]
-
Select the images sequentially, starting from the 0-th image.
-
Initialize the connection weights of the Cue neurons: .
-
Initialize and , .
-
Load the learned connection weights .
-
Calculate using Equation (1) and the learned connection weights .
-
Using the values of obtained from Step 5, calculate in Equation (6).
-
Using the values of obtained in Step 5 and obtained in Step 6, perform the learning of in Equation (9):
The teacher signal is set to . This value has been determined empirically by examining the simulation results.
-
Write the post-learning to a file.
-
Return to Step 1 and repeat Steps 2–9 for each image (1–9).
-
Terminate the process after all image patterns have been learned.
After the learning process, we examine whether the images have been stored in the Cue neurons. In the recall process, the digital data of an arbitrary memorized image are presented to the Recall Net, and the output values of the Recall neurons are fed into all Cue neurons in the Cue Ball. In this process, the Cue neurons that hold the presented image are expected to maximize the value of . Next, we examine this recall process. The algorithm for the recall process is summarized below.
[Recall Algorithm]
-
Load the learned connection weights and .
-
Select a desired image from a set of images that have already been processed.
-
Input the digital data of the image selected in Step 2 into the Recall neurons and calculate according to Equation (6), where . The normalized values of are used.
-
Set , and .
-
Select the Cue neuron for which among those indexed from i=0 to 9.
-
For the selected Cue neuron, calculate using Equation (1) and the learned connection weights , and reconstruct the image data.
At this stage, the data used for normalization is employed to restore to its original, unnormalized values.
-
Perform steps 2 through 6 above while changing the selected image.
-
Once Step 7 is complete, the process ends.
According to the learning and recall algorithms described above, once the connection weights have been trained, one of the memorized images is presented to the Recall Net. If the Cue neuron that stores the presented image can be identified, Equation (1) can be applied to that Cue neuron to accurately recall the original image. In the simulations, the Cue neuron number (i) correspond to the image number (p). However, the Cue Ball itself does not know knowledge of which image will be presented. Therefore, when a memorized image has been presented to the Recall Net, the most important factor is which Cue neuron responds. The recall process described above was applied to all memorized image data, and the output values of each Cue neuron were examined for each presented image. The results are shown in Figure.3.
0.bmp
Output of the Cue neuron (after learning)

1.bmp
Output of the Cue neuron (after learning)
2.bmp
Output of the Cue neuron (after learning)

3.bmp
Output of the Cue neuron (after learning)
4.bmp
Output of the Cue neuron (after learning)


5.bmp
Output of the Cue neuron (after learning)
6.bmp
Output of the Cue neuron (after learning)

7.bmp
Output of the Cue neuron (after learning)

8.bmp
Output of the Cue neuron (after learning)
9.bmp
Output of the Cue neuron (after learning)


Figure.3: Output values of the Cue neurons when a stored image is presented to the Recall Net, after learning and . The vertical axis represents the output value , and the horizontal axis represents the cue neuron number. Note that the cue neuron number and image number match. The reddish-brown filled bar graph is the cue neuron that is learning the presented image. The light green bars are other cue neurons. For example, in the case of the image "0.bmp," the output of the 0th cue neuron is the highest at 1072.59 (ranking 1st), which indicates that the memory has been successfully recalled. Meanwhile, the output value of the ranking 2nd, 970.60, corresponds to the 1st cue neuron. In contrast, the image "4.bmp" is incorrectly recalled, as indicated by the light yellow background in the graph. In this case, the image "4.bmp" should be recalled, but the system instead recalls the image "1.bmp." The difference between the values for the incorrectly recalled and correctly recalled images was 28.24. All other images were recalled correctly.
In Figure.3, the vertical axis represents the output value , and the horizontal axis represents the Cue neuron index. Note that the Cue neuron indices correspond to the image indices. The reddish-brown filled bars represent the Cue neurons that have learned the presented (learning) images, while the light-green bars represent the other Cue neurons. For example, suppose that the image "0.bmp" is memorized in the 0th cue neuron and that its recall is successful. This Cue neuron exhibits a maximum output value of 1072.59, which ranks first. The second-largest output value, 970.60, is produced by the 1st cue neuron, which corresponds to the image "1.bmp." In contrast, the image "4.bmp" appears to have been incorrectly recalled as "1.bmp." In this instance, 4th Cue neuron, which corresponds to image "4.bmp", shows an output value of 1035.94 (the 2nd-highest value), while the 1st Cue neuron shows an output value of 1064.18 (the highest value). The latter is indicated by the reddish-brown shaded bar in the graph. The difference between the output values for the incorrectly recalled and correctly recalled images was 28.24. Although the difference was small, the output value for "1.bmp" was slightly higher than that for "4.bmp." A visual inspection of the images in the Appendix suggests that, although the exact reason is unclear, the similar portions of the sky in the two images may have contributed to this misrecall. As for the other images, however, recall has been successful in all cases.
Using the image numbers for the Cue neurons obtained here, the images were reconstructed by appending a BMP header to the image data derived from Equation (1). All of the reconstructed images were identical to the original images. It is of interest to investigate how the learned Cue neurons respond when an incomplete version of a memorized image, in which a portion of the image is missing, is presented to the Recall Net. Since this investigation requires extensive analysis, we plan to report the results in a subsequent paper.
4. Conclusions and Discussion
This paper presented a model for storing and recalling color images of different sizes. The underlying neural network model, referred to as the Cue Ball–Recall Net system, is based on a series of papers published from 2018 to 2026 [1–5]. In this study, ten Cue neurons were used in the Cue Ball to memory the images, corresponding to the number of images to be memorized. The Recall Net was composed of a number of Recall neurons equal to the number of pixels in each image, ranging from 106,134 to 360,000. The ten images [6] used in this study are presented in the Appendix. In the simulations, the pixel values of these color images were converted into digital values for processing.
In the simulations, after learning the connection weights and using the proposed learning and recall algorithms, we have investigated whether the Cue neuron responsible for storing a particular image could be identified when that image has been presented to the Recall Net. Therefore, when an image is presented to the Recall Net, the crucial information for the simulation results lies in which Cue neuron produces the maximum output value ( ). If the Cue neuron that memories the presented image responds, the original stored image can be accurately recalled by applying Equation (1) to the output of that Cue neuron. Figure.3 shows the results of an investigation into the responses of Cue neurons in this scenario. For the stored images "0.bmp" through "9.bmp," recall was successful for all images except "4.bmp." In other words, the cue neuron corresponding to each memorized image exhibited the highest output value. It appears that the system mistakenly have retrieved "1.bmp" instead of "4.bmp." The difference in the output values between the incorrectly have retrieved image and the correctly retrieved image has been 28.24. Although this difference is small, the output value for "1.bmp" has been slightly higher than that for "4.bmp." The value associated with this misrecall depends on the synaptic connection weights of the Cue neurons. However, since numerous connection weights are involved, the details of this relationship remain unclear. It should also be noted that, using the identified Cue neuron indices, we have reconstructed the images by adding BMP headers to the output values obtained from Equation (1), together with the values used for normalization in Equation (12). All reconstructed images have been identical to the original images.
As mentioned in Section 3, the numerical values of shown in Figure. 3 depend on the teacher signal in Equation (9).
So far, no analytical method has been found for determining the teacher signal . Therefore, the only available approach is an empirical one, in which various values of are tested. Some of the results obtained using this approach are presented in Table.1.
| Cue Neuron No. | 0.bmp | ||
|---|---|---|---|
| 0 | 1.001140 | 1.115157 | 1.000104 |
| 1 | 1.000960 | 1.096915 | 1.000087 |
| 2 | 1.000920 | 1.092887 | 1.000084 |
| 3 | 1.000931 | 1.094043 | 1.000085 |
| 4 | 1.000913 | 1.092240 | 1.000083 |
| 5 | 1.000917 | 1.092591 | 1.000083 |
| 6 | 1.000823 | 1.083129 | 1.000075 |
| 7 | 1.000865 | 1.087398 | 1.000079 |
| 8 | 1.000949 | 1.095867 | 1.000086 |
| 9 | 1.000404 | 1.040797 | 1.000037 |
Table.1. Changes in the values of the learned Cue neurons for three teacher signal values: , and . Now, the changes in the values for “0.bmp” are shown. Although the values of (the fractional components) fluctuate significantly, the cue neuron with the highest rank remains invariant for all values of (the 1st-ranked is the Cue neuron index=0). Now, was used in Figure. 3.
Table.1 shows the variation in the values for "0.bmp" across three different teacher signal values (, and ). Although the decimal portions of the values fluctuate significantly, the cue neuron ranked 1st remains the same for all images, regardless of the teacher signal value. In contrast, variations are observed in the rankings from 2nd place onwards. Within the range of values investigated, no definitive value of was found to be optimal. It is of interest to investigate how the learned Cue neurons respond when an incomplete version of a memorized image, with a portion of the image missing, is presented to the Recall Net. One advantage of memorizing images and other patterns in a neural network as an associative memory model is its ability to recall the original image even when an incomplete version is presented. Research on memory recall using incomplete images requires vast amounts of simulation data and yields a large volume of results; therefore, these findings will be presented in a future report.
A drawback of this model is that the number of neurons increases as the number of stored images or their size grows, which in turn leads to higher memory consumption. In this study, the number of images has been also kept relatively small. As a result, the memory required to store the connection weights and has been limited to approximately 24.93 MB each, for a total of 49.86 MB.
Acknowledgments
The simulations and manuscript preparation for this study were carried out in a general study booth at the “Kobe University Library for Human Sciences.” The author would like to express sincere gratitude for providing a place to conduct this research.
Reference
[1] Inazawa, H., “Associative Memory using Attribute-Specific Neuron Groups-1: Learning between Multiple Cue Balls”, arXiv: 2512.02319, https://arxiv.org/abs/2512.02319, 2025.
[2] Inazawa, H., “Hetero-Correlation-Associative Memory with Trigger Neurons: Accumulation of Memory through Additional Learning in Neural Networks”, Complex Systems, 27, Issue 2, 187-197, 2018.
[3] Inazawa, H., “Associative Memory Model with Neural Networks: Memorizing multiple images with one neuron”. arXiv: 2510.06542, https://doi.org/10.48550/arXiv.2510.06542, 2025.
[4] Inazawa, H., “The Method for Storing Patterns in Neural Networks: Memorization and Recall of QR code Patterns-”. arXiv: 2504.06631, https://doi.org/10.48550/arXiv.2504.06631, 2025.
[5] Inazawa, H., “An associative memory model with very high memory rate: Image storage by sequential addition learning”. arXiv: 2210.03893, https://doi.org/10.48550/arXiv.2210.03893, 2022.
[6] PAKUTASO, Free-to-use assets: https://www.pakutaso.com/
[7] DENSO WAVE. "QR Code". Available at: https://www.denso-wave.com/qrcode/
[8] Anderson, J.A. (1972). A Simple Neural Network Generating an Interactive Memory. Math. Biosciences, 14, 197-220.
[9] Kohonen, T. (1972). Correlation Matrix Memories. IEEE Trans., C-21, 353-359.
[10] Amari, S. & Maginu, K. (1988). Statistical Neurodynamics of Associative Memory. Neural Networks, Vol. 1, 63-73.
[11] Yoshizawa, S., Morita, M. & Amari, S. (1993). Capacity of Associative Memory Using a Nonmonotonic Neuron Model. Neural Networks, Vol. 6, 167-176.
[12] Hopfield, J.J. (1982). Neural Networks and Physical Systems with Emergent Collective Computational Abilities. Proc. of the National Academy of Science USA 79: 2254-2258.
[13] Amit, D.J., Gutfreund, H. & Sompolinsky, H. (1985). Storing Infinite Numbers of Patterns in a Spin-Glass Model of Neural Networks. Phys. Rev. Lett., 55, 1530-1533.
[14] Widrow, B. & Hoff, M.E. (1960). Adaptive Switching Circuits. In 1960 IRE WESCON Convention Record, Part 4, 96-104. New York: IRE. Reprinted in Anderson and Rosenfeld [1988].
[15] Rescorla, R.A. & Wagner, A.R. (1972). A Theory of Pavlovian Conditioning: The Effectiveness of Reinforcement and Nonreinforcement. In classical Conditioning II: Current Research and Theory, eds. Bloch, A.H. & Prokasy, W.F., 64-69, New York: Appleton-Century-Crofts.
[16] Rumelhart, D.E., McCleland, J.L. & the PDP Research Group (1986). Parallel Distributed Processing: Explorations in the Microstructure of Cognition, Vol. 1: Foundations. Cambridge: MIT Press.
[17] Inazawa, H & Kitakaze, K (1998) "Alocally inhibited lateral neural network: on the fundamental features of a network consisting of neurons with a restricted range of interaction", Biological Cybernetics, 78, 3, 207-215.
Appendix
The ten photographs used in this study are shown below. The labels beneath the images, such as “0.bmp,” indicate the corresponding image file names.

0.bmp

1.bmp

2.bmp

3.bmp

4.bmp

5.bmp

6.bmp

7.bmp

8.bmp

9.bmp